/* Minification failed. Returning unminified contents.
(6197,7-14): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: Promise
 */
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery-1.10.2.min.map
*/
(function (e, t) {
    if (window.$ != null) return; var n, r, i = typeof t, o = e.location, a = e.document, s = a.documentElement, l = e.jQuery, u = e.$, c = {}, p = [], f = "1.10.2", d = p.concat, h = p.push, g = p.slice, m = p.indexOf, y = c.toString, v = c.hasOwnProperty, b = f.trim, x = function (e, t) { return new x.fn.init(e, t, r) }, w = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, T = /\S+/g, C = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, N = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, k = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, E = /^[\],:{}\s]*$/, S = /(?:^|:|,)(?:\s*\[)+/g, A = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, j = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, D = /^-ms-/, L = /-([\da-z])/gi, H = function (e, t) { return t.toUpperCase() }, q = function (e) { (a.addEventListener || "load" === e.type || "complete" === a.readyState) && (_(), x.ready()) }, _ = function () { a.addEventListener ? (a.removeEventListener("DOMContentLoaded", q, !1), e.removeEventListener("load", q, !1)) : (a.detachEvent("onreadystatechange", q), e.detachEvent("onload", q)) }; x.fn = x.prototype = { jquery: f, constructor: x, init: function (e, n, r) { var i, o; if (!e) return this; if ("string" == typeof e) { if (i = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : N.exec(e), !i || !i[1] && n) return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e); if (i[1]) { if (n = n instanceof x ? n[0] : n, x.merge(this, x.parseHTML(i[1], n && n.nodeType ? n.ownerDocument || n : a, !0)), k.test(i[1]) && x.isPlainObject(n)) for (i in n) x.isFunction(this[i]) ? this[i](n[i]) : this.attr(i, n[i]); return this } if (o = a.getElementById(i[2]), o && o.parentNode) { if (o.id !== i[2]) return r.find(e); this.length = 1, this[0] = o } return this.context = a, this.selector = e, this } return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : x.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), x.makeArray(e, this)) }, selector: "", length: 0, toArray: function () { return g.call(this) }, get: function (e) { return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e] }, pushStack: function (e) { var t = x.merge(this.constructor(), e); return t.prevObject = this, t.context = this.context, t }, each: function (e, t) { return x.each(this, e, t) }, ready: function (e) { return x.ready.promise().done(e), this }, slice: function () { return this.pushStack(g.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (e) { var t = this.length, n = +e + (0 > e ? t : 0); return this.pushStack(n >= 0 && t > n ? [this[n]] : []) }, map: function (e) { return this.pushStack(x.map(this, function (t, n) { return e.call(t, n, t) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: h, sort: [].sort, splice: [].splice }, x.fn.init.prototype = x.fn, x.extend = x.fn.extend = function () { var e, n, r, i, o, a, s = arguments[0] || {}, l = 1, u = arguments.length, c = !1; for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, l = 2), "object" == typeof s || x.isFunction(s) || (s = {}), u === l && (s = this, --l) ; u > l; l++) if (null != (o = arguments[l])) for (i in o) e = s[i], r = o[i], s !== r && (c && r && (x.isPlainObject(r) || (n = x.isArray(r))) ? (n ? (n = !1, a = e && x.isArray(e) ? e : []) : a = e && x.isPlainObject(e) ? e : {}, s[i] = x.extend(c, a, r)) : r !== t && (s[i] = r)); return s }, x.extend({ expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""), noConflict: function (t) { return e.$ === x && (e.$ = u), t && e.jQuery === x && (e.jQuery = l), x }, isReady: !1, readyWait: 1, holdReady: function (e) { e ? x.readyWait++ : x.ready(!0) }, ready: function (e) { if (e === !0 ? !--x.readyWait : !x.isReady) { if (!a.body) return setTimeout(x.ready); x.isReady = !0, e !== !0 && --x.readyWait > 0 || (n.resolveWith(a, [x]), x.fn.trigger && x(a).trigger("ready").off("ready")) } }, isFunction: function (e) { return "function" === x.type(e) }, isArray: Array.isArray || function (e) { return "array" === x.type(e) }, isWindow: function (e) { return null != e && e == e.window }, isNumeric: function (e) { return !isNaN(parseFloat(e)) && isFinite(e) }, type: function (e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? c[y.call(e)] || "object" : typeof e }, isPlainObject: function (e) { var n; if (!e || "object" !== x.type(e) || e.nodeType || x.isWindow(e)) return !1; try { if (e.constructor && !v.call(e, "constructor") && !v.call(e.constructor.prototype, "isPrototypeOf")) return !1 } catch (r) { return !1 } if (x.support.ownLast) for (n in e) return v.call(e, n); for (n in e); return n === t || v.call(e, n) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, error: function (e) { throw Error(e) }, parseHTML: function (e, t, n) { if (!e || "string" != typeof e) return null; "boolean" == typeof t && (n = t, t = !1), t = t || a; var r = k.exec(e), i = !n && []; return r ? [t.createElement(r[1])] : (r = x.buildFragment([e], t, i), i && x(i).remove(), x.merge([], r.childNodes)) }, parseJSON: function (n) { return e.JSON && e.JSON.parse ? e.JSON.parse(n) : null === n ? n : "string" == typeof n && (n = x.trim(n), n && E.test(n.replace(A, "@").replace(j, "]").replace(S, ""))) ? Function("return " + n)() : (x.error("Invalid JSON: " + n), t) }, parseXML: function (n) { var r, i; if (!n || "string" != typeof n) return null; try { e.DOMParser ? (i = new DOMParser, r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n)) } catch (o) { r = t } return r && r.documentElement && !r.getElementsByTagName("parsererror").length || x.error("Invalid XML: " + n), r }, noop: function () { }, globalEval: function (t) { t && x.trim(t) && (e.execScript || function (t) { e.eval.call(e, t) })(t) }, camelCase: function (e) { return e.replace(D, "ms-").replace(L, H) }, nodeName: function (e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() }, each: function (e, t, n) { var r, i = 0, o = e.length, a = M(e); if (n) { if (a) { for (; o > i; i++) if (r = t.apply(e[i], n), r === !1) break } else for (i in e) if (r = t.apply(e[i], n), r === !1) break } else if (a) { for (; o > i; i++) if (r = t.call(e[i], i, e[i]), r === !1) break } else for (i in e) if (r = t.call(e[i], i, e[i]), r === !1) break; return e }, trim: b && !b.call("\ufeff\u00a0") ? function (e) { return null == e ? "" : b.call(e) } : function (e) { return null == e ? "" : (e + "").replace(C, "") }, makeArray: function (e, t) { var n = t || []; return null != e && (M(Object(e)) ? x.merge(n, "string" == typeof e ? [e] : e) : h.call(n, e)), n }, inArray: function (e, t, n) { var r; if (t) { if (m) return m.call(t, e, n); for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++) if (n in t && t[n] === e) return n } return -1 }, merge: function (e, n) { var r = n.length, i = e.length, o = 0; if ("number" == typeof r) for (; r > o; o++) e[i++] = n[o]; else while (n[o] !== t) e[i++] = n[o++]; return e.length = i, e }, grep: function (e, t, n) { var r, i = [], o = 0, a = e.length; for (n = !!n; a > o; o++) r = !!t(e[o], o), n !== r && i.push(e[o]); return i }, map: function (e, t, n) { var r, i = 0, o = e.length, a = M(e), s = []; if (a) for (; o > i; i++) r = t(e[i], i, n), null != r && (s[s.length] = r); else for (i in e) r = t(e[i], i, n), null != r && (s[s.length] = r); return d.apply([], s) }, guid: 1, proxy: function (e, n) { var r, i, o; return "string" == typeof n && (o = e[n], n = e, e = o), x.isFunction(e) ? (r = g.call(arguments, 2), i = function () { return e.apply(n || this, r.concat(g.call(arguments))) }, i.guid = e.guid = e.guid || x.guid++, i) : t }, access: function (e, n, r, i, o, a, s) { var l = 0, u = e.length, c = null == r; if ("object" === x.type(r)) { o = !0; for (l in r) x.access(e, n, l, r[l], !0, a, s) } else if (i !== t && (o = !0, x.isFunction(i) || (s = !0), c && (s ? (n.call(e, i), n = null) : (c = n, n = function (e, t, n) { return c.call(x(e), n) })), n)) for (; u > l; l++) n(e[l], r, s ? i : i.call(e[l], l, n(e[l], r))); return o ? e : c ? n.call(e) : u ? n(e[0], r) : a }, now: function () { return (new Date).getTime() }, swap: function (e, t, n, r) { var i, o, a = {}; for (o in t) a[o] = e.style[o], e.style[o] = t[o]; i = n.apply(e, r || []); for (o in t) e.style[o] = a[o]; return i } }), x.ready.promise = function (t) { if (!n) if (n = x.Deferred(), "complete" === a.readyState) setTimeout(x.ready); else if (a.addEventListener) a.addEventListener("DOMContentLoaded", q, !1), e.addEventListener("load", q, !1); else { a.attachEvent("onreadystatechange", q), e.attachEvent("onload", q); var r = !1; try { r = null == e.frameElement && a.documentElement } catch (i) { } r && r.doScroll && function o() { if (!x.isReady) { try { r.doScroll("left") } catch (e) { return setTimeout(o, 50) } _(), x.ready() } }() } return n.promise(t) }, x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (e, t) { c["[object " + t + "]"] = t.toLowerCase() }); function M(e) { var t = e.length, n = x.type(e); return x.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e) } r = x(a), function (e, t) { var n, r, i, o, a, s, l, u, c, p, f, d, h, g, m, y, v, b = "sizzle" + -new Date, w = e.document, T = 0, C = 0, N = st(), k = st(), E = st(), S = !1, A = function (e, t) { return e === t ? (S = !0, 0) : 0 }, j = typeof t, D = 1 << 31, L = {}.hasOwnProperty, H = [], q = H.pop, _ = H.push, M = H.push, O = H.slice, F = H.indexOf || function (e) { var t = 0, n = this.length; for (; n > t; t++) if (this[t] === e) return t; return -1 }, B = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", P = "[\\x20\\t\\r\\n\\f]", R = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", W = R.replace("w", "w#"), $ = "\\[" + P + "*(" + R + ")" + P + "*(?:([*^$|!~]?=)" + P + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + W + ")|)|)" + P + "*\\]", I = ":(" + R + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + $.replace(3, 8) + ")*)|.*)\\)|)", z = RegExp("^" + P + "+|((?:^|[^\\\\])(?:\\\\.)*)" + P + "+$", "g"), X = RegExp("^" + P + "*," + P + "*"), U = RegExp("^" + P + "*([>+~]|" + P + ")" + P + "*"), V = RegExp(P + "*[+~]"), Y = RegExp("=" + P + "*([^\\]'\"]*)" + P + "*\\]", "g"), J = RegExp(I), G = RegExp("^" + W + "$"), Q = { ID: RegExp("^#(" + R + ")"), CLASS: RegExp("^\\.(" + R + ")"), TAG: RegExp("^(" + R.replace("w", "w*") + ")"), ATTR: RegExp("^" + $), PSEUDO: RegExp("^" + I), CHILD: RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + P + "*(even|odd|(([+-]|)(\\d*)n|)" + P + "*(?:([+-]|)" + P + "*(\\d+)|))" + P + "*\\)|)", "i"), bool: RegExp("^(?:" + B + ")$", "i"), needsContext: RegExp("^" + P + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + P + "*((?:-\\d)?\\d*)" + P + "*\\)|)(?=[^-]|$)", "i") }, K = /^[^{]+\{\s*\[native \w/, Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, et = /^(?:input|select|textarea|button)$/i, tt = /^h\d$/i, nt = /'|\\/g, rt = RegExp("\\\\([\\da-f]{1,6}" + P + "?|(" + P + ")|.)", "ig"), it = function (e, t, n) { var r = "0x" + t - 65536; return r !== r || n ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(55296 | r >> 10, 56320 | 1023 & r) }; try { M.apply(H = O.call(w.childNodes), w.childNodes), H[w.childNodes.length].nodeType } catch (ot) { M = { apply: H.length ? function (e, t) { _.apply(e, O.call(t)) } : function (e, t) { var n = e.length, r = 0; while (e[n++] = t[r++]); e.length = n - 1 } } } function at(e, t, n, i) { var o, a, s, l, u, c, d, m, y, x; if ((t ? t.ownerDocument || t : w) !== f && p(t), t = t || f, n = n || [], !e || "string" != typeof e) return n; if (1 !== (l = t.nodeType) && 9 !== l) return []; if (h && !i) { if (o = Z.exec(e)) if (s = o[1]) { if (9 === l) { if (a = t.getElementById(s), !a || !a.parentNode) return n; if (a.id === s) return n.push(a), n } else if (t.ownerDocument && (a = t.ownerDocument.getElementById(s)) && v(t, a) && a.id === s) return n.push(a), n } else { if (o[2]) return M.apply(n, t.getElementsByTagName(e)), n; if ((s = o[3]) && r.getElementsByClassName && t.getElementsByClassName) return M.apply(n, t.getElementsByClassName(s)), n } if (r.qsa && (!g || !g.test(e))) { if (m = d = b, y = t, x = 9 === l && e, 1 === l && "object" !== t.nodeName.toLowerCase()) { c = mt(e), (d = t.getAttribute("id")) ? m = d.replace(nt, "\\$&") : t.setAttribute("id", m), m = "[id='" + m + "'] ", u = c.length; while (u--) c[u] = m + yt(c[u]); y = V.test(e) && t.parentNode || t, x = c.join(",") } if (x) try { return M.apply(n, y.querySelectorAll(x)), n } catch (T) { } finally { d || t.removeAttribute("id") } } } return kt(e.replace(z, "$1"), t, n, i) } function st() { var e = []; function t(n, r) { return e.push(n += " ") > o.cacheLength && delete t[e.shift()], t[n] = r } return t } function lt(e) { return e[b] = !0, e } function ut(e) { var t = f.createElement("div"); try { return !!e(t) } catch (n) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function ct(e, t) { var n = e.split("|"), r = e.length; while (r--) o.attrHandle[n[r]] = t } function pt(e, t) { var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || D) - (~e.sourceIndex || D); if (r) return r; if (n) while (n = n.nextSibling) if (n === t) return -1; return e ? 1 : -1 } function ft(e) { return function (t) { var n = t.nodeName.toLowerCase(); return "input" === n && t.type === e } } function dt(e) { return function (t) { var n = t.nodeName.toLowerCase(); return ("input" === n || "button" === n) && t.type === e } } function ht(e) { return lt(function (t) { return t = +t, lt(function (n, r) { var i, o = e([], n.length, t), a = o.length; while (a--) n[i = o[a]] && (n[i] = !(r[i] = n[i])) }) }) } s = at.isXML = function (e) { var t = e && (e.ownerDocument || e).documentElement; return t ? "HTML" !== t.nodeName : !1 }, r = at.support = {}, p = at.setDocument = function (e) { var n = e ? e.ownerDocument || e : w, i = n.defaultView; return n !== f && 9 === n.nodeType && n.documentElement ? (f = n, d = n.documentElement, h = !s(n), i && i.attachEvent && i !== i.top && i.attachEvent("onbeforeunload", function () { p() }), r.attributes = ut(function (e) { return e.className = "i", !e.getAttribute("className") }), r.getElementsByTagName = ut(function (e) { return e.appendChild(n.createComment("")), !e.getElementsByTagName("*").length }), r.getElementsByClassName = ut(function (e) { return e.innerHTML = "<div class='a'></div><div class='a i'></div>", e.firstChild.className = "i", 2 === e.getElementsByClassName("i").length }), r.getById = ut(function (e) { return d.appendChild(e).id = b, !n.getElementsByName || !n.getElementsByName(b).length }), r.getById ? (o.find.ID = function (e, t) { if (typeof t.getElementById !== j && h) { var n = t.getElementById(e); return n && n.parentNode ? [n] : [] } }, o.filter.ID = function (e) { var t = e.replace(rt, it); return function (e) { return e.getAttribute("id") === t } }) : (delete o.find.ID, o.filter.ID = function (e) { var t = e.replace(rt, it); return function (e) { var n = typeof e.getAttributeNode !== j && e.getAttributeNode("id"); return n && n.value === t } }), o.find.TAG = r.getElementsByTagName ? function (e, n) { return typeof n.getElementsByTagName !== j ? n.getElementsByTagName(e) : t } : function (e, t) { var n, r = [], i = 0, o = t.getElementsByTagName(e); if ("*" === e) { while (n = o[i++]) 1 === n.nodeType && r.push(n); return r } return o }, o.find.CLASS = r.getElementsByClassName && function (e, n) { return typeof n.getElementsByClassName !== j && h ? n.getElementsByClassName(e) : t }, m = [], g = [], (r.qsa = K.test(n.querySelectorAll)) && (ut(function (e) { e.innerHTML = "<select><option selected=''></option></select>", e.querySelectorAll("[selected]").length || g.push("\\[" + P + "*(?:value|" + B + ")"), e.querySelectorAll(":checked").length || g.push(":checked") }), ut(function (e) { var t = n.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && g.push("[*^$]=" + P + "*(?:''|\"\")"), e.querySelectorAll(":enabled").length || g.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), g.push(",.*:") })), (r.matchesSelector = K.test(y = d.webkitMatchesSelector || d.mozMatchesSelector || d.oMatchesSelector || d.msMatchesSelector)) && ut(function (e) { r.disconnectedMatch = y.call(e, "div"), y.call(e, "[s!='']:x"), m.push("!=", I) }), g = g.length && RegExp(g.join("|")), m = m.length && RegExp(m.join("|")), v = K.test(d.contains) || d.compareDocumentPosition ? function (e, t) { var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) } : function (e, t) { if (t) while (t = t.parentNode) if (t === e) return !0; return !1 }, A = d.compareDocumentPosition ? function (e, t) { if (e === t) return S = !0, 0; var i = t.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(t); return i ? 1 & i || !r.sortDetached && t.compareDocumentPosition(e) === i ? e === n || v(w, e) ? -1 : t === n || v(w, t) ? 1 : c ? F.call(c, e) - F.call(c, t) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1 } : function (e, t) { var r, i = 0, o = e.parentNode, a = t.parentNode, s = [e], l = [t]; if (e === t) return S = !0, 0; if (!o || !a) return e === n ? -1 : t === n ? 1 : o ? -1 : a ? 1 : c ? F.call(c, e) - F.call(c, t) : 0; if (o === a) return pt(e, t); r = e; while (r = r.parentNode) s.unshift(r); r = t; while (r = r.parentNode) l.unshift(r); while (s[i] === l[i]) i++; return i ? pt(s[i], l[i]) : s[i] === w ? -1 : l[i] === w ? 1 : 0 }, n) : f }, at.matches = function (e, t) { return at(e, null, null, t) }, at.matchesSelector = function (e, t) { if ((e.ownerDocument || e) !== f && p(e), t = t.replace(Y, "='$1']"), !(!r.matchesSelector || !h || m && m.test(t) || g && g.test(t))) try { var n = y.call(e, t); if (n || r.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (i) { } return at(t, f, null, [e]).length > 0 }, at.contains = function (e, t) { return (e.ownerDocument || e) !== f && p(e), v(e, t) }, at.attr = function (e, n) { (e.ownerDocument || e) !== f && p(e); var i = o.attrHandle[n.toLowerCase()], a = i && L.call(o.attrHandle, n.toLowerCase()) ? i(e, n, !h) : t; return a === t ? r.attributes || !h ? e.getAttribute(n) : (a = e.getAttributeNode(n)) && a.specified ? a.value : null : a }, at.error = function (e) { throw Error("Syntax error, unrecognized expression: " + e) }, at.uniqueSort = function (e) { var t, n = [], i = 0, o = 0; if (S = !r.detectDuplicates, c = !r.sortStable && e.slice(0), e.sort(A), S) { while (t = e[o++]) t === e[o] && (i = n.push(o)); while (i--) e.splice(n[i], 1) } return e }, a = at.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (1 === i || 9 === i || 11 === i) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling) n += a(e) } else if (3 === i || 4 === i) return e.nodeValue } else for (; t = e[r]; r++) n += a(t); return n }, o = at.selectors = { cacheLength: 50, createPseudo: lt, match: Q, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(rt, it), e[3] = (e[4] || e[5] || "").replace(rt, it), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || at.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && at.error(e[0]), e }, PSEUDO: function (e) { var n, r = !e[5] && e[2]; return Q.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : r && J.test(r) && (n = mt(r, !0)) && (n = r.indexOf(")", r.length - n) - r.length) && (e[0] = e[0].slice(0, n), e[2] = r.slice(0, n)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(rt, it).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = N[e + " "]; return t || (t = RegExp("(^|" + P + ")" + e + "(" + P + "|$)")) && N(e, function (e) { return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== j && e.getAttribute("class") || "") }) }, ATTR: function (e, t, n) { return function (r) { var i = at.attr(r, e); return null == i ? "!=" === t : t ? (i += "", "=" === t ? i === n : "!=" === t ? i !== n : "^=" === t ? n && 0 === i.indexOf(n) : "*=" === t ? n && i.indexOf(n) > -1 : "$=" === t ? n && i.slice(-n.length) === n : "~=" === t ? (" " + i + " ").indexOf(n) > -1 : "|=" === t ? i === n || i.slice(0, n.length + 1) === n + "-" : !1) : !0 } }, CHILD: function (e, t, n, r, i) { var o = "nth" !== e.slice(0, 3), a = "last" !== e.slice(-4), s = "of-type" === t; return 1 === r && 0 === i ? function (e) { return !!e.parentNode } : function (t, n, l) { var u, c, p, f, d, h, g = o !== a ? "nextSibling" : "previousSibling", m = t.parentNode, y = s && t.nodeName.toLowerCase(), v = !l && !s; if (m) { if (o) { while (g) { p = t; while (p = p[g]) if (s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) return !1; h = g = "only" === e && !h && "nextSibling" } return !0 } if (h = [a ? m.firstChild : m.lastChild], a && v) { c = m[b] || (m[b] = {}), u = c[e] || [], d = u[0] === T && u[1], f = u[0] === T && u[2], p = d && m.childNodes[d]; while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if (1 === p.nodeType && ++f && p === t) { c[e] = [T, d, f]; break } } else if (v && (u = (t[b] || (t[b] = {}))[e]) && u[0] === T) f = u[1]; else while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if ((s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) && ++f && (v && ((p[b] || (p[b] = {}))[e] = [T, f]), p === t)) break; return f -= i, f === r || 0 === f % r && f / r >= 0 } } }, PSEUDO: function (e, t) { var n, r = o.pseudos[e] || o.setFilters[e.toLowerCase()] || at.error("unsupported pseudo: " + e); return r[b] ? r(t) : r.length > 1 ? (n = [e, e, "", t], o.setFilters.hasOwnProperty(e.toLowerCase()) ? lt(function (e, n) { var i, o = r(e, t), a = o.length; while (a--) i = F.call(e, o[a]), e[i] = !(n[i] = o[a]) }) : function (e) { return r(e, 0, n) }) : r } }, pseudos: { not: lt(function (e) { var t = [], n = [], r = l(e.replace(z, "$1")); return r[b] ? lt(function (e, t, n, i) { var o, a = r(e, null, i, []), s = e.length; while (s--) (o = a[s]) && (e[s] = !(t[s] = o)) }) : function (e, i, o) { return t[0] = e, r(t, null, o, n), !n.pop() } }), has: lt(function (e) { return function (t) { return at(e, t).length > 0 } }), contains: lt(function (e) { return function (t) { return (t.textContent || t.innerText || a(t)).indexOf(e) > -1 } }), lang: lt(function (e) { return G.test(e || "") || at.error("unsupported lang: " + e), e = e.replace(rt, it).toLowerCase(), function (t) { var n; do if (n = h ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(), n === e || 0 === n.indexOf(e + "-"); while ((t = t.parentNode) && 1 === t.nodeType); return !1 } }), target: function (t) { var n = e.location && e.location.hash; return n && n.slice(1) === t.id }, root: function (e) { return e === d }, focus: function (e) { return e === f.activeElement && (!f.hasFocus || f.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: function (e) { return e.disabled === !1 }, disabled: function (e) { return e.disabled === !0 }, checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, e.selected === !0 }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeName > "@" || 3 === e.nodeType || 4 === e.nodeType) return !1; return !0 }, parent: function (e) { return !o.pseudos.empty(e) }, header: function (e) { return tt.test(e.nodeName) }, input: function (e) { return et.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || t.toLowerCase() === e.type) }, first: ht(function () { return [0] }), last: ht(function (e, t) { return [t - 1] }), eq: ht(function (e, t, n) { return [0 > n ? n + t : n] }), even: ht(function (e, t) { var n = 0; for (; t > n; n += 2) e.push(n); return e }), odd: ht(function (e, t) { var n = 1; for (; t > n; n += 2) e.push(n); return e }), lt: ht(function (e, t, n) { var r = 0 > n ? n + t : n; for (; --r >= 0;) e.push(r); return e }), gt: ht(function (e, t, n) { var r = 0 > n ? n + t : n; for (; t > ++r;) e.push(r); return e }) } }, o.pseudos.nth = o.pseudos.eq; for (n in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) o.pseudos[n] = ft(n); for (n in { submit: !0, reset: !0 }) o.pseudos[n] = dt(n); function gt() { } gt.prototype = o.filters = o.pseudos, o.setFilters = new gt; function mt(e, t) { var n, r, i, a, s, l, u, c = k[e + " "]; if (c) return t ? 0 : c.slice(0); s = e, l = [], u = o.preFilter; while (s) { (!n || (r = X.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(i = [])), n = !1, (r = U.exec(s)) && (n = r.shift(), i.push({ value: n, type: r[0].replace(z, " ") }), s = s.slice(n.length)); for (a in o.filter) !(r = Q[a].exec(s)) || u[a] && !(r = u[a](r)) || (n = r.shift(), i.push({ value: n, type: a, matches: r }), s = s.slice(n.length)); if (!n) break } return t ? s.length : s ? at.error(e) : k(e, l).slice(0) } function yt(e) { var t = 0, n = e.length, r = ""; for (; n > t; t++) r += e[t].value; return r } function vt(e, t, n) { var r = t.dir, o = n && "parentNode" === r, a = C++; return t.first ? function (t, n, i) { while (t = t[r]) if (1 === t.nodeType || o) return e(t, n, i) } : function (t, n, s) { var l, u, c, p = T + " " + a; if (s) { while (t = t[r]) if ((1 === t.nodeType || o) && e(t, n, s)) return !0 } else while (t = t[r]) if (1 === t.nodeType || o) if (c = t[b] || (t[b] = {}), (u = c[r]) && u[0] === p) { if ((l = u[1]) === !0 || l === i) return l === !0 } else if (u = c[r] = [p], u[1] = e(t, n, s) || i, u[1] === !0) return !0 } } function bt(e) { return e.length > 1 ? function (t, n, r) { var i = e.length; while (i--) if (!e[i](t, n, r)) return !1; return !0 } : e[0] } function xt(e, t, n, r, i) { var o, a = [], s = 0, l = e.length, u = null != t; for (; l > s; s++) (o = e[s]) && (!n || n(o, r, i)) && (a.push(o), u && t.push(s)); return a } function wt(e, t, n, r, i, o) { return r && !r[b] && (r = wt(r)), i && !i[b] && (i = wt(i, o)), lt(function (o, a, s, l) { var u, c, p, f = [], d = [], h = a.length, g = o || Nt(t || "*", s.nodeType ? [s] : s, []), m = !e || !o && t ? g : xt(g, f, e, s, l), y = n ? i || (o ? e : h || r) ? [] : a : m; if (n && n(m, y, s, l), r) { u = xt(y, d), r(u, [], s, l), c = u.length; while (c--) (p = u[c]) && (y[d[c]] = !(m[d[c]] = p)) } if (o) { if (i || e) { if (i) { u = [], c = y.length; while (c--) (p = y[c]) && u.push(m[c] = p); i(null, y = [], u, l) } c = y.length; while (c--) (p = y[c]) && (u = i ? F.call(o, p) : f[c]) > -1 && (o[u] = !(a[u] = p)) } } else y = xt(y === a ? y.splice(h, y.length) : y), i ? i(null, a, y, l) : M.apply(a, y) }) } function Tt(e) { var t, n, r, i = e.length, a = o.relative[e[0].type], s = a || o.relative[" "], l = a ? 1 : 0, c = vt(function (e) { return e === t }, s, !0), p = vt(function (e) { return F.call(t, e) > -1 }, s, !0), f = [function (e, n, r) { return !a && (r || n !== u) || ((t = n).nodeType ? c(e, n, r) : p(e, n, r)) }]; for (; i > l; l++) if (n = o.relative[e[l].type]) f = [vt(bt(f), n)]; else { if (n = o.filter[e[l].type].apply(null, e[l].matches), n[b]) { for (r = ++l; i > r; r++) if (o.relative[e[r].type]) break; return wt(l > 1 && bt(f), l > 1 && yt(e.slice(0, l - 1).concat({ value: " " === e[l - 2].type ? "*" : "" })).replace(z, "$1"), n, r > l && Tt(e.slice(l, r)), i > r && Tt(e = e.slice(r)), i > r && yt(e)) } f.push(n) } return bt(f) } function Ct(e, t) { var n = 0, r = t.length > 0, a = e.length > 0, s = function (s, l, c, p, d) { var h, g, m, y = [], v = 0, b = "0", x = s && [], w = null != d, C = u, N = s || a && o.find.TAG("*", d && l.parentNode || l), k = T += null == C ? 1 : Math.random() || .1; for (w && (u = l !== f && l, i = n) ; null != (h = N[b]) ; b++) { if (a && h) { g = 0; while (m = e[g++]) if (m(h, l, c)) { p.push(h); break } w && (T = k, i = ++n) } r && ((h = !m && h) && v--, s && x.push(h)) } if (v += b, r && b !== v) { g = 0; while (m = t[g++]) m(x, y, l, c); if (s) { if (v > 0) while (b--) x[b] || y[b] || (y[b] = q.call(p)); y = xt(y) } M.apply(p, y), w && !s && y.length > 0 && v + t.length > 1 && at.uniqueSort(p) } return w && (T = k, u = C), x }; return r ? lt(s) : s } l = at.compile = function (e, t) { var n, r = [], i = [], o = E[e + " "]; if (!o) { t || (t = mt(e)), n = t.length; while (n--) o = Tt(t[n]), o[b] ? r.push(o) : i.push(o); o = E(e, Ct(i, r)) } return o }; function Nt(e, t, n) { var r = 0, i = t.length; for (; i > r; r++) at(e, t[r], n); return n } function kt(e, t, n, i) { var a, s, u, c, p, f = mt(e); if (!i && 1 === f.length) { if (s = f[0] = f[0].slice(0), s.length > 2 && "ID" === (u = s[0]).type && r.getById && 9 === t.nodeType && h && o.relative[s[1].type]) { if (t = (o.find.ID(u.matches[0].replace(rt, it), t) || [])[0], !t) return n; e = e.slice(s.shift().value.length) } a = Q.needsContext.test(e) ? 0 : s.length; while (a--) { if (u = s[a], o.relative[c = u.type]) break; if ((p = o.find[c]) && (i = p(u.matches[0].replace(rt, it), V.test(s[0].type) && t.parentNode || t))) { if (s.splice(a, 1), e = i.length && yt(s), !e) return M.apply(n, i), n; break } } } return l(e, f)(i, t, !h, n, V.test(e)), n } r.sortStable = b.split("").sort(A).join("") === b, r.detectDuplicates = S, p(), r.sortDetached = ut(function (e) { return 1 & e.compareDocumentPosition(f.createElement("div")) }), ut(function (e) { return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href") }) || ct("type|href|height|width", function (e, n, r) { return r ? t : e.getAttribute(n, "type" === n.toLowerCase() ? 1 : 2) }), r.attributes && ut(function (e) { return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") }) || ct("value", function (e, n, r) { return r || "input" !== e.nodeName.toLowerCase() ? t : e.defaultValue }), ut(function (e) { return null == e.getAttribute("disabled") }) || ct(B, function (e, n, r) { var i; return r ? t : (i = e.getAttributeNode(n)) && i.specified ? i.value : e[n] === !0 ? n.toLowerCase() : null }), x.find = at, x.expr = at.selectors, x.expr[":"] = x.expr.pseudos, x.unique = at.uniqueSort, x.text = at.getText, x.isXMLDoc = at.isXML, x.contains = at.contains }(e); var O = {}; function F(e) { var t = O[e] = {}; return x.each(e.match(T) || [], function (e, n) { t[n] = !0 }), t } x.Callbacks = function (e) { e = "string" == typeof e ? O[e] || F(e) : x.extend({}, e); var n, r, i, o, a, s, l = [], u = !e.once && [], c = function (t) { for (r = e.memory && t, i = !0, a = s || 0, s = 0, o = l.length, n = !0; l && o > a; a++) if (l[a].apply(t[0], t[1]) === !1 && e.stopOnFalse) { r = !1; break } n = !1, l && (u ? u.length && c(u.shift()) : r ? l = [] : p.disable()) }, p = { add: function () { if (l) { var t = l.length; (function i(t) { x.each(t, function (t, n) { var r = x.type(n); "function" === r ? e.unique && p.has(n) || l.push(n) : n && n.length && "string" !== r && i(n) }) })(arguments), n ? o = l.length : r && (s = t, c(r)) } return this }, remove: function () { return l && x.each(arguments, function (e, t) { var r; while ((r = x.inArray(t, l, r)) > -1) l.splice(r, 1), n && (o >= r && o--, a >= r && a--) }), this }, has: function (e) { return e ? x.inArray(e, l) > -1 : !(!l || !l.length) }, empty: function () { return l = [], o = 0, this }, disable: function () { return l = u = r = t, this }, disabled: function () { return !l }, lock: function () { return u = t, r || p.disable(), this }, locked: function () { return !u }, fireWith: function (e, t) { return !l || i && !u || (t = t || [], t = [e, t.slice ? t.slice() : t], n ? u.push(t) : c(t)), this }, fire: function () { return p.fireWith(this, arguments), this }, fired: function () { return !!i } }; return p }, x.extend({ Deferred: function (e) { var t = [["resolve", "done", x.Callbacks("once memory"), "resolved"], ["reject", "fail", x.Callbacks("once memory"), "rejected"], ["notify", "progress", x.Callbacks("memory")]], n = "pending", r = { state: function () { return n }, always: function () { return i.done(arguments).fail(arguments), this }, then: function () { var e = arguments; return x.Deferred(function (n) { x.each(t, function (t, o) { var a = o[0], s = x.isFunction(e[t]) && e[t]; i[o[1]](function () { var e = s && s.apply(this, arguments); e && x.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === r ? n.promise() : this, s ? [e] : arguments) }) }), e = null }).promise() }, promise: function (e) { return null != e ? x.extend(e, r) : r } }, i = {}; return r.pipe = r.then, x.each(t, function (e, o) { var a = o[2], s = o[3]; r[o[1]] = a.add, s && a.add(function () { n = s }, t[1 ^ e][2].disable, t[2][2].lock), i[o[0]] = function () { return i[o[0] + "With"](this === i ? r : this, arguments), this }, i[o[0] + "With"] = a.fireWith }), r.promise(i), e && e.call(i, i), i }, when: function (e) { var t = 0, n = g.call(arguments), r = n.length, i = 1 !== r || e && x.isFunction(e.promise) ? r : 0, o = 1 === i ? e : x.Deferred(), a = function (e, t, n) { return function (r) { t[e] = this, n[e] = arguments.length > 1 ? g.call(arguments) : r, n === s ? o.notifyWith(t, n) : --i || o.resolveWith(t, n) } }, s, l, u; if (r > 1) for (s = Array(r), l = Array(r), u = Array(r) ; r > t; t++) n[t] && x.isFunction(n[t].promise) ? n[t].promise().done(a(t, u, n)).fail(o.reject).progress(a(t, l, s)) : --i; return i || o.resolveWith(u, n), o.promise() } }), x.support = function (t) {
        var n, r, o, s, l, u, c, p, f, d = a.createElement("div"); if (d.setAttribute("className", "t"), d.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", n = d.getElementsByTagName("*") || [], r = d.getElementsByTagName("a")[0], !r || !r.style || !n.length) return t; s = a.createElement("select"), u = s.appendChild(a.createElement("option")), o = d.getElementsByTagName("input")[0], r.style.cssText = "top:1px;float:left;opacity:.5", t.getSetAttribute = "t" !== d.className, t.leadingWhitespace = 3 === d.firstChild.nodeType, t.tbody = !d.getElementsByTagName("tbody").length, t.htmlSerialize = !!d.getElementsByTagName("link").length, t.style = /top/.test(r.getAttribute("style")), t.hrefNormalized = "/a" === r.getAttribute("href"), t.opacity = /^0.5/.test(r.style.opacity), t.cssFloat = !!r.style.cssFloat, t.checkOn = !!o.value, t.optSelected = u.selected, t.enctype = !!a.createElement("form").enctype, t.html5Clone = "<:nav></:nav>" !== a.createElement("nav").cloneNode(!0).outerHTML, t.inlineBlockNeedsLayout = !1, t.shrinkWrapBlocks = !1, t.pixelPosition = !1, t.deleteExpando = !0, t.noCloneEvent = !0, t.reliableMarginRight = !0, t.boxSizingReliable = !0, o.checked = !0, t.noCloneChecked = o.cloneNode(!0).checked, s.disabled = !0, t.optDisabled = !u.disabled; try { delete d.test } catch (h) { t.deleteExpando = !1 } o = a.createElement("input"), o.setAttribute("value", ""), t.input = "" === o.getAttribute("value"), o.value = "t", o.setAttribute("type", "radio"), t.radioValue = "t" === o.value, o.setAttribute("checked", "t"), o.setAttribute("name", "t"), l = a.createDocumentFragment(), l.appendChild(o), t.appendChecked = o.checked, t.checkClone = l.cloneNode(!0).cloneNode(!0).lastChild.checked, d.attachEvent && (d.attachEvent("onclick", function () { t.noCloneEvent = !1 }), d.cloneNode(!0).click()); for (f in { submit: !0, change: !0, focusin: !0 }) d.setAttribute(c = "on" + f, "t"), t[f + "Bubbles"] = c in e || d.attributes[c].expando === !1; d.style.backgroundClip = "content-box", d.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === d.style.backgroundClip; for (f in x(t)) break; return t.ownLast = "0" !== f, x(function () { var n, r, o, s = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", l = a.getElementsByTagName("body")[0]; l && (n = a.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", l.appendChild(n).appendChild(d), d.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", o = d.getElementsByTagName("td"), o[0].style.cssText = "padding:0;margin:0;border:0;display:none", p = 0 === o[0].offsetHeight, o[0].style.display = "", o[1].style.display = "none", t.reliableHiddenOffsets = p && 0 === o[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", x.swap(l, null != l.style.zoom ? { zoom: 1 } : {}, function () { t.boxSizing = 4 === d.offsetWidth }), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(d, null) || {}).top, t.boxSizingReliable = "4px" === (e.getComputedStyle(d, null) || { width: "4px" }).width, r = d.appendChild(a.createElement("div")), r.style.cssText = d.style.cssText = s, r.style.marginRight = r.style.width = "0", d.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(r, null) || {}).marginRight)), typeof d.style.zoom !== i && (d.innerHTML = "", d.style.cssText = s + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.innerHTML = "<div></div>", d.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== d.offsetWidth, t.inlineBlockNeedsLayout && (l.style.zoom = 1)), l.removeChild(n), n = d = o = r = null) }), n = s = l = u = r = o = null, t
}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
;
// Unobtrusive Ajax support library for jQuery
// Copyright (C) Microsoft Corporation. All rights reserved.
// @version v3.2.5
// 
// Microsoft grants you the right to use these script files for the sole
// purpose of either: (i) interacting through your browser with the Microsoft
// website or online service, subject to the applicable licensing or use
// terms; or (ii) using the files as included with a Microsoft product subject
// to that product's license terms. Microsoft reserves all other rights to the
// files not expressly granted by Microsoft, whether by implication, estoppel
// or otherwise. Insofar as a script file is dual licensed under GPL,
// Microsoft neither took the code under GPL nor distributes it thereunder but
// under the terms set out in this paragraph. All notices and licenses
// below are for informational purposes only.
!function(t){function a(t,a){for(var e=window,r=(t||"").split(".");e&&r.length;)e=e[r.shift()];return"function"==typeof e?e:(a.push(t),Function.constructor.apply(null,a))}function e(t){return"GET"===t||"POST"===t}function r(t,a){e(a)||t.setRequestHeader("X-HTTP-Method-Override",a)}function n(a,e,r){var n;r.indexOf("application/x-javascript")===-1&&(n=(a.getAttribute("data-ajax-mode")||"").toUpperCase(),t(a.getAttribute("data-ajax-update")).each(function(a,r){switch(n){case"BEFORE":t(r).prepend(e);break;case"AFTER":t(r).append(e);break;case"REPLACE-WITH":t(r).replaceWith(e);break;default:t(r).html(e)}}))}function u(u,i){var o,d,c,s;o=u.getAttribute("data-ajax-confirm"),o&&!window.confirm(o)||(d=t(u.getAttribute("data-ajax-loading")),s=parseInt(u.getAttribute("data-ajax-loading-duration"),10)||0,t.extend(i,{type:u.getAttribute("data-ajax-method")||void 0,url:u.getAttribute("data-ajax-url")||void 0,cache:"true"===(u.getAttribute("data-ajax-cache")||"").toLowerCase(),beforeSend:function(t){var e;return r(t,c),e=a(u.getAttribute("data-ajax-begin"),["xhr"]).apply(u,arguments),e!==!1&&d.show(s),e},complete:function(){d.hide(s),a(u.getAttribute("data-ajax-complete"),["xhr","status"]).apply(u,arguments)},success:function(t,e,r){n(u,t,r.getResponseHeader("Content-Type")||"text/html"),a(u.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(u,arguments)},error:function(){a(u.getAttribute("data-ajax-failure"),["xhr","status","error"]).apply(u,arguments)}}),i.data.push({name:"X-Requested-With",value:"XMLHttpRequest"}),c=i.type.toUpperCase(),e(c)||(i.type="POST",i.data.push({name:"X-HTTP-Method-Override",value:c})),t.ajax(i))}function i(a){var e=t(a).data(c);return!e||!e.validate||e.validate()}var o="unobtrusiveAjaxClick",d="unobtrusiveAjaxClickTarget",c="unobtrusiveValidation";t(document).on("click","a[data-ajax=true]",function(t){t.preventDefault(),u(this,{url:this.href,type:"GET",data:[]})}),t(document).on("click","form[data-ajax=true] input[type=image]",function(a){var e=a.target.name,r=t(a.target),n=t(r.parents("form")[0]),u=r.offset();n.data(o,[{name:e+".x",value:Math.round(a.pageX-u.left)},{name:e+".y",value:Math.round(a.pageY-u.top)}]),setTimeout(function(){n.removeData(o)},0)}),t(document).on("click","form[data-ajax=true] :submit",function(a){var e=a.currentTarget.name,r=t(a.target),n=t(r.parents("form")[0]);n.data(o,e?[{name:e,value:a.currentTarget.value}]:[]),n.data(d,r),setTimeout(function(){n.removeData(o),n.removeData(d)},0)}),t(document).on("submit","form[data-ajax=true]",function(a){var e=t(this).data(o)||[],r=t(this).data(d),n=r&&(r.hasClass("cancel")||void 0!==r.attr("formnovalidate"));a.preventDefault(),(n||i(this))&&u(this,{url:this.action,type:this.method||"GET",data:e.concat(t(this).serializeArray())})})}(jQuery);;
/*!
 * Modernizr v2.8.3
 * www.modernizr.com
 *
 * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
 * Available under the BSD and MIT licenses: www.modernizr.com/license/
 */

/*
 * Modernizr tests which native CSS3 and HTML5 features are available in
 * the current UA and makes the results available to you in two ways:
 * as properties on a global Modernizr object, and as classes on the
 * <html> element. This information allows you to progressively enhance
 * your pages with a granular level of control over the experience.
 *
 * Modernizr has an optional (not included) conditional resource loader
 * called Modernizr.load(), based on Yepnope.js (yepnopejs.com).
 * To get a build that includes Modernizr.load(), as well as choosing
 * which tests to include, go to www.modernizr.com/download/
 *
 * Authors        Faruk Ates, Paul Irish, Alex Sexton
 * Contributors   Ryan Seddon, Ben Alman
 */

window.Modernizr = (function( window, document, undefined ) {

    var version = '2.8.3',

    Modernizr = {},

    /*>>cssclasses*/
    // option for enabling the HTML classes to be added
    enableClasses = true,
    /*>>cssclasses*/

    docElement = document.documentElement,

    /**
     * Create our "modernizr" element that we do most feature tests on.
     */
    mod = 'modernizr',
    modElem = document.createElement(mod),
    mStyle = modElem.style,

    /**
     * Create the input element for various Web Forms feature tests.
     */
    inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ ,

    /*>>smile*/
    smile = ':)',
    /*>>smile*/

    toString = {}.toString,

    // TODO :: make the prefixes more granular
    /*>>prefixes*/
    // List of property values to set for css tests. See ticket #21
    prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
    /*>>prefixes*/

    /*>>domprefixes*/
    // Following spec is to expose vendor-specific style properties as:
    //   elem.style.WebkitBorderRadius
    // and the following would be incorrect:
    //   elem.style.webkitBorderRadius

    // Webkit ghosts their properties in lowercase but Opera & Moz do not.
    // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
    //   erik.eae.net/archives/2008/03/10/21.48.10/

    // More here: github.com/Modernizr/Modernizr/issues/issue/21
    omPrefixes = 'Webkit Moz O ms',

    cssomPrefixes = omPrefixes.split(' '),

    domPrefixes = omPrefixes.toLowerCase().split(' '),
    /*>>domprefixes*/

    /*>>ns*/
    ns = {'svg': 'http://www.w3.org/2000/svg'},
    /*>>ns*/

    tests = {},
    inputs = {},
    attrs = {},

    classes = [],

    slice = classes.slice,

    featureName, // used in testing loop


    /*>>teststyles*/
    // Inject element with style element and some CSS rules
    injectElementWithStyles = function( rule, callback, nodes, testnames ) {

      var style, ret, node, docOverflow,
          div = document.createElement('div'),
          // After page load injecting a fake body doesn't work so check if body exists
          body = document.body,
          // IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it.
          fakeBody = body || document.createElement('body');

      if ( parseInt(nodes, 10) ) {
          // In order not to give false positives we create a node for each test
          // This also allows the method to scale for unspecified uses
          while ( nodes-- ) {
              node = document.createElement('div');
              node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
              div.appendChild(node);
          }
      }

      // <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed
      // when injected with innerHTML. To get around this you need to prepend the 'NoScope' element
      // with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements.
      // msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx
      // Documents served as xml will throw if using &shy; so use xml friendly encoded version. See issue #277
      style = ['&#173;','<style id="s', mod, '">', rule, '</style>'].join('');
      div.id = mod;
      // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
      // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
      (body ? div : fakeBody).innerHTML += style;
      fakeBody.appendChild(div);
      if ( !body ) {
          //avoid crashing IE8, if background image is used
          fakeBody.style.background = '';
          //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
          fakeBody.style.overflow = 'hidden';
          docOverflow = docElement.style.overflow;
          docElement.style.overflow = 'hidden';
          docElement.appendChild(fakeBody);
      }

      ret = callback(div, rule);
      // If this is done after page load we don't want to remove the body so check if body exists
      if ( !body ) {
          fakeBody.parentNode.removeChild(fakeBody);
          docElement.style.overflow = docOverflow;
      } else {
          div.parentNode.removeChild(div);
      }

      return !!ret;

    },
    /*>>teststyles*/

    /*>>mq*/
    // adapted from matchMedia polyfill
    // by Scott Jehl and Paul Irish
    // gist.github.com/786768
    testMediaQuery = function( mq ) {

      var matchMedia = window.matchMedia || window.msMatchMedia;
      if ( matchMedia ) {
        return matchMedia(mq) && matchMedia(mq).matches || false;
      }

      var bool;

      injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
        bool = (window.getComputedStyle ?
                  getComputedStyle(node, null) :
                  node.currentStyle)['position'] == 'absolute';
      });

      return bool;

     },
     /*>>mq*/


    /*>>hasevent*/
    //
    // isEventSupported determines if a given element supports the given event
    // kangax.github.com/iseventsupported/
    //
    // The following results are known incorrects:
    //   Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative
    //   Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333
    //   ...
    isEventSupported = (function() {

      var TAGNAMES = {
        'select': 'input', 'change': 'input',
        'submit': 'form', 'reset': 'form',
        'error': 'img', 'load': 'img', 'abort': 'img'
      };

      function isEventSupported( eventName, element ) {

        element = element || document.createElement(TAGNAMES[eventName] || 'div');
        eventName = 'on' + eventName;

        // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those
        var isSupported = eventName in element;

        if ( !isSupported ) {
          // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element
          if ( !element.setAttribute ) {
            element = document.createElement('div');
          }
          if ( element.setAttribute && element.removeAttribute ) {
            element.setAttribute(eventName, '');
            isSupported = is(element[eventName], 'function');

            // If property was created, "remove it" (by setting value to `undefined`)
            if ( !is(element[eventName], 'undefined') ) {
              element[eventName] = undefined;
            }
            element.removeAttribute(eventName);
          }
        }

        element = null;
        return isSupported;
      }
      return isEventSupported;
    })(),
    /*>>hasevent*/

    // TODO :: Add flag for hasownprop ? didn't last time

    // hasOwnProperty shim by kangax needed for Safari 2.0 support
    _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;

    if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
      hasOwnProp = function (object, property) {
        return _hasOwnProperty.call(object, property);
      };
    }
    else {
      hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
        return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
      };
    }

    // Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js
    // es5.github.com/#x15.3.4.5

    if (!Function.prototype.bind) {
      Function.prototype.bind = function bind(that) {

        var target = this;

        if (typeof target != "function") {
            throw new TypeError();
        }

        var args = slice.call(arguments, 1),
            bound = function () {

            if (this instanceof bound) {

              var F = function(){};
              F.prototype = target.prototype;
              var self = new F();

              var result = target.apply(
                  self,
                  args.concat(slice.call(arguments))
              );
              if (Object(result) === result) {
                  return result;
              }
              return self;

            } else {

              return target.apply(
                  that,
                  args.concat(slice.call(arguments))
              );

            }

        };

        return bound;
      };
    }

    /**
     * setCss applies given styles to the Modernizr DOM node.
     */
    function setCss( str ) {
        mStyle.cssText = str;
    }

    /**
     * setCssAll extrapolates all vendor-specific css strings.
     */
    function setCssAll( str1, str2 ) {
        return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
    }

    /**
     * is returns a boolean for if typeof obj is exactly type.
     */
    function is( obj, type ) {
        return typeof obj === type;
    }

    /**
     * contains returns a boolean for if substr is found within str.
     */
    function contains( str, substr ) {
        return !!~('' + str).indexOf(substr);
    }

    /*>>testprop*/

    // testProps is a generic CSS / DOM property test.

    // In testing support for a given CSS property, it's legit to test:
    //    `elem.style[styleName] !== undefined`
    // If the property is supported it will return an empty string,
    // if unsupported it will return undefined.

    // We'll take advantage of this quick test and skip setting a style
    // on our modernizr element, but instead just testing undefined vs
    // empty string.

    // Because the testing of the CSS property names (with "-", as
    // opposed to the camelCase DOM properties) is non-portable and
    // non-standard but works in WebKit and IE (but not Gecko or Opera),
    // we explicitly reject properties with dashes so that authors
    // developing in WebKit or IE first don't end up with
    // browser-specific content by accident.

    function testProps( props, prefixed ) {
        for ( var i in props ) {
            var prop = props[i];
            if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
                return prefixed == 'pfx' ? prop : true;
            }
        }
        return false;
    }
    /*>>testprop*/

    // TODO :: add testDOMProps
    /**
     * testDOMProps is a generic DOM property test; if a browser supports
     *   a certain property, it won't return undefined for it.
     */
    function testDOMProps( props, obj, elem ) {
        for ( var i in props ) {
            var item = obj[props[i]];
            if ( item !== undefined) {

                // return the property name as a string
                if (elem === false) return props[i];

                // let's bind a function
                if (is(item, 'function')){
                  // default to autobind unless override
                  return item.bind(elem || obj);
                }

                // return the unbound function or obj or value
                return item;
            }
        }
        return false;
    }

    /*>>testallprops*/
    /**
     * testPropsAll tests a list of DOM properties we want to check against.
     *   We specify literally ALL possible (known and/or likely) properties on
     *   the element including the non-vendor prefixed one, for forward-
     *   compatibility.
     */
    function testPropsAll( prop, prefixed, elem ) {

        var ucProp  = prop.charAt(0).toUpperCase() + prop.slice(1),
            props   = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');

        // did they call .prefixed('boxSizing') or are we just testing a prop?
        if(is(prefixed, "string") || is(prefixed, "undefined")) {
          return testProps(props, prefixed);

        // otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
        } else {
          props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
          return testDOMProps(props, prefixed, elem);
        }
    }
    /*>>testallprops*/


    /**
     * Tests
     * -----
     */

    // The *new* flexbox
    // dev.w3.org/csswg/css3-flexbox

    tests['flexbox'] = function() {
      return testPropsAll('flexWrap');
    };

    // The *old* flexbox
    // www.w3.org/TR/2009/WD-css3-flexbox-20090723/

    tests['flexboxlegacy'] = function() {
        return testPropsAll('boxDirection');
    };

    // On the S60 and BB Storm, getContext exists, but always returns undefined
    // so we actually have to call getContext() to verify
    // github.com/Modernizr/Modernizr/issues/issue/97/

    tests['canvas'] = function() {
        var elem = document.createElement('canvas');
        return !!(elem.getContext && elem.getContext('2d'));
    };

    tests['canvastext'] = function() {
        return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
    };

    // webk.it/70117 is tracking a legit WebGL feature detect proposal

    // We do a soft detect which may false positive in order to avoid
    // an expensive context creation: bugzil.la/732441

    tests['webgl'] = function() {
        return !!window.WebGLRenderingContext;
    };

    /*
     * The Modernizr.touch test only indicates if the browser supports
     *    touch events, which does not necessarily reflect a touchscreen
     *    device, as evidenced by tablets running Windows 7 or, alas,
     *    the Palm Pre / WebOS (touch) phones.
     *
     * Additionally, Chrome (desktop) used to lie about its support on this,
     *    but that has since been rectified: crbug.com/36415
     *
     * We also test for Firefox 4 Multitouch Support.
     *
     * For more info, see: modernizr.github.com/Modernizr/touch.html
     */

    tests['touch'] = function() {
        var bool;

        if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
          bool = true;
        } else {
          injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
            bool = node.offsetTop === 9;
          });
        }

        return bool;
    };


    // geolocation is often considered a trivial feature detect...
    // Turns out, it's quite tricky to get right:
    //
    // Using !!navigator.geolocation does two things we don't want. It:
    //   1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513
    //   2. Disables page caching in WebKit: webk.it/43956
    //
    // Meanwhile, in Firefox < 8, an about:config setting could expose
    // a false positive that would throw an exception: bugzil.la/688158

    tests['geolocation'] = function() {
        return 'geolocation' in navigator;
    };


    tests['postmessage'] = function() {
      return !!window.postMessage;
    };


    // Chrome incognito mode used to throw an exception when using openDatabase
    // It doesn't anymore.
    tests['websqldatabase'] = function() {
      return !!window.openDatabase;
    };

    // Vendors had inconsistent prefixing with the experimental Indexed DB:
    // - Webkit's implementation is accessible through webkitIndexedDB
    // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
    // For speed, we don't test the legacy (and beta-only) indexedDB
    tests['indexedDB'] = function() {
      return !!testPropsAll("indexedDB", window);
    };

    // documentMode logic from YUI to filter out IE8 Compat Mode
    //   which false positives.
    tests['hashchange'] = function() {
      return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
    };

    // Per 1.6:
    // This used to be Modernizr.historymanagement but the longer
    // name has been deprecated in favor of a shorter and property-matching one.
    // The old API is still available in 1.6, but as of 2.0 will throw a warning,
    // and in the first release thereafter disappear entirely.
    tests['history'] = function() {
      return !!(window.history && history.pushState);
    };

    tests['draganddrop'] = function() {
        var div = document.createElement('div');
        return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
    };

    // FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10
    // will be supported until FF19 (2/12/13), at which time, ESR becomes FF17.
    // FF10 still uses prefixes, so check for it until then.
    // for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/
    tests['websockets'] = function() {
        return 'WebSocket' in window || 'MozWebSocket' in window;
    };


    // css-tricks.com/rgba-browser-support/
    tests['rgba'] = function() {
        // Set an rgba() color and check the returned value

        setCss('background-color:rgba(150,255,150,.5)');

        return contains(mStyle.backgroundColor, 'rgba');
    };

    tests['hsla'] = function() {
        // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally,
        //   except IE9 who retains it as hsla

        setCss('background-color:hsla(120,40%,100%,.5)');

        return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
    };

    tests['multiplebgs'] = function() {
        // Setting multiple images AND a color on the background shorthand property
        //  and then querying the style.background property value for the number of
        //  occurrences of "url(" is a reliable method for detecting ACTUAL support for this!

        setCss('background:url(https://),url(https://),red url(https://)');

        // If the UA supports multiple backgrounds, there should be three occurrences
        //   of the string "url(" in the return value for elemStyle.background

        return (/(url\s*\(.*?){3}/).test(mStyle.background);
    };



    // this will false positive in Opera Mini
    //   github.com/Modernizr/Modernizr/issues/396

    tests['backgroundsize'] = function() {
        return testPropsAll('backgroundSize');
    };

    tests['borderimage'] = function() {
        return testPropsAll('borderImage');
    };


    // Super comprehensive table about all the unique implementations of
    // border-radius: muddledramblings.com/table-of-css3-border-radius-compliance

    tests['borderradius'] = function() {
        return testPropsAll('borderRadius');
    };

    // WebOS unfortunately false positives on this test.
    tests['boxshadow'] = function() {
        return testPropsAll('boxShadow');
    };

    // FF3.0 will false positive on this test
    tests['textshadow'] = function() {
        return document.createElement('div').style.textShadow === '';
    };


    tests['opacity'] = function() {
        // Browsers that actually have CSS Opacity implemented have done so
        //  according to spec, which means their return values are within the
        //  range of [0.0,1.0] - including the leading zero.

        setCssAll('opacity:.55');

        // The non-literal . in this regex is intentional:
        //   German Chrome returns this value as 0,55
        // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632
        return (/^0.55$/).test(mStyle.opacity);
    };


    // Note, Android < 4 will pass this test, but can only animate
    //   a single property at a time
    //   goo.gl/v3V4Gp
    tests['cssanimations'] = function() {
        return testPropsAll('animationName');
    };


    tests['csscolumns'] = function() {
        return testPropsAll('columnCount');
    };


    tests['cssgradients'] = function() {
        /**
         * For CSS Gradients syntax, please see:
         * webkit.org/blog/175/introducing-css-gradients/
         * developer.mozilla.org/en/CSS/-moz-linear-gradient
         * developer.mozilla.org/en/CSS/-moz-radial-gradient
         * dev.w3.org/csswg/css3-images/#gradients-
         */

        var str1 = 'background-image:',
            str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
            str3 = 'linear-gradient(left top,#9f9, white);';

        setCss(
             // legacy webkit syntax (FIXME: remove when syntax not in use anymore)
              (str1 + '-webkit- '.split(' ').join(str2 + str1) +
             // standard syntax             // trailing 'background-image:'
              prefixes.join(str3 + str1)).slice(0, -str1.length)
        );

        return contains(mStyle.backgroundImage, 'gradient');
    };


    tests['cssreflections'] = function() {
        return testPropsAll('boxReflect');
    };


    tests['csstransforms'] = function() {
        return !!testPropsAll('transform');
    };


    tests['csstransforms3d'] = function() {

        var ret = !!testPropsAll('perspective');

        // Webkit's 3D transforms are passed off to the browser's own graphics renderer.
        //   It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
        //   some conditions. As a result, Webkit typically recognizes the syntax but
        //   will sometimes throw a false positive, thus we must do a more thorough check:
        if ( ret && 'webkitPerspective' in docElement.style ) {

          // Webkit allows this media query to succeed only if the feature is enabled.
          // `@media (transform-3d),(-webkit-transform-3d){ ... }`
          injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
            ret = node.offsetLeft === 9 && node.offsetHeight === 3;
          });
        }
        return ret;
    };


    tests['csstransitions'] = function() {
        return testPropsAll('transition');
    };


    /*>>fontface*/
    // @font-face detection routine by Diego Perini
    // javascript.nwbox.com/CSSSupport/

    // false positives:
    //   WebOS github.com/Modernizr/Modernizr/issues/342
    //   WP7   github.com/Modernizr/Modernizr/issues/538
    tests['fontface'] = function() {
        var bool;

        injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
          var style = document.getElementById('smodernizr'),
              sheet = style.sheet || style.styleSheet,
              cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';

          bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
        });

        return bool;
    };
    /*>>fontface*/

    // CSS generated content detection
    tests['generatedcontent'] = function() {
        var bool;

        injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
          bool = node.offsetHeight >= 3;
        });

        return bool;
    };



    // These tests evaluate support of the video/audio elements, as well as
    // testing what types of content they support.
    //
    // We're using the Boolean constructor here, so that we can extend the value
    // e.g.  Modernizr.video     // true
    //       Modernizr.video.ogg // 'probably'
    //
    // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
    //                     thx to NielsLeenheer and zcorpan

    // Note: in some older browsers, "no" was a return value instead of empty string.
    //   It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2
    //   It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5

    tests['video'] = function() {
        var elem = document.createElement('video'),
            bool = false;

        // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
        try {
            if ( bool = !!elem.canPlayType ) {
                bool      = new Boolean(bool);
                bool.ogg  = elem.canPlayType('video/ogg; codecs="theora"')      .replace(/^no$/,'');

                // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546
                bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');

                bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
            }

        } catch(e) { }

        return bool;
    };

    tests['audio'] = function() {
        var elem = document.createElement('audio'),
            bool = false;

        try {
            if ( bool = !!elem.canPlayType ) {
                bool      = new Boolean(bool);
                bool.ogg  = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
                bool.mp3  = elem.canPlayType('audio/mpeg;')               .replace(/^no$/,'');

                // Mimetypes accepted:
                //   developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
                //   bit.ly/iphoneoscodecs
                bool.wav  = elem.canPlayType('audio/wav; codecs="1"')     .replace(/^no$/,'');
                bool.m4a  = ( elem.canPlayType('audio/x-m4a;')            ||
                              elem.canPlayType('audio/aac;'))             .replace(/^no$/,'');
            }
        } catch(e) { }

        return bool;
    };


    // In FF4, if disabled, window.localStorage should === null.

    // Normally, we could not test that directly and need to do a
    //   `('localStorage' in window) && ` test first because otherwise Firefox will
    //   throw bugzil.la/365772 if cookies are disabled

    // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem
    // will throw the exception:
    //   QUOTA_EXCEEDED_ERRROR DOM Exception 22.
    // Peculiarly, getItem and removeItem calls do not throw.

    // Because we are forced to try/catch this, we'll go aggressive.

    // Just FWIW: IE8 Compat mode supports these features completely:
    //   www.quirksmode.org/dom/html5.html
    // But IE8 doesn't support either with local files

    tests['localstorage'] = function() {
        try {
            localStorage.setItem(mod, mod);
            localStorage.removeItem(mod);
            return true;
        } catch(e) {
            return false;
        }
    };

    tests['sessionstorage'] = function() {
        try {
            sessionStorage.setItem(mod, mod);
            sessionStorage.removeItem(mod);
            return true;
        } catch(e) {
            return false;
        }
    };


    tests['webworkers'] = function() {
        return !!window.Worker;
    };


    tests['applicationcache'] = function() {
        return !!window.applicationCache;
    };


    // Thanks to Erik Dahlstrom
    tests['svg'] = function() {
        return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
    };

    // specifically for SVG inline in HTML, not within XHTML
    // test page: paulirish.com/demo/inline-svg
    tests['inlinesvg'] = function() {
      var div = document.createElement('div');
      div.innerHTML = '<svg/>';
      return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
    };

    // SVG SMIL animation
    tests['smil'] = function() {
        return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
    };

    // This test is only for clip paths in SVG proper, not clip paths on HTML content
    // demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg

    // However read the comments to dig into applying SVG clippaths to HTML content here:
    //   github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491
    tests['svgclippaths'] = function() {
        return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
    };

    /*>>webforms*/
    // input features and input types go directly onto the ret object, bypassing the tests loop.
    // Hold this guy to execute in a moment.
    function webforms() {
        /*>>input*/
        // Run through HTML5's new input attributes to see if the UA understands any.
        // We're using f which is the <input> element created early on
        // Mike Taylr has created a comprehensive resource for testing these attributes
        //   when applied to all input types:
        //   miketaylr.com/code/input-type-attr.html
        // spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary

        // Only input placeholder is tested while textarea's placeholder is not.
        // Currently Safari 4 and Opera 11 have support only for the input placeholder
        // Both tests are available in feature-detects/forms-placeholder.js
        Modernizr['input'] = (function( props ) {
            for ( var i = 0, len = props.length; i < len; i++ ) {
                attrs[ props[i] ] = !!(props[i] in inputElem);
            }
            if (attrs.list){
              // safari false positive's on datalist: webk.it/74252
              // see also github.com/Modernizr/Modernizr/issues/146
              attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
            }
            return attrs;
        })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
        /*>>input*/

        /*>>inputtypes*/
        // Run through HTML5's new input types to see if the UA understands any.
        //   This is put behind the tests runloop because it doesn't return a
        //   true/false like all the other tests; instead, it returns an object
        //   containing each input type with its corresponding true/false value

        // Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/
        Modernizr['inputtypes'] = (function(props) {

            for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {

                inputElem.setAttribute('type', inputElemType = props[i]);
                bool = inputElem.type !== 'text';

                // We first check to see if the type we give it sticks..
                // If the type does, we feed it a textual value, which shouldn't be valid.
                // If the value doesn't stick, we know there's input sanitization which infers a custom UI
                if ( bool ) {

                    inputElem.value         = smile;
                    inputElem.style.cssText = 'position:absolute;visibility:hidden;';

                    if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {

                      docElement.appendChild(inputElem);
                      defaultView = document.defaultView;

                      // Safari 2-4 allows the smiley as a value, despite making a slider
                      bool =  defaultView.getComputedStyle &&
                              defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
                              // Mobile android web browser has false positive, so must
                              // check the height to see if the widget is actually there.
                              (inputElem.offsetHeight !== 0);

                      docElement.removeChild(inputElem);

                    } else if ( /^(search|tel)$/.test(inputElemType) ){
                      // Spec doesn't define any special parsing or detectable UI
                      //   behaviors so we pass these through as true

                      // Interestingly, opera fails the earlier test, so it doesn't
                      //  even make it here.

                    } else if ( /^(url|email)$/.test(inputElemType) ) {
                      // Real url and email support comes with prebaked validation.
                      bool = inputElem.checkValidity && inputElem.checkValidity() === false;

                    } else {
                      // If the upgraded input compontent rejects the :) text, we got a winner
                      bool = inputElem.value != smile;
                    }
                }

                inputs[ props[i] ] = !!bool;
            }
            return inputs;
        })('search tel url email datetime date month week time datetime-local number range color'.split(' '));
        /*>>inputtypes*/
    }
    /*>>webforms*/


    // End of test definitions
    // -----------------------



    // Run through all tests and detect their support in the current UA.
    // todo: hypothetically we could be doing an array of tests and use a basic loop here.
    for ( var feature in tests ) {
        if ( hasOwnProp(tests, feature) ) {
            // run the test, throw the return value into the Modernizr,
            //   then based on that boolean, define an appropriate className
            //   and push it into an array of classes we'll join later.
            featureName  = feature.toLowerCase();
            Modernizr[featureName] = tests[feature]();

            classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
        }
    }

    /*>>webforms*/
    // input tests need to run.
    Modernizr.input || webforms();
    /*>>webforms*/


    /**
     * addTest allows the user to define their own feature tests
     * the result will be added onto the Modernizr object,
     * as well as an appropriate className set on the html element
     *
     * @param feature - String naming the feature
     * @param test - Function returning true if feature is supported, false if not
     */
     Modernizr.addTest = function ( feature, test ) {
       if ( typeof feature == 'object' ) {
         for ( var key in feature ) {
           if ( hasOwnProp( feature, key ) ) {
             Modernizr.addTest( key, feature[ key ] );
           }
         }
       } else {

         feature = feature.toLowerCase();

         if ( Modernizr[feature] !== undefined ) {
           // we're going to quit if you're trying to overwrite an existing test
           // if we were to allow it, we'd do this:
           //   var re = new RegExp("\\b(no-)?" + feature + "\\b");
           //   docElement.className = docElement.className.replace( re, '' );
           // but, no rly, stuff 'em.
           return Modernizr;
         }

         test = typeof test == 'function' ? test() : test;

         if (typeof enableClasses !== "undefined" && enableClasses) {
           docElement.className += ' ' + (test ? '' : 'no-') + feature;
         }
         Modernizr[feature] = test;

       }

       return Modernizr; // allow chaining.
     };


    // Reset modElem.cssText to nothing to reduce memory footprint.
    setCss('');
    modElem = inputElem = null;

    /*>>shiv*/
    /**
     * @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
     */
    ;(function(window, document) {
        /*jshint evil:true */
        /** version */
        var version = '3.7.0';

        /** Preset options */
        var options = window.html5 || {};

        /** Used to skip problem elements */
        var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;

        /** Not all elements can be cloned in IE **/
        var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;

        /** Detect whether the browser supports default html5 styles */
        var supportsHtml5Styles;

        /** Name of the expando, to work with multiple documents or to re-shiv one document */
        var expando = '_html5shiv';

        /** The id for the the documents expando */
        var expanID = 0;

        /** Cached data for each document */
        var expandoData = {};

        /** Detect whether the browser supports unknown elements */
        var supportsUnknownElements;

        (function() {
          try {
            var a = document.createElement('a');
            a.innerHTML = '<xyz></xyz>';
            //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
            supportsHtml5Styles = ('hidden' in a);

            supportsUnknownElements = a.childNodes.length == 1 || (function() {
              // assign a false positive if unable to shiv
              (document.createElement)('a');
              var frag = document.createDocumentFragment();
              return (
                typeof frag.cloneNode == 'undefined' ||
                typeof frag.createDocumentFragment == 'undefined' ||
                typeof frag.createElement == 'undefined'
              );
            }());
          } catch(e) {
            // assign a false positive if detection fails => unable to shiv
            supportsHtml5Styles = true;
            supportsUnknownElements = true;
          }

        }());

        /*--------------------------------------------------------------------------*/

        /**
         * Creates a style sheet with the given CSS text and adds it to the document.
         * @private
         * @param {Document} ownerDocument The document.
         * @param {String} cssText The CSS text.
         * @returns {StyleSheet} The style element.
         */
        function addStyleSheet(ownerDocument, cssText) {
          var p = ownerDocument.createElement('p'),
          parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;

          p.innerHTML = 'x<style>' + cssText + '</style>';
          return parent.insertBefore(p.lastChild, parent.firstChild);
        }

        /**
         * Returns the value of `html5.elements` as an array.
         * @private
         * @returns {Array} An array of shived element node names.
         */
        function getElements() {
          var elements = html5.elements;
          return typeof elements == 'string' ? elements.split(' ') : elements;
        }

        /**
         * Returns the data associated to the given document
         * @private
         * @param {Document} ownerDocument The document.
         * @returns {Object} An object of data.
         */
        function getExpandoData(ownerDocument) {
          var data = expandoData[ownerDocument[expando]];
          if (!data) {
            data = {};
            expanID++;
            ownerDocument[expando] = expanID;
            expandoData[expanID] = data;
          }
          return data;
        }

        /**
         * returns a shived element for the given nodeName and document
         * @memberOf html5
         * @param {String} nodeName name of the element
         * @param {Document} ownerDocument The context document.
         * @returns {Object} The shived element.
         */
        function createElement(nodeName, ownerDocument, data){
          if (!ownerDocument) {
            ownerDocument = document;
          }
          if(supportsUnknownElements){
            return ownerDocument.createElement(nodeName);
          }
          if (!data) {
            data = getExpandoData(ownerDocument);
          }
          var node;

          if (data.cache[nodeName]) {
            node = data.cache[nodeName].cloneNode();
          } else if (saveClones.test(nodeName)) {
            node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
          } else {
            node = data.createElem(nodeName);
          }

          // Avoid adding some elements to fragments in IE < 9 because
          // * Attributes like `name` or `type` cannot be set/changed once an element
          //   is inserted into a document/fragment
          // * Link elements with `src` attributes that are inaccessible, as with
          //   a 403 response, will cause the tab/window to crash
          // * Script elements appended to fragments will execute when their `src`
          //   or `text` property is set
          return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
        }

        /**
         * returns a shived DocumentFragment for the given document
         * @memberOf html5
         * @param {Document} ownerDocument The context document.
         * @returns {Object} The shived DocumentFragment.
         */
        function createDocumentFragment(ownerDocument, data){
          if (!ownerDocument) {
            ownerDocument = document;
          }
          if(supportsUnknownElements){
            return ownerDocument.createDocumentFragment();
          }
          data = data || getExpandoData(ownerDocument);
          var clone = data.frag.cloneNode(),
          i = 0,
          elems = getElements(),
          l = elems.length;
          for(;i<l;i++){
            clone.createElement(elems[i]);
          }
          return clone;
        }

        /**
         * Shivs the `createElement` and `createDocumentFragment` methods of the document.
         * @private
         * @param {Document|DocumentFragment} ownerDocument The document.
         * @param {Object} data of the document.
         */
        function shivMethods(ownerDocument, data) {
          if (!data.cache) {
            data.cache = {};
            data.createElem = ownerDocument.createElement;
            data.createFrag = ownerDocument.createDocumentFragment;
            data.frag = data.createFrag();
          }


          ownerDocument.createElement = function(nodeName) {
            //abort shiv
            if (!html5.shivMethods) {
              return data.createElem(nodeName);
            }
            return createElement(nodeName, ownerDocument, data);
          };

          ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
                                                          'var n=f.cloneNode(),c=n.createElement;' +
                                                          'h.shivMethods&&(' +
                                                          // unroll the `createElement` calls
                                                          getElements().join().replace(/[\w\-]+/g, function(nodeName) {
            data.createElem(nodeName);
            data.frag.createElement(nodeName);
            return 'c("' + nodeName + '")';
          }) +
            ');return n}'
                                                         )(html5, data.frag);
        }

        /*--------------------------------------------------------------------------*/

        /**
         * Shivs the given document.
         * @memberOf html5
         * @param {Document} ownerDocument The document to shiv.
         * @returns {Document} The shived document.
         */
        function shivDocument(ownerDocument) {
          if (!ownerDocument) {
            ownerDocument = document;
          }
          var data = getExpandoData(ownerDocument);

          if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
            data.hasCSS = !!addStyleSheet(ownerDocument,
                                          // corrects block display not defined in IE6/7/8/9
                                          'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
                                            // adds styling not present in IE6/7/8/9
                                            'mark{background:#FF0;color:#000}' +
                                            // hides non-rendered elements
                                            'template{display:none}'
                                         );
          }
          if (!supportsUnknownElements) {
            shivMethods(ownerDocument, data);
          }
          return ownerDocument;
        }

        /*--------------------------------------------------------------------------*/

        /**
         * The `html5` object is exposed so that more elements can be shived and
         * existing shiving can be detected on iframes.
         * @type Object
         * @example
         *
         * // options can be changed before the script is included
         * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
         */
        var html5 = {

          /**
           * An array or space separated string of node names of the elements to shiv.
           * @memberOf html5
           * @type Array|String
           */
          'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',

          /**
           * current version of html5shiv
           */
          'version': version,

          /**
           * A flag to indicate that the HTML5 style sheet should be inserted.
           * @memberOf html5
           * @type Boolean
           */
          'shivCSS': (options.shivCSS !== false),

          /**
           * Is equal to true if a browser supports creating unknown/HTML5 elements
           * @memberOf html5
           * @type boolean
           */
          'supportsUnknownElements': supportsUnknownElements,

          /**
           * A flag to indicate that the document's `createElement` and `createDocumentFragment`
           * methods should be overwritten.
           * @memberOf html5
           * @type Boolean
           */
          'shivMethods': (options.shivMethods !== false),

          /**
           * A string to describe the type of `html5` object ("default" or "default print").
           * @memberOf html5
           * @type String
           */
          'type': 'default',

          // shivs the document according to the specified `html5` object options
          'shivDocument': shivDocument,

          //creates a shived element
          createElement: createElement,

          //creates a shived documentFragment
          createDocumentFragment: createDocumentFragment
        };

        /*--------------------------------------------------------------------------*/

        // expose html5
        window.html5 = html5;

        // shiv the document
        shivDocument(document);

    }(this, document));
    /*>>shiv*/

    // Assign private properties to the return object with prefix
    Modernizr._version      = version;

    // expose these for the plugin API. Look in the source for how to join() them against your input
    /*>>prefixes*/
    Modernizr._prefixes     = prefixes;
    /*>>prefixes*/
    /*>>domprefixes*/
    Modernizr._domPrefixes  = domPrefixes;
    Modernizr._cssomPrefixes  = cssomPrefixes;
    /*>>domprefixes*/

    /*>>mq*/
    // Modernizr.mq tests a given media query, live against the current state of the window
    // A few important notes:
    //   * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false
    //   * A max-width or orientation query will be evaluated against the current state, which may change later.
    //   * You must specify values. Eg. If you are testing support for the min-width media query use:
    //       Modernizr.mq('(min-width:0)')
    // usage:
    // Modernizr.mq('only screen and (max-width:768)')
    Modernizr.mq            = testMediaQuery;
    /*>>mq*/

    /*>>hasevent*/
    // Modernizr.hasEvent() detects support for a given event, with an optional element to test on
    // Modernizr.hasEvent('gesturestart', elem)
    Modernizr.hasEvent      = isEventSupported;
    /*>>hasevent*/

    /*>>testprop*/
    // Modernizr.testProp() investigates whether a given style property is recognized
    // Note that the property names must be provided in the camelCase variant.
    // Modernizr.testProp('pointerEvents')
    Modernizr.testProp      = function(prop){
        return testProps([prop]);
    };
    /*>>testprop*/

    /*>>testallprops*/
    // Modernizr.testAllProps() investigates whether a given style property,
    //   or any of its vendor-prefixed variants, is recognized
    // Note that the property names must be provided in the camelCase variant.
    // Modernizr.testAllProps('boxSizing')
    Modernizr.testAllProps  = testPropsAll;
    /*>>testallprops*/


    /*>>teststyles*/
    // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards
    // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... })
    Modernizr.testStyles    = injectElementWithStyles;
    /*>>teststyles*/


    /*>>prefixed*/
    // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input
    // Modernizr.prefixed('boxSizing') // 'MozBoxSizing'

    // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style.
    // Return values will also be the camelCase variant, if you need to translate that to hypenated style use:
    //
    //     str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');

    // If you're trying to ascertain which transition end event to bind to, you might do something like...
    //
    //     var transEndEventNames = {
    //       'WebkitTransition' : 'webkitTransitionEnd',
    //       'MozTransition'    : 'transitionend',
    //       'OTransition'      : 'oTransitionEnd',
    //       'msTransition'     : 'MSTransitionEnd',
    //       'transition'       : 'transitionend'
    //     },
    //     transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];

    Modernizr.prefixed      = function(prop, obj, elem){
      if(!obj) {
        return testPropsAll(prop, 'pfx');
      } else {
        // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
        return testPropsAll(prop, obj, elem);
      }
    };
    /*>>prefixed*/


    /*>>cssclasses*/
    // Remove "no-js" class from <html> element, if it exists:
    docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +

                            // Add the new classes to the <html> element.
                            (enableClasses ? ' js ' + classes.join(' ') : '');
    /*>>cssclasses*/

    return Modernizr;

})(this, this.document);
;
/*! modernizr 3.6.0 (Custom Build) | MIT *
 * https://modernizr.com/download/?-cssgrid_cssgridlegacy-setclasses !*/
!function (e, n, t) { function r(e, n) { return typeof e === n } function o() { var e, n, t, o, s, i, l; for (var a in w) if (w.hasOwnProperty(a)) { if (e = [], n = w[a], n.name && (e.push(n.name.toLowerCase()), n.options && n.options.aliases && n.options.aliases.length)) for (t = 0; t < n.options.aliases.length; t++)e.push(n.options.aliases[t].toLowerCase()); for (o = r(n.fn, "function") ? n.fn() : n.fn, s = 0; s < e.length; s++)i = e[s], l = i.split("."), 1 === l.length ? Modernizr[l[0]] = o : (!Modernizr[l[0]] || Modernizr[l[0]] instanceof Boolean || (Modernizr[l[0]] = new Boolean(Modernizr[l[0]])), Modernizr[l[0]][l[1]] = o), C.push((o ? "" : "no-") + l.join("-")) } } function s(e) { var n = _.className, t = Modernizr._config.classPrefix || ""; if (x && (n = n.baseVal), Modernizr._config.enableJSClass) { var r = new RegExp("(^|\\s)" + t + "no-js(\\s|$)"); n = n.replace(r, "$1" + t + "js$2") } Modernizr._config.enableClasses && (n += " " + t + e.join(" " + t), x ? _.className.baseVal = n : _.className = n) } function i(e, n) { return !!~("" + e).indexOf(n) } function l() { return "function" != typeof n.createElement ? n.createElement(arguments[0]) : x ? n.createElementNS.call(n, "http://www.w3.org/2000/svg", arguments[0]) : n.createElement.apply(n, arguments) } function a(e) { return e.replace(/([a-z])-([a-z])/g, function (e, n, t) { return n + t.toUpperCase() }).replace(/^-/, "") } function u(e, n) { return function () { return e.apply(n, arguments) } } function f(e, n, t) { var o; for (var s in e) if (e[s] in n) return t === !1 ? e[s] : (o = n[e[s]], r(o, "function") ? u(o, t || n) : o); return !1 } function c(e) { return e.replace(/([A-Z])/g, function (e, n) { return "-" + n.toLowerCase() }).replace(/^ms-/, "-ms-") } function d(n, t, r) { var o; if ("getComputedStyle" in e) { o = getComputedStyle.call(e, n, t); var s = e.console; if (null !== o) r && (o = o.getPropertyValue(r)); else if (s) { var i = s.error ? "error" : "log"; s[i].call(s, "getComputedStyle returning null, its possible modernizr test results are inaccurate") } } else o = !t && n.currentStyle && n.currentStyle[r]; return o } function p() { var e = n.body; return e || (e = l(x ? "svg" : "body"), e.fake = !0), e } function m(e, t, r, o) { var s, i, a, u, f = "modernizr", c = l("div"), d = p(); if (parseInt(r, 10)) for (; r--;)a = l("div"), a.id = o ? o[r] : f + (r + 1), c.appendChild(a); return s = l("style"), s.type = "text/css", s.id = "s" + f, (d.fake ? d : c).appendChild(s), d.appendChild(c), s.styleSheet ? s.styleSheet.cssText = e : s.appendChild(n.createTextNode(e)), c.id = f, d.fake && (d.style.background = "", d.style.overflow = "hidden", u = _.style.overflow, _.style.overflow = "hidden", _.appendChild(d)), i = t(c, e), d.fake ? (d.parentNode.removeChild(d), _.style.overflow = u, _.offsetHeight) : c.parentNode.removeChild(c), !!i } function g(n, r) { var o = n.length; if ("CSS" in e && "supports" in e.CSS) { for (; o--;)if (e.CSS.supports(c(n[o]), r)) return !0; return !1 } if ("CSSSupportsRule" in e) { for (var s = []; o--;)s.push("(" + c(n[o]) + ":" + r + ")"); return s = s.join(" or "), m("@supports (" + s + ") { #modernizr { position: absolute; } }", function (e) { return "absolute" == d(e, null, "position") }) } return t } function y(e, n, o, s) { function u() { c && (delete N.style, delete N.modElem) } if (s = r(s, "undefined") ? !1 : s, !r(o, "undefined")) { var f = g(e, o); if (!r(f, "undefined")) return f } for (var c, d, p, m, y, v = ["modernizr", "tspan", "samp"]; !N.style && v.length;)c = !0, N.modElem = l(v.shift()), N.style = N.modElem.style; for (p = e.length, d = 0; p > d; d++)if (m = e[d], y = N.style[m], i(m, "-") && (m = a(m)), N.style[m] !== t) { if (s || r(o, "undefined")) return u(), "pfx" == n ? m : !0; try { N.style[m] = o } catch (h) { } if (N.style[m] != y) return u(), "pfx" == n ? m : !0 } return u(), !1 } function v(e, n, t, o, s) { var i = e.charAt(0).toUpperCase() + e.slice(1), l = (e + " " + P.join(i + " ") + i).split(" "); return r(n, "string") || r(n, "undefined") ? y(l, n, o, s) : (l = (e + " " + z.join(i + " ") + i).split(" "), f(l, n, t)) } function h(e, n, r) { return v(e, t, t, n, r) } var C = [], w = [], S = { _version: "3.6.0", _config: { classPrefix: "", enableClasses: !0, enableJSClass: !0, usePrefixes: !0 }, _q: [], on: function (e, n) { var t = this; setTimeout(function () { n(t[e]) }, 0) }, addTest: function (e, n, t) { w.push({ name: e, fn: n, options: t }) }, addAsyncTest: function (e) { w.push({ name: null, fn: e }) } }, Modernizr = function () { }; Modernizr.prototype = S, Modernizr = new Modernizr; var _ = n.documentElement, x = "svg" === _.nodeName.toLowerCase(), b = "Moz O ms Webkit", P = S._config.usePrefixes ? b.split(" ") : []; S._cssomPrefixes = P; var z = S._config.usePrefixes ? b.toLowerCase().split(" ") : []; S._domPrefixes = z; var E = { elem: l("modernizr") }; Modernizr._q.push(function () { delete E.elem }); var N = { style: E.elem.style }; Modernizr._q.unshift(function () { delete N.style }), S.testAllProps = v, S.testAllProps = h, Modernizr.addTest("cssgridlegacy", h("grid-columns", "10px", !0)), Modernizr.addTest("cssgrid", h("grid-template-rows", "none", !0)), o(), s(C), delete S.addTest, delete S.addAsyncTest; for (var T = 0; T < Modernizr._q.length; T++)Modernizr._q[T](); e.Modernizr = Modernizr }(window, document);;
/*!
 * https://github.com/es-shims/es5-shim
 * @license es5-shim Copyright 2009-2015 by contributors, MIT License
 * see https://github.com/es-shims/es5-shim/blob/master/LICENSE
 */

// vim: ts=4 sts=4 sw=4 expandtab

// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;

// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function (root, factory) {
    'use strict';

    /* global define, exports, module */
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(factory);
    } else if (typeof exports === 'object') {
        // Node. Does not work with strict CommonJS, but
        // only CommonJS-like enviroments that support module.exports,
        // like Node.
        module.exports = factory();
    } else {
        // Browser globals (root is window)
        root.returnExports = factory();
    }
}(this, function () {
    /**
     * Brings an environment as close to ECMAScript 5 compliance
     * as is possible with the facilities of erstwhile engines.
     *
     * Annotated ES5: http://es5.github.com/ (specific links below)
     * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
     * Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/
     */

    // Shortcut to an often accessed properties, in order to avoid multiple
    // dereference that costs universally. This also holds a reference to known-good
    // functions.
    var $Array = Array;
    var ArrayPrototype = $Array.prototype;
    var $Object = Object;
    var ObjectPrototype = $Object.prototype;
    var $Function = Function;
    var FunctionPrototype = $Function.prototype;
    var $String = String;
    var StringPrototype = $String.prototype;
    var $Number = Number;
    var NumberPrototype = $Number.prototype;
    var array_slice = ArrayPrototype.slice;
    var array_splice = ArrayPrototype.splice;
    var array_push = ArrayPrototype.push;
    var array_unshift = ArrayPrototype.unshift;
    var array_concat = ArrayPrototype.concat;
    var array_join = ArrayPrototype.join;
    var call = FunctionPrototype.call;
    var apply = FunctionPrototype.apply;
    var max = Math.max;
    var min = Math.min;

    // Having a toString local variable name breaks in Opera so use to_string.
    var to_string = ObjectPrototype.toString;

    /* global Symbol */
    /* eslint-disable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
    var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
    var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };

    var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; };
    var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; };
    /* eslint-enable one-var-declaration-per-line, no-redeclare, max-statements-per-line */

    /* inlined from http://npmjs.com/define-properties */
    var supportsDescriptors = $Object.defineProperty && (function () {
        try {
            var obj = {};
            $Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
            for (var _ in obj) { // jscs:ignore disallowUnusedVariables
                return false;
            }
            return obj.x === obj;
        } catch (e) { /* this is ES3 */
            return false;
        }
    }());
    var defineProperties = (function (has) {
        // Define configurable, writable, and non-enumerable props
        // if they don't exist.
        var defineProperty;
        if (supportsDescriptors) {
            defineProperty = function (object, name, method, forceAssign) {
                if (!forceAssign && (name in object)) {
                    return;
                }
                $Object.defineProperty(object, name, {
                    configurable: true,
                    enumerable: false,
                    writable: true,
                    value: method
                });
            };
        } else {
            defineProperty = function (object, name, method, forceAssign) {
                if (!forceAssign && (name in object)) {
                    return;
                }
                object[name] = method;
            };
        }
        return function defineProperties(object, map, forceAssign) {
            for (var name in map) {
                if (has.call(map, name)) {
                    defineProperty(object, name, map[name], forceAssign);
                }
            }
        };
    }(ObjectPrototype.hasOwnProperty));

    //
    // Util
    // ======
    //

    /* replaceable with https://npmjs.com/package/es-abstract /helpers/isPrimitive */
    var isPrimitive = function isPrimitive(input) {
        var type = typeof input;
        return input === null || (type !== 'object' && type !== 'function');
    };

    var isActualNaN = $Number.isNaN || function isActualNaN(x) {
        return x !== x;
    };

    var ES = {
        // ES5 9.4
        // http://es5.github.com/#x9.4
        // http://jsperf.com/to-integer
        /* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */
        ToInteger: function ToInteger(num) {
            var n = +num;
            if (isActualNaN(n)) {
                n = 0;
            } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
                n = (n > 0 || -1) * Math.floor(Math.abs(n));
            }
            return n;
        },

        /* replaceable with https://npmjs.com/package/es-abstract ES5.ToPrimitive */
        ToPrimitive: function ToPrimitive(input) {
            var val, valueOf, toStr;
            if (isPrimitive(input)) {
                return input;
            }
            valueOf = input.valueOf;
            if (isCallable(valueOf)) {
                val = valueOf.call(input);
                if (isPrimitive(val)) {
                    return val;
                }
            }
            toStr = input.toString;
            if (isCallable(toStr)) {
                val = toStr.call(input);
                if (isPrimitive(val)) {
                    return val;
                }
            }
            throw new TypeError();
        },

        // ES5 9.9
        // http://es5.github.com/#x9.9
        /* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */
        ToObject: function (o) {
            if (o == null) { // this matches both null and undefined
                throw new TypeError("can't convert " + o + ' to object');
            }
            return $Object(o);
        },

        /* replaceable with https://npmjs.com/package/es-abstract ES5.ToUint32 */
        ToUint32: function ToUint32(x) {
            return x >>> 0;
        }
    };

    //
    // Function
    // ========
    //

    // ES-5 15.3.4.5
    // http://es5.github.com/#x15.3.4.5

    var Empty = function Empty() {};

    defineProperties(FunctionPrototype, {
        bind: function bind(that) { // .length is 1
            // 1. Let Target be the this value.
            var target = this;
            // 2. If IsCallable(Target) is false, throw a TypeError exception.
            if (!isCallable(target)) {
                throw new TypeError('Function.prototype.bind called on incompatible ' + target);
            }
            // 3. Let A be a new (possibly empty) internal list of all of the
            //   argument values provided after thisArg (arg1, arg2 etc), in order.
            // XXX slicedArgs will stand in for "A" if used
            var args = array_slice.call(arguments, 1); // for normal call
            // 4. Let F be a new native ECMAScript object.
            // 11. Set the [[Prototype]] internal property of F to the standard
            //   built-in Function prototype object as specified in 15.3.3.1.
            // 12. Set the [[Call]] internal property of F as described in
            //   15.3.4.5.1.
            // 13. Set the [[Construct]] internal property of F as described in
            //   15.3.4.5.2.
            // 14. Set the [[HasInstance]] internal property of F as described in
            //   15.3.4.5.3.
            var bound;
            var binder = function () {

                if (this instanceof bound) {
                    // 15.3.4.5.2 [[Construct]]
                    // When the [[Construct]] internal method of a function object,
                    // F that was created using the bind function is called with a
                    // list of arguments ExtraArgs, the following steps are taken:
                    // 1. Let target be the value of F's [[TargetFunction]]
                    //   internal property.
                    // 2. If target has no [[Construct]] internal method, a
                    //   TypeError exception is thrown.
                    // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
                    //   property.
                    // 4. Let args be a new list containing the same values as the
                    //   list boundArgs in the same order followed by the same
                    //   values as the list ExtraArgs in the same order.
                    // 5. Return the result of calling the [[Construct]] internal
                    //   method of target providing args as the arguments.

                    var result = apply.call(
                        target,
                        this,
                        array_concat.call(args, array_slice.call(arguments))
                    );
                    if ($Object(result) === result) {
                        return result;
                    }
                    return this;

                } else {
                    // 15.3.4.5.1 [[Call]]
                    // When the [[Call]] internal method of a function object, F,
                    // which was created using the bind function is called with a
                    // this value and a list of arguments ExtraArgs, the following
                    // steps are taken:
                    // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
                    //   property.
                    // 2. Let boundThis be the value of F's [[BoundThis]] internal
                    //   property.
                    // 3. Let target be the value of F's [[TargetFunction]] internal
                    //   property.
                    // 4. Let args be a new list containing the same values as the
                    //   list boundArgs in the same order followed by the same
                    //   values as the list ExtraArgs in the same order.
                    // 5. Return the result of calling the [[Call]] internal method
                    //   of target providing boundThis as the this value and
                    //   providing args as the arguments.

                    // equiv: target.call(this, ...boundArgs, ...args)
                    return apply.call(
                        target,
                        that,
                        array_concat.call(args, array_slice.call(arguments))
                    );

                }

            };

            // 15. If the [[Class]] internal property of Target is "Function", then
            //     a. Let L be the length property of Target minus the length of A.
            //     b. Set the length own property of F to either 0 or L, whichever is
            //       larger.
            // 16. Else set the length own property of F to 0.

            var boundLength = max(0, target.length - args.length);

            // 17. Set the attributes of the length own property of F to the values
            //   specified in 15.3.5.1.
            var boundArgs = [];
            for (var i = 0; i < boundLength; i++) {
                array_push.call(boundArgs, '$' + i);
            }

            // XXX Build a dynamic function with desired amount of arguments is the only
            // way to set the length property of a function.
            // In environments where Content Security Policies enabled (Chrome extensions,
            // for ex.) all use of eval or Function costructor throws an exception.
            // However in all of these environments Function.prototype.bind exists
            // and so this code will never be executed.
            bound = $Function('binder', 'return function (' + array_join.call(boundArgs, ',') + '){ return binder.apply(this, arguments); }')(binder);

            if (target.prototype) {
                Empty.prototype = target.prototype;
                bound.prototype = new Empty();
                // Clean up dangling references.
                Empty.prototype = null;
            }

            // TODO
            // 18. Set the [[Extensible]] internal property of F to true.

            // TODO
            // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
            // 20. Call the [[DefineOwnProperty]] internal method of F with
            //   arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
            //   thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
            //   false.
            // 21. Call the [[DefineOwnProperty]] internal method of F with
            //   arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
            //   [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
            //   and false.

            // TODO
            // NOTE Function objects created using Function.prototype.bind do not
            // have a prototype property or the [[Code]], [[FormalParameters]], and
            // [[Scope]] internal properties.
            // XXX can't delete prototype in pure-js.

            // 22. Return F.
            return bound;
        }
    });

    // _Please note: Shortcuts are defined after `Function.prototype.bind` as we
    // use it in defining shortcuts.
    var owns = call.bind(ObjectPrototype.hasOwnProperty);
    var toStr = call.bind(ObjectPrototype.toString);
    var arraySlice = call.bind(array_slice);
    var arraySliceApply = apply.bind(array_slice);
    /* globals document */
    if (typeof document === 'object' && document && document.documentElement) {
        try {
            arraySlice(document.documentElement.childNodes);
        } catch (e) {
            var origArraySlice = arraySlice;
            var origArraySliceApply = arraySliceApply;
            arraySlice = function arraySliceIE(arr) {
                var r = [];
                var i = arr.length;
                while (i-- > 0) {
                    r[i] = arr[i];
                }
                return origArraySliceApply(r, origArraySlice(arguments, 1));
            };
            arraySliceApply = function arraySliceApplyIE(arr, args) {
                return origArraySliceApply(arraySlice(arr), args);
            };
        }
    }
    var strSlice = call.bind(StringPrototype.slice);
    var strSplit = call.bind(StringPrototype.split);
    var strIndexOf = call.bind(StringPrototype.indexOf);
    var pushCall = call.bind(array_push);
    var isEnum = call.bind(ObjectPrototype.propertyIsEnumerable);
    var arraySort = call.bind(ArrayPrototype.sort);

    //
    // Array
    // =====
    //

    var isArray = $Array.isArray || function isArray(obj) {
        return toStr(obj) === '[object Array]';
    };

    // ES5 15.4.4.12
    // http://es5.github.com/#x15.4.4.13
    // Return len+argCount.
    // [bugfix, ielt8]
    // IE < 8 bug: [].unshift(0) === undefined but should be "1"
    var hasUnshiftReturnValueBug = [].unshift(0) !== 1;
    defineProperties(ArrayPrototype, {
        unshift: function () {
            array_unshift.apply(this, arguments);
            return this.length;
        }
    }, hasUnshiftReturnValueBug);

    // ES5 15.4.3.2
    // http://es5.github.com/#x15.4.3.2
    // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
    defineProperties($Array, { isArray: isArray });

    // The IsCallable() check in the Array functions
    // has been replaced with a strict check on the
    // internal class of the object to trap cases where
    // the provided function was actually a regular
    // expression literal, which in V8 and
    // JavaScriptCore is a typeof "function".  Only in
    // V8 are regular expression literals permitted as
    // reduce parameters, so it is desirable in the
    // general case for the shim to match the more
    // strict and common behavior of rejecting regular
    // expressions.

    // ES5 15.4.4.18
    // http://es5.github.com/#x15.4.4.18
    // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach

    // Check failure of by-index access of string characters (IE < 9)
    // and failure of `0 in boxedString` (Rhino)
    var boxedString = $Object('a');
    var splitString = boxedString[0] !== 'a' || !(0 in boxedString);

    var properlyBoxesContext = function properlyBoxed(method) {
        // Check node 0.6.21 bug where third parameter is not boxed
        var properlyBoxesNonStrict = true;
        var properlyBoxesStrict = true;
        var threwException = false;
        if (method) {
            try {
                method.call('foo', function (_, __, context) {
                    if (typeof context !== 'object') {
                        properlyBoxesNonStrict = false;
                    }
                });

                method.call([1], function () {
                    'use strict';

                    properlyBoxesStrict = typeof this === 'string';
                }, 'x');
            } catch (e) {
                threwException = true;
            }
        }
        return !!method && !threwException && properlyBoxesNonStrict && properlyBoxesStrict;
    };

    defineProperties(ArrayPrototype, {
        forEach: function forEach(callbackfn/*, thisArg*/) {
            var object = ES.ToObject(this);
            var self = splitString && isString(this) ? strSplit(this, '') : object;
            var i = -1;
            var length = ES.ToUint32(self.length);
            var T;
            if (arguments.length > 1) {
                T = arguments[1];
            }

            // If no callback function or if callback is not a callable function
            if (!isCallable(callbackfn)) {
                throw new TypeError('Array.prototype.forEach callback must be a function');
            }

            while (++i < length) {
                if (i in self) {
                    // Invoke the callback function with call, passing arguments:
                    // context, property value, property key, thisArg object
                    if (typeof T === 'undefined') {
                        callbackfn(self[i], i, object);
                    } else {
                        callbackfn.call(T, self[i], i, object);
                    }
                }
            }
        }
    }, !properlyBoxesContext(ArrayPrototype.forEach));

    // ES5 15.4.4.19
    // http://es5.github.com/#x15.4.4.19
    // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
    defineProperties(ArrayPrototype, {
        map: function map(callbackfn/*, thisArg*/) {
            var object = ES.ToObject(this);
            var self = splitString && isString(this) ? strSplit(this, '') : object;
            var length = ES.ToUint32(self.length);
            var result = $Array(length);
            var T;
            if (arguments.length > 1) {
                T = arguments[1];
            }

            // If no callback function or if callback is not a callable function
            if (!isCallable(callbackfn)) {
                throw new TypeError('Array.prototype.map callback must be a function');
            }

            for (var i = 0; i < length; i++) {
                if (i in self) {
                    if (typeof T === 'undefined') {
                        result[i] = callbackfn(self[i], i, object);
                    } else {
                        result[i] = callbackfn.call(T, self[i], i, object);
                    }
                }
            }
            return result;
        }
    }, !properlyBoxesContext(ArrayPrototype.map));

    // ES5 15.4.4.20
    // http://es5.github.com/#x15.4.4.20
    // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
    defineProperties(ArrayPrototype, {
        filter: function filter(callbackfn/*, thisArg*/) {
            var object = ES.ToObject(this);
            var self = splitString && isString(this) ? strSplit(this, '') : object;
            var length = ES.ToUint32(self.length);
            var result = [];
            var value;
            var T;
            if (arguments.length > 1) {
                T = arguments[1];
            }

            // If no callback function or if callback is not a callable function
            if (!isCallable(callbackfn)) {
                throw new TypeError('Array.prototype.filter callback must be a function');
            }

            for (var i = 0; i < length; i++) {
                if (i in self) {
                    value = self[i];
                    if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) {
                        pushCall(result, value);
                    }
                }
            }
            return result;
        }
    }, !properlyBoxesContext(ArrayPrototype.filter));

    // ES5 15.4.4.16
    // http://es5.github.com/#x15.4.4.16
    // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
    defineProperties(ArrayPrototype, {
        every: function every(callbackfn/*, thisArg*/) {
            var object = ES.ToObject(this);
            var self = splitString && isString(this) ? strSplit(this, '') : object;
            var length = ES.ToUint32(self.length);
            var T;
            if (arguments.length > 1) {
                T = arguments[1];
            }

            // If no callback function or if callback is not a callable function
            if (!isCallable(callbackfn)) {
                throw new TypeError('Array.prototype.every callback must be a function');
            }

            for (var i = 0; i < length; i++) {
                if (i in self && !(typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
                    return false;
                }
            }
            return true;
        }
    }, !properlyBoxesContext(ArrayPrototype.every));

    // ES5 15.4.4.17
    // http://es5.github.com/#x15.4.4.17
    // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
    defineProperties(ArrayPrototype, {
        some: function some(callbackfn/*, thisArg */) {
            var object = ES.ToObject(this);
            var self = splitString && isString(this) ? strSplit(this, '') : object;
            var length = ES.ToUint32(self.length);
            var T;
            if (arguments.length > 1) {
                T = arguments[1];
            }

            // If no callback function or if callback is not a callable function
            if (!isCallable(callbackfn)) {
                throw new TypeError('Array.prototype.some callback must be a function');
            }

            for (var i = 0; i < length; i++) {
                if (i in self && (typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
                    return true;
                }
            }
            return false;
        }
    }, !properlyBoxesContext(ArrayPrototype.some));

    // ES5 15.4.4.21
    // http://es5.github.com/#x15.4.4.21
    // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
    var reduceCoercesToObject = false;
    if (ArrayPrototype.reduce) {
        reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) {
            return list;
        }) === 'object';
    }
    defineProperties(ArrayPrototype, {
        reduce: function reduce(callbackfn/*, initialValue*/) {
            var object = ES.ToObject(this);
            var self = splitString && isString(this) ? strSplit(this, '') : object;
            var length = ES.ToUint32(self.length);

            // If no callback function or if callback is not a callable function
            if (!isCallable(callbackfn)) {
                throw new TypeError('Array.prototype.reduce callback must be a function');
            }

            // no value to return if no initial value and an empty array
            if (length === 0 && arguments.length === 1) {
                throw new TypeError('reduce of empty array with no initial value');
            }

            var i = 0;
            var result;
            if (arguments.length >= 2) {
                result = arguments[1];
            } else {
                do {
                    if (i in self) {
                        result = self[i++];
                        break;
                    }

                    // if array contains no values, no initial value to return
                    if (++i >= length) {
                        throw new TypeError('reduce of empty array with no initial value');
                    }
                } while (true);
            }

            for (; i < length; i++) {
                if (i in self) {
                    result = callbackfn(result, self[i], i, object);
                }
            }

            return result;
        }
    }, !reduceCoercesToObject);

    // ES5 15.4.4.22
    // http://es5.github.com/#x15.4.4.22
    // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
    var reduceRightCoercesToObject = false;
    if (ArrayPrototype.reduceRight) {
        reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) {
            return list;
        }) === 'object';
    }
    defineProperties(ArrayPrototype, {
        reduceRight: function reduceRight(callbackfn/*, initial*/) {
            var object = ES.ToObject(this);
            var self = splitString && isString(this) ? strSplit(this, '') : object;
            var length = ES.ToUint32(self.length);

            // If no callback function or if callback is not a callable function
            if (!isCallable(callbackfn)) {
                throw new TypeError('Array.prototype.reduceRight callback must be a function');
            }

            // no value to return if no initial value, empty array
            if (length === 0 && arguments.length === 1) {
                throw new TypeError('reduceRight of empty array with no initial value');
            }

            var result;
            var i = length - 1;
            if (arguments.length >= 2) {
                result = arguments[1];
            } else {
                do {
                    if (i in self) {
                        result = self[i--];
                        break;
                    }

                    // if array contains no values, no initial value to return
                    if (--i < 0) {
                        throw new TypeError('reduceRight of empty array with no initial value');
                    }
                } while (true);
            }

            if (i < 0) {
                return result;
            }

            do {
                if (i in self) {
                    result = callbackfn(result, self[i], i, object);
                }
            } while (i--);

            return result;
        }
    }, !reduceRightCoercesToObject);

    // ES5 15.4.4.14
    // http://es5.github.com/#x15.4.4.14
    // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
    var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
    defineProperties(ArrayPrototype, {
        indexOf: function indexOf(searchElement/*, fromIndex */) {
            var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
            var length = ES.ToUint32(self.length);

            if (length === 0) {
                return -1;
            }

            var i = 0;
            if (arguments.length > 1) {
                i = ES.ToInteger(arguments[1]);
            }

            // handle negative indices
            i = i >= 0 ? i : max(0, length + i);
            for (; i < length; i++) {
                if (i in self && self[i] === searchElement) {
                    return i;
                }
            }
            return -1;
        }
    }, hasFirefox2IndexOfBug);

    // ES5 15.4.4.15
    // http://es5.github.com/#x15.4.4.15
    // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
    var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1;
    defineProperties(ArrayPrototype, {
        lastIndexOf: function lastIndexOf(searchElement/*, fromIndex */) {
            var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
            var length = ES.ToUint32(self.length);

            if (length === 0) {
                return -1;
            }
            var i = length - 1;
            if (arguments.length > 1) {
                i = min(i, ES.ToInteger(arguments[1]));
            }
            // handle negative indices
            i = i >= 0 ? i : length - Math.abs(i);
            for (; i >= 0; i--) {
                if (i in self && searchElement === self[i]) {
                    return i;
                }
            }
            return -1;
        }
    }, hasFirefox2LastIndexOfBug);

    // ES5 15.4.4.12
    // http://es5.github.com/#x15.4.4.12
    var spliceNoopReturnsEmptyArray = (function () {
        var a = [1, 2];
        var result = a.splice();
        return a.length === 2 && isArray(result) && result.length === 0;
    }());
    defineProperties(ArrayPrototype, {
        // Safari 5.0 bug where .splice() returns undefined
        splice: function splice(start, deleteCount) {
            if (arguments.length === 0) {
                return [];
            } else {
                return array_splice.apply(this, arguments);
            }
        }
    }, !spliceNoopReturnsEmptyArray);

    var spliceWorksWithEmptyObject = (function () {
        var obj = {};
        ArrayPrototype.splice.call(obj, 0, 0, 1);
        return obj.length === 1;
    }());
    defineProperties(ArrayPrototype, {
        splice: function splice(start, deleteCount) {
            if (arguments.length === 0) {
                return [];
            }
            var args = arguments;
            this.length = max(ES.ToInteger(this.length), 0);
            if (arguments.length > 0 && typeof deleteCount !== 'number') {
                args = arraySlice(arguments);
                if (args.length < 2) {
                    pushCall(args, this.length - start);
                } else {
                    args[1] = ES.ToInteger(deleteCount);
                }
            }
            return array_splice.apply(this, args);
        }
    }, !spliceWorksWithEmptyObject);
    var spliceWorksWithLargeSparseArrays = (function () {
        // Per https://github.com/es-shims/es5-shim/issues/295
        // Safari 7/8 breaks with sparse arrays of size 1e5 or greater
        var arr = new $Array(1e5);
        // note: the index MUST be 8 or larger or the test will false pass
        arr[8] = 'x';
        arr.splice(1, 1);
        // note: this test must be defined *after* the indexOf shim
        // per https://github.com/es-shims/es5-shim/issues/313
        return arr.indexOf('x') === 7;
    }());
    var spliceWorksWithSmallSparseArrays = (function () {
        // Per https://github.com/es-shims/es5-shim/issues/295
        // Opera 12.15 breaks on this, no idea why.
        var n = 256;
        var arr = [];
        arr[n] = 'a';
        arr.splice(n + 1, 0, 'b');
        return arr[n] === 'a';
    }());
    defineProperties(ArrayPrototype, {
        splice: function splice(start, deleteCount) {
            var O = ES.ToObject(this);
            var A = [];
            var len = ES.ToUint32(O.length);
            var relativeStart = ES.ToInteger(start);
            var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len);
            var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart);

            var k = 0;
            var from;
            while (k < actualDeleteCount) {
                from = $String(actualStart + k);
                if (owns(O, from)) {
                    A[k] = O[from];
                }
                k += 1;
            }

            var items = arraySlice(arguments, 2);
            var itemCount = items.length;
            var to;
            if (itemCount < actualDeleteCount) {
                k = actualStart;
                var maxK = len - actualDeleteCount;
                while (k < maxK) {
                    from = $String(k + actualDeleteCount);
                    to = $String(k + itemCount);
                    if (owns(O, from)) {
                        O[to] = O[from];
                    } else {
                        delete O[to];
                    }
                    k += 1;
                }
                k = len;
                var minK = len - actualDeleteCount + itemCount;
                while (k > minK) {
                    delete O[k - 1];
                    k -= 1;
                }
            } else if (itemCount > actualDeleteCount) {
                k = len - actualDeleteCount;
                while (k > actualStart) {
                    from = $String(k + actualDeleteCount - 1);
                    to = $String(k + itemCount - 1);
                    if (owns(O, from)) {
                        O[to] = O[from];
                    } else {
                        delete O[to];
                    }
                    k -= 1;
                }
            }
            k = actualStart;
            for (var i = 0; i < items.length; ++i) {
                O[k] = items[i];
                k += 1;
            }
            O.length = len - actualDeleteCount + itemCount;

            return A;
        }
    }, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays);

    var originalJoin = ArrayPrototype.join;
    var hasStringJoinBug;
    try {
        hasStringJoinBug = Array.prototype.join.call('123', ',') !== '1,2,3';
    } catch (e) {
        hasStringJoinBug = true;
    }
    if (hasStringJoinBug) {
        defineProperties(ArrayPrototype, {
            join: function join(separator) {
                var sep = typeof separator === 'undefined' ? ',' : separator;
                return originalJoin.call(isString(this) ? strSplit(this, '') : this, sep);
            }
        }, hasStringJoinBug);
    }

    var hasJoinUndefinedBug = [1, 2].join(undefined) !== '1,2';
    if (hasJoinUndefinedBug) {
        defineProperties(ArrayPrototype, {
            join: function join(separator) {
                var sep = typeof separator === 'undefined' ? ',' : separator;
                return originalJoin.call(this, sep);
            }
        }, hasJoinUndefinedBug);
    }

    var pushShim = function push(item) {
        var O = ES.ToObject(this);
        var n = ES.ToUint32(O.length);
        var i = 0;
        while (i < arguments.length) {
            O[n + i] = arguments[i];
            i += 1;
        }
        O.length = n + i;
        return n + i;
    };

    var pushIsNotGeneric = (function () {
        var obj = {};
        var result = Array.prototype.push.call(obj, undefined);
        return result !== 1 || obj.length !== 1 || typeof obj[0] !== 'undefined' || !owns(obj, 0);
    }());
    defineProperties(ArrayPrototype, {
        push: function push(item) {
            if (isArray(this)) {
                return array_push.apply(this, arguments);
            }
            return pushShim.apply(this, arguments);
        }
    }, pushIsNotGeneric);

    // This fixes a very weird bug in Opera 10.6 when pushing `undefined
    var pushUndefinedIsWeird = (function () {
        var arr = [];
        var result = arr.push(undefined);
        return result !== 1 || arr.length !== 1 || typeof arr[0] !== 'undefined' || !owns(arr, 0);
    }());
    defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird);

    // ES5 15.2.3.14
    // http://es5.github.io/#x15.4.4.10
    // Fix boxed string bug
    defineProperties(ArrayPrototype, {
        slice: function (start, end) {
            var arr = isString(this) ? strSplit(this, '') : this;
            return arraySliceApply(arr, arguments);
        }
    }, splitString);

    var sortIgnoresNonFunctions = (function () {
        try {
            [1, 2].sort(null);
        } catch (e) {
            try {
                [1, 2].sort({});
            } catch (e2) {
                return false;
            }
        }
        return true;
    }());
    var sortThrowsOnRegex = (function () {
        // this is a problem in Firefox 4, in which `typeof /a/ === 'function'`
        try {
            [1, 2].sort(/a/);
            return false;
        } catch (e) {}
        return true;
    }());
    var sortIgnoresUndefined = (function () {
        // applies in IE 8, for one.
        try {
            [1, 2].sort(undefined);
            return true;
        } catch (e) {}
        return false;
    }());
    defineProperties(ArrayPrototype, {
        sort: function sort(compareFn) {
            if (typeof compareFn === 'undefined') {
                return arraySort(this);
            }
            if (!isCallable(compareFn)) {
                throw new TypeError('Array.prototype.sort callback must be a function');
            }
            return arraySort(this, compareFn);
        }
    }, sortIgnoresNonFunctions || !sortIgnoresUndefined || !sortThrowsOnRegex);

    //
    // Object
    // ======
    //

    // ES5 15.2.3.14
    // http://es5.github.com/#x15.2.3.14

    // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
    var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString'); // jscs:ignore disallowQuotedKeysInObjects
    var hasProtoEnumBug = isEnum(function () {}, 'prototype');
    var hasStringEnumBug = !owns('x', '0');
    var equalsConstructorPrototype = function (o) {
        var ctor = o.constructor;
        return ctor && ctor.prototype === o;
    };
    var excludedKeys = {
        $window: true,
        $console: true,
        $parent: true,
        $self: true,
        $frame: true,
        $frames: true,
        $frameElement: true,
        $webkitIndexedDB: true,
        $webkitStorageInfo: true,
        $external: true,
        $width: true,
        $height: true,
        $top: true,
        $localStorage: true
    };
    var hasAutomationEqualityBug = (function () {
        /* globals window */
        if (typeof window === 'undefined') {
            return false;
        }
        for (var k in window) {
            try {
                if (!excludedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') {
                    equalsConstructorPrototype(window[k]);
                }
            } catch (e) {
                return true;
            }
        }
        return false;
    }());
    var equalsConstructorPrototypeIfNotBuggy = function (object) {
        if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
            return equalsConstructorPrototype(object);
        }
        try {
            return equalsConstructorPrototype(object);
        } catch (e) {
            return false;
        }
    };
    var dontEnums = [
        'toString',
        'toLocaleString',
        'valueOf',
        'hasOwnProperty',
        'isPrototypeOf',
        'propertyIsEnumerable',
        'constructor'
    ];
    var dontEnumsLength = dontEnums.length;

    // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js
    // can be replaced with require('is-arguments') if we ever use a build process instead
    var isStandardArguments = function isArguments(value) {
        return toStr(value) === '[object Arguments]';
    };
    var isLegacyArguments = function isArguments(value) {
        return value !== null
            && typeof value === 'object'
            && typeof value.length === 'number'
            && value.length >= 0
            && !isArray(value)
            && isCallable(value.callee);
    };
    var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;

    defineProperties($Object, {
        keys: function keys(object) {
            var isFn = isCallable(object);
            var isArgs = isArguments(object);
            var isObject = object !== null && typeof object === 'object';
            var isStr = isObject && isString(object);

            if (!isObject && !isFn && !isArgs) {
                throw new TypeError('Object.keys called on a non-object');
            }

            var theKeys = [];
            var skipProto = hasProtoEnumBug && isFn;
            if ((isStr && hasStringEnumBug) || isArgs) {
                for (var i = 0; i < object.length; ++i) {
                    pushCall(theKeys, $String(i));
                }
            }

            if (!isArgs) {
                for (var name in object) {
                    if (!(skipProto && name === 'prototype') && owns(object, name)) {
                        pushCall(theKeys, $String(name));
                    }
                }
            }

            if (hasDontEnumBug) {
                var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
                for (var j = 0; j < dontEnumsLength; j++) {
                    var dontEnum = dontEnums[j];
                    if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) {
                        pushCall(theKeys, dontEnum);
                    }
                }
            }
            return theKeys;
        }
    });

    var keysWorksWithArguments = $Object.keys && (function () {
        // Safari 5.0 bug
        return $Object.keys(arguments).length === 2;
    }(1, 2));
    var keysHasArgumentsLengthBug = $Object.keys && (function () {
        var argKeys = $Object.keys(arguments);
        return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
    }(1));
    var originalKeys = $Object.keys;
    defineProperties($Object, {
        keys: function keys(object) {
            if (isArguments(object)) {
                return originalKeys(arraySlice(object));
            } else {
                return originalKeys(object);
            }
        }
    }, !keysWorksWithArguments || keysHasArgumentsLengthBug);

    //
    // Date
    // ====
    //

    var hasNegativeMonthYearBug = new Date(-3509827329600292).getUTCMonth() !== 0;
    var aNegativeTestDate = new Date(-1509842289600292);
    var aPositiveTestDate = new Date(1449662400000);
    var hasToUTCStringFormatBug = aNegativeTestDate.toUTCString() !== 'Mon, 01 Jan -45875 11:59:59 GMT';
    var hasToDateStringFormatBug;
    var hasToStringFormatBug;
    var timeZoneOffset = aNegativeTestDate.getTimezoneOffset();
    if (timeZoneOffset < -720) {
        hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875';
        hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/).test(String(aPositiveTestDate));
    } else {
        hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875';
        hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/).test(String(aPositiveTestDate));
    }

    var originalGetFullYear = call.bind(Date.prototype.getFullYear);
    var originalGetMonth = call.bind(Date.prototype.getMonth);
    var originalGetDate = call.bind(Date.prototype.getDate);
    var originalGetUTCFullYear = call.bind(Date.prototype.getUTCFullYear);
    var originalGetUTCMonth = call.bind(Date.prototype.getUTCMonth);
    var originalGetUTCDate = call.bind(Date.prototype.getUTCDate);
    var originalGetUTCDay = call.bind(Date.prototype.getUTCDay);
    var originalGetUTCHours = call.bind(Date.prototype.getUTCHours);
    var originalGetUTCMinutes = call.bind(Date.prototype.getUTCMinutes);
    var originalGetUTCSeconds = call.bind(Date.prototype.getUTCSeconds);
    var originalGetUTCMilliseconds = call.bind(Date.prototype.getUTCMilliseconds);
    var dayName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
    var monthName = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
    var daysInMonth = function daysInMonth(month, year) {
        return originalGetDate(new Date(year, month, 0));
    };

    defineProperties(Date.prototype, {
        getFullYear: function getFullYear() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var year = originalGetFullYear(this);
            if (year < 0 && originalGetMonth(this) > 11) {
                return year + 1;
            }
            return year;
        },
        getMonth: function getMonth() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var year = originalGetFullYear(this);
            var month = originalGetMonth(this);
            if (year < 0 && month > 11) {
                return 0;
            }
            return month;
        },
        getDate: function getDate() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var year = originalGetFullYear(this);
            var month = originalGetMonth(this);
            var date = originalGetDate(this);
            if (year < 0 && month > 11) {
                if (month === 12) {
                    return date;
                }
                var days = daysInMonth(0, year + 1);
                return (days - date) + 1;
            }
            return date;
        },
        getUTCFullYear: function getUTCFullYear() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var year = originalGetUTCFullYear(this);
            if (year < 0 && originalGetUTCMonth(this) > 11) {
                return year + 1;
            }
            return year;
        },
        getUTCMonth: function getUTCMonth() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var year = originalGetUTCFullYear(this);
            var month = originalGetUTCMonth(this);
            if (year < 0 && month > 11) {
                return 0;
            }
            return month;
        },
        getUTCDate: function getUTCDate() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var year = originalGetUTCFullYear(this);
            var month = originalGetUTCMonth(this);
            var date = originalGetUTCDate(this);
            if (year < 0 && month > 11) {
                if (month === 12) {
                    return date;
                }
                var days = daysInMonth(0, year + 1);
                return (days - date) + 1;
            }
            return date;
        }
    }, hasNegativeMonthYearBug);

    defineProperties(Date.prototype, {
        toUTCString: function toUTCString() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var day = originalGetUTCDay(this);
            var date = originalGetUTCDate(this);
            var month = originalGetUTCMonth(this);
            var year = originalGetUTCFullYear(this);
            var hour = originalGetUTCHours(this);
            var minute = originalGetUTCMinutes(this);
            var second = originalGetUTCSeconds(this);
            return dayName[day] + ', '
                + (date < 10 ? '0' + date : date) + ' '
                + monthName[month] + ' '
                + year + ' '
                + (hour < 10 ? '0' + hour : hour) + ':'
                + (minute < 10 ? '0' + minute : minute) + ':'
                + (second < 10 ? '0' + second : second) + ' GMT';
        }
    }, hasNegativeMonthYearBug || hasToUTCStringFormatBug);

    // Opera 12 has `,`
    defineProperties(Date.prototype, {
        toDateString: function toDateString() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var day = this.getDay();
            var date = this.getDate();
            var month = this.getMonth();
            var year = this.getFullYear();
            return dayName[day] + ' '
                + monthName[month] + ' '
                + (date < 10 ? '0' + date : date) + ' '
                + year;
        }
    }, hasNegativeMonthYearBug || hasToDateStringFormatBug);

    // can't use defineProperties here because of toString enumeration issue in IE <= 8
    if (hasNegativeMonthYearBug || hasToStringFormatBug) {
        Date.prototype.toString = function toString() {
            if (!this || !(this instanceof Date)) {
                throw new TypeError('this is not a Date object.');
            }
            var day = this.getDay();
            var date = this.getDate();
            var month = this.getMonth();
            var year = this.getFullYear();
            var hour = this.getHours();
            var minute = this.getMinutes();
            var second = this.getSeconds();
            var timezoneOffset = this.getTimezoneOffset();
            var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60);
            var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60);
            return dayName[day] + ' '
                + monthName[month] + ' '
                + (date < 10 ? '0' + date : date) + ' '
                + year + ' '
                + (hour < 10 ? '0' + hour : hour) + ':'
                + (minute < 10 ? '0' + minute : minute) + ':'
                + (second < 10 ? '0' + second : second) + ' GMT'
                + (timezoneOffset > 0 ? '-' : '+')
                + (hoursOffset < 10 ? '0' + hoursOffset : hoursOffset)
                + (minutesOffset < 10 ? '0' + minutesOffset : minutesOffset);
        };
        if (supportsDescriptors) {
            $Object.defineProperty(Date.prototype, 'toString', {
                configurable: true,
                enumerable: false,
                writable: true
            });
        }
    }

    // ES5 15.9.5.43
    // http://es5.github.com/#x15.9.5.43
    // This function returns a String value represent the instance in time
    // represented by this Date object. The format of the String is the Date Time
    // string format defined in 15.9.1.15. All fields are present in the String.
    // The time zone is always UTC, denoted by the suffix Z. If the time value of
    // this object is not a finite Number a RangeError exception is thrown.
    var negativeDate = -62198755200000;
    var negativeYearString = '-000001';
    var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1; // eslint-disable-line max-len
    var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z';

    var getTime = call.bind(Date.prototype.getTime);

    defineProperties(Date.prototype, {
        toISOString: function toISOString() {
            if (!isFinite(this) || !isFinite(getTime(this))) {
                // Adope Photoshop requires the second check.
                throw new RangeError('Date.prototype.toISOString called on non-finite value.');
            }

            var year = originalGetUTCFullYear(this);

            var month = originalGetUTCMonth(this);
            // see https://github.com/es-shims/es5-shim/issues/111
            year += Math.floor(month / 12);
            month = ((month % 12) + 12) % 12;

            // the date time string format is specified in 15.9.1.15.
            var result = [
                month + 1,
                originalGetUTCDate(this),
                originalGetUTCHours(this),
                originalGetUTCMinutes(this),
                originalGetUTCSeconds(this)
            ];
            year = (
                (year < 0 ? '-' : (year > 9999 ? '+' : ''))
                + strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
            );

            for (var i = 0; i < result.length; ++i) {
                // pad months, days, hours, minutes, and seconds to have two digits.
                result[i] = strSlice('00' + result[i], -2);
            }
            // pad milliseconds to have three digits.
            return (
                year + '-' + arraySlice(result, 0, 2).join('-')
                + 'T' + arraySlice(result, 2).join(':') + '.'
                + strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z'
            );
        }
    }, hasNegativeDateBug || hasSafari51DateBug);

    // ES5 15.9.5.44
    // http://es5.github.com/#x15.9.5.44
    // This function provides a String representation of a Date object for use by
    // JSON.stringify (15.12.3).
    var dateToJSONIsSupported = (function () {
        try {
            return Date.prototype.toJSON
                && new Date(NaN).toJSON() === null
                && new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1
                && Date.prototype.toJSON.call({ // generic
                    toISOString: function () { return true; }
                });
        } catch (e) {
            return false;
        }
    }());
    if (!dateToJSONIsSupported) {
        Date.prototype.toJSON = function toJSON(key) {
            // When the toJSON method is called with argument key, the following
            // steps are taken:

            // 1.  Let O be the result of calling ToObject, giving it the this
            // value as its argument.
            // 2. Let tv be ES.ToPrimitive(O, hint Number).
            var O = $Object(this);
            var tv = ES.ToPrimitive(O);
            // 3. If tv is a Number and is not finite, return null.
            if (typeof tv === 'number' && !isFinite(tv)) {
                return null;
            }
            // 4. Let toISO be the result of calling the [[Get]] internal method of
            // O with argument "toISOString".
            var toISO = O.toISOString;
            // 5. If IsCallable(toISO) is false, throw a TypeError exception.
            if (!isCallable(toISO)) {
                throw new TypeError('toISOString property is not callable');
            }
            // 6. Return the result of calling the [[Call]] internal method of
            //  toISO with O as the this value and an empty argument list.
            return toISO.call(O);

            // NOTE 1 The argument is ignored.

            // NOTE 2 The toJSON function is intentionally generic; it does not
            // require that its this value be a Date object. Therefore, it can be
            // transferred to other kinds of objects for use as a method. However,
            // it does require that any such object have a toISOString method. An
            // object is free to use the argument key to filter its
            // stringification.
        };
    }

    // ES5 15.9.4.2
    // http://es5.github.com/#x15.9.4.2
    // based on work shared by Daniel Friesen (dantman)
    // http://gist.github.com/303249
    var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15;
    var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z'));
    var doesNotParseY2KNewYear = isNaN(Date.parse('2000-01-01T00:00:00.000Z'));
    if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
        // XXX global assignment won't work in embeddings that use
        // an alternate object for the context.
        /* global Date: true */
        var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1;
        var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
        // eslint-disable-next-line no-implicit-globals, no-global-assign
        Date = (function (NativeDate) {
            // Date.length === 7
            var DateShim = function Date(Y, M, D, h, m, s, ms) {
                var length = arguments.length;
                var date;
                if (this instanceof NativeDate) {
                    var seconds = s;
                    var millis = ms;
                    if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) {
                        // work around a Safari 8/9 bug where it treats the seconds as signed
                        var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
                        var sToShift = Math.floor(msToShift / 1e3);
                        seconds += sToShift;
                        millis -= sToShift * 1e3;
                    }
                    date = length === 1 && $String(Y) === Y // isString(Y)
                        // We explicitly pass it through parse:
                        ? new NativeDate(DateShim.parse(Y))
                        // We have to manually make calls depending on argument
                        // length here
                        : length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis)
                            : length >= 6 ? new NativeDate(Y, M, D, h, m, seconds)
                                : length >= 5 ? new NativeDate(Y, M, D, h, m)
                                    : length >= 4 ? new NativeDate(Y, M, D, h)
                                        : length >= 3 ? new NativeDate(Y, M, D)
                                            : length >= 2 ? new NativeDate(Y, M)
                                                : length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y)
                                                    : new NativeDate();
                } else {
                    date = NativeDate.apply(this, arguments);
                }
                if (!isPrimitive(date)) {
                    // Prevent mixups with unfixed Date object
                    defineProperties(date, { constructor: DateShim }, true);
                }
                return date;
            };

            // 15.9.1.15 Date Time String Format.
            var isoDateExpression = new RegExp('^'
                + '(\\d{4}|[+-]\\d{6})' // four-digit year capture or sign + 6-digit extended year
                + '(?:-(\\d{2})' // optional month capture
                + '(?:-(\\d{2})' // optional day capture
                + '(?:' // capture hours:minutes:seconds.milliseconds
                    + 'T(\\d{2})' // hours capture
                    + ':(\\d{2})' // minutes capture
                    + '(?:' // optional :seconds.milliseconds
                        + ':(\\d{2})' // seconds capture
                        + '(?:(\\.\\d{1,}))?' // milliseconds capture
                    + ')?'
                + '(' // capture UTC offset component
                    + 'Z|' // UTC capture
                    + '(?:' // offset specifier +/-hours:minutes
                        + '([-+])' // sign capture
                        + '(\\d{2})' // hours offset capture
                        + ':(\\d{2})' // minutes offset capture
                    + ')'
                + ')?)?)?)?'
            + '$');

            var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];

            var dayFromMonth = function dayFromMonth(year, month) {
                var t = month > 1 ? 1 : 0;
                return (
                    months[month]
                    + Math.floor((year - 1969 + t) / 4)
                    - Math.floor((year - 1901 + t) / 100)
                    + Math.floor((year - 1601 + t) / 400)
                    + (365 * (year - 1970))
                );
            };

            var toUTC = function toUTC(t) {
                var s = 0;
                var ms = t;
                if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
                    // work around a Safari 8/9 bug where it treats the seconds as signed
                    var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
                    var sToShift = Math.floor(msToShift / 1e3);
                    s += sToShift;
                    ms -= sToShift * 1e3;
                }
                return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms));
            };

            // Copy any custom methods a 3rd party library may have added
            for (var key in NativeDate) {
                if (owns(NativeDate, key)) {
                    DateShim[key] = NativeDate[key];
                }
            }

            // Copy "native" methods explicitly; they may be non-enumerable
            defineProperties(DateShim, {
                now: NativeDate.now,
                UTC: NativeDate.UTC
            }, true);
            DateShim.prototype = NativeDate.prototype;
            defineProperties(DateShim.prototype, { constructor: DateShim }, true);

            // Upgrade Date.parse to handle simplified ISO 8601 strings
            var parseShim = function parse(string) {
                var match = isoDateExpression.exec(string);
                if (match) {
                    // parse months, days, hours, minutes, seconds, and milliseconds
                    // provide default values if necessary
                    // parse the UTC offset component
                    var year = $Number(match[1]),
                        month = $Number(match[2] || 1) - 1,
                        day = $Number(match[3] || 1) - 1,
                        hour = $Number(match[4] || 0),
                        minute = $Number(match[5] || 0),
                        second = $Number(match[6] || 0),
                        millisecond = Math.floor($Number(match[7] || 0) * 1000),
                        // When time zone is missed, local offset should be used
                        // (ES 5.1 bug)
                        // see https://bugs.ecmascript.org/show_bug.cgi?id=112
                        isLocalTime = Boolean(match[4] && !match[8]),
                        signOffset = match[9] === '-' ? 1 : -1,
                        hourOffset = $Number(match[10] || 0),
                        minuteOffset = $Number(match[11] || 0),
                        result;
                    var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0;
                    if (
                        hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25)
                        && minute < 60 && second < 60 && millisecond < 1000
                        && month > -1 && month < 12 && hourOffset < 24
                        && minuteOffset < 60 // detect invalid offsets
                        && day > -1
                        && day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month))
                    ) {
                        result = (
                            ((dayFromMonth(year, month) + day) * 24)
                            + hour
                            + (hourOffset * signOffset)
                        ) * 60;
                        result = ((
                            ((result + minute + (minuteOffset * signOffset)) * 60)
                            + second
                        ) * 1000) + millisecond;
                        if (isLocalTime) {
                            result = toUTC(result);
                        }
                        if (-8.64e15 <= result && result <= 8.64e15) {
                            return result;
                        }
                    }
                    return NaN;
                }
                return NativeDate.parse.apply(this, arguments);
            };
            defineProperties(DateShim, { parse: parseShim });

            return DateShim;
        }(Date));
        /* global Date: false */
    }

    // ES5 15.9.4.4
    // http://es5.github.com/#x15.9.4.4
    if (!Date.now) {
        Date.now = function now() {
            return new Date().getTime();
        };
    }

    //
    // Number
    // ======
    //

    // ES5.1 15.7.4.5
    // http://es5.github.com/#x15.7.4.5
    var hasToFixedBugs = NumberPrototype.toFixed && (
        (0.00008).toFixed(3) !== '0.000'
        || (0.9).toFixed(0) !== '1'
        || (1.255).toFixed(2) !== '1.25'
        || (1000000000000000128).toFixed(0) !== '1000000000000000128'
    );

    var toFixedHelpers = {
        base: 1e7,
        size: 6,
        data: [0, 0, 0, 0, 0, 0],
        multiply: function multiply(n, c) {
            var i = -1;
            var c2 = c;
            while (++i < toFixedHelpers.size) {
                c2 += n * toFixedHelpers.data[i];
                toFixedHelpers.data[i] = c2 % toFixedHelpers.base;
                c2 = Math.floor(c2 / toFixedHelpers.base);
            }
        },
        divide: function divide(n) {
            var i = toFixedHelpers.size;
            var c = 0;
            while (--i >= 0) {
                c += toFixedHelpers.data[i];
                toFixedHelpers.data[i] = Math.floor(c / n);
                c = (c % n) * toFixedHelpers.base;
            }
        },
        numToString: function numToString() {
            var i = toFixedHelpers.size;
            var s = '';
            while (--i >= 0) {
                if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) {
                    var t = $String(toFixedHelpers.data[i]);
                    if (s === '') {
                        s = t;
                    } else {
                        s += strSlice('0000000', 0, 7 - t.length) + t;
                    }
                }
            }
            return s;
        },
        pow: function pow(x, n, acc) {
            return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc)));
        },
        log: function log(x) {
            var n = 0;
            var x2 = x;
            while (x2 >= 4096) {
                n += 12;
                x2 /= 4096;
            }
            while (x2 >= 2) {
                n += 1;
                x2 /= 2;
            }
            return n;
        }
    };

    var toFixedShim = function toFixed(fractionDigits) {
        var f, x, s, m, e, z, j, k;

        // Test for NaN and round fractionDigits down
        f = $Number(fractionDigits);
        f = isActualNaN(f) ? 0 : Math.floor(f);

        if (f < 0 || f > 20) {
            throw new RangeError('Number.toFixed called with invalid number of decimals');
        }

        x = $Number(this);

        if (isActualNaN(x)) {
            return 'NaN';
        }

        // If it is too big or small, return the string value of the number
        if (x <= -1e21 || x >= 1e21) {
            return $String(x);
        }

        s = '';

        if (x < 0) {
            s = '-';
            x = -x;
        }

        m = '0';

        if (x > 1e-21) {
            // 1e-21 < x < 1e21
            // -70 < log2(x) < 70
            e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69;
            z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1));
            z *= 0x10000000000000; // Math.pow(2, 52);
            e = 52 - e;

            // -18 < e < 122
            // x = z / 2 ^ e
            if (e > 0) {
                toFixedHelpers.multiply(0, z);
                j = f;

                while (j >= 7) {
                    toFixedHelpers.multiply(1e7, 0);
                    j -= 7;
                }

                toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0);
                j = e - 1;

                while (j >= 23) {
                    toFixedHelpers.divide(1 << 23);
                    j -= 23;
                }

                toFixedHelpers.divide(1 << j);
                toFixedHelpers.multiply(1, 1);
                toFixedHelpers.divide(2);
                m = toFixedHelpers.numToString();
            } else {
                toFixedHelpers.multiply(0, z);
                toFixedHelpers.multiply(1 << (-e), 0);
                m = toFixedHelpers.numToString() + strSlice('0.00000000000000000000', 2, 2 + f);
            }
        }

        if (f > 0) {
            k = m.length;

            if (k <= f) {
                m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m;
            } else {
                m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f);
            }
        } else {
            m = s + m;
        }

        return m;
    };
    defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs);

    var hasToPrecisionUndefinedBug = (function () {
        try {
            return 1.0.toPrecision(undefined) === '1';
        } catch (e) {
            return true;
        }
    }());
    var originalToPrecision = NumberPrototype.toPrecision;
    defineProperties(NumberPrototype, {
        toPrecision: function toPrecision(precision) {
            return typeof precision === 'undefined' ? originalToPrecision.call(this) : originalToPrecision.call(this, precision);
        }
    }, hasToPrecisionUndefinedBug);

    //
    // String
    // ======
    //

    // ES5 15.5.4.14
    // http://es5.github.com/#x15.5.4.14

    // [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
    // Many browsers do not split properly with regular expressions or they
    // do not perform the split correctly under obscure conditions.
    // See http://blog.stevenlevithan.com/archives/cross-browser-split
    // I've tested in many browsers and this seems to cover the deviant ones:
    //    'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
    //    '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
    //    'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
    //       [undefined, "t", undefined, "e", ...]
    //    ''.split(/.?/) should be [], not [""]
    //    '.'.split(/()()/) should be ["."], not ["", "", "."]

    if (
        'ab'.split(/(?:ab)*/).length !== 2
        || '.'.split(/(.?)(.?)/).length !== 4
        || 'tesst'.split(/(s)*/)[1] === 't'
        || 'test'.split(/(?:)/, -1).length !== 4
        || ''.split(/.?/).length
        || '.'.split(/()()/).length > 1
    ) {
        (function () {
            var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
            var maxSafe32BitInt = Math.pow(2, 32) - 1;

            StringPrototype.split = function (separator, limit) {
                var string = String(this);
                if (typeof separator === 'undefined' && limit === 0) {
                    return [];
                }

                // If `separator` is not a regex, use native split
                if (!isRegex(separator)) {
                    return strSplit(this, separator, limit);
                }

                var output = [];
                var flags = (separator.ignoreCase ? 'i' : '')
                            + (separator.multiline ? 'm' : '')
                            + (separator.unicode ? 'u' : '') // in ES6
                            + (separator.sticky ? 'y' : ''), // Firefox 3+ and ES6
                    lastLastIndex = 0,
                    // Make `global` and avoid `lastIndex` issues by working with a copy
                    separator2, match, lastIndex, lastLength;
                var separatorCopy = new RegExp(separator.source, flags + 'g');
                if (!compliantExecNpcg) {
                    // Doesn't need flags gy, but they don't hurt
                    separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
                }
                /* Values for `limit`, per the spec:
                 * If undefined: 4294967295 // maxSafe32BitInt
                 * If 0, Infinity, or NaN: 0
                 * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
                 * If negative number: 4294967296 - Math.floor(Math.abs(limit))
                 * If other: Type-convert, then use the above rules
                 */
                var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit);
                match = separatorCopy.exec(string);
                while (match) {
                    // `separatorCopy.lastIndex` is not reliable cross-browser
                    lastIndex = match.index + match[0].length;
                    if (lastIndex > lastLastIndex) {
                        pushCall(output, strSlice(string, lastLastIndex, match.index));
                        // Fix browsers whose `exec` methods don't consistently return `undefined` for
                        // nonparticipating capturing groups
                        if (!compliantExecNpcg && match.length > 1) {
                            /* eslint-disable no-loop-func */
                            match[0].replace(separator2, function () {
                                for (var i = 1; i < arguments.length - 2; i++) {
                                    if (typeof arguments[i] === 'undefined') {
                                        match[i] = void 0;
                                    }
                                }
                            });
                            /* eslint-enable no-loop-func */
                        }
                        if (match.length > 1 && match.index < string.length) {
                            array_push.apply(output, arraySlice(match, 1));
                        }
                        lastLength = match[0].length;
                        lastLastIndex = lastIndex;
                        if (output.length >= splitLimit) {
                            break;
                        }
                    }
                    if (separatorCopy.lastIndex === match.index) {
                        separatorCopy.lastIndex++; // Avoid an infinite loop
                    }
                    match = separatorCopy.exec(string);
                }
                if (lastLastIndex === string.length) {
                    if (lastLength || !separatorCopy.test('')) {
                        pushCall(output, '');
                    }
                } else {
                    pushCall(output, strSlice(string, lastLastIndex));
                }
                return output.length > splitLimit ? arraySlice(output, 0, splitLimit) : output;
            };
        }());

    // [bugfix, chrome]
    // If separator is undefined, then the result array contains just one String,
    // which is the this value (converted to a String). If limit is not undefined,
    // then the output array is truncated so that it contains no more than limit
    // elements.
    // "0".split(undefined, 0) -> []
    } else if ('0'.split(void 0, 0).length) {
        StringPrototype.split = function split(separator, limit) {
            if (typeof separator === 'undefined' && limit === 0) {
                return [];
            }
            return strSplit(this, separator, limit);
        };
    }

    var str_replace = StringPrototype.replace;
    var replaceReportsGroupsCorrectly = (function () {
        var groups = [];
        'x'.replace(/x(.)?/g, function (match, group) {
            pushCall(groups, group);
        });
        return groups.length === 1 && typeof groups[0] === 'undefined';
    }());

    if (!replaceReportsGroupsCorrectly) {
        StringPrototype.replace = function replace(searchValue, replaceValue) {
            var isFn = isCallable(replaceValue);
            var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source);
            if (!isFn || !hasCapturingGroups) {
                return str_replace.call(this, searchValue, replaceValue);
            } else {
                var wrappedReplaceValue = function (match) {
                    var length = arguments.length;
                    var originalLastIndex = searchValue.lastIndex;
                    searchValue.lastIndex = 0;
                    var args = searchValue.exec(match) || [];
                    searchValue.lastIndex = originalLastIndex;
                    pushCall(args, arguments[length - 2], arguments[length - 1]);
                    return replaceValue.apply(this, args);
                };
                return str_replace.call(this, searchValue, wrappedReplaceValue);
            }
        };
    }

    // ECMA-262, 3rd B.2.3
    // Not an ECMAScript standard, although ECMAScript 3rd Edition has a
    // non-normative section suggesting uniform semantics and it should be
    // normalized across all browsers
    // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
    var string_substr = StringPrototype.substr;
    var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
    defineProperties(StringPrototype, {
        substr: function substr(start, length) {
            var normalizedStart = start;
            if (start < 0) {
                normalizedStart = max(this.length + start, 0);
            }
            return string_substr.call(this, normalizedStart, length);
        }
    }, hasNegativeSubstrBug);

    // ES5 15.5.4.20
    // whitespace from: http://es5.github.io/#x15.5.4.20
    var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003'
        + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028'
        + '\u2029\uFEFF';
    var zeroWidth = '\u200b';
    var wsRegexChars = '[' + ws + ']';
    var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
    var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$');
    var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim());
    defineProperties(StringPrototype, {
        // http://blog.stevenlevithan.com/archives/faster-trim-javascript
        // http://perfectionkills.com/whitespace-deviations/
        trim: function trim() {
            if (typeof this === 'undefined' || this === null) {
                throw new TypeError("can't convert " + this + ' to object');
            }
            return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, '');
        }
    }, hasTrimWhitespaceBug);
    var trim = call.bind(String.prototype.trim);

    var hasLastIndexBug = StringPrototype.lastIndexOf && 'abcあい'.lastIndexOf('あい', 2) !== -1;
    defineProperties(StringPrototype, {
        lastIndexOf: function lastIndexOf(searchString) {
            if (typeof this === 'undefined' || this === null) {
                throw new TypeError("can't convert " + this + ' to object');
            }
            var S = $String(this);
            var searchStr = $String(searchString);
            var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN;
            var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos);
            var start = min(max(pos, 0), S.length);
            var searchLen = searchStr.length;
            var k = start + searchLen;
            while (k > 0) {
                k = max(0, k - searchLen);
                var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr);
                if (index !== -1) {
                    return k + index;
                }
            }
            return -1;
        }
    }, hasLastIndexBug);

    var originalLastIndexOf = StringPrototype.lastIndexOf;
    defineProperties(StringPrototype, {
        lastIndexOf: function lastIndexOf(searchString) {
            return originalLastIndexOf.apply(this, arguments);
        }
    }, StringPrototype.lastIndexOf.length !== 1);

    // ES-5 15.1.2.2
    // eslint-disable-next-line radix
    if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
        /* global parseInt: true */
        parseInt = (function (origParseInt) {
            var hexRegex = /^[-+]?0[xX]/;
            return function parseInt(str, radix) {
                if (typeof str === 'symbol') {
                    // handle Symbols in node 8.3/8.4
                    // eslint-disable-next-line no-implicit-coercion, no-unused-expressions
                    '' + str; // jscs:ignore disallowImplicitTypeConversion
                }

                var string = trim(String(str));
                var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
                return origParseInt(string, defaultedRadix);
            };
        }(parseInt));
    }

    // https://es5.github.io/#x15.1.2.3
    if (1 / parseFloat('-0') !== -Infinity) {
        /* global parseFloat: true */
        parseFloat = (function (origParseFloat) {
            return function parseFloat(string) {
                var inputString = trim(String(string));
                var result = origParseFloat(inputString);
                return result === 0 && strSlice(inputString, 0, 1) === '-' ? -0 : result;
            };
        }(parseFloat));
    }

    if (String(new RangeError('test')) !== 'RangeError: test') {
        var errorToStringShim = function toString() {
            if (typeof this === 'undefined' || this === null) {
                throw new TypeError("can't convert " + this + ' to object');
            }
            var name = this.name;
            if (typeof name === 'undefined') {
                name = 'Error';
            } else if (typeof name !== 'string') {
                name = $String(name);
            }
            var msg = this.message;
            if (typeof msg === 'undefined') {
                msg = '';
            } else if (typeof msg !== 'string') {
                msg = $String(msg);
            }
            if (!name) {
                return msg;
            }
            if (!msg) {
                return name;
            }
            return name + ': ' + msg;
        };
        // can't use defineProperties here because of toString enumeration issue in IE <= 8
        Error.prototype.toString = errorToStringShim;
    }

    if (supportsDescriptors) {
        var ensureNonEnumerable = function (obj, prop) {
            if (isEnum(obj, prop)) {
                var desc = Object.getOwnPropertyDescriptor(obj, prop);
                if (desc.configurable) {
                    desc.enumerable = false;
                    Object.defineProperty(obj, prop, desc);
                }
            }
        };
        ensureNonEnumerable(Error.prototype, 'message');
        if (Error.prototype.message !== '') {
            Error.prototype.message = '';
        }
        ensureNonEnumerable(Error.prototype, 'name');
    }

    if (String(/a/mig) !== '/a/gim') {
        var regexToString = function toString() {
            var str = '/' + this.source + '/';
            if (this.global) {
                str += 'g';
            }
            if (this.ignoreCase) {
                str += 'i';
            }
            if (this.multiline) {
                str += 'm';
            }
            return str;
        };
        // can't use defineProperties here because of toString enumeration issue in IE <= 8
        RegExp.prototype.toString = regexToString;
    }
}));
;
 /*!
  * https://github.com/paulmillr/es6-shim
  * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
  *   and contributors,  MIT License
  * es6-shim: v0.35.1
  * see https://github.com/paulmillr/es6-shim/blob/0.35.1/LICENSE
  * Details and documentation:
  * https://github.com/paulmillr/es6-shim/
  */

// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/returnExports.js
(function (root, factory) {
  /*global define, module, exports */
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(factory);
  } else if (typeof exports === 'object') {
    // Node. Does not work with strict CommonJS, but
    // only CommonJS-like environments that support module.exports,
    // like Node.
    module.exports = factory();
  } else {
    // Browser globals (root is window)
    root.returnExports = factory();
  }
}(this, function () {
  'use strict';

  var _apply = Function.call.bind(Function.apply);
  var _call = Function.call.bind(Function.call);
  var isArray = Array.isArray;
  var keys = Object.keys;

  var not = function notThunker(func) {
    return function notThunk() {
      return !_apply(func, this, arguments);
    };
  };
  var throwsError = function (func) {
    try {
      func();
      return false;
    } catch (e) {
      return true;
    }
  };
  var valueOrFalseIfThrows = function valueOrFalseIfThrows(func) {
    try {
      return func();
    } catch (e) {
      return false;
    }
  };

  var isCallableWithoutNew = not(throwsError);
  var arePropertyDescriptorsSupported = function () {
    // if Object.defineProperty exists but throws, it's IE 8
    return !throwsError(function () {
      Object.defineProperty({}, 'x', { get: function () {} });
    });
  };
  var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported();
  var functionsHaveNames = (function foo() {}).name === 'foo'; // eslint-disable-line no-extra-parens

  var _forEach = Function.call.bind(Array.prototype.forEach);
  var _reduce = Function.call.bind(Array.prototype.reduce);
  var _filter = Function.call.bind(Array.prototype.filter);
  var _some = Function.call.bind(Array.prototype.some);

  var defineProperty = function (object, name, value, force) {
    if (!force && name in object) { return; }
    if (supportsDescriptors) {
      Object.defineProperty(object, name, {
        configurable: true,
        enumerable: false,
        writable: true,
        value: value
      });
    } else {
      object[name] = value;
    }
  };

  // Define configurable, writable and non-enumerable props
  // if they don’t exist.
  var defineProperties = function (object, map, forceOverride) {
    _forEach(keys(map), function (name) {
      var method = map[name];
      defineProperty(object, name, method, !!forceOverride);
    });
  };

  var _toString = Function.call.bind(Object.prototype.toString);
  var isCallable = typeof /abc/ === 'function' ? function IsCallableSlow(x) {
    // Some old browsers (IE, FF) say that typeof /abc/ === 'function'
    return typeof x === 'function' && _toString(x) === '[object Function]';
  } : function IsCallableFast(x) { return typeof x === 'function'; };

  var Value = {
    getter: function (object, name, getter) {
      if (!supportsDescriptors) {
        throw new TypeError('getters require true ES5 support');
      }
      Object.defineProperty(object, name, {
        configurable: true,
        enumerable: false,
        get: getter
      });
    },
    proxy: function (originalObject, key, targetObject) {
      if (!supportsDescriptors) {
        throw new TypeError('getters require true ES5 support');
      }
      var originalDescriptor = Object.getOwnPropertyDescriptor(originalObject, key);
      Object.defineProperty(targetObject, key, {
        configurable: originalDescriptor.configurable,
        enumerable: originalDescriptor.enumerable,
        get: function getKey() { return originalObject[key]; },
        set: function setKey(value) { originalObject[key] = value; }
      });
    },
    redefine: function (object, property, newValue) {
      if (supportsDescriptors) {
        var descriptor = Object.getOwnPropertyDescriptor(object, property);
        descriptor.value = newValue;
        Object.defineProperty(object, property, descriptor);
      } else {
        object[property] = newValue;
      }
    },
    defineByDescriptor: function (object, property, descriptor) {
      if (supportsDescriptors) {
        Object.defineProperty(object, property, descriptor);
      } else if ('value' in descriptor) {
        object[property] = descriptor.value;
      }
    },
    preserveToString: function (target, source) {
      if (source && isCallable(source.toString)) {
        defineProperty(target, 'toString', source.toString.bind(source), true);
      }
    }
  };

  // Simple shim for Object.create on ES3 browsers
  // (unlike real shim, no attempt to support `prototype === null`)
  var create = Object.create || function (prototype, properties) {
    var Prototype = function Prototype() {};
    Prototype.prototype = prototype;
    var object = new Prototype();
    if (typeof properties !== 'undefined') {
      keys(properties).forEach(function (key) {
        Value.defineByDescriptor(object, key, properties[key]);
      });
    }
    return object;
  };

  var supportsSubclassing = function (C, f) {
    if (!Object.setPrototypeOf) { return false; /* skip test on IE < 11 */ }
    return valueOrFalseIfThrows(function () {
      var Sub = function Subclass(arg) {
        var o = new C(arg);
        Object.setPrototypeOf(o, Subclass.prototype);
        return o;
      };
      Object.setPrototypeOf(Sub, C);
      Sub.prototype = create(C.prototype, {
        constructor: { value: Sub }
      });
      return f(Sub);
    });
  };

  var getGlobal = function () {
    /* global self, window, global */
    // the only reliable means to get the global object is
    // `Function('return this')()`
    // However, this causes CSP violations in Chrome apps.
    if (typeof self !== 'undefined') { return self; }
    if (typeof window !== 'undefined') { return window; }
    if (typeof global !== 'undefined') { return global; }
    throw new Error('unable to locate global object');
  };

  var globals = getGlobal();
  var globalIsFinite = globals.isFinite;
  var _indexOf = Function.call.bind(String.prototype.indexOf);
  var _arrayIndexOfApply = Function.apply.bind(Array.prototype.indexOf);
  var _concat = Function.call.bind(Array.prototype.concat);
  // var _sort = Function.call.bind(Array.prototype.sort);
  var _strSlice = Function.call.bind(String.prototype.slice);
  var _push = Function.call.bind(Array.prototype.push);
  var _pushApply = Function.apply.bind(Array.prototype.push);
  var _shift = Function.call.bind(Array.prototype.shift);
  var _max = Math.max;
  var _min = Math.min;
  var _floor = Math.floor;
  var _abs = Math.abs;
  var _exp = Math.exp;
  var _log = Math.log;
  var _sqrt = Math.sqrt;
  var _hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
  var ArrayIterator; // make our implementation private
  var noop = function () {};

  var OrigMap = globals.Map;
  var origMapDelete = OrigMap && OrigMap.prototype['delete'];
  var origMapGet = OrigMap && OrigMap.prototype.get;
  var origMapHas = OrigMap && OrigMap.prototype.has;
  var origMapSet = OrigMap && OrigMap.prototype.set;

  var Symbol = globals.Symbol || {};
  var symbolSpecies = Symbol.species || '@@species';

  var numberIsNaN = Number.isNaN || function isNaN(value) {
    // NaN !== NaN, but they are identical.
    // NaNs are the only non-reflexive value, i.e., if x !== x,
    // then x is NaN.
    // isNaN is broken: it converts its argument to number, so
    // isNaN('foo') => true
    return value !== value;
  };
  var numberIsFinite = Number.isFinite || function isFinite(value) {
    return typeof value === 'number' && globalIsFinite(value);
  };
  var _sign = isCallable(Math.sign) ? Math.sign : function sign(value) {
    var number = Number(value);
    if (number === 0) { return number; }
    if (numberIsNaN(number)) { return number; }
    return number < 0 ? -1 : 1;
  };

  // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js
  // can be replaced with require('is-arguments') if we ever use a build process instead
  var isStandardArguments = function isArguments(value) {
    return _toString(value) === '[object Arguments]';
  };
  var isLegacyArguments = function isArguments(value) {
    return value !== null &&
      typeof value === 'object' &&
      typeof value.length === 'number' &&
      value.length >= 0 &&
      _toString(value) !== '[object Array]' &&
      _toString(value.callee) === '[object Function]';
  };
  var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;

  var Type = {
    primitive: function (x) { return x === null || (typeof x !== 'function' && typeof x !== 'object'); },
    string: function (x) { return _toString(x) === '[object String]'; },
    regex: function (x) { return _toString(x) === '[object RegExp]'; },
    symbol: function (x) {
      return typeof globals.Symbol === 'function' && typeof x === 'symbol';
    }
  };

  var overrideNative = function overrideNative(object, property, replacement) {
    var original = object[property];
    defineProperty(object, property, replacement, true);
    Value.preserveToString(object[property], original);
  };

  // eslint-disable-next-line no-restricted-properties
  var hasSymbols = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' && Type.symbol(Symbol());

  // This is a private name in the es6 spec, equal to '[Symbol.iterator]'
  // we're going to use an arbitrary _-prefixed name to make our shims
  // work properly with each other, even though we don't have full Iterator
  // support.  That is, `Array.from(map.keys())` will work, but we don't
  // pretend to export a "real" Iterator interface.
  var $iterator$ = Type.symbol(Symbol.iterator) ? Symbol.iterator : '_es6-shim iterator_';
  // Firefox ships a partial implementation using the name @@iterator.
  // https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14
  // So use that name if we detect it.
  if (globals.Set && typeof new globals.Set()['@@iterator'] === 'function') {
    $iterator$ = '@@iterator';
  }

  // Reflect
  if (!globals.Reflect) {
    defineProperty(globals, 'Reflect', {}, true);
  }
  var Reflect = globals.Reflect;

  var $String = String;

  /* global document */
  var domAll = (typeof document === 'undefined' || !document) ? null : document.all;
  /* jshint eqnull:true */
  var isNullOrUndefined = domAll == null ? function isNullOrUndefined(x) {
    /* jshint eqnull:true */
    return x == null;
  } : function isNullOrUndefinedAndNotDocumentAll(x) {
    /* jshint eqnull:true */
    return x == null && x !== domAll;
  };

  var ES = {
    // http://www.ecma-international.org/ecma-262/6.0/#sec-call
    Call: function Call(F, V) {
      var args = arguments.length > 2 ? arguments[2] : [];
      if (!ES.IsCallable(F)) {
        throw new TypeError(F + ' is not a function');
      }
      return _apply(F, V, args);
    },

    RequireObjectCoercible: function (x, optMessage) {
      if (isNullOrUndefined(x)) {
        throw new TypeError(optMessage || 'Cannot call method on ' + x);
      }
      return x;
    },

    // This might miss the "(non-standard exotic and does not implement
    // [[Call]])" case from
    // http://www.ecma-international.org/ecma-262/6.0/#sec-typeof-operator-runtime-semantics-evaluation
    // but we can't find any evidence these objects exist in practice.
    // If we find some in the future, you could test `Object(x) === x`,
    // which is reliable according to
    // http://www.ecma-international.org/ecma-262/6.0/#sec-toobject
    // but is not well optimized by runtimes and creates an object
    // whenever it returns false, and thus is very slow.
    TypeIsObject: function (x) {
      if (x === void 0 || x === null || x === true || x === false) {
        return false;
      }
      return typeof x === 'function' || typeof x === 'object' || x === domAll;
    },

    ToObject: function (o, optMessage) {
      return Object(ES.RequireObjectCoercible(o, optMessage));
    },

    IsCallable: isCallable,

    IsConstructor: function (x) {
      // We can't tell callables from constructors in ES5
      return ES.IsCallable(x);
    },

    ToInt32: function (x) {
      return ES.ToNumber(x) >> 0;
    },

    ToUint32: function (x) {
      return ES.ToNumber(x) >>> 0;
    },

    ToNumber: function (value) {
      if (_toString(value) === '[object Symbol]') {
        throw new TypeError('Cannot convert a Symbol value to a number');
      }
      return +value;
    },

    ToInteger: function (value) {
      var number = ES.ToNumber(value);
      if (numberIsNaN(number)) { return 0; }
      if (number === 0 || !numberIsFinite(number)) { return number; }
      return (number > 0 ? 1 : -1) * _floor(_abs(number));
    },

    ToLength: function (value) {
      var len = ES.ToInteger(value);
      if (len <= 0) { return 0; } // includes converting -0 to +0
      if (len > Number.MAX_SAFE_INTEGER) { return Number.MAX_SAFE_INTEGER; }
      return len;
    },

    SameValue: function (a, b) {
      if (a === b) {
        // 0 === -0, but they are not identical.
        if (a === 0) { return 1 / a === 1 / b; }
        return true;
      }
      return numberIsNaN(a) && numberIsNaN(b);
    },

    SameValueZero: function (a, b) {
      // same as SameValue except for SameValueZero(+0, -0) == true
      return (a === b) || (numberIsNaN(a) && numberIsNaN(b));
    },

    IsIterable: function (o) {
      return ES.TypeIsObject(o) && (typeof o[$iterator$] !== 'undefined' || isArguments(o));
    },

    GetIterator: function (o) {
      if (isArguments(o)) {
        // special case support for `arguments`
        return new ArrayIterator(o, 'value');
      }
      var itFn = ES.GetMethod(o, $iterator$);
      if (!ES.IsCallable(itFn)) {
        // Better diagnostics if itFn is null or undefined
        throw new TypeError('value is not an iterable');
      }
      var it = ES.Call(itFn, o);
      if (!ES.TypeIsObject(it)) {
        throw new TypeError('bad iterator');
      }
      return it;
    },

    GetMethod: function (o, p) {
      var func = ES.ToObject(o)[p];
      if (isNullOrUndefined(func)) {
        return void 0;
      }
      if (!ES.IsCallable(func)) {
        throw new TypeError('Method not callable: ' + p);
      }
      return func;
    },

    IteratorComplete: function (iterResult) {
      return !!iterResult.done;
    },

    IteratorClose: function (iterator, completionIsThrow) {
      var returnMethod = ES.GetMethod(iterator, 'return');
      if (returnMethod === void 0) {
        return;
      }
      var innerResult, innerException;
      try {
        innerResult = ES.Call(returnMethod, iterator);
      } catch (e) {
        innerException = e;
      }
      if (completionIsThrow) {
        return;
      }
      if (innerException) {
        throw innerException;
      }
      if (!ES.TypeIsObject(innerResult)) {
        throw new TypeError("Iterator's return method returned a non-object.");
      }
    },

    IteratorNext: function (it) {
      var result = arguments.length > 1 ? it.next(arguments[1]) : it.next();
      if (!ES.TypeIsObject(result)) {
        throw new TypeError('bad iterator');
      }
      return result;
    },

    IteratorStep: function (it) {
      var result = ES.IteratorNext(it);
      var done = ES.IteratorComplete(result);
      return done ? false : result;
    },

    Construct: function (C, args, newTarget, isES6internal) {
      var target = typeof newTarget === 'undefined' ? C : newTarget;

      if (!isES6internal && Reflect.construct) {
        // Try to use Reflect.construct if available
        return Reflect.construct(C, args, target);
      }
      // OK, we have to fake it.  This will only work if the
      // C.[[ConstructorKind]] == "base" -- but that's the only
      // kind we can make in ES5 code anyway.

      // OrdinaryCreateFromConstructor(target, "%ObjectPrototype%")
      var proto = target.prototype;
      if (!ES.TypeIsObject(proto)) {
        proto = Object.prototype;
      }
      var obj = create(proto);
      // Call the constructor.
      var result = ES.Call(C, obj, args);
      return ES.TypeIsObject(result) ? result : obj;
    },

    SpeciesConstructor: function (O, defaultConstructor) {
      var C = O.constructor;
      if (C === void 0) {
        return defaultConstructor;
      }
      if (!ES.TypeIsObject(C)) {
        throw new TypeError('Bad constructor');
      }
      var S = C[symbolSpecies];
      if (isNullOrUndefined(S)) {
        return defaultConstructor;
      }
      if (!ES.IsConstructor(S)) {
        throw new TypeError('Bad @@species');
      }
      return S;
    },

    CreateHTML: function (string, tag, attribute, value) {
      var S = ES.ToString(string);
      var p1 = '<' + tag;
      if (attribute !== '') {
        var V = ES.ToString(value);
        var escapedV = V.replace(/"/g, '&quot;');
        p1 += ' ' + attribute + '="' + escapedV + '"';
      }
      var p2 = p1 + '>';
      var p3 = p2 + S;
      return p3 + '</' + tag + '>';
    },

    IsRegExp: function IsRegExp(argument) {
      if (!ES.TypeIsObject(argument)) {
        return false;
      }
      var isRegExp = argument[Symbol.match];
      if (typeof isRegExp !== 'undefined') {
        return !!isRegExp;
      }
      return Type.regex(argument);
    },

    ToString: function ToString(string) {
      return $String(string);
    }
  };

  // Well-known Symbol shims
  if (supportsDescriptors && hasSymbols) {
    var defineWellKnownSymbol = function defineWellKnownSymbol(name) {
      if (Type.symbol(Symbol[name])) {
        return Symbol[name];
      }
      // eslint-disable-next-line no-restricted-properties
      var sym = Symbol['for']('Symbol.' + name);
      Object.defineProperty(Symbol, name, {
        configurable: false,
        enumerable: false,
        writable: false,
        value: sym
      });
      return sym;
    };
    if (!Type.symbol(Symbol.search)) {
      var symbolSearch = defineWellKnownSymbol('search');
      var originalSearch = String.prototype.search;
      defineProperty(RegExp.prototype, symbolSearch, function search(string) {
        return ES.Call(originalSearch, string, [this]);
      });
      var searchShim = function search(regexp) {
        var O = ES.RequireObjectCoercible(this);
        if (!isNullOrUndefined(regexp)) {
          var searcher = ES.GetMethod(regexp, symbolSearch);
          if (typeof searcher !== 'undefined') {
            return ES.Call(searcher, regexp, [O]);
          }
        }
        return ES.Call(originalSearch, O, [ES.ToString(regexp)]);
      };
      overrideNative(String.prototype, 'search', searchShim);
    }
    if (!Type.symbol(Symbol.replace)) {
      var symbolReplace = defineWellKnownSymbol('replace');
      var originalReplace = String.prototype.replace;
      defineProperty(RegExp.prototype, symbolReplace, function replace(string, replaceValue) {
        return ES.Call(originalReplace, string, [this, replaceValue]);
      });
      var replaceShim = function replace(searchValue, replaceValue) {
        var O = ES.RequireObjectCoercible(this);
        if (!isNullOrUndefined(searchValue)) {
          var replacer = ES.GetMethod(searchValue, symbolReplace);
          if (typeof replacer !== 'undefined') {
            return ES.Call(replacer, searchValue, [O, replaceValue]);
          }
        }
        return ES.Call(originalReplace, O, [ES.ToString(searchValue), replaceValue]);
      };
      overrideNative(String.prototype, 'replace', replaceShim);
    }
    if (!Type.symbol(Symbol.split)) {
      var symbolSplit = defineWellKnownSymbol('split');
      var originalSplit = String.prototype.split;
      defineProperty(RegExp.prototype, symbolSplit, function split(string, limit) {
        return ES.Call(originalSplit, string, [this, limit]);
      });
      var splitShim = function split(separator, limit) {
        var O = ES.RequireObjectCoercible(this);
        if (!isNullOrUndefined(separator)) {
          var splitter = ES.GetMethod(separator, symbolSplit);
          if (typeof splitter !== 'undefined') {
            return ES.Call(splitter, separator, [O, limit]);
          }
        }
        return ES.Call(originalSplit, O, [ES.ToString(separator), limit]);
      };
      overrideNative(String.prototype, 'split', splitShim);
    }
    var symbolMatchExists = Type.symbol(Symbol.match);
    var stringMatchIgnoresSymbolMatch = symbolMatchExists && (function () {
      // Firefox 41, through Nightly 45 has Symbol.match, but String#match ignores it.
      // Firefox 40 and below have Symbol.match but String#match works fine.
      var o = {};
      o[Symbol.match] = function () { return 42; };
      return 'a'.match(o) !== 42;
    }());
    if (!symbolMatchExists || stringMatchIgnoresSymbolMatch) {
      var symbolMatch = defineWellKnownSymbol('match');

      var originalMatch = String.prototype.match;
      defineProperty(RegExp.prototype, symbolMatch, function match(string) {
        return ES.Call(originalMatch, string, [this]);
      });

      var matchShim = function match(regexp) {
        var O = ES.RequireObjectCoercible(this);
        if (!isNullOrUndefined(regexp)) {
          var matcher = ES.GetMethod(regexp, symbolMatch);
          if (typeof matcher !== 'undefined') {
            return ES.Call(matcher, regexp, [O]);
          }
        }
        return ES.Call(originalMatch, O, [ES.ToString(regexp)]);
      };
      overrideNative(String.prototype, 'match', matchShim);
    }
  }

  var wrapConstructor = function wrapConstructor(original, replacement, keysToSkip) {
    Value.preserveToString(replacement, original);
    if (Object.setPrototypeOf) {
      // sets up proper prototype chain where possible
      Object.setPrototypeOf(original, replacement);
    }
    if (supportsDescriptors) {
      _forEach(Object.getOwnPropertyNames(original), function (key) {
        if (key in noop || keysToSkip[key]) { return; }
        Value.proxy(original, key, replacement);
      });
    } else {
      _forEach(Object.keys(original), function (key) {
        if (key in noop || keysToSkip[key]) { return; }
        replacement[key] = original[key];
      });
    }
    replacement.prototype = original.prototype;
    Value.redefine(original.prototype, 'constructor', replacement);
  };

  var defaultSpeciesGetter = function () { return this; };
  var addDefaultSpecies = function (C) {
    if (supportsDescriptors && !_hasOwnProperty(C, symbolSpecies)) {
      Value.getter(C, symbolSpecies, defaultSpeciesGetter);
    }
  };

  var addIterator = function (prototype, impl) {
    var implementation = impl || function iterator() { return this; };
    defineProperty(prototype, $iterator$, implementation);
    if (!prototype[$iterator$] && Type.symbol($iterator$)) {
      // implementations are buggy when $iterator$ is a Symbol
      prototype[$iterator$] = implementation;
    }
  };

  var createDataProperty = function createDataProperty(object, name, value) {
    if (supportsDescriptors) {
      Object.defineProperty(object, name, {
        configurable: true,
        enumerable: true,
        writable: true,
        value: value
      });
    } else {
      object[name] = value;
    }
  };
  var createDataPropertyOrThrow = function createDataPropertyOrThrow(object, name, value) {
    createDataProperty(object, name, value);
    if (!ES.SameValue(object[name], value)) {
      throw new TypeError('property is nonconfigurable');
    }
  };

  var emulateES6construct = function (o, defaultNewTarget, defaultProto, slots) {
    // This is an es5 approximation to es6 construct semantics.  in es6,
    // 'new Foo' invokes Foo.[[Construct]] which (for almost all objects)
    // just sets the internal variable NewTarget (in es6 syntax `new.target`)
    // to Foo and then returns Foo().

    // Many ES6 object then have constructors of the form:
    // 1. If NewTarget is undefined, throw a TypeError exception
    // 2. Let xxx by OrdinaryCreateFromConstructor(NewTarget, yyy, zzz)

    // So we're going to emulate those first two steps.
    if (!ES.TypeIsObject(o)) {
      throw new TypeError('Constructor requires `new`: ' + defaultNewTarget.name);
    }
    var proto = defaultNewTarget.prototype;
    if (!ES.TypeIsObject(proto)) {
      proto = defaultProto;
    }
    var obj = create(proto);
    for (var name in slots) {
      if (_hasOwnProperty(slots, name)) {
        var value = slots[name];
        defineProperty(obj, name, value, true);
      }
    }
    return obj;
  };

  // Firefox 31 reports this function's length as 0
  // https://bugzilla.mozilla.org/show_bug.cgi?id=1062484
  if (String.fromCodePoint && String.fromCodePoint.length !== 1) {
    var originalFromCodePoint = String.fromCodePoint;
    overrideNative(String, 'fromCodePoint', function fromCodePoint(codePoints) {
      return ES.Call(originalFromCodePoint, this, arguments);
    });
  }

  var StringShims = {
    fromCodePoint: function fromCodePoint(codePoints) {
      var result = [];
      var next;
      for (var i = 0, length = arguments.length; i < length; i++) {
        next = Number(arguments[i]);
        if (!ES.SameValue(next, ES.ToInteger(next)) || next < 0 || next > 0x10FFFF) {
          throw new RangeError('Invalid code point ' + next);
        }

        if (next < 0x10000) {
          _push(result, String.fromCharCode(next));
        } else {
          next -= 0x10000;
          _push(result, String.fromCharCode((next >> 10) + 0xD800));
          _push(result, String.fromCharCode((next % 0x400) + 0xDC00));
        }
      }
      return result.join('');
    },

    raw: function raw(callSite) {
      var cooked = ES.ToObject(callSite, 'bad callSite');
      var rawString = ES.ToObject(cooked.raw, 'bad raw value');
      var len = rawString.length;
      var literalsegments = ES.ToLength(len);
      if (literalsegments <= 0) {
        return '';
      }

      var stringElements = [];
      var nextIndex = 0;
      var nextKey, next, nextSeg, nextSub;
      while (nextIndex < literalsegments) {
        nextKey = ES.ToString(nextIndex);
        nextSeg = ES.ToString(rawString[nextKey]);
        _push(stringElements, nextSeg);
        if (nextIndex + 1 >= literalsegments) {
          break;
        }
        next = nextIndex + 1 < arguments.length ? arguments[nextIndex + 1] : '';
        nextSub = ES.ToString(next);
        _push(stringElements, nextSub);
        nextIndex += 1;
      }
      return stringElements.join('');
    }
  };
  if (String.raw && String.raw({ raw: { 0: 'x', 1: 'y', length: 2 } }) !== 'xy') {
    // IE 11 TP has a broken String.raw implementation
    overrideNative(String, 'raw', StringShims.raw);
  }
  defineProperties(String, StringShims);

  // Fast repeat, uses the `Exponentiation by squaring` algorithm.
  // Perf: http://jsperf.com/string-repeat2/2
  var stringRepeat = function repeat(s, times) {
    if (times < 1) { return ''; }
    if (times % 2) { return repeat(s, times - 1) + s; }
    var half = repeat(s, times / 2);
    return half + half;
  };
  var stringMaxLength = Infinity;

  var StringPrototypeShims = {
    repeat: function repeat(times) {
      var thisStr = ES.ToString(ES.RequireObjectCoercible(this));
      var numTimes = ES.ToInteger(times);
      if (numTimes < 0 || numTimes >= stringMaxLength) {
        throw new RangeError('repeat count must be less than infinity and not overflow maximum string size');
      }
      return stringRepeat(thisStr, numTimes);
    },

    startsWith: function startsWith(searchString) {
      var S = ES.ToString(ES.RequireObjectCoercible(this));
      if (ES.IsRegExp(searchString)) {
        throw new TypeError('Cannot call method "startsWith" with a regex');
      }
      var searchStr = ES.ToString(searchString);
      var position;
      if (arguments.length > 1) {
        position = arguments[1];
      }
      var start = _max(ES.ToInteger(position), 0);
      return _strSlice(S, start, start + searchStr.length) === searchStr;
    },

    endsWith: function endsWith(searchString) {
      var S = ES.ToString(ES.RequireObjectCoercible(this));
      if (ES.IsRegExp(searchString)) {
        throw new TypeError('Cannot call method "endsWith" with a regex');
      }
      var searchStr = ES.ToString(searchString);
      var len = S.length;
      var endPosition;
      if (arguments.length > 1) {
        endPosition = arguments[1];
      }
      var pos = typeof endPosition === 'undefined' ? len : ES.ToInteger(endPosition);
      var end = _min(_max(pos, 0), len);
      return _strSlice(S, end - searchStr.length, end) === searchStr;
    },

    includes: function includes(searchString) {
      if (ES.IsRegExp(searchString)) {
        throw new TypeError('"includes" does not accept a RegExp');
      }
      var searchStr = ES.ToString(searchString);
      var position;
      if (arguments.length > 1) {
        position = arguments[1];
      }
      // Somehow this trick makes method 100% compat with the spec.
      return _indexOf(this, searchStr, position) !== -1;
    },

    codePointAt: function codePointAt(pos) {
      var thisStr = ES.ToString(ES.RequireObjectCoercible(this));
      var position = ES.ToInteger(pos);
      var length = thisStr.length;
      if (position >= 0 && position < length) {
        var first = thisStr.charCodeAt(position);
        var isEnd = position + 1 === length;
        if (first < 0xD800 || first > 0xDBFF || isEnd) { return first; }
        var second = thisStr.charCodeAt(position + 1);
        if (second < 0xDC00 || second > 0xDFFF) { return first; }
        return ((first - 0xD800) * 1024) + (second - 0xDC00) + 0x10000;
      }
    }
  };
  if (String.prototype.includes && 'a'.includes('a', Infinity) !== false) {
    overrideNative(String.prototype, 'includes', StringPrototypeShims.includes);
  }

  if (String.prototype.startsWith && String.prototype.endsWith) {
    var startsWithRejectsRegex = throwsError(function () {
      /* throws if spec-compliant */
      '/a/'.startsWith(/a/);
    });
    var startsWithHandlesInfinity = valueOrFalseIfThrows(function () {
      return 'abc'.startsWith('a', Infinity) === false;
    });
    if (!startsWithRejectsRegex || !startsWithHandlesInfinity) {
      // Firefox (< 37?) and IE 11 TP have a noncompliant startsWith implementation
      overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith);
      overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith);
    }
  }
  if (hasSymbols) {
    var startsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () {
      var re = /a/;
      re[Symbol.match] = false;
      return '/a/'.startsWith(re);
    });
    if (!startsWithSupportsSymbolMatch) {
      overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith);
    }
    var endsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () {
      var re = /a/;
      re[Symbol.match] = false;
      return '/a/'.endsWith(re);
    });
    if (!endsWithSupportsSymbolMatch) {
      overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith);
    }
    var includesSupportsSymbolMatch = valueOrFalseIfThrows(function () {
      var re = /a/;
      re[Symbol.match] = false;
      return '/a/'.includes(re);
    });
    if (!includesSupportsSymbolMatch) {
      overrideNative(String.prototype, 'includes', StringPrototypeShims.includes);
    }
  }

  defineProperties(String.prototype, StringPrototypeShims);

  // whitespace from: http://es5.github.io/#x15.5.4.20
  // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
  var ws = [
    '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003',
    '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028',
    '\u2029\uFEFF'
  ].join('');
  var trimRegexp = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
  var trimShim = function trim() {
    return ES.ToString(ES.RequireObjectCoercible(this)).replace(trimRegexp, '');
  };
  var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
  var nonWSregex = new RegExp('[' + nonWS + ']', 'g');
  var isBadHexRegex = /^[-+]0x[0-9a-f]+$/i;
  var hasStringTrimBug = nonWS.trim().length !== nonWS.length;
  defineProperty(String.prototype, 'trim', trimShim, hasStringTrimBug);

  // Given an argument x, it will return an IteratorResult object,
  // with value set to x and done to false.
  // Given no arguments, it will return an iterator completion object.
  var iteratorResult = function (x) {
    return { value: x, done: arguments.length === 0 };
  };

  // see http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype-@@iterator
  var StringIterator = function (s) {
    ES.RequireObjectCoercible(s);
    this._s = ES.ToString(s);
    this._i = 0;
  };
  StringIterator.prototype.next = function () {
    var s = this._s;
    var i = this._i;
    if (typeof s === 'undefined' || i >= s.length) {
      this._s = void 0;
      return iteratorResult();
    }
    var first = s.charCodeAt(i);
    var second, len;
    if (first < 0xD800 || first > 0xDBFF || (i + 1) === s.length) {
      len = 1;
    } else {
      second = s.charCodeAt(i + 1);
      len = (second < 0xDC00 || second > 0xDFFF) ? 1 : 2;
    }
    this._i = i + len;
    return iteratorResult(s.substr(i, len));
  };
  addIterator(StringIterator.prototype);
  addIterator(String.prototype, function () {
    return new StringIterator(this);
  });

  var ArrayShims = {
    from: function from(items) {
      var C = this;
      var mapFn;
      if (arguments.length > 1) {
        mapFn = arguments[1];
      }
      var mapping, T;
      if (typeof mapFn === 'undefined') {
        mapping = false;
      } else {
        if (!ES.IsCallable(mapFn)) {
          throw new TypeError('Array.from: when provided, the second argument must be a function');
        }
        if (arguments.length > 2) {
          T = arguments[2];
        }
        mapping = true;
      }

      // Note that that Arrays will use ArrayIterator:
      // https://bugs.ecmascript.org/show_bug.cgi?id=2416
      var usingIterator = typeof (isArguments(items) || ES.GetMethod(items, $iterator$)) !== 'undefined';

      var length, result, i;
      if (usingIterator) {
        result = ES.IsConstructor(C) ? Object(new C()) : [];
        var iterator = ES.GetIterator(items);
        var next, nextValue;

        i = 0;
        while (true) {
          next = ES.IteratorStep(iterator);
          if (next === false) {
            break;
          }
          nextValue = next.value;
          try {
            if (mapping) {
              nextValue = typeof T === 'undefined' ? mapFn(nextValue, i) : _call(mapFn, T, nextValue, i);
            }
            result[i] = nextValue;
          } catch (e) {
            ES.IteratorClose(iterator, true);
            throw e;
          }
          i += 1;
        }
        length = i;
      } else {
        var arrayLike = ES.ToObject(items);
        length = ES.ToLength(arrayLike.length);
        result = ES.IsConstructor(C) ? Object(new C(length)) : new Array(length);
        var value;
        for (i = 0; i < length; ++i) {
          value = arrayLike[i];
          if (mapping) {
            value = typeof T === 'undefined' ? mapFn(value, i) : _call(mapFn, T, value, i);
          }
          createDataPropertyOrThrow(result, i, value);
        }
      }

      result.length = length;
      return result;
    },

    of: function of() {
      var len = arguments.length;
      var C = this;
      var A = isArray(C) || !ES.IsCallable(C) ? new Array(len) : ES.Construct(C, [len]);
      for (var k = 0; k < len; ++k) {
        createDataPropertyOrThrow(A, k, arguments[k]);
      }
      A.length = len;
      return A;
    }
  };
  defineProperties(Array, ArrayShims);
  addDefaultSpecies(Array);

  // Our ArrayIterator is private; see
  // https://github.com/paulmillr/es6-shim/issues/252
  ArrayIterator = function (array, kind) {
    this.i = 0;
    this.array = array;
    this.kind = kind;
  };

  defineProperties(ArrayIterator.prototype, {
    next: function () {
      var i = this.i;
      var array = this.array;
      if (!(this instanceof ArrayIterator)) {
        throw new TypeError('Not an ArrayIterator');
      }
      if (typeof array !== 'undefined') {
        var len = ES.ToLength(array.length);
        for (; i < len; i++) {
          var kind = this.kind;
          var retval;
          if (kind === 'key') {
            retval = i;
          } else if (kind === 'value') {
            retval = array[i];
          } else if (kind === 'entry') {
            retval = [i, array[i]];
          }
          this.i = i + 1;
          return iteratorResult(retval);
        }
      }
      this.array = void 0;
      return iteratorResult();
    }
  });
  addIterator(ArrayIterator.prototype);

/*
  var orderKeys = function orderKeys(a, b) {
    var aNumeric = String(ES.ToInteger(a)) === a;
    var bNumeric = String(ES.ToInteger(b)) === b;
    if (aNumeric && bNumeric) {
      return b - a;
    } else if (aNumeric && !bNumeric) {
      return -1;
    } else if (!aNumeric && bNumeric) {
      return 1;
    } else {
      return a.localeCompare(b);
    }
  };

  var getAllKeys = function getAllKeys(object) {
    var ownKeys = [];
    var keys = [];

    for (var key in object) {
      _push(_hasOwnProperty(object, key) ? ownKeys : keys, key);
    }
    _sort(ownKeys, orderKeys);
    _sort(keys, orderKeys);

    return _concat(ownKeys, keys);
  };
  */

  // note: this is positioned here because it depends on ArrayIterator
  var arrayOfSupportsSubclassing = Array.of === ArrayShims.of || (function () {
    // Detects a bug in Webkit nightly r181886
    var Foo = function Foo(len) { this.length = len; };
    Foo.prototype = [];
    var fooArr = Array.of.apply(Foo, [1, 2]);
    return fooArr instanceof Foo && fooArr.length === 2;
  }());
  if (!arrayOfSupportsSubclassing) {
    overrideNative(Array, 'of', ArrayShims.of);
  }

  var ArrayPrototypeShims = {
    copyWithin: function copyWithin(target, start) {
      var o = ES.ToObject(this);
      var len = ES.ToLength(o.length);
      var relativeTarget = ES.ToInteger(target);
      var relativeStart = ES.ToInteger(start);
      var to = relativeTarget < 0 ? _max(len + relativeTarget, 0) : _min(relativeTarget, len);
      var from = relativeStart < 0 ? _max(len + relativeStart, 0) : _min(relativeStart, len);
      var end;
      if (arguments.length > 2) {
        end = arguments[2];
      }
      var relativeEnd = typeof end === 'undefined' ? len : ES.ToInteger(end);
      var finalItem = relativeEnd < 0 ? _max(len + relativeEnd, 0) : _min(relativeEnd, len);
      var count = _min(finalItem - from, len - to);
      var direction = 1;
      if (from < to && to < (from + count)) {
        direction = -1;
        from += count - 1;
        to += count - 1;
      }
      while (count > 0) {
        if (from in o) {
          o[to] = o[from];
        } else {
          delete o[to];
        }
        from += direction;
        to += direction;
        count -= 1;
      }
      return o;
    },

    fill: function fill(value) {
      var start;
      if (arguments.length > 1) {
        start = arguments[1];
      }
      var end;
      if (arguments.length > 2) {
        end = arguments[2];
      }
      var O = ES.ToObject(this);
      var len = ES.ToLength(O.length);
      start = ES.ToInteger(typeof start === 'undefined' ? 0 : start);
      end = ES.ToInteger(typeof end === 'undefined' ? len : end);

      var relativeStart = start < 0 ? _max(len + start, 0) : _min(start, len);
      var relativeEnd = end < 0 ? len + end : end;

      for (var i = relativeStart; i < len && i < relativeEnd; ++i) {
        O[i] = value;
      }
      return O;
    },

    find: function find(predicate) {
      var list = ES.ToObject(this);
      var length = ES.ToLength(list.length);
      if (!ES.IsCallable(predicate)) {
        throw new TypeError('Array#find: predicate must be a function');
      }
      var thisArg = arguments.length > 1 ? arguments[1] : null;
      for (var i = 0, value; i < length; i++) {
        value = list[i];
        if (thisArg) {
          if (_call(predicate, thisArg, value, i, list)) {
            return value;
          }
        } else if (predicate(value, i, list)) {
          return value;
        }
      }
    },

    findIndex: function findIndex(predicate) {
      var list = ES.ToObject(this);
      var length = ES.ToLength(list.length);
      if (!ES.IsCallable(predicate)) {
        throw new TypeError('Array#findIndex: predicate must be a function');
      }
      var thisArg = arguments.length > 1 ? arguments[1] : null;
      for (var i = 0; i < length; i++) {
        if (thisArg) {
          if (_call(predicate, thisArg, list[i], i, list)) {
            return i;
          }
        } else if (predicate(list[i], i, list)) {
          return i;
        }
      }
      return -1;
    },

    keys: function keys() {
      return new ArrayIterator(this, 'key');
    },

    values: function values() {
      return new ArrayIterator(this, 'value');
    },

    entries: function entries() {
      return new ArrayIterator(this, 'entry');
    }
  };
  // Safari 7.1 defines Array#keys and Array#entries natively,
  // but the resulting ArrayIterator objects don't have a "next" method.
  if (Array.prototype.keys && !ES.IsCallable([1].keys().next)) {
    delete Array.prototype.keys;
  }
  if (Array.prototype.entries && !ES.IsCallable([1].entries().next)) {
    delete Array.prototype.entries;
  }

  // Chrome 38 defines Array#keys and Array#entries, and Array#@@iterator, but not Array#values
  if (Array.prototype.keys && Array.prototype.entries && !Array.prototype.values && Array.prototype[$iterator$]) {
    defineProperties(Array.prototype, {
      values: Array.prototype[$iterator$]
    });
    if (Type.symbol(Symbol.unscopables)) {
      Array.prototype[Symbol.unscopables].values = true;
    }
  }
  // Chrome 40 defines Array#values with the incorrect name, although Array#{keys,entries} have the correct name
  if (functionsHaveNames && Array.prototype.values && Array.prototype.values.name !== 'values') {
    var originalArrayPrototypeValues = Array.prototype.values;
    overrideNative(Array.prototype, 'values', function values() { return ES.Call(originalArrayPrototypeValues, this, arguments); });
    defineProperty(Array.prototype, $iterator$, Array.prototype.values, true);
  }
  defineProperties(Array.prototype, ArrayPrototypeShims);

  if (1 / [true].indexOf(true, -0) < 0) {
    // indexOf when given a position arg of -0 should return +0.
    // https://github.com/tc39/ecma262/pull/316
    defineProperty(Array.prototype, 'indexOf', function indexOf(searchElement) {
      var value = _arrayIndexOfApply(this, arguments);
      if (value === 0 && (1 / value) < 0) {
        return 0;
      }
      return value;
    }, true);
  }

  addIterator(Array.prototype, function () { return this.values(); });
  // Chrome defines keys/values/entries on Array, but doesn't give us
  // any way to identify its iterator.  So add our own shimmed field.
  if (Object.getPrototypeOf) {
    addIterator(Object.getPrototypeOf([].values()));
  }

  // note: this is positioned here because it relies on Array#entries
  var arrayFromSwallowsNegativeLengths = (function () {
    // Detects a Firefox bug in v32
    // https://bugzilla.mozilla.org/show_bug.cgi?id=1063993
    return valueOrFalseIfThrows(function () {
      return Array.from({ length: -1 }).length === 0;
    });
  }());
  var arrayFromHandlesIterables = (function () {
    // Detects a bug in Webkit nightly r181886
    var arr = Array.from([0].entries());
    return arr.length === 1 && isArray(arr[0]) && arr[0][0] === 0 && arr[0][1] === 0;
  }());
  if (!arrayFromSwallowsNegativeLengths || !arrayFromHandlesIterables) {
    overrideNative(Array, 'from', ArrayShims.from);
  }
  var arrayFromHandlesUndefinedMapFunction = (function () {
    // Microsoft Edge v0.11 throws if the mapFn argument is *provided* but undefined,
    // but the spec doesn't care if it's provided or not - undefined doesn't throw.
    return valueOrFalseIfThrows(function () {
      return Array.from([0], void 0);
    });
  }());
  if (!arrayFromHandlesUndefinedMapFunction) {
    var origArrayFrom = Array.from;
    overrideNative(Array, 'from', function from(items) {
      if (arguments.length > 1 && typeof arguments[1] !== 'undefined') {
        return ES.Call(origArrayFrom, this, arguments);
      } else {
        return _call(origArrayFrom, this, items);
      }
    });
  }

  var int32sAsOne = -(Math.pow(2, 32) - 1);
  var toLengthsCorrectly = function (method, reversed) {
    var obj = { length: int32sAsOne };
    obj[reversed ? (obj.length >>> 0) - 1 : 0] = true;
    return valueOrFalseIfThrows(function () {
      _call(method, obj, function () {
        // note: in nonconforming browsers, this will be called
        // -1 >>> 0 times, which is 4294967295, so the throw matters.
        throw new RangeError('should not reach here');
      }, []);
      return true;
    });
  };
  if (!toLengthsCorrectly(Array.prototype.forEach)) {
    var originalForEach = Array.prototype.forEach;
    overrideNative(Array.prototype, 'forEach', function forEach(callbackFn) {
      return ES.Call(originalForEach, this.length >= 0 ? this : [], arguments);
    }, true);
  }
  if (!toLengthsCorrectly(Array.prototype.map)) {
    var originalMap = Array.prototype.map;
    overrideNative(Array.prototype, 'map', function map(callbackFn) {
      return ES.Call(originalMap, this.length >= 0 ? this : [], arguments);
    }, true);
  }
  if (!toLengthsCorrectly(Array.prototype.filter)) {
    var originalFilter = Array.prototype.filter;
    overrideNative(Array.prototype, 'filter', function filter(callbackFn) {
      return ES.Call(originalFilter, this.length >= 0 ? this : [], arguments);
    }, true);
  }
  if (!toLengthsCorrectly(Array.prototype.some)) {
    var originalSome = Array.prototype.some;
    overrideNative(Array.prototype, 'some', function some(callbackFn) {
      return ES.Call(originalSome, this.length >= 0 ? this : [], arguments);
    }, true);
  }
  if (!toLengthsCorrectly(Array.prototype.every)) {
    var originalEvery = Array.prototype.every;
    overrideNative(Array.prototype, 'every', function every(callbackFn) {
      return ES.Call(originalEvery, this.length >= 0 ? this : [], arguments);
    }, true);
  }
  if (!toLengthsCorrectly(Array.prototype.reduce)) {
    var originalReduce = Array.prototype.reduce;
    overrideNative(Array.prototype, 'reduce', function reduce(callbackFn) {
      return ES.Call(originalReduce, this.length >= 0 ? this : [], arguments);
    }, true);
  }
  if (!toLengthsCorrectly(Array.prototype.reduceRight, true)) {
    var originalReduceRight = Array.prototype.reduceRight;
    overrideNative(Array.prototype, 'reduceRight', function reduceRight(callbackFn) {
      return ES.Call(originalReduceRight, this.length >= 0 ? this : [], arguments);
    }, true);
  }

  var lacksOctalSupport = Number('0o10') !== 8;
  var lacksBinarySupport = Number('0b10') !== 2;
  var trimsNonWhitespace = _some(nonWS, function (c) {
    return Number(c + 0 + c) === 0;
  });
  if (lacksOctalSupport || lacksBinarySupport || trimsNonWhitespace) {
    var OrigNumber = Number;
    var binaryRegex = /^0b[01]+$/i;
    var octalRegex = /^0o[0-7]+$/i;
    // Note that in IE 8, RegExp.prototype.test doesn't seem to exist: ie, "test" is an own property of regexes. wtf.
    var isBinary = binaryRegex.test.bind(binaryRegex);
    var isOctal = octalRegex.test.bind(octalRegex);
    var toPrimitive = function (O) { // need to replace this with `es-to-primitive/es6`
      var result;
      if (typeof O.valueOf === 'function') {
        result = O.valueOf();
        if (Type.primitive(result)) {
          return result;
        }
      }
      if (typeof O.toString === 'function') {
        result = O.toString();
        if (Type.primitive(result)) {
          return result;
        }
      }
      throw new TypeError('No default value');
    };
    var hasNonWS = nonWSregex.test.bind(nonWSregex);
    var isBadHex = isBadHexRegex.test.bind(isBadHexRegex);
    var NumberShim = (function () {
      // this is wrapped in an IIFE because of IE 6-8's wacky scoping issues with named function expressions.
      var NumberShim = function Number(value) {
        var primValue;
        if (arguments.length > 0) {
          primValue = Type.primitive(value) ? value : toPrimitive(value, 'number');
        } else {
          primValue = 0;
        }
        if (typeof primValue === 'string') {
          primValue = ES.Call(trimShim, primValue);
          if (isBinary(primValue)) {
            primValue = parseInt(_strSlice(primValue, 2), 2);
          } else if (isOctal(primValue)) {
            primValue = parseInt(_strSlice(primValue, 2), 8);
          } else if (hasNonWS(primValue) || isBadHex(primValue)) {
            primValue = NaN;
          }
        }
        var receiver = this;
        var valueOfSucceeds = valueOrFalseIfThrows(function () {
          OrigNumber.prototype.valueOf.call(receiver);
          return true;
        });
        if (receiver instanceof NumberShim && !valueOfSucceeds) {
          return new OrigNumber(primValue);
        }
        /* jshint newcap: false */
        return OrigNumber(primValue);
        /* jshint newcap: true */
      };
      return NumberShim;
    }());
    wrapConstructor(OrigNumber, NumberShim, {});
    // this is necessary for ES3 browsers, where these properties are non-enumerable.
    defineProperties(NumberShim, {
      NaN: OrigNumber.NaN,
      MAX_VALUE: OrigNumber.MAX_VALUE,
      MIN_VALUE: OrigNumber.MIN_VALUE,
      NEGATIVE_INFINITY: OrigNumber.NEGATIVE_INFINITY,
      POSITIVE_INFINITY: OrigNumber.POSITIVE_INFINITY
    });
    /* globals Number: true */
    /* eslint-disable no-undef, no-global-assign */
    /* jshint -W020 */
    Number = NumberShim;
    Value.redefine(globals, 'Number', NumberShim);
    /* jshint +W020 */
    /* eslint-enable no-undef, no-global-assign */
    /* globals Number: false */
  }

  var maxSafeInteger = Math.pow(2, 53) - 1;
  defineProperties(Number, {
    MAX_SAFE_INTEGER: maxSafeInteger,
    MIN_SAFE_INTEGER: -maxSafeInteger,
    EPSILON: 2.220446049250313e-16,

    parseInt: globals.parseInt,
    parseFloat: globals.parseFloat,

    isFinite: numberIsFinite,

    isInteger: function isInteger(value) {
      return numberIsFinite(value) && ES.ToInteger(value) === value;
    },

    isSafeInteger: function isSafeInteger(value) {
      return Number.isInteger(value) && _abs(value) <= Number.MAX_SAFE_INTEGER;
    },

    isNaN: numberIsNaN
  });
  // Firefox 37 has a conforming Number.parseInt, but it's not === to the global parseInt (fixed in v40)
  defineProperty(Number, 'parseInt', globals.parseInt, Number.parseInt !== globals.parseInt);

  // Work around bugs in Array#find and Array#findIndex -- early
  // implementations skipped holes in sparse arrays. (Note that the
  // implementations of find/findIndex indirectly use shimmed
  // methods of Number, so this test has to happen down here.)
  /*jshint elision: true */
  /* eslint-disable no-sparse-arrays */
  if ([, 1].find(function () { return true; }) === 1) {
    overrideNative(Array.prototype, 'find', ArrayPrototypeShims.find);
  }
  if ([, 1].findIndex(function () { return true; }) !== 0) {
    overrideNative(Array.prototype, 'findIndex', ArrayPrototypeShims.findIndex);
  }
  /* eslint-enable no-sparse-arrays */
  /*jshint elision: false */

  var isEnumerableOn = Function.bind.call(Function.bind, Object.prototype.propertyIsEnumerable);
  var ensureEnumerable = function ensureEnumerable(obj, prop) {
    if (supportsDescriptors && isEnumerableOn(obj, prop)) {
      Object.defineProperty(obj, prop, { enumerable: false });
    }
  };
  var sliceArgs = function sliceArgs() {
    // per https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
    // and https://gist.github.com/WebReflection/4327762cb87a8c634a29
    var initial = Number(this);
    var len = arguments.length;
    var desiredArgCount = len - initial;
    var args = new Array(desiredArgCount < 0 ? 0 : desiredArgCount);
    for (var i = initial; i < len; ++i) {
      args[i - initial] = arguments[i];
    }
    return args;
  };
  var assignTo = function assignTo(source) {
    return function assignToSource(target, key) {
      target[key] = source[key];
      return target;
    };
  };
  var assignReducer = function (target, source) {
    var sourceKeys = keys(Object(source));
    var symbols;
    if (ES.IsCallable(Object.getOwnPropertySymbols)) {
      symbols = _filter(Object.getOwnPropertySymbols(Object(source)), isEnumerableOn(source));
    }
    return _reduce(_concat(sourceKeys, symbols || []), assignTo(source), target);
  };

  var ObjectShims = {
    // 19.1.3.1
    assign: function (target, source) {
      var to = ES.ToObject(target, 'Cannot convert undefined or null to object');
      return _reduce(ES.Call(sliceArgs, 1, arguments), assignReducer, to);
    },

    // Added in WebKit in https://bugs.webkit.org/show_bug.cgi?id=143865
    is: function is(a, b) {
      return ES.SameValue(a, b);
    }
  };
  var assignHasPendingExceptions = Object.assign && Object.preventExtensions && (function () {
    // Firefox 37 still has "pending exception" logic in its Object.assign implementation,
    // which is 72% slower than our shim, and Firefox 40's native implementation.
    var thrower = Object.preventExtensions({ 1: 2 });
    try {
      Object.assign(thrower, 'xy');
    } catch (e) {
      return thrower[1] === 'y';
    }
  }());
  if (assignHasPendingExceptions) {
    overrideNative(Object, 'assign', ObjectShims.assign);
  }
  defineProperties(Object, ObjectShims);

  if (supportsDescriptors) {
    var ES5ObjectShims = {
      // 19.1.3.9
      // shim from https://gist.github.com/WebReflection/5593554
      setPrototypeOf: (function (Object, magic) {
        var set;

        var checkArgs = function (O, proto) {
          if (!ES.TypeIsObject(O)) {
            throw new TypeError('cannot set prototype on a non-object');
          }
          if (!(proto === null || ES.TypeIsObject(proto))) {
            throw new TypeError('can only set prototype to an object or null' + proto);
          }
        };

        var setPrototypeOf = function (O, proto) {
          checkArgs(O, proto);
          _call(set, O, proto);
          return O;
        };

        try {
          // this works already in Firefox and Safari
          set = Object.getOwnPropertyDescriptor(Object.prototype, magic).set;
          _call(set, {}, null);
        } catch (e) {
          if (Object.prototype !== {}[magic]) {
            // IE < 11 cannot be shimmed
            return;
          }
          // probably Chrome or some old Mobile stock browser
          set = function (proto) {
            this[magic] = proto;
          };
          // please note that this will **not** work
          // in those browsers that do not inherit
          // __proto__ by mistake from Object.prototype
          // in these cases we should probably throw an error
          // or at least be informed about the issue
          setPrototypeOf.polyfill = setPrototypeOf(
            setPrototypeOf({}, null),
            Object.prototype
          ) instanceof Object;
          // setPrototypeOf.polyfill === true means it works as meant
          // setPrototypeOf.polyfill === false means it's not 100% reliable
          // setPrototypeOf.polyfill === undefined
          // or
          // setPrototypeOf.polyfill ==  null means it's not a polyfill
          // which means it works as expected
          // we can even delete Object.prototype.__proto__;
        }
        return setPrototypeOf;
      }(Object, '__proto__'))
    };

    defineProperties(Object, ES5ObjectShims);
  }

  // Workaround bug in Opera 12 where setPrototypeOf(x, null) doesn't work,
  // but Object.create(null) does.
  if (Object.setPrototypeOf && Object.getPrototypeOf &&
      Object.getPrototypeOf(Object.setPrototypeOf({}, null)) !== null &&
      Object.getPrototypeOf(Object.create(null)) === null) {
    (function () {
      var FAKENULL = Object.create(null);
      var gpo = Object.getPrototypeOf;
      var spo = Object.setPrototypeOf;
      Object.getPrototypeOf = function (o) {
        var result = gpo(o);
        return result === FAKENULL ? null : result;
      };
      Object.setPrototypeOf = function (o, p) {
        var proto = p === null ? FAKENULL : p;
        return spo(o, proto);
      };
      Object.setPrototypeOf.polyfill = false;
    }());
  }

  var objectKeysAcceptsPrimitives = !throwsError(function () { Object.keys('foo'); });
  if (!objectKeysAcceptsPrimitives) {
    var originalObjectKeys = Object.keys;
    overrideNative(Object, 'keys', function keys(value) {
      return originalObjectKeys(ES.ToObject(value));
    });
    keys = Object.keys;
  }
  var objectKeysRejectsRegex = throwsError(function () { Object.keys(/a/g); });
  if (objectKeysRejectsRegex) {
    var regexRejectingObjectKeys = Object.keys;
    overrideNative(Object, 'keys', function keys(value) {
      if (Type.regex(value)) {
        var regexKeys = [];
        for (var k in value) {
          if (_hasOwnProperty(value, k)) {
            _push(regexKeys, k);
          }
        }
        return regexKeys;
      }
      return regexRejectingObjectKeys(value);
    });
    keys = Object.keys;
  }

  if (Object.getOwnPropertyNames) {
    var objectGOPNAcceptsPrimitives = !throwsError(function () { Object.getOwnPropertyNames('foo'); });
    if (!objectGOPNAcceptsPrimitives) {
      var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : [];
      var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames;
      overrideNative(Object, 'getOwnPropertyNames', function getOwnPropertyNames(value) {
        var val = ES.ToObject(value);
        if (_toString(val) === '[object Window]') {
          try {
            return originalObjectGetOwnPropertyNames(val);
          } catch (e) {
            // IE bug where layout engine calls userland gOPN for cross-domain `window` objects
            return _concat([], cachedWindowNames);
          }
        }
        return originalObjectGetOwnPropertyNames(val);
      });
    }
  }
  if (Object.getOwnPropertyDescriptor) {
    var objectGOPDAcceptsPrimitives = !throwsError(function () { Object.getOwnPropertyDescriptor('foo', 'bar'); });
    if (!objectGOPDAcceptsPrimitives) {
      var originalObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
      overrideNative(Object, 'getOwnPropertyDescriptor', function getOwnPropertyDescriptor(value, property) {
        return originalObjectGetOwnPropertyDescriptor(ES.ToObject(value), property);
      });
    }
  }
  if (Object.seal) {
    var objectSealAcceptsPrimitives = !throwsError(function () { Object.seal('foo'); });
    if (!objectSealAcceptsPrimitives) {
      var originalObjectSeal = Object.seal;
      overrideNative(Object, 'seal', function seal(value) {
        if (!ES.TypeIsObject(value)) { return value; }
        return originalObjectSeal(value);
      });
    }
  }
  if (Object.isSealed) {
    var objectIsSealedAcceptsPrimitives = !throwsError(function () { Object.isSealed('foo'); });
    if (!objectIsSealedAcceptsPrimitives) {
      var originalObjectIsSealed = Object.isSealed;
      overrideNative(Object, 'isSealed', function isSealed(value) {
        if (!ES.TypeIsObject(value)) { return true; }
        return originalObjectIsSealed(value);
      });
    }
  }
  if (Object.freeze) {
    var objectFreezeAcceptsPrimitives = !throwsError(function () { Object.freeze('foo'); });
    if (!objectFreezeAcceptsPrimitives) {
      var originalObjectFreeze = Object.freeze;
      overrideNative(Object, 'freeze', function freeze(value) {
        if (!ES.TypeIsObject(value)) { return value; }
        return originalObjectFreeze(value);
      });
    }
  }
  if (Object.isFrozen) {
    var objectIsFrozenAcceptsPrimitives = !throwsError(function () { Object.isFrozen('foo'); });
    if (!objectIsFrozenAcceptsPrimitives) {
      var originalObjectIsFrozen = Object.isFrozen;
      overrideNative(Object, 'isFrozen', function isFrozen(value) {
        if (!ES.TypeIsObject(value)) { return true; }
        return originalObjectIsFrozen(value);
      });
    }
  }
  if (Object.preventExtensions) {
    var objectPreventExtensionsAcceptsPrimitives = !throwsError(function () { Object.preventExtensions('foo'); });
    if (!objectPreventExtensionsAcceptsPrimitives) {
      var originalObjectPreventExtensions = Object.preventExtensions;
      overrideNative(Object, 'preventExtensions', function preventExtensions(value) {
        if (!ES.TypeIsObject(value)) { return value; }
        return originalObjectPreventExtensions(value);
      });
    }
  }
  if (Object.isExtensible) {
    var objectIsExtensibleAcceptsPrimitives = !throwsError(function () { Object.isExtensible('foo'); });
    if (!objectIsExtensibleAcceptsPrimitives) {
      var originalObjectIsExtensible = Object.isExtensible;
      overrideNative(Object, 'isExtensible', function isExtensible(value) {
        if (!ES.TypeIsObject(value)) { return false; }
        return originalObjectIsExtensible(value);
      });
    }
  }
  if (Object.getPrototypeOf) {
    var objectGetProtoAcceptsPrimitives = !throwsError(function () { Object.getPrototypeOf('foo'); });
    if (!objectGetProtoAcceptsPrimitives) {
      var originalGetProto = Object.getPrototypeOf;
      overrideNative(Object, 'getPrototypeOf', function getPrototypeOf(value) {
        return originalGetProto(ES.ToObject(value));
      });
    }
  }

  var hasFlags = supportsDescriptors && (function () {
    var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags');
    return desc && ES.IsCallable(desc.get);
  }());
  if (supportsDescriptors && !hasFlags) {
    var regExpFlagsGetter = function flags() {
      if (!ES.TypeIsObject(this)) {
        throw new TypeError('Method called on incompatible type: must be an object.');
      }
      var result = '';
      if (this.global) {
        result += 'g';
      }
      if (this.ignoreCase) {
        result += 'i';
      }
      if (this.multiline) {
        result += 'm';
      }
      if (this.unicode) {
        result += 'u';
      }
      if (this.sticky) {
        result += 'y';
      }
      return result;
    };

    Value.getter(RegExp.prototype, 'flags', regExpFlagsGetter);
  }

  var regExpSupportsFlagsWithRegex = supportsDescriptors && valueOrFalseIfThrows(function () {
    return String(new RegExp(/a/g, 'i')) === '/a/i';
  });
  var regExpNeedsToSupportSymbolMatch = hasSymbols && supportsDescriptors && (function () {
    // Edge 0.12 supports flags fully, but does not support Symbol.match
    var regex = /./;
    regex[Symbol.match] = false;
    return RegExp(regex) === regex;
  }());

  var regexToStringIsGeneric = valueOrFalseIfThrows(function () {
    return RegExp.prototype.toString.call({ source: 'abc' }) === '/abc/';
  });
  var regexToStringSupportsGenericFlags = regexToStringIsGeneric && valueOrFalseIfThrows(function () {
    return RegExp.prototype.toString.call({ source: 'a', flags: 'b' }) === '/a/b';
  });
  if (!regexToStringIsGeneric || !regexToStringSupportsGenericFlags) {
    var origRegExpToString = RegExp.prototype.toString;
    defineProperty(RegExp.prototype, 'toString', function toString() {
      var R = ES.RequireObjectCoercible(this);
      if (Type.regex(R)) {
        return _call(origRegExpToString, R);
      }
      var pattern = $String(R.source);
      var flags = $String(R.flags);
      return '/' + pattern + '/' + flags;
    }, true);
    Value.preserveToString(RegExp.prototype.toString, origRegExpToString);
  }

  if (supportsDescriptors && (!regExpSupportsFlagsWithRegex || regExpNeedsToSupportSymbolMatch)) {
    var flagsGetter = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get;
    var sourceDesc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source') || {};
    var legacySourceGetter = function () {
      // prior to it being a getter, it's own + nonconfigurable
      return this.source;
    };
    var sourceGetter = ES.IsCallable(sourceDesc.get) ? sourceDesc.get : legacySourceGetter;

    var OrigRegExp = RegExp;
    var RegExpShim = (function () {
      return function RegExp(pattern, flags) {
        var patternIsRegExp = ES.IsRegExp(pattern);
        var calledWithNew = this instanceof RegExp;
        if (!calledWithNew && patternIsRegExp && typeof flags === 'undefined' && pattern.constructor === RegExp) {
          return pattern;
        }

        var P = pattern;
        var F = flags;
        if (Type.regex(pattern)) {
          P = ES.Call(sourceGetter, pattern);
          F = typeof flags === 'undefined' ? ES.Call(flagsGetter, pattern) : flags;
          return new RegExp(P, F);
        } else if (patternIsRegExp) {
          P = pattern.source;
          F = typeof flags === 'undefined' ? pattern.flags : flags;
        }
        return new OrigRegExp(pattern, flags);
      };
    }());
    wrapConstructor(OrigRegExp, RegExpShim, {
      $input: true // Chrome < v39 & Opera < 26 have a nonstandard "$input" property
    });
    /* globals RegExp: true */
    /* eslint-disable no-undef, no-global-assign */
    /* jshint -W020 */
    RegExp = RegExpShim;
    Value.redefine(globals, 'RegExp', RegExpShim);
    /* jshint +W020 */
    /* eslint-enable no-undef, no-global-assign */
    /* globals RegExp: false */
  }

  if (supportsDescriptors) {
    var regexGlobals = {
      input: '$_',
      lastMatch: '$&',
      lastParen: '$+',
      leftContext: '$`',
      rightContext: '$\''
    };
    _forEach(keys(regexGlobals), function (prop) {
      if (prop in RegExp && !(regexGlobals[prop] in RegExp)) {
        Value.getter(RegExp, regexGlobals[prop], function get() {
          return RegExp[prop];
        });
      }
    });
  }
  addDefaultSpecies(RegExp);

  var inverseEpsilon = 1 / Number.EPSILON;
  var roundTiesToEven = function roundTiesToEven(n) {
    // Even though this reduces down to `return n`, it takes advantage of built-in rounding.
    return (n + inverseEpsilon) - inverseEpsilon;
  };
  var BINARY_32_EPSILON = Math.pow(2, -23);
  var BINARY_32_MAX_VALUE = Math.pow(2, 127) * (2 - BINARY_32_EPSILON);
  var BINARY_32_MIN_VALUE = Math.pow(2, -126);
  var E = Math.E;
  var LOG2E = Math.LOG2E;
  var LOG10E = Math.LOG10E;
  var numberCLZ = Number.prototype.clz;
  delete Number.prototype.clz; // Safari 8 has Number#clz

  var MathShims = {
    acosh: function acosh(value) {
      var x = Number(value);
      if (numberIsNaN(x) || value < 1) { return NaN; }
      if (x === 1) { return 0; }
      if (x === Infinity) { return x; }
      return _log((x / E) + (_sqrt(x + 1) * _sqrt(x - 1) / E)) + 1;
    },

    asinh: function asinh(value) {
      var x = Number(value);
      if (x === 0 || !globalIsFinite(x)) {
        return x;
      }
      return x < 0 ? -asinh(-x) : _log(x + _sqrt((x * x) + 1));
    },

    atanh: function atanh(value) {
      var x = Number(value);
      if (numberIsNaN(x) || x < -1 || x > 1) {
        return NaN;
      }
      if (x === -1) { return -Infinity; }
      if (x === 1) { return Infinity; }
      if (x === 0) { return x; }
      return 0.5 * _log((1 + x) / (1 - x));
    },

    cbrt: function cbrt(value) {
      var x = Number(value);
      if (x === 0) { return x; }
      var negate = x < 0;
      var result;
      if (negate) { x = -x; }
      if (x === Infinity) {
        result = Infinity;
      } else {
        result = _exp(_log(x) / 3);
        // from http://en.wikipedia.org/wiki/Cube_root#Numerical_methods
        result = ((x / (result * result)) + (2 * result)) / 3;
      }
      return negate ? -result : result;
    },

    clz32: function clz32(value) {
      // See https://bugs.ecmascript.org/show_bug.cgi?id=2465
      var x = Number(value);
      var number = ES.ToUint32(x);
      if (number === 0) {
        return 32;
      }
      return numberCLZ ? ES.Call(numberCLZ, number) : 31 - _floor(_log(number + 0.5) * LOG2E);
    },

    cosh: function cosh(value) {
      var x = Number(value);
      if (x === 0) { return 1; } // +0 or -0
      if (numberIsNaN(x)) { return NaN; }
      if (!globalIsFinite(x)) { return Infinity; }
      if (x < 0) { x = -x; }
      if (x > 21) { return _exp(x) / 2; }
      return (_exp(x) + _exp(-x)) / 2;
    },

    expm1: function expm1(value) {
      var x = Number(value);
      if (x === -Infinity) { return -1; }
      if (!globalIsFinite(x) || x === 0) { return x; }
      if (_abs(x) > 0.5) {
        return _exp(x) - 1;
      }
      // A more precise approximation using Taylor series expansion
      // from https://github.com/paulmillr/es6-shim/issues/314#issuecomment-70293986
      var t = x;
      var sum = 0;
      var n = 1;
      while (sum + t !== sum) {
        sum += t;
        n += 1;
        t *= x / n;
      }
      return sum;
    },

    hypot: function hypot(x, y) {
      var result = 0;
      var largest = 0;
      for (var i = 0; i < arguments.length; ++i) {
        var value = _abs(Number(arguments[i]));
        if (largest < value) {
          result *= (largest / value) * (largest / value);
          result += 1;
          largest = value;
        } else {
          result += value > 0 ? (value / largest) * (value / largest) : value;
        }
      }
      return largest === Infinity ? Infinity : largest * _sqrt(result);
    },

    log2: function log2(value) {
      return _log(value) * LOG2E;
    },

    log10: function log10(value) {
      return _log(value) * LOG10E;
    },

    log1p: function log1p(value) {
      var x = Number(value);
      if (x < -1 || numberIsNaN(x)) { return NaN; }
      if (x === 0 || x === Infinity) { return x; }
      if (x === -1) { return -Infinity; }

      return (1 + x) - 1 === 0 ? x : x * (_log(1 + x) / ((1 + x) - 1));
    },

    sign: _sign,

    sinh: function sinh(value) {
      var x = Number(value);
      if (!globalIsFinite(x) || x === 0) { return x; }

      if (_abs(x) < 1) {
        return (Math.expm1(x) - Math.expm1(-x)) / 2;
      }
      return (_exp(x - 1) - _exp(-x - 1)) * E / 2;
    },

    tanh: function tanh(value) {
      var x = Number(value);
      if (numberIsNaN(x) || x === 0) { return x; }
      // can exit early at +-20 as JS loses precision for true value at this integer
      if (x >= 20) { return 1; }
      if (x <= -20) { return -1; }

      return (Math.expm1(x) - Math.expm1(-x)) / (_exp(x) + _exp(-x));
    },

    trunc: function trunc(value) {
      var x = Number(value);
      return x < 0 ? -_floor(-x) : _floor(x);
    },

    imul: function imul(x, y) {
      // taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
      var a = ES.ToUint32(x);
      var b = ES.ToUint32(y);
      var ah = (a >>> 16) & 0xffff;
      var al = a & 0xffff;
      var bh = (b >>> 16) & 0xffff;
      var bl = b & 0xffff;
      // the shift by 0 fixes the sign on the high part
      // the final |0 converts the unsigned value into a signed value
      return (al * bl) + ((((ah * bl) + (al * bh)) << 16) >>> 0) | 0;
    },

    fround: function fround(x) {
      var v = Number(x);
      if (v === 0 || v === Infinity || v === -Infinity || numberIsNaN(v)) {
        return v;
      }
      var sign = _sign(v);
      var abs = _abs(v);
      if (abs < BINARY_32_MIN_VALUE) {
        return sign * roundTiesToEven(
          abs / BINARY_32_MIN_VALUE / BINARY_32_EPSILON
        ) * BINARY_32_MIN_VALUE * BINARY_32_EPSILON;
      }
      // Veltkamp's splitting (?)
      var a = (1 + (BINARY_32_EPSILON / Number.EPSILON)) * abs;
      var result = a - (a - abs);
      if (result > BINARY_32_MAX_VALUE || numberIsNaN(result)) {
        return sign * Infinity;
      }
      return sign * result;
    }
  };
  defineProperties(Math, MathShims);
  // IE 11 TP has an imprecise log1p: reports Math.log1p(-1e-17) as 0
  defineProperty(Math, 'log1p', MathShims.log1p, Math.log1p(-1e-17) !== -1e-17);
  // IE 11 TP has an imprecise asinh: reports Math.asinh(-1e7) as not exactly equal to -Math.asinh(1e7)
  defineProperty(Math, 'asinh', MathShims.asinh, Math.asinh(-1e7) !== -Math.asinh(1e7));
  // Chrome 40 has an imprecise Math.tanh with very small numbers
  defineProperty(Math, 'tanh', MathShims.tanh, Math.tanh(-2e-17) !== -2e-17);
  // Chrome 40 loses Math.acosh precision with high numbers
  defineProperty(Math, 'acosh', MathShims.acosh, Math.acosh(Number.MAX_VALUE) === Infinity);
  // Firefox 38 on Windows
  defineProperty(Math, 'cbrt', MathShims.cbrt, Math.abs(1 - (Math.cbrt(1e-300) / 1e-100)) / Number.EPSILON > 8);
  // node 0.11 has an imprecise Math.sinh with very small numbers
  defineProperty(Math, 'sinh', MathShims.sinh, Math.sinh(-2e-17) !== -2e-17);
  // FF 35 on Linux reports 22025.465794806725 for Math.expm1(10)
  var expm1OfTen = Math.expm1(10);
  defineProperty(Math, 'expm1', MathShims.expm1, expm1OfTen > 22025.465794806719 || expm1OfTen < 22025.4657948067165168);

  var origMathRound = Math.round;
  // breaks in e.g. Safari 8, Internet Explorer 11, Opera 12
  var roundHandlesBoundaryConditions = Math.round(0.5 - (Number.EPSILON / 4)) === 0 &&
    Math.round(-0.5 + (Number.EPSILON / 3.99)) === 1;

  // When engines use Math.floor(x + 0.5) internally, Math.round can be buggy for large integers.
  // This behavior should be governed by "round to nearest, ties to even mode"
  // see http://www.ecma-international.org/ecma-262/6.0/#sec-terms-and-definitions-number-type
  // These are the boundary cases where it breaks.
  var smallestPositiveNumberWhereRoundBreaks = inverseEpsilon + 1;
  var largestPositiveNumberWhereRoundBreaks = (2 * inverseEpsilon) - 1;
  var roundDoesNotIncreaseIntegers = [
    smallestPositiveNumberWhereRoundBreaks,
    largestPositiveNumberWhereRoundBreaks
  ].every(function (num) {
    return Math.round(num) === num;
  });
  defineProperty(Math, 'round', function round(x) {
    var floor = _floor(x);
    var ceil = floor === -1 ? -0 : floor + 1;
    return x - floor < 0.5 ? floor : ceil;
  }, !roundHandlesBoundaryConditions || !roundDoesNotIncreaseIntegers);
  Value.preserveToString(Math.round, origMathRound);

  var origImul = Math.imul;
  if (Math.imul(0xffffffff, 5) !== -5) {
    // Safari 6.1, at least, reports "0" for this value
    Math.imul = MathShims.imul;
    Value.preserveToString(Math.imul, origImul);
  }
  if (Math.imul.length !== 2) {
    // Safari 8.0.4 has a length of 1
    // fixed in https://bugs.webkit.org/show_bug.cgi?id=143658
    overrideNative(Math, 'imul', function imul(x, y) {
      return ES.Call(origImul, Math, arguments);
    });
  }

  // Promises
  // Simplest possible implementation; use a 3rd-party library if you
  // want the best possible speed and/or long stack traces.
  var PromiseShim = (function () {
    var setTimeout = globals.setTimeout;
    // some environments don't have setTimeout - no way to shim here.
    if (typeof setTimeout !== 'function' && typeof setTimeout !== 'object') { return; }

    ES.IsPromise = function (promise) {
      if (!ES.TypeIsObject(promise)) {
        return false;
      }
      if (typeof promise._promise === 'undefined') {
        return false; // uninitialized, or missing our hidden field.
      }
      return true;
    };

    // "PromiseCapability" in the spec is what most promise implementations
    // call a "deferred".
    var PromiseCapability = function (C) {
      if (!ES.IsConstructor(C)) {
        throw new TypeError('Bad promise constructor');
      }
      var capability = this;
      var resolver = function (resolve, reject) {
        if (capability.resolve !== void 0 || capability.reject !== void 0) {
          throw new TypeError('Bad Promise implementation!');
        }
        capability.resolve = resolve;
        capability.reject = reject;
      };
      // Initialize fields to inform optimizers about the object shape.
      capability.resolve = void 0;
      capability.reject = void 0;
      capability.promise = new C(resolver);
      if (!(ES.IsCallable(capability.resolve) && ES.IsCallable(capability.reject))) {
        throw new TypeError('Bad promise constructor');
      }
    };

    // find an appropriate setImmediate-alike
    var makeZeroTimeout;
    /*global window */
    if (typeof window !== 'undefined' && ES.IsCallable(window.postMessage)) {
      makeZeroTimeout = function () {
        // from http://dbaron.org/log/20100309-faster-timeouts
        var timeouts = [];
        var messageName = 'zero-timeout-message';
        var setZeroTimeout = function (fn) {
          _push(timeouts, fn);
          window.postMessage(messageName, '*');
        };
        var handleMessage = function (event) {
          if (event.source === window && event.data === messageName) {
            event.stopPropagation();
            if (timeouts.length === 0) { return; }
            var fn = _shift(timeouts);
            fn();
          }
        };
        window.addEventListener('message', handleMessage, true);
        return setZeroTimeout;
      };
    }
    var makePromiseAsap = function () {
      // An efficient task-scheduler based on a pre-existing Promise
      // implementation, which we can use even if we override the
      // global Promise below (in order to workaround bugs)
      // https://github.com/Raynos/observ-hash/issues/2#issuecomment-35857671
      var P = globals.Promise;
      var pr = P && P.resolve && P.resolve();
      return pr && function (task) {
        return pr.then(task);
      };
    };
    /*global process */
    /* jscs:disable disallowMultiLineTernary */
    var enqueue = ES.IsCallable(globals.setImmediate) ?
      globals.setImmediate :
      typeof process === 'object' && process.nextTick ? process.nextTick :
      makePromiseAsap() ||
      (ES.IsCallable(makeZeroTimeout) ? makeZeroTimeout() :
      function (task) { setTimeout(task, 0); }); // fallback
    /* jscs:enable disallowMultiLineTernary */

    // Constants for Promise implementation
    var PROMISE_IDENTITY = function (x) { return x; };
    var PROMISE_THROWER = function (e) { throw e; };
    var PROMISE_PENDING = 0;
    var PROMISE_FULFILLED = 1;
    var PROMISE_REJECTED = 2;
    // We store fulfill/reject handlers and capabilities in a single array.
    var PROMISE_FULFILL_OFFSET = 0;
    var PROMISE_REJECT_OFFSET = 1;
    var PROMISE_CAPABILITY_OFFSET = 2;
    // This is used in an optimization for chaining promises via then.
    var PROMISE_FAKE_CAPABILITY = {};

    var enqueuePromiseReactionJob = function (handler, capability, argument) {
      enqueue(function () {
        promiseReactionJob(handler, capability, argument);
      });
    };

    var promiseReactionJob = function (handler, promiseCapability, argument) {
      var handlerResult, f;
      if (promiseCapability === PROMISE_FAKE_CAPABILITY) {
        // Fast case, when we don't actually need to chain through to a
        // (real) promiseCapability.
        return handler(argument);
      }
      try {
        handlerResult = handler(argument);
        f = promiseCapability.resolve;
      } catch (e) {
        handlerResult = e;
        f = promiseCapability.reject;
      }
      f(handlerResult);
    };

    var fulfillPromise = function (promise, value) {
      var _promise = promise._promise;
      var length = _promise.reactionLength;
      if (length > 0) {
        enqueuePromiseReactionJob(
          _promise.fulfillReactionHandler0,
          _promise.reactionCapability0,
          value
        );
        _promise.fulfillReactionHandler0 = void 0;
        _promise.rejectReactions0 = void 0;
        _promise.reactionCapability0 = void 0;
        if (length > 1) {
          for (var i = 1, idx = 0; i < length; i++, idx += 3) {
            enqueuePromiseReactionJob(
              _promise[idx + PROMISE_FULFILL_OFFSET],
              _promise[idx + PROMISE_CAPABILITY_OFFSET],
              value
            );
            promise[idx + PROMISE_FULFILL_OFFSET] = void 0;
            promise[idx + PROMISE_REJECT_OFFSET] = void 0;
            promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0;
          }
        }
      }
      _promise.result = value;
      _promise.state = PROMISE_FULFILLED;
      _promise.reactionLength = 0;
    };

    var rejectPromise = function (promise, reason) {
      var _promise = promise._promise;
      var length = _promise.reactionLength;
      if (length > 0) {
        enqueuePromiseReactionJob(
          _promise.rejectReactionHandler0,
          _promise.reactionCapability0,
          reason
        );
        _promise.fulfillReactionHandler0 = void 0;
        _promise.rejectReactions0 = void 0;
        _promise.reactionCapability0 = void 0;
        if (length > 1) {
          for (var i = 1, idx = 0; i < length; i++, idx += 3) {
            enqueuePromiseReactionJob(
              _promise[idx + PROMISE_REJECT_OFFSET],
              _promise[idx + PROMISE_CAPABILITY_OFFSET],
              reason
            );
            promise[idx + PROMISE_FULFILL_OFFSET] = void 0;
            promise[idx + PROMISE_REJECT_OFFSET] = void 0;
            promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0;
          }
        }
      }
      _promise.result = reason;
      _promise.state = PROMISE_REJECTED;
      _promise.reactionLength = 0;
    };

    var createResolvingFunctions = function (promise) {
      var alreadyResolved = false;
      var resolve = function (resolution) {
        var then;
        if (alreadyResolved) { return; }
        alreadyResolved = true;
        if (resolution === promise) {
          return rejectPromise(promise, new TypeError('Self resolution'));
        }
        if (!ES.TypeIsObject(resolution)) {
          return fulfillPromise(promise, resolution);
        }
        try {
          then = resolution.then;
        } catch (e) {
          return rejectPromise(promise, e);
        }
        if (!ES.IsCallable(then)) {
          return fulfillPromise(promise, resolution);
        }
        enqueue(function () {
          promiseResolveThenableJob(promise, resolution, then);
        });
      };
      var reject = function (reason) {
        if (alreadyResolved) { return; }
        alreadyResolved = true;
        return rejectPromise(promise, reason);
      };
      return { resolve: resolve, reject: reject };
    };

    var optimizedThen = function (then, thenable, resolve, reject) {
      // Optimization: since we discard the result, we can pass our
      // own then implementation a special hint to let it know it
      // doesn't have to create it.  (The PROMISE_FAKE_CAPABILITY
      // object is local to this implementation and unforgeable outside.)
      if (then === Promise$prototype$then) {
        _call(then, thenable, resolve, reject, PROMISE_FAKE_CAPABILITY);
      } else {
        _call(then, thenable, resolve, reject);
      }
    };
    var promiseResolveThenableJob = function (promise, thenable, then) {
      var resolvingFunctions = createResolvingFunctions(promise);
      var resolve = resolvingFunctions.resolve;
      var reject = resolvingFunctions.reject;
      try {
        optimizedThen(then, thenable, resolve, reject);
      } catch (e) {
        reject(e);
      }
    };

    var Promise$prototype, Promise$prototype$then;
    var Promise = (function () {
      var PromiseShim = function Promise(resolver) {
        if (!(this instanceof PromiseShim)) {
          throw new TypeError('Constructor Promise requires "new"');
        }
        if (this && this._promise) {
          throw new TypeError('Bad construction');
        }
        // see https://bugs.ecmascript.org/show_bug.cgi?id=2482
        if (!ES.IsCallable(resolver)) {
          throw new TypeError('not a valid resolver');
        }
        var promise = emulateES6construct(this, PromiseShim, Promise$prototype, {
          _promise: {
            result: void 0,
            state: PROMISE_PENDING,
            // The first member of the "reactions" array is inlined here,
            // since most promises only have one reaction.
            // We've also exploded the 'reaction' object to inline the
            // "handler" and "capability" fields, since both fulfill and
            // reject reactions share the same capability.
            reactionLength: 0,
            fulfillReactionHandler0: void 0,
            rejectReactionHandler0: void 0,
            reactionCapability0: void 0
          }
        });
        var resolvingFunctions = createResolvingFunctions(promise);
        var reject = resolvingFunctions.reject;
        try {
          resolver(resolvingFunctions.resolve, reject);
        } catch (e) {
          reject(e);
        }
        return promise;
      };
      return PromiseShim;
    }());
    Promise$prototype = Promise.prototype;

    var _promiseAllResolver = function (index, values, capability, remaining) {
      var alreadyCalled = false;
      return function (x) {
        if (alreadyCalled) { return; }
        alreadyCalled = true;
        values[index] = x;
        if ((--remaining.count) === 0) {
          var resolve = capability.resolve;
          resolve(values); // call w/ this===undefined
        }
      };
    };

    var performPromiseAll = function (iteratorRecord, C, resultCapability) {
      var it = iteratorRecord.iterator;
      var values = [];
      var remaining = { count: 1 };
      var next, nextValue;
      var index = 0;
      while (true) {
        try {
          next = ES.IteratorStep(it);
          if (next === false) {
            iteratorRecord.done = true;
            break;
          }
          nextValue = next.value;
        } catch (e) {
          iteratorRecord.done = true;
          throw e;
        }
        values[index] = void 0;
        var nextPromise = C.resolve(nextValue);
        var resolveElement = _promiseAllResolver(
          index, values, resultCapability, remaining
        );
        remaining.count += 1;
        optimizedThen(nextPromise.then, nextPromise, resolveElement, resultCapability.reject);
        index += 1;
      }
      if ((--remaining.count) === 0) {
        var resolve = resultCapability.resolve;
        resolve(values); // call w/ this===undefined
      }
      return resultCapability.promise;
    };

    var performPromiseRace = function (iteratorRecord, C, resultCapability) {
      var it = iteratorRecord.iterator;
      var next, nextValue, nextPromise;
      while (true) {
        try {
          next = ES.IteratorStep(it);
          if (next === false) {
            // NOTE: If iterable has no items, resulting promise will never
            // resolve; see:
            // https://github.com/domenic/promises-unwrapping/issues/75
            // https://bugs.ecmascript.org/show_bug.cgi?id=2515
            iteratorRecord.done = true;
            break;
          }
          nextValue = next.value;
        } catch (e) {
          iteratorRecord.done = true;
          throw e;
        }
        nextPromise = C.resolve(nextValue);
        optimizedThen(nextPromise.then, nextPromise, resultCapability.resolve, resultCapability.reject);
      }
      return resultCapability.promise;
    };

    defineProperties(Promise, {
      all: function all(iterable) {
        var C = this;
        if (!ES.TypeIsObject(C)) {
          throw new TypeError('Promise is not object');
        }
        var capability = new PromiseCapability(C);
        var iterator, iteratorRecord;
        try {
          iterator = ES.GetIterator(iterable);
          iteratorRecord = { iterator: iterator, done: false };
          return performPromiseAll(iteratorRecord, C, capability);
        } catch (e) {
          var exception = e;
          if (iteratorRecord && !iteratorRecord.done) {
            try {
              ES.IteratorClose(iterator, true);
            } catch (ee) {
              exception = ee;
            }
          }
          var reject = capability.reject;
          reject(exception);
          return capability.promise;
        }
      },

      race: function race(iterable) {
        var C = this;
        if (!ES.TypeIsObject(C)) {
          throw new TypeError('Promise is not object');
        }
        var capability = new PromiseCapability(C);
        var iterator, iteratorRecord;
        try {
          iterator = ES.GetIterator(iterable);
          iteratorRecord = { iterator: iterator, done: false };
          return performPromiseRace(iteratorRecord, C, capability);
        } catch (e) {
          var exception = e;
          if (iteratorRecord && !iteratorRecord.done) {
            try {
              ES.IteratorClose(iterator, true);
            } catch (ee) {
              exception = ee;
            }
          }
          var reject = capability.reject;
          reject(exception);
          return capability.promise;
        }
      },

      reject: function reject(reason) {
        var C = this;
        if (!ES.TypeIsObject(C)) {
          throw new TypeError('Bad promise constructor');
        }
        var capability = new PromiseCapability(C);
        var rejectFunc = capability.reject;
        rejectFunc(reason); // call with this===undefined
        return capability.promise;
      },

      resolve: function resolve(v) {
        // See https://esdiscuss.org/topic/fixing-promise-resolve for spec
        var C = this;
        if (!ES.TypeIsObject(C)) {
          throw new TypeError('Bad promise constructor');
        }
        if (ES.IsPromise(v)) {
          var constructor = v.constructor;
          if (constructor === C) {
            return v;
          }
        }
        var capability = new PromiseCapability(C);
        var resolveFunc = capability.resolve;
        resolveFunc(v); // call with this===undefined
        return capability.promise;
      }
    });

    defineProperties(Promise$prototype, {
      'catch': function (onRejected) {
        return this.then(null, onRejected);
      },

      then: function then(onFulfilled, onRejected) {
        var promise = this;
        if (!ES.IsPromise(promise)) { throw new TypeError('not a promise'); }
        var C = ES.SpeciesConstructor(promise, Promise);
        var resultCapability;
        var returnValueIsIgnored = arguments.length > 2 && arguments[2] === PROMISE_FAKE_CAPABILITY;
        if (returnValueIsIgnored && C === Promise) {
          resultCapability = PROMISE_FAKE_CAPABILITY;
        } else {
          resultCapability = new PromiseCapability(C);
        }
        // PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability)
        // Note that we've split the 'reaction' object into its two
        // components, "capabilities" and "handler"
        // "capabilities" is always equal to `resultCapability`
        var fulfillReactionHandler = ES.IsCallable(onFulfilled) ? onFulfilled : PROMISE_IDENTITY;
        var rejectReactionHandler = ES.IsCallable(onRejected) ? onRejected : PROMISE_THROWER;
        var _promise = promise._promise;
        var value;
        if (_promise.state === PROMISE_PENDING) {
          if (_promise.reactionLength === 0) {
            _promise.fulfillReactionHandler0 = fulfillReactionHandler;
            _promise.rejectReactionHandler0 = rejectReactionHandler;
            _promise.reactionCapability0 = resultCapability;
          } else {
            var idx = 3 * (_promise.reactionLength - 1);
            _promise[idx + PROMISE_FULFILL_OFFSET] = fulfillReactionHandler;
            _promise[idx + PROMISE_REJECT_OFFSET] = rejectReactionHandler;
            _promise[idx + PROMISE_CAPABILITY_OFFSET] = resultCapability;
          }
          _promise.reactionLength += 1;
        } else if (_promise.state === PROMISE_FULFILLED) {
          value = _promise.result;
          enqueuePromiseReactionJob(
            fulfillReactionHandler, resultCapability, value
          );
        } else if (_promise.state === PROMISE_REJECTED) {
          value = _promise.result;
          enqueuePromiseReactionJob(
            rejectReactionHandler, resultCapability, value
          );
        } else {
          throw new TypeError('unexpected Promise state');
        }
        return resultCapability.promise;
      }
    });
    // This helps the optimizer by ensuring that methods which take
    // capabilities aren't polymorphic.
    PROMISE_FAKE_CAPABILITY = new PromiseCapability(Promise);
    Promise$prototype$then = Promise$prototype.then;

    return Promise;
  }());

  // Chrome's native Promise has extra methods that it shouldn't have. Let's remove them.
  if (globals.Promise) {
    delete globals.Promise.accept;
    delete globals.Promise.defer;
    delete globals.Promise.prototype.chain;
  }

  if (typeof PromiseShim === 'function') {
    // export the Promise constructor.
    defineProperties(globals, { Promise: PromiseShim });
    // In Chrome 33 (and thereabouts) Promise is defined, but the
    // implementation is buggy in a number of ways.  Let's check subclassing
    // support to see if we have a buggy implementation.
    var promiseSupportsSubclassing = supportsSubclassing(globals.Promise, function (S) {
      return S.resolve(42).then(function () {}) instanceof S;
    });
    var promiseIgnoresNonFunctionThenCallbacks = !throwsError(function () {
      globals.Promise.reject(42).then(null, 5).then(null, noop);
    });
    var promiseRequiresObjectContext = throwsError(function () { globals.Promise.call(3, noop); });
    // Promise.resolve() was errata'ed late in the ES6 process.
    // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1170742
    //      https://code.google.com/p/v8/issues/detail?id=4161
    // It serves as a proxy for a number of other bugs in early Promise
    // implementations.
    var promiseResolveBroken = (function (Promise) {
      var p = Promise.resolve(5);
      p.constructor = {};
      var p2 = Promise.resolve(p);
      try {
        p2.then(null, noop).then(null, noop); // avoid "uncaught rejection" warnings in console
      } catch (e) {
        return true; // v8 native Promises break here https://code.google.com/p/chromium/issues/detail?id=575314
      }
      return p === p2; // This *should* be false!
    }(globals.Promise));

    // Chrome 46 (probably older too) does not retrieve a thenable's .then synchronously
    var getsThenSynchronously = supportsDescriptors && (function () {
      var count = 0;
      var thenable = Object.defineProperty({}, 'then', { get: function () { count += 1; } });
      Promise.resolve(thenable);
      return count === 1;
    }());

    var BadResolverPromise = function BadResolverPromise(executor) {
      var p = new Promise(executor);
      executor(3, function () {});
      this.then = p.then;
      this.constructor = BadResolverPromise;
    };
    BadResolverPromise.prototype = Promise.prototype;
    BadResolverPromise.all = Promise.all;
    // Chrome Canary 49 (probably older too) has some implementation bugs
    var hasBadResolverPromise = valueOrFalseIfThrows(function () {
      return !!BadResolverPromise.all([1, 2]);
    });

    if (!promiseSupportsSubclassing || !promiseIgnoresNonFunctionThenCallbacks ||
        !promiseRequiresObjectContext || promiseResolveBroken ||
        !getsThenSynchronously || hasBadResolverPromise) {
      /* globals Promise: true */
      /* eslint-disable no-undef, no-global-assign */
      /* jshint -W020 */
      Promise = PromiseShim;
      /* jshint +W020 */
      /* eslint-enable no-undef, no-global-assign */
      /* globals Promise: false */
      overrideNative(globals, 'Promise', PromiseShim);
    }
    if (Promise.all.length !== 1) {
      var origAll = Promise.all;
      overrideNative(Promise, 'all', function all(iterable) {
        return ES.Call(origAll, this, arguments);
      });
    }
    if (Promise.race.length !== 1) {
      var origRace = Promise.race;
      overrideNative(Promise, 'race', function race(iterable) {
        return ES.Call(origRace, this, arguments);
      });
    }
    if (Promise.resolve.length !== 1) {
      var origResolve = Promise.resolve;
      overrideNative(Promise, 'resolve', function resolve(x) {
        return ES.Call(origResolve, this, arguments);
      });
    }
    if (Promise.reject.length !== 1) {
      var origReject = Promise.reject;
      overrideNative(Promise, 'reject', function reject(r) {
        return ES.Call(origReject, this, arguments);
      });
    }
    ensureEnumerable(Promise, 'all');
    ensureEnumerable(Promise, 'race');
    ensureEnumerable(Promise, 'resolve');
    ensureEnumerable(Promise, 'reject');
    addDefaultSpecies(Promise);
  }

  // Map and Set require a true ES5 environment
  // Their fast path also requires that the environment preserve
  // property insertion order, which is not guaranteed by the spec.
  var testOrder = function (a) {
    var b = keys(_reduce(a, function (o, k) {
      o[k] = true;
      return o;
    }, {}));
    return a.join(':') === b.join(':');
  };
  var preservesInsertionOrder = testOrder(['z', 'a', 'bb']);
  // some engines (eg, Chrome) only preserve insertion order for string keys
  var preservesNumericInsertionOrder = testOrder(['z', 1, 'a', '3', 2]);

  if (supportsDescriptors) {

    var fastkey = function fastkey(key, skipInsertionOrderCheck) {
      if (!skipInsertionOrderCheck && !preservesInsertionOrder) {
        return null;
      }
      if (isNullOrUndefined(key)) {
        return '^' + ES.ToString(key);
      } else if (typeof key === 'string') {
        return '$' + key;
      } else if (typeof key === 'number') {
        // note that -0 will get coerced to "0" when used as a property key
        if (!preservesNumericInsertionOrder) {
          return 'n' + key;
        }
        return key;
      } else if (typeof key === 'boolean') {
        return 'b' + key;
      }
      return null;
    };

    var emptyObject = function emptyObject() {
      // accomodate some older not-quite-ES5 browsers
      return Object.create ? Object.create(null) : {};
    };

    var addIterableToMap = function addIterableToMap(MapConstructor, map, iterable) {
      if (isArray(iterable) || Type.string(iterable)) {
        _forEach(iterable, function (entry) {
          if (!ES.TypeIsObject(entry)) {
            throw new TypeError('Iterator value ' + entry + ' is not an entry object');
          }
          map.set(entry[0], entry[1]);
        });
      } else if (iterable instanceof MapConstructor) {
        _call(MapConstructor.prototype.forEach, iterable, function (value, key) {
          map.set(key, value);
        });
      } else {
        var iter, adder;
        if (!isNullOrUndefined(iterable)) {
          adder = map.set;
          if (!ES.IsCallable(adder)) { throw new TypeError('bad map'); }
          iter = ES.GetIterator(iterable);
        }
        if (typeof iter !== 'undefined') {
          while (true) {
            var next = ES.IteratorStep(iter);
            if (next === false) { break; }
            var nextItem = next.value;
            try {
              if (!ES.TypeIsObject(nextItem)) {
                throw new TypeError('Iterator value ' + nextItem + ' is not an entry object');
              }
              _call(adder, map, nextItem[0], nextItem[1]);
            } catch (e) {
              ES.IteratorClose(iter, true);
              throw e;
            }
          }
        }
      }
    };
    var addIterableToSet = function addIterableToSet(SetConstructor, set, iterable) {
      if (isArray(iterable) || Type.string(iterable)) {
        _forEach(iterable, function (value) {
          set.add(value);
        });
      } else if (iterable instanceof SetConstructor) {
        _call(SetConstructor.prototype.forEach, iterable, function (value) {
          set.add(value);
        });
      } else {
        var iter, adder;
        if (!isNullOrUndefined(iterable)) {
          adder = set.add;
          if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); }
          iter = ES.GetIterator(iterable);
        }
        if (typeof iter !== 'undefined') {
          while (true) {
            var next = ES.IteratorStep(iter);
            if (next === false) { break; }
            var nextValue = next.value;
            try {
              _call(adder, set, nextValue);
            } catch (e) {
              ES.IteratorClose(iter, true);
              throw e;
            }
          }
        }
      }
    };

    var collectionShims = {
      Map: (function () {

        var empty = {};

        var MapEntry = function MapEntry(key, value) {
          this.key = key;
          this.value = value;
          this.next = null;
          this.prev = null;
        };

        MapEntry.prototype.isRemoved = function isRemoved() {
          return this.key === empty;
        };

        var isMap = function isMap(map) {
          return !!map._es6map;
        };

        var requireMapSlot = function requireMapSlot(map, method) {
          if (!ES.TypeIsObject(map) || !isMap(map)) {
            throw new TypeError('Method Map.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(map));
          }
        };

        var MapIterator = function MapIterator(map, kind) {
          requireMapSlot(map, '[[MapIterator]]');
          this.head = map._head;
          this.i = this.head;
          this.kind = kind;
        };

        MapIterator.prototype = {
          next: function next() {
            var i = this.i;
            var kind = this.kind;
            var head = this.head;
            if (typeof this.i === 'undefined') {
              return iteratorResult();
            }
            while (i.isRemoved() && i !== head) {
              // back up off of removed entries
              i = i.prev;
            }
            // advance to next unreturned element.
            var result;
            while (i.next !== head) {
              i = i.next;
              if (!i.isRemoved()) {
                if (kind === 'key') {
                  result = i.key;
                } else if (kind === 'value') {
                  result = i.value;
                } else {
                  result = [i.key, i.value];
                }
                this.i = i;
                return iteratorResult(result);
              }
            }
            // once the iterator is done, it is done forever.
            this.i = void 0;
            return iteratorResult();
          }
        };
        addIterator(MapIterator.prototype);

        var Map$prototype;
        var MapShim = function Map() {
          if (!(this instanceof Map)) {
            throw new TypeError('Constructor Map requires "new"');
          }
          if (this && this._es6map) {
            throw new TypeError('Bad construction');
          }
          var map = emulateES6construct(this, Map, Map$prototype, {
            _es6map: true,
            _head: null,
            _map: OrigMap ? new OrigMap() : null,
            _size: 0,
            _storage: emptyObject()
          });

          var head = new MapEntry(null, null);
          // circular doubly-linked list.
          /* eslint no-multi-assign: 1 */
          head.next = head.prev = head;
          map._head = head;

          // Optionally initialize map from iterable
          if (arguments.length > 0) {
            addIterableToMap(Map, map, arguments[0]);
          }
          return map;
        };
        Map$prototype = MapShim.prototype;

        Value.getter(Map$prototype, 'size', function () {
          if (typeof this._size === 'undefined') {
            throw new TypeError('size method called on incompatible Map');
          }
          return this._size;
        });

        defineProperties(Map$prototype, {
          get: function get(key) {
            requireMapSlot(this, 'get');
            var entry;
            var fkey = fastkey(key, true);
            if (fkey !== null) {
              // fast O(1) path
              entry = this._storage[fkey];
              if (entry) {
                return entry.value;
              } else {
                return;
              }
            }
            if (this._map) {
              // fast object key path
              entry = origMapGet.call(this._map, key);
              if (entry) {
                return entry.value;
              } else {
                return;
              }
            }
            var head = this._head;
            var i = head;
            while ((i = i.next) !== head) {
              if (ES.SameValueZero(i.key, key)) {
                return i.value;
              }
            }
          },

          has: function has(key) {
            requireMapSlot(this, 'has');
            var fkey = fastkey(key, true);
            if (fkey !== null) {
              // fast O(1) path
              return typeof this._storage[fkey] !== 'undefined';
            }
            if (this._map) {
              // fast object key path
              return origMapHas.call(this._map, key);
            }
            var head = this._head;
            var i = head;
            while ((i = i.next) !== head) {
              if (ES.SameValueZero(i.key, key)) {
                return true;
              }
            }
            return false;
          },

          set: function set(key, value) {
            requireMapSlot(this, 'set');
            var head = this._head;
            var i = head;
            var entry;
            var fkey = fastkey(key, true);
            if (fkey !== null) {
              // fast O(1) path
              if (typeof this._storage[fkey] !== 'undefined') {
                this._storage[fkey].value = value;
                return this;
              } else {
                entry = this._storage[fkey] = new MapEntry(key, value); /* eslint no-multi-assign: 1 */
                i = head.prev;
                // fall through
              }
            } else if (this._map) {
              // fast object key path
              if (origMapHas.call(this._map, key)) {
                origMapGet.call(this._map, key).value = value;
              } else {
                entry = new MapEntry(key, value);
                origMapSet.call(this._map, key, entry);
                i = head.prev;
                // fall through
              }
            }
            while ((i = i.next) !== head) {
              if (ES.SameValueZero(i.key, key)) {
                i.value = value;
                return this;
              }
            }
            entry = entry || new MapEntry(key, value);
            if (ES.SameValue(-0, key)) {
              entry.key = +0; // coerce -0 to +0 in entry
            }
            entry.next = this._head;
            entry.prev = this._head.prev;
            entry.prev.next = entry;
            entry.next.prev = entry;
            this._size += 1;
            return this;
          },

          'delete': function (key) {
            requireMapSlot(this, 'delete');
            var head = this._head;
            var i = head;
            var fkey = fastkey(key, true);
            if (fkey !== null) {
              // fast O(1) path
              if (typeof this._storage[fkey] === 'undefined') {
                return false;
              }
              i = this._storage[fkey].prev;
              delete this._storage[fkey];
              // fall through
            } else if (this._map) {
              // fast object key path
              if (!origMapHas.call(this._map, key)) {
                return false;
              }
              i = origMapGet.call(this._map, key).prev;
              origMapDelete.call(this._map, key);
              // fall through
            }
            while ((i = i.next) !== head) {
              if (ES.SameValueZero(i.key, key)) {
                i.key = empty;
                i.value = empty;
                i.prev.next = i.next;
                i.next.prev = i.prev;
                this._size -= 1;
                return true;
              }
            }
            return false;
          },

          clear: function clear() {
             /* eslint no-multi-assign: 1 */
            requireMapSlot(this, 'clear');
            this._map = OrigMap ? new OrigMap() : null;
            this._size = 0;
            this._storage = emptyObject();
            var head = this._head;
            var i = head;
            var p = i.next;
            while ((i = p) !== head) {
              i.key = empty;
              i.value = empty;
              p = i.next;
              i.next = i.prev = head;
            }
            head.next = head.prev = head;
          },

          keys: function keys() {
            requireMapSlot(this, 'keys');
            return new MapIterator(this, 'key');
          },

          values: function values() {
            requireMapSlot(this, 'values');
            return new MapIterator(this, 'value');
          },

          entries: function entries() {
            requireMapSlot(this, 'entries');
            return new MapIterator(this, 'key+value');
          },

          forEach: function forEach(callback) {
            requireMapSlot(this, 'forEach');
            var context = arguments.length > 1 ? arguments[1] : null;
            var it = this.entries();
            for (var entry = it.next(); !entry.done; entry = it.next()) {
              if (context) {
                _call(callback, context, entry.value[1], entry.value[0], this);
              } else {
                callback(entry.value[1], entry.value[0], this);
              }
            }
          }
        });
        addIterator(Map$prototype, Map$prototype.entries);

        return MapShim;
      }()),

      Set: (function () {
        var isSet = function isSet(set) {
          return set._es6set && typeof set._storage !== 'undefined';
        };
        var requireSetSlot = function requireSetSlot(set, method) {
          if (!ES.TypeIsObject(set) || !isSet(set)) {
            // https://github.com/paulmillr/es6-shim/issues/176
            throw new TypeError('Set.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(set));
          }
        };

        // Creating a Map is expensive.  To speed up the common case of
        // Sets containing only string or numeric keys, we use an object
        // as backing storage and lazily create a full Map only when
        // required.
        var Set$prototype;
        var SetShim = function Set() {
          if (!(this instanceof Set)) {
            throw new TypeError('Constructor Set requires "new"');
          }
          if (this && this._es6set) {
            throw new TypeError('Bad construction');
          }
          var set = emulateES6construct(this, Set, Set$prototype, {
            _es6set: true,
            '[[SetData]]': null,
            _storage: emptyObject()
          });
          if (!set._es6set) {
            throw new TypeError('bad set');
          }

          // Optionally initialize Set from iterable
          if (arguments.length > 0) {
            addIterableToSet(Set, set, arguments[0]);
          }
          return set;
        };
        Set$prototype = SetShim.prototype;

        var decodeKey = function (key) {
          var k = key;
          if (k === '^null') {
            return null;
          } else if (k === '^undefined') {
            return void 0;
          } else {
            var first = k.charAt(0);
            if (first === '$') {
              return _strSlice(k, 1);
            } else if (first === 'n') {
              return +_strSlice(k, 1);
            } else if (first === 'b') {
              return k === 'btrue';
            }
          }
          return +k;
        };
        // Switch from the object backing storage to a full Map.
        var ensureMap = function ensureMap(set) {
          if (!set['[[SetData]]']) {
            var m = new collectionShims.Map();
            set['[[SetData]]'] = m;
            _forEach(keys(set._storage), function (key) {
              var k = decodeKey(key);
              m.set(k, k);
            });
            set['[[SetData]]'] = m;
          }
          set._storage = null; // free old backing storage
        };

        Value.getter(SetShim.prototype, 'size', function () {
          requireSetSlot(this, 'size');
          if (this._storage) {
            return keys(this._storage).length;
          }
          ensureMap(this);
          return this['[[SetData]]'].size;
        });

        defineProperties(SetShim.prototype, {
          has: function has(key) {
            requireSetSlot(this, 'has');
            var fkey;
            if (this._storage && (fkey = fastkey(key)) !== null) {
              return !!this._storage[fkey];
            }
            ensureMap(this);
            return this['[[SetData]]'].has(key);
          },

          add: function add(key) {
            requireSetSlot(this, 'add');
            var fkey;
            if (this._storage && (fkey = fastkey(key)) !== null) {
              this._storage[fkey] = true;
              return this;
            }
            ensureMap(this);
            this['[[SetData]]'].set(key, key);
            return this;
          },

          'delete': function (key) {
            requireSetSlot(this, 'delete');
            var fkey;
            if (this._storage && (fkey = fastkey(key)) !== null) {
              var hasFKey = _hasOwnProperty(this._storage, fkey);
              return (delete this._storage[fkey]) && hasFKey;
            }
            ensureMap(this);
            return this['[[SetData]]']['delete'](key);
          },

          clear: function clear() {
            requireSetSlot(this, 'clear');
            if (this._storage) {
              this._storage = emptyObject();
            }
            if (this['[[SetData]]']) {
              this['[[SetData]]'].clear();
            }
          },

          values: function values() {
            requireSetSlot(this, 'values');
            ensureMap(this);
            return this['[[SetData]]'].values();
          },

          entries: function entries() {
            requireSetSlot(this, 'entries');
            ensureMap(this);
            return this['[[SetData]]'].entries();
          },

          forEach: function forEach(callback) {
            requireSetSlot(this, 'forEach');
            var context = arguments.length > 1 ? arguments[1] : null;
            var entireSet = this;
            ensureMap(entireSet);
            this['[[SetData]]'].forEach(function (value, key) {
              if (context) {
                _call(callback, context, key, key, entireSet);
              } else {
                callback(key, key, entireSet);
              }
            });
          }
        });
        defineProperty(SetShim.prototype, 'keys', SetShim.prototype.values, true);
        addIterator(SetShim.prototype, SetShim.prototype.values);

        return SetShim;
      }())
    };

    if (globals.Map || globals.Set) {
      // Safari 8, for example, doesn't accept an iterable.
      var mapAcceptsArguments = valueOrFalseIfThrows(function () { return new Map([[1, 2]]).get(1) === 2; });
      if (!mapAcceptsArguments) {
        globals.Map = function Map() {
          if (!(this instanceof Map)) {
            throw new TypeError('Constructor Map requires "new"');
          }
          var m = new OrigMap();
          if (arguments.length > 0) {
            addIterableToMap(Map, m, arguments[0]);
          }
          delete m.constructor;
          Object.setPrototypeOf(m, globals.Map.prototype);
          return m;
        };
        globals.Map.prototype = create(OrigMap.prototype);
        defineProperty(globals.Map.prototype, 'constructor', globals.Map, true);
        Value.preserveToString(globals.Map, OrigMap);
      }
      var testMap = new Map();
      var mapUsesSameValueZero = (function () {
        // Chrome 38-42, node 0.11/0.12, iojs 1/2 also have a bug when the Map has a size > 4
        var m = new Map([[1, 0], [2, 0], [3, 0], [4, 0]]);
        m.set(-0, m);
        return m.get(0) === m && m.get(-0) === m && m.has(0) && m.has(-0);
      }());
      var mapSupportsChaining = testMap.set(1, 2) === testMap;
      if (!mapUsesSameValueZero || !mapSupportsChaining) {
        overrideNative(Map.prototype, 'set', function set(k, v) {
          _call(origMapSet, this, k === 0 ? 0 : k, v);
          return this;
        });
      }
      if (!mapUsesSameValueZero) {
        defineProperties(Map.prototype, {
          get: function get(k) {
            return _call(origMapGet, this, k === 0 ? 0 : k);
          },
          has: function has(k) {
            return _call(origMapHas, this, k === 0 ? 0 : k);
          }
        }, true);
        Value.preserveToString(Map.prototype.get, origMapGet);
        Value.preserveToString(Map.prototype.has, origMapHas);
      }
      var testSet = new Set();
      var setUsesSameValueZero = (function (s) {
        s['delete'](0);
        s.add(-0);
        return !s.has(0);
      }(testSet));
      var setSupportsChaining = testSet.add(1) === testSet;
      if (!setUsesSameValueZero || !setSupportsChaining) {
        var origSetAdd = Set.prototype.add;
        Set.prototype.add = function add(v) {
          _call(origSetAdd, this, v === 0 ? 0 : v);
          return this;
        };
        Value.preserveToString(Set.prototype.add, origSetAdd);
      }
      if (!setUsesSameValueZero) {
        var origSetHas = Set.prototype.has;
        Set.prototype.has = function has(v) {
          return _call(origSetHas, this, v === 0 ? 0 : v);
        };
        Value.preserveToString(Set.prototype.has, origSetHas);
        var origSetDel = Set.prototype['delete'];
        Set.prototype['delete'] = function SetDelete(v) {
          return _call(origSetDel, this, v === 0 ? 0 : v);
        };
        Value.preserveToString(Set.prototype['delete'], origSetDel);
      }
      var mapSupportsSubclassing = supportsSubclassing(globals.Map, function (M) {
        var m = new M([]);
        // Firefox 32 is ok with the instantiating the subclass but will
        // throw when the map is used.
        m.set(42, 42);
        return m instanceof M;
      });
      // without Object.setPrototypeOf, subclassing is not possible
      var mapFailsToSupportSubclassing = Object.setPrototypeOf && !mapSupportsSubclassing;
      var mapRequiresNew = (function () {
        try {
          return !(globals.Map() instanceof globals.Map);
        } catch (e) {
          return e instanceof TypeError;
        }
      }());
      if (globals.Map.length !== 0 || mapFailsToSupportSubclassing || !mapRequiresNew) {
        globals.Map = function Map() {
          if (!(this instanceof Map)) {
            throw new TypeError('Constructor Map requires "new"');
          }
          var m = new OrigMap();
          if (arguments.length > 0) {
            addIterableToMap(Map, m, arguments[0]);
          }
          delete m.constructor;
          Object.setPrototypeOf(m, Map.prototype);
          return m;
        };
        globals.Map.prototype = OrigMap.prototype;
        defineProperty(globals.Map.prototype, 'constructor', globals.Map, true);
        Value.preserveToString(globals.Map, OrigMap);
      }
      var setSupportsSubclassing = supportsSubclassing(globals.Set, function (S) {
        var s = new S([]);
        s.add(42, 42);
        return s instanceof S;
      });
      // without Object.setPrototypeOf, subclassing is not possible
      var setFailsToSupportSubclassing = Object.setPrototypeOf && !setSupportsSubclassing;
      var setRequiresNew = (function () {
        try {
          return !(globals.Set() instanceof globals.Set);
        } catch (e) {
          return e instanceof TypeError;
        }
      }());
      if (globals.Set.length !== 0 || setFailsToSupportSubclassing || !setRequiresNew) {
        var OrigSet = globals.Set;
        globals.Set = function Set() {
          if (!(this instanceof Set)) {
            throw new TypeError('Constructor Set requires "new"');
          }
          var s = new OrigSet();
          if (arguments.length > 0) {
            addIterableToSet(Set, s, arguments[0]);
          }
          delete s.constructor;
          Object.setPrototypeOf(s, Set.prototype);
          return s;
        };
        globals.Set.prototype = OrigSet.prototype;
        defineProperty(globals.Set.prototype, 'constructor', globals.Set, true);
        Value.preserveToString(globals.Set, OrigSet);
      }
      var newMap = new globals.Map();
      var mapIterationThrowsStopIterator = !valueOrFalseIfThrows(function () {
        return newMap.keys().next().done;
      });
      /*
        - In Firefox < 23, Map#size is a function.
        - In all current Firefox, Set#entries/keys/values & Map#clear do not exist
        - https://bugzilla.mozilla.org/show_bug.cgi?id=869996
        - In Firefox 24, Map and Set do not implement forEach
        - In Firefox 25 at least, Map and Set are callable without "new"
      */
      if (
        typeof globals.Map.prototype.clear !== 'function' ||
        new globals.Set().size !== 0 ||
        newMap.size !== 0 ||
        typeof globals.Map.prototype.keys !== 'function' ||
        typeof globals.Set.prototype.keys !== 'function' ||
        typeof globals.Map.prototype.forEach !== 'function' ||
        typeof globals.Set.prototype.forEach !== 'function' ||
        isCallableWithoutNew(globals.Map) ||
        isCallableWithoutNew(globals.Set) ||
        typeof newMap.keys().next !== 'function' || // Safari 8
        mapIterationThrowsStopIterator || // Firefox 25
        !mapSupportsSubclassing
      ) {
        defineProperties(globals, {
          Map: collectionShims.Map,
          Set: collectionShims.Set
        }, true);
      }

      if (globals.Set.prototype.keys !== globals.Set.prototype.values) {
        // Fixed in WebKit with https://bugs.webkit.org/show_bug.cgi?id=144190
        defineProperty(globals.Set.prototype, 'keys', globals.Set.prototype.values, true);
      }

      // Shim incomplete iterator implementations.
      addIterator(Object.getPrototypeOf((new globals.Map()).keys()));
      addIterator(Object.getPrototypeOf((new globals.Set()).keys()));

      if (functionsHaveNames && globals.Set.prototype.has.name !== 'has') {
        // Microsoft Edge v0.11.10074.0 is missing a name on Set#has
        var anonymousSetHas = globals.Set.prototype.has;
        overrideNative(globals.Set.prototype, 'has', function has(key) {
          return _call(anonymousSetHas, this, key);
        });
      }
    }
    defineProperties(globals, collectionShims);
    addDefaultSpecies(globals.Map);
    addDefaultSpecies(globals.Set);
  }

  var throwUnlessTargetIsObject = function throwUnlessTargetIsObject(target) {
    if (!ES.TypeIsObject(target)) {
      throw new TypeError('target must be an object');
    }
  };

  // Some Reflect methods are basically the same as
  // those on the Object global, except that a TypeError is thrown if
  // target isn't an object. As well as returning a boolean indicating
  // the success of the operation.
  var ReflectShims = {
    // Apply method in a functional form.
    apply: function apply() {
      return ES.Call(ES.Call, null, arguments);
    },

    // New operator in a functional form.
    construct: function construct(constructor, args) {
      if (!ES.IsConstructor(constructor)) {
        throw new TypeError('First argument must be a constructor.');
      }
      var newTarget = arguments.length > 2 ? arguments[2] : constructor;
      if (!ES.IsConstructor(newTarget)) {
        throw new TypeError('new.target must be a constructor.');
      }
      return ES.Construct(constructor, args, newTarget, 'internal');
    },

    // When deleting a non-existent or configurable property,
    // true is returned.
    // When attempting to delete a non-configurable property,
    // it will return false.
    deleteProperty: function deleteProperty(target, key) {
      throwUnlessTargetIsObject(target);
      if (supportsDescriptors) {
        var desc = Object.getOwnPropertyDescriptor(target, key);

        if (desc && !desc.configurable) {
          return false;
        }
      }

      // Will return true.
      return delete target[key];
    },

    has: function has(target, key) {
      throwUnlessTargetIsObject(target);
      return key in target;
    }
  };

  if (Object.getOwnPropertyNames) {
    Object.assign(ReflectShims, {
      // Basically the result of calling the internal [[OwnPropertyKeys]].
      // Concatenating propertyNames and propertySymbols should do the trick.
      // This should continue to work together with a Symbol shim
      // which overrides Object.getOwnPropertyNames and implements
      // Object.getOwnPropertySymbols.
      ownKeys: function ownKeys(target) {
        throwUnlessTargetIsObject(target);
        var keys = Object.getOwnPropertyNames(target);

        if (ES.IsCallable(Object.getOwnPropertySymbols)) {
          _pushApply(keys, Object.getOwnPropertySymbols(target));
        }

        return keys;
      }
    });
  }

  var callAndCatchException = function ConvertExceptionToBoolean(func) {
    return !throwsError(func);
  };

  if (Object.preventExtensions) {
    Object.assign(ReflectShims, {
      isExtensible: function isExtensible(target) {
        throwUnlessTargetIsObject(target);
        return Object.isExtensible(target);
      },
      preventExtensions: function preventExtensions(target) {
        throwUnlessTargetIsObject(target);
        return callAndCatchException(function () {
          Object.preventExtensions(target);
        });
      }
    });
  }

  if (supportsDescriptors) {
    var internalGet = function get(target, key, receiver) {
      var desc = Object.getOwnPropertyDescriptor(target, key);

      if (!desc) {
        var parent = Object.getPrototypeOf(target);

        if (parent === null) {
          return void 0;
        }

        return internalGet(parent, key, receiver);
      }

      if ('value' in desc) {
        return desc.value;
      }

      if (desc.get) {
        return ES.Call(desc.get, receiver);
      }

      return void 0;
    };

    var internalSet = function set(target, key, value, receiver) {
      var desc = Object.getOwnPropertyDescriptor(target, key);

      if (!desc) {
        var parent = Object.getPrototypeOf(target);

        if (parent !== null) {
          return internalSet(parent, key, value, receiver);
        }

        desc = {
          value: void 0,
          writable: true,
          enumerable: true,
          configurable: true
        };
      }

      if ('value' in desc) {
        if (!desc.writable) {
          return false;
        }

        if (!ES.TypeIsObject(receiver)) {
          return false;
        }

        var existingDesc = Object.getOwnPropertyDescriptor(receiver, key);

        if (existingDesc) {
          return Reflect.defineProperty(receiver, key, {
            value: value
          });
        } else {
          return Reflect.defineProperty(receiver, key, {
            value: value,
            writable: true,
            enumerable: true,
            configurable: true
          });
        }
      }

      if (desc.set) {
        _call(desc.set, receiver, value);
        return true;
      }

      return false;
    };

    Object.assign(ReflectShims, {
      defineProperty: function defineProperty(target, propertyKey, attributes) {
        throwUnlessTargetIsObject(target);
        return callAndCatchException(function () {
          Object.defineProperty(target, propertyKey, attributes);
        });
      },

      getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
        throwUnlessTargetIsObject(target);
        return Object.getOwnPropertyDescriptor(target, propertyKey);
      },

      // Syntax in a functional form.
      get: function get(target, key) {
        throwUnlessTargetIsObject(target);
        var receiver = arguments.length > 2 ? arguments[2] : target;

        return internalGet(target, key, receiver);
      },

      set: function set(target, key, value) {
        throwUnlessTargetIsObject(target);
        var receiver = arguments.length > 3 ? arguments[3] : target;

        return internalSet(target, key, value, receiver);
      }
    });
  }

  if (Object.getPrototypeOf) {
    var objectDotGetPrototypeOf = Object.getPrototypeOf;
    ReflectShims.getPrototypeOf = function getPrototypeOf(target) {
      throwUnlessTargetIsObject(target);
      return objectDotGetPrototypeOf(target);
    };
  }

  if (Object.setPrototypeOf && ReflectShims.getPrototypeOf) {
    var willCreateCircularPrototype = function (object, lastProto) {
      var proto = lastProto;
      while (proto) {
        if (object === proto) {
          return true;
        }
        proto = ReflectShims.getPrototypeOf(proto);
      }
      return false;
    };

    Object.assign(ReflectShims, {
      // Sets the prototype of the given object.
      // Returns true on success, otherwise false.
      setPrototypeOf: function setPrototypeOf(object, proto) {
        throwUnlessTargetIsObject(object);
        if (proto !== null && !ES.TypeIsObject(proto)) {
          throw new TypeError('proto must be an object or null');
        }

        // If they already are the same, we're done.
        if (proto === Reflect.getPrototypeOf(object)) {
          return true;
        }

        // Cannot alter prototype if object not extensible.
        if (Reflect.isExtensible && !Reflect.isExtensible(object)) {
          return false;
        }

        // Ensure that we do not create a circular prototype chain.
        if (willCreateCircularPrototype(object, proto)) {
          return false;
        }

        Object.setPrototypeOf(object, proto);

        return true;
      }
    });
  }
  var defineOrOverrideReflectProperty = function (key, shim) {
    if (!ES.IsCallable(globals.Reflect[key])) {
      defineProperty(globals.Reflect, key, shim);
    } else {
      var acceptsPrimitives = valueOrFalseIfThrows(function () {
        globals.Reflect[key](1);
        globals.Reflect[key](NaN);
        globals.Reflect[key](true);
        return true;
      });
      if (acceptsPrimitives) {
        overrideNative(globals.Reflect, key, shim);
      }
    }
  };
  Object.keys(ReflectShims).forEach(function (key) {
    defineOrOverrideReflectProperty(key, ReflectShims[key]);
  });
  var originalReflectGetProto = globals.Reflect.getPrototypeOf;
  if (functionsHaveNames && originalReflectGetProto && originalReflectGetProto.name !== 'getPrototypeOf') {
    overrideNative(globals.Reflect, 'getPrototypeOf', function getPrototypeOf(target) {
      return _call(originalReflectGetProto, globals.Reflect, target);
    });
  }
  if (globals.Reflect.setPrototypeOf) {
    if (valueOrFalseIfThrows(function () {
      globals.Reflect.setPrototypeOf(1, {});
      return true;
    })) {
      overrideNative(globals.Reflect, 'setPrototypeOf', ReflectShims.setPrototypeOf);
    }
  }
  if (globals.Reflect.defineProperty) {
    if (!valueOrFalseIfThrows(function () {
      var basic = !globals.Reflect.defineProperty(1, 'test', { value: 1 });
      // "extensible" fails on Edge 0.12
      var extensible = typeof Object.preventExtensions !== 'function' || !globals.Reflect.defineProperty(Object.preventExtensions({}), 'test', {});
      return basic && extensible;
    })) {
      overrideNative(globals.Reflect, 'defineProperty', ReflectShims.defineProperty);
    }
  }
  if (globals.Reflect.construct) {
    if (!valueOrFalseIfThrows(function () {
      var F = function F() {};
      return globals.Reflect.construct(function () {}, [], F) instanceof F;
    })) {
      overrideNative(globals.Reflect, 'construct', ReflectShims.construct);
    }
  }

  if (String(new Date(NaN)) !== 'Invalid Date') {
    var dateToString = Date.prototype.toString;
    var shimmedDateToString = function toString() {
      var valueOf = +this;
      if (valueOf !== valueOf) {
        return 'Invalid Date';
      }
      return ES.Call(dateToString, this);
    };
    overrideNative(Date.prototype, 'toString', shimmedDateToString);
  }

  // Annex B HTML methods
  // http://www.ecma-international.org/ecma-262/6.0/#sec-additional-properties-of-the-string.prototype-object
  var stringHTMLshims = {
    anchor: function anchor(name) { return ES.CreateHTML(this, 'a', 'name', name); },
    big: function big() { return ES.CreateHTML(this, 'big', '', ''); },
    blink: function blink() { return ES.CreateHTML(this, 'blink', '', ''); },
    bold: function bold() { return ES.CreateHTML(this, 'b', '', ''); },
    fixed: function fixed() { return ES.CreateHTML(this, 'tt', '', ''); },
    fontcolor: function fontcolor(color) { return ES.CreateHTML(this, 'font', 'color', color); },
    fontsize: function fontsize(size) { return ES.CreateHTML(this, 'font', 'size', size); },
    italics: function italics() { return ES.CreateHTML(this, 'i', '', ''); },
    link: function link(url) { return ES.CreateHTML(this, 'a', 'href', url); },
    small: function small() { return ES.CreateHTML(this, 'small', '', ''); },
    strike: function strike() { return ES.CreateHTML(this, 'strike', '', ''); },
    sub: function sub() { return ES.CreateHTML(this, 'sub', '', ''); },
    sup: function sub() { return ES.CreateHTML(this, 'sup', '', ''); }
  };
  _forEach(Object.keys(stringHTMLshims), function (key) {
    var method = String.prototype[key];
    var shouldOverwrite = false;
    if (ES.IsCallable(method)) {
      var output = _call(method, '', ' " ');
      var quotesCount = _concat([], output.match(/"/g)).length;
      shouldOverwrite = output !== output.toLowerCase() || quotesCount > 2;
    } else {
      shouldOverwrite = true;
    }
    if (shouldOverwrite) {
      overrideNative(String.prototype, key, stringHTMLshims[key]);
    }
  });

  var JSONstringifiesSymbols = (function () {
    // Microsoft Edge v0.12 stringifies Symbols incorrectly
    if (!hasSymbols) { return false; } // Symbols are not supported
    var stringify = typeof JSON === 'object' && typeof JSON.stringify === 'function' ? JSON.stringify : null;
    if (!stringify) { return false; } // JSON.stringify is not supported
    if (typeof stringify(Symbol()) !== 'undefined') { return true; } // Symbols should become `undefined`
    if (stringify([Symbol()]) !== '[null]') { return true; } // Symbols in arrays should become `null`
    var obj = { a: Symbol() };
    obj[Symbol()] = true;
    if (stringify(obj) !== '{}') { return true; } // Symbol-valued keys *and* Symbol-valued properties should be omitted
    return false;
  }());
  var JSONstringifyAcceptsObjectSymbol = valueOrFalseIfThrows(function () {
    // Chrome 45 throws on stringifying object symbols
    if (!hasSymbols) { return true; } // Symbols are not supported
    return JSON.stringify(Object(Symbol())) === '{}' && JSON.stringify([Object(Symbol())]) === '[{}]';
  });
  if (JSONstringifiesSymbols || !JSONstringifyAcceptsObjectSymbol) {
    var origStringify = JSON.stringify;
    overrideNative(JSON, 'stringify', function stringify(value) {
      if (typeof value === 'symbol') { return; }
      var replacer;
      if (arguments.length > 1) {
        replacer = arguments[1];
      }
      var args = [value];
      if (!isArray(replacer)) {
        var replaceFn = ES.IsCallable(replacer) ? replacer : null;
        var wrappedReplacer = function (key, val) {
          var parsedValue = replaceFn ? _call(replaceFn, this, key, val) : val;
          if (typeof parsedValue !== 'symbol') {
            if (Type.symbol(parsedValue)) {
              return assignTo({})(parsedValue);
            } else {
              return parsedValue;
            }
          }
        };
        args.push(wrappedReplacer);
      } else {
        // create wrapped replacer that handles an array replacer?
        args.push(replacer);
      }
      if (arguments.length > 2) {
        args.push(arguments[2]);
      }
      return origStringify.apply(this, args);
    });
  }

  return globals;
}));
;
/*!@license Copyright 2013, Heinrich Goebl, License: MIT, see https://github.com/hgoebl/mobile-detect.js*/
!function(a,b){a(function(){"use strict";function a(a,b){return null!=a&&null!=b&&a.toLowerCase()===b.toLowerCase()}function c(a,b){var c,d,e=a.length;if(!e||!b)return!1;for(c=b.toLowerCase(),d=0;d<e;++d)if(c===a[d].toLowerCase())return!0;return!1}function d(a){for(var b in a)h.call(a,b)&&(a[b]=new RegExp(a[b],"i"))}function e(a,b){this.ua=a||"",this._cache={},this.maxPhoneWidth=b||600}var f={};f.mobileDetectRules={phones:{iPhone:"\\biPhone\\b|\\biPod\\b",BlackBerry:"BlackBerry|\\bBB10\\b|rim[0-9]+",HTC:"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m",Nexus:"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6",Dell:"Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b",Motorola:"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b",Samsung:"\\bSamsung\\b|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C",LG:"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)",Sony:"SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533",Asus:"Asus.*Galaxy|PadFone.*Mobile",NokiaLumia:"Lumia [0-9]{3,4}",Micromax:"Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b",Palm:"PalmSource|Palm",Vertu:"Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature",Pantech:"PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790",Fly:"IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250",Wiko:"KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM",iMobile:"i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)",SimValley:"\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b",Wolfgang:"AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q",Alcatel:"Alcatel",Nintendo:"Nintendo 3DS",Amoi:"Amoi",INQ:"INQ",GenericPhone:"Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser"},tablets:{iPad:"iPad|iPad.*Mobile",NexusTablet:"Android.*Nexus[\\s]+(7|9|10)",SamsungTablet:"SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587",Kindle:"Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)",SurfaceTablet:"Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)",HPTablet:"HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10",AsusTablet:"^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z",BlackBerryTablet:"PlayBook|RIM Tablet",HTCtablet:"HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410",MotorolaTablet:"xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617",NookTablet:"Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2",AcerTablet:"Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20\\b|\\bA3-A30",ToshibaTablet:"Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO",LGTablet:"\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b",FujitsuTablet:"Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b",PrestigioTablet:"PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002",LenovoTablet:"Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)",DellTablet:"Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7",YarvikTablet:"Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b",MedionTablet:"Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB",ArnovaTablet:"97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2",IntensoTablet:"INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004",IRUTablet:"M702pro",MegafonTablet:"MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b",EbodaTablet:"E-Boda (Supreme|Impresspeed|Izzycomm|Essential)",AllViewTablet:"Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)",ArchosTablet:"\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b",AinolTablet:"NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark",NokiaLumiaTablet:"Lumia 2520",SonyTablet:"Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31",PhilipsTablet:"\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b",CubeTablet:"Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT",CobyTablet:"MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010",MIDTablet:"M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10",MSITablet:"MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b",SMiTTablet:"Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)",RockChipTablet:"Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A",FlyTablet:"IQ310|Fly Vision",bqTablet:"Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris [E|M]10)|Maxwell.*Lite|Maxwell.*Plus",HuaweiTablet:"MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim",NecTablet:"\\bN-06D|\\bN-08D",PantechTablet:"Pantech.*P4100",BronchoTablet:"Broncho.*(N701|N708|N802|a710)",VersusTablet:"TOUCHPAD.*[78910]|\\bTOUCHTAB\\b",ZyncTablet:"z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900",PositivoTablet:"TB07STA|TB10STA|TB07FTA|TB10FTA",NabiTablet:"Android.*\\bNabi",KoboTablet:"Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build",DanewTablet:"DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b",TexetTablet:"NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE",PlaystationTablet:"Playstation.*(Portable|Vita)",TrekstorTablet:"ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab",PyleAudioTablet:"\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b",AdvanTablet:"Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ",DanyTechTablet:"Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1",GalapadTablet:"Android.*\\bG1\\b",MicromaxTablet:"Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b",KarbonnTablet:"Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b",AllFineTablet:"Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide",PROSCANTablet:"\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b",YONESTablet:"BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026",ChangJiaTablet:"TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503",GUTablet:"TX-A1301|TX-M9002|Q702|kf026",PointOfViewTablet:"TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10",OvermaxTablet:"OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)",HCLTablet:"HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync",DPSTablet:"DPS Dream 9|DPS Dual 7",VistureTablet:"V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10",CrestaTablet:"CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989",MediatekTablet:"\\bMT8125|MT8389|MT8135|MT8377\\b",ConcordeTablet:"Concorde([ ]+)?Tab|ConCorde ReadMan",GoCleverTablet:"GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042",ModecomTablet:"FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003",VoninoTablet:"\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b",ECSTablet:"V07OT2|TM105A|S10OT1|TR10CS1",StorexTablet:"eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab",VodafoneTablet:"SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497",EssentielBTablet:"Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2",RossMoorTablet:"RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711",iMobileTablet:"i-mobile i-note",TolinoTablet:"tolino tab [0-9.]+|tolino shine",AudioSonicTablet:"\\bC-22Q|T7-QC|T-17B|T-17P\\b",AMPETablet:"Android.* A78 ",SkkTablet:"Android.* (SKYPAD|PHOENIX|CYCLOPS)",TecnoTablet:"TECNO P9",JXDTablet:"Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b",iJoyTablet:"Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)",FX2Tablet:"FX2 PAD7|FX2 PAD10",XoroTablet:"KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151",ViewsonicTablet:"ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a",OdysTablet:"LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10",CaptivaTablet:"CAPTIVA PAD",IconbitTablet:"NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S",TeclastTablet:"T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi",OndaTablet:"\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+",JaytechTablet:"TPC-PA762",BlaupunktTablet:"Endeavour 800NG|Endeavour 1010",DigmaTablet:"\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b",EvolioTablet:"ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b",LavaTablet:"QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b",AocTablet:"MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712",MpmanTablet:"MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010",CelkonTablet:"CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b",WolderTablet:"miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b",MiTablet:"\\bMI PAD\\b|\\bHM NOTE 1W\\b",NibiruTablet:"Nibiru M1|Nibiru Jupiter One",NexoTablet:"NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI",LeaderTablet:"TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100",UbislateTablet:"UbiSlate[\\s]?7C",PocketBookTablet:"Pocketbook",KocasoTablet:"\\b(TB-1207)\\b",HisenseTablet:"\\b(F5281|E2371)\\b",Hudl:"Hudl HT7S3|Hudl 2",TelstraTablet:"T-Hub2",GenericTablet:"Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b"},oss:{AndroidOS:"Android",BlackBerryOS:"blackberry|\\bBB10\\b|rim tablet os",PalmOS:"PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino",SymbianOS:"Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b",WindowsMobileOS:"Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;",WindowsPhoneOS:"Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;",iOS:"\\biPhone.*Mobile|\\biPod|\\biPad",MeeGoOS:"MeeGo",MaemoOS:"Maemo",JavaOS:"J2ME/|\\bMIDP\\b|\\bCLDC\\b",webOS:"webOS|hpwOS",badaOS:"\\bBada\\b",BREWOS:"BREW"},uas:{Chrome:"\\bCrMo\\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?",Dolfin:"\\bDolfin\\b",Opera:"Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+|Coast/[0-9.]+",Skyfire:"Skyfire",Edge:"Mobile Safari/[.0-9]* Edge",IE:"IEMobile|MSIEMobile",Firefox:"fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS",Bolt:"bolt",TeaShark:"teashark",Blazer:"Blazer",Safari:"Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari",UCBrowser:"UC.*Browser|UCWEB",baiduboxapp:"baiduboxapp",baidubrowser:"baidubrowser",DiigoBrowser:"DiigoBrowser",Puffin:"Puffin",Mercury:"\\bMercury\\b",ObigoBrowser:"Obigo",NetFront:"NF-Browser",GenericBrowser:"NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger",PaleMoon:"Android.*PaleMoon|Mobile.*PaleMoon"},props:{Mobile:"Mobile/[VER]",Build:"Build/[VER]",Version:"Version/[VER]",VendorID:"VendorID/[VER]",iPad:"iPad.*CPU[a-z ]+[VER]",iPhone:"iPhone.*CPU[a-z ]+[VER]",iPod:"iPod.*CPU[a-z ]+[VER]",Kindle:"Kindle/[VER]",Chrome:["Chrome/[VER]","CriOS/[VER]","CrMo/[VER]"],Coast:["Coast/[VER]"],Dolfin:"Dolfin/[VER]",Firefox:["Firefox/[VER]","FxiOS/[VER]"],Fennec:"Fennec/[VER]",Edge:"Edge/[VER]",IE:["IEMobile/[VER];","IEMobile [VER]","MSIE [VER];","Trident/[0-9.]+;.*rv:[VER]"],NetFront:"NetFront/[VER]",NokiaBrowser:"NokiaBrowser/[VER]",Opera:[" OPR/[VER]","Opera Mini/[VER]","Version/[VER]"],"Opera Mini":"Opera Mini/[VER]","Opera Mobi":"Version/[VER]","UC Browser":"UC Browser[VER]",MQQBrowser:"MQQBrowser/[VER]",MicroMessenger:"MicroMessenger/[VER]",baiduboxapp:"baiduboxapp/[VER]",baidubrowser:"baidubrowser/[VER]",SamsungBrowser:"SamsungBrowser/[VER]",Iron:"Iron/[VER]",Safari:["Version/[VER]","Safari/[VER]"],Skyfire:"Skyfire/[VER]",Tizen:"Tizen/[VER]",Webkit:"webkit[ /][VER]",PaleMoon:"PaleMoon/[VER]",Gecko:"Gecko/[VER]",Trident:"Trident/[VER]",Presto:"Presto/[VER]",Goanna:"Goanna/[VER]",iOS:" \\bi?OS\\b [VER][ ;]{1}",Android:"Android [VER]",BlackBerry:["BlackBerry[\\w]+/[VER]","BlackBerry.*Version/[VER]","Version/[VER]"],BREW:"BREW [VER]",Java:"Java/[VER]","Windows Phone OS":["Windows Phone OS [VER]","Windows Phone [VER]"],"Windows Phone":"Windows Phone [VER]","Windows CE":"Windows CE/[VER]","Windows NT":"Windows NT [VER]",Symbian:["SymbianOS/[VER]","Symbian/[VER]"],webOS:["webOS/[VER]","hpwOS/[VER];"]},utils:{Bot:"Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom",MobileBot:"Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2",DesktopMode:"WPDesktop",TV:"SonyDTV|HbbTV",WebKit:"(webkit)[ /]([\\w.]+)",Console:"\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\\b",Watch:"SM-V700"}},f.detectMobileBrowsers={fullPattern:/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,shortPattern:/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,tabletPattern:/android|ipad|playbook|silk/i
};var g,h=Object.prototype.hasOwnProperty;return f.FALLBACK_PHONE="UnknownPhone",f.FALLBACK_TABLET="UnknownTablet",f.FALLBACK_MOBILE="UnknownMobile",g="isArray"in Array?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},function(){var a,b,c,e,i,j,k=f.mobileDetectRules;for(a in k.props)if(h.call(k.props,a)){for(b=k.props[a],g(b)||(b=[b]),i=b.length,e=0;e<i;++e)c=b[e],j=c.indexOf("[VER]"),j>=0&&(c=c.substring(0,j)+"([\\w._\\+]+)"+c.substring(j+5)),b[e]=new RegExp(c,"i");k.props[a]=b}d(k.oss),d(k.phones),d(k.tablets),d(k.uas),d(k.utils),k.oss0={WindowsPhoneOS:k.oss.WindowsPhoneOS,WindowsMobileOS:k.oss.WindowsMobileOS}}(),f.findMatch=function(a,b){for(var c in a)if(h.call(a,c)&&a[c].test(b))return c;return null},f.findMatches=function(a,b){var c=[];for(var d in a)h.call(a,d)&&a[d].test(b)&&c.push(d);return c},f.getVersionStr=function(a,b){var c,d,e,g,i=f.mobileDetectRules.props;if(h.call(i,a))for(c=i[a],e=c.length,d=0;d<e;++d)if(g=c[d].exec(b),null!==g)return g[1];return null},f.getVersion=function(a,b){var c=f.getVersionStr(a,b);return c?f.prepareVersionNo(c):NaN},f.prepareVersionNo=function(a){var b;return b=a.split(/[a-z._ \/\-]/i),1===b.length&&(a=b[0]),b.length>1&&(a=b[0]+".",b.shift(),a+=b.join("")),Number(a)},f.isMobileFallback=function(a){return f.detectMobileBrowsers.fullPattern.test(a)||f.detectMobileBrowsers.shortPattern.test(a.substr(0,4))},f.isTabletFallback=function(a){return f.detectMobileBrowsers.tabletPattern.test(a)},f.prepareDetectionCache=function(a,c,d){if(a.mobile===b){var g,h,i;return(h=f.findMatch(f.mobileDetectRules.tablets,c))?(a.mobile=a.tablet=h,void(a.phone=null)):(g=f.findMatch(f.mobileDetectRules.phones,c))?(a.mobile=a.phone=g,void(a.tablet=null)):void(f.isMobileFallback(c)?(i=e.isPhoneSized(d),i===b?(a.mobile=f.FALLBACK_MOBILE,a.tablet=a.phone=null):i?(a.mobile=a.phone=f.FALLBACK_PHONE,a.tablet=null):(a.mobile=a.tablet=f.FALLBACK_TABLET,a.phone=null)):f.isTabletFallback(c)?(a.mobile=a.tablet=f.FALLBACK_TABLET,a.phone=null):a.mobile=a.tablet=a.phone=null)}},f.mobileGrade=function(a){var b=null!==a.mobile();return a.os("iOS")&&a.version("iPad")>=4.3||a.os("iOS")&&a.version("iPhone")>=3.1||a.os("iOS")&&a.version("iPod")>=3.1||a.version("Android")>2.1&&a.is("Webkit")||a.version("Windows Phone OS")>=7||a.is("BlackBerry")&&a.version("BlackBerry")>=6||a.match("Playbook.*Tablet")||a.version("webOS")>=1.4&&a.match("Palm|Pre|Pixi")||a.match("hp.*TouchPad")||a.is("Firefox")&&a.version("Firefox")>=12||a.is("Chrome")&&a.is("AndroidOS")&&a.version("Android")>=4||a.is("Skyfire")&&a.version("Skyfire")>=4.1&&a.is("AndroidOS")&&a.version("Android")>=2.3||a.is("Opera")&&a.version("Opera Mobi")>11&&a.is("AndroidOS")||a.is("MeeGoOS")||a.is("Tizen")||a.is("Dolfin")&&a.version("Bada")>=2||(a.is("UC Browser")||a.is("Dolfin"))&&a.version("Android")>=2.3||a.match("Kindle Fire")||a.is("Kindle")&&a.version("Kindle")>=3||a.is("AndroidOS")&&a.is("NookTablet")||a.version("Chrome")>=11&&!b||a.version("Safari")>=5&&!b||a.version("Firefox")>=4&&!b||a.version("MSIE")>=7&&!b||a.version("Opera")>=10&&!b?"A":a.os("iOS")&&a.version("iPad")<4.3||a.os("iOS")&&a.version("iPhone")<3.1||a.os("iOS")&&a.version("iPod")<3.1||a.is("Blackberry")&&a.version("BlackBerry")>=5&&a.version("BlackBerry")<6||a.version("Opera Mini")>=5&&a.version("Opera Mini")<=6.5&&(a.version("Android")>=2.3||a.is("iOS"))||a.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3")||a.version("Opera Mobi")>=11&&a.is("SymbianOS")?"B":(a.version("BlackBerry")<5||a.match("MSIEMobile|Windows CE.*Mobile")||a.version("Windows Mobile")<=5.2,"C")},f.detectOS=function(a){return f.findMatch(f.mobileDetectRules.oss0,a)||f.findMatch(f.mobileDetectRules.oss,a)},f.getDeviceSmallerSide=function(){return window.screen.width<window.screen.height?window.screen.width:window.screen.height},e.prototype={constructor:e,mobile:function(){return f.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.mobile},phone:function(){return f.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.phone},tablet:function(){return f.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.tablet},userAgent:function(){return this._cache.userAgent===b&&(this._cache.userAgent=f.findMatch(f.mobileDetectRules.uas,this.ua)),this._cache.userAgent},userAgents:function(){return this._cache.userAgents===b&&(this._cache.userAgents=f.findMatches(f.mobileDetectRules.uas,this.ua)),this._cache.userAgents},os:function(){return this._cache.os===b&&(this._cache.os=f.detectOS(this.ua)),this._cache.os},version:function(a){return f.getVersion(a,this.ua)},versionStr:function(a){return f.getVersionStr(a,this.ua)},is:function(b){return c(this.userAgents(),b)||a(b,this.os())||a(b,this.phone())||a(b,this.tablet())||c(f.findMatches(f.mobileDetectRules.utils,this.ua),b)},match:function(a){return a instanceof RegExp||(a=new RegExp(a,"i")),a.test(this.ua)},isPhoneSized:function(a){return e.isPhoneSized(a||this.maxPhoneWidth)},mobileGrade:function(){return this._cache.grade===b&&(this._cache.grade=f.mobileGrade(this)),this._cache.grade}},"undefined"!=typeof window&&window.screen?e.isPhoneSized=function(a){return a<0?b:f.getDeviceSmallerSide()<=a}:e.isPhoneSized=function(){},e._impl=f,e.version="1.3.6 2017-04-05",e})}(function(a){if("undefined"!=typeof module&&module.exports)return function(a){module.exports=a()};if("function"==typeof define&&define.amd)return define;if("undefined"!=typeof window)return function(a){window.MobileDetect=a()};throw new Error("unknown environment")}());;
/*
 Highcharts JS v5.0.7 (2017-01-17)

 (c) 2009-2016 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(L,a){"object"===typeof module&&module.exports?module.exports=L.document?a(L):a:L.Highcharts=a(L)})("undefined"!==typeof window?window:this,function(L){L=function(){var a=window,B=a.document,A=a.navigator&&a.navigator.userAgent||"",H=B&&B.createElementNS&&!!B.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,G=/(edge|msie|trident)/i.test(A)&&!window.opera,r=!H,g=/Firefox/.test(A),f=g&&4>parseInt(A.split("Firefox/")[1],10);return a.Highcharts?a.Highcharts.error(16,!0):{product:"Highcharts",
version:"5.0.7",deg2rad:2*Math.PI/360,doc:B,hasBidiBug:f,hasTouch:B&&void 0!==B.documentElement.ontouchstart,isMS:G,isWebKit:/AppleWebKit/.test(A),isFirefox:g,isTouchDevice:/(Mobile|Android|Windows Phone)/.test(A),SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:H,vml:r,win:a,charts:[],marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){}}}();(function(a){var B=[],A=a.charts,H=a.doc,G=a.win;a.error=function(r,g){r=a.isNumber(r)?"Highcharts error #"+
r+": www.highcharts.com/errors/"+r:r;if(g)throw Error(r);G.console&&console.log(r)};a.Fx=function(a,g,f){this.options=g;this.elem=a;this.prop=f};a.Fx.prototype={dSetter:function(){var a=this.paths[0],g=this.paths[1],f=[],u=this.now,l=a.length,q;if(1===u)f=this.toD;else if(l===g.length&&1>u)for(;l--;)q=parseFloat(a[l]),f[l]=isNaN(q)?a[l]:u*parseFloat(g[l]-q)+q;else f=g;this.elem.attr("d",f,null,!0)},update:function(){var a=this.elem,g=this.prop,f=this.now,u=this.options.step;if(this[g+"Setter"])this[g+
"Setter"]();else a.attr?a.element&&a.attr(g,f,null,!0):a.style[g]=f+this.unit;u&&u.call(a,f,this)},run:function(a,g,f){var r=this,l=function(a){return l.stopped?!1:r.step(a)},q;this.startTime=+new Date;this.start=a;this.end=g;this.unit=f;this.now=this.start;this.pos=0;l.elem=this.elem;l.prop=this.prop;l()&&1===B.push(l)&&(l.timerId=setInterval(function(){for(q=0;q<B.length;q++)B[q]()||B.splice(q--,1);B.length||clearInterval(l.timerId)},13))},step:function(a){var r=+new Date,f,u=this.options;f=this.elem;
var l=u.complete,q=u.duration,d=u.curAnim,b;if(f.attr&&!f.element)f=!1;else if(a||r>=q+this.startTime){this.now=this.end;this.pos=1;this.update();a=d[this.prop]=!0;for(b in d)!0!==d[b]&&(a=!1);a&&l&&l.call(f);f=!1}else this.pos=u.easing((r-this.startTime)/q),this.now=this.start+(this.end-this.start)*this.pos,this.update(),f=!0;return f},initPath:function(r,g,f){function u(a){var e,b;for(n=a.length;n--;)e="M"===a[n]||"L"===a[n],b=/[a-zA-Z]/.test(a[n+3]),e&&b&&a.splice(n+1,0,a[n+1],a[n+2],a[n+1],a[n+
2])}function l(a,e){for(;a.length<m;){a[0]=e[m-a.length];var b=a.slice(0,t);[].splice.apply(a,[0,0].concat(b));E&&(b=a.slice(a.length-t),[].splice.apply(a,[a.length,0].concat(b)),n--)}a[0]="M"}function q(a,e){for(var b=(m-a.length)/t;0<b&&b--;)c=a.slice().splice(a.length/z-t,t*z),c[0]=e[m-t-b*t],C&&(c[t-6]=c[t-2],c[t-5]=c[t-1]),[].splice.apply(a,[a.length/z,0].concat(c)),E&&b--}g=g||"";var d,b=r.startX,p=r.endX,C=-1<g.indexOf("C"),t=C?7:3,m,c,n;g=g.split(" ");f=f.slice();var E=r.isArea,z=E?2:1,e;
C&&(u(g),u(f));if(b&&p){for(n=0;n<b.length;n++)if(b[n]===p[0]){d=n;break}else if(b[0]===p[p.length-b.length+n]){d=n;e=!0;break}void 0===d&&(g=[])}g.length&&a.isNumber(d)&&(m=f.length+d*z*t,e?(l(g,f),q(f,g)):(l(f,g),q(g,f)));return[g,f]}};a.extend=function(a,g){var f;a||(a={});for(f in g)a[f]=g[f];return a};a.merge=function(){var r,g=arguments,f,u={},l=function(q,d){var b,p;"object"!==typeof q&&(q={});for(p in d)d.hasOwnProperty(p)&&(b=d[p],a.isObject(b,!0)&&"renderTo"!==p&&"number"!==typeof b.nodeType?
q[p]=l(q[p]||{},b):q[p]=d[p]);return q};!0===g[0]&&(u=g[1],g=Array.prototype.slice.call(g,2));f=g.length;for(r=0;r<f;r++)u=l(u,g[r]);return u};a.pInt=function(a,g){return parseInt(a,g||10)};a.isString=function(a){return"string"===typeof a};a.isArray=function(a){a=Object.prototype.toString.call(a);return"[object Array]"===a||"[object Array Iterator]"===a};a.isObject=function(r,g){return r&&"object"===typeof r&&(!g||!a.isArray(r))};a.isNumber=function(a){return"number"===typeof a&&!isNaN(a)};a.erase=
function(a,g){for(var f=a.length;f--;)if(a[f]===g){a.splice(f,1);break}};a.defined=function(a){return void 0!==a&&null!==a};a.attr=function(r,g,f){var u,l;if(a.isString(g))a.defined(f)?r.setAttribute(g,f):r&&r.getAttribute&&(l=r.getAttribute(g));else if(a.defined(g)&&a.isObject(g))for(u in g)r.setAttribute(u,g[u]);return l};a.splat=function(r){return a.isArray(r)?r:[r]};a.syncTimeout=function(a,g,f){if(g)return setTimeout(a,g,f);a.call(0,f)};a.pick=function(){var a=arguments,g,f,u=a.length;for(g=
0;g<u;g++)if(f=a[g],void 0!==f&&null!==f)return f};a.css=function(r,g){a.isMS&&!a.svg&&g&&void 0!==g.opacity&&(g.filter="alpha(opacity\x3d"+100*g.opacity+")");a.extend(r.style,g)};a.createElement=function(r,g,f,u,l){r=H.createElement(r);var q=a.css;g&&a.extend(r,g);l&&q(r,{padding:0,border:"none",margin:0});f&&q(r,f);u&&u.appendChild(r);return r};a.extendClass=function(r,g){var f=function(){};f.prototype=new r;a.extend(f.prototype,g);return f};a.pad=function(a,g,f){return Array((g||2)+1-String(a).length).join(f||
0)+a};a.relativeLength=function(a,g){return/%$/.test(a)?g*parseFloat(a)/100:parseFloat(a)};a.wrap=function(a,g,f){var r=a[g];a[g]=function(){var a=Array.prototype.slice.call(arguments),q=arguments,d=this;d.proceed=function(){r.apply(d,arguments.length?arguments:q)};a.unshift(r);a=f.apply(this,a);d.proceed=null;return a}};a.getTZOffset=function(r){var g=a.Date;return 6E4*(g.hcGetTimezoneOffset&&g.hcGetTimezoneOffset(r)||g.hcTimezoneOffset||0)};a.dateFormat=function(r,g,f){if(!a.defined(g)||isNaN(g))return a.defaultOptions.lang.invalidDate||
"";r=a.pick(r,"%Y-%m-%d %H:%M:%S");var u=a.Date,l=new u(g-a.getTZOffset(g)),q,d=l[u.hcGetHours](),b=l[u.hcGetDay](),p=l[u.hcGetDate](),C=l[u.hcGetMonth](),t=l[u.hcGetFullYear](),m=a.defaultOptions.lang,c=m.weekdays,n=m.shortWeekdays,E=a.pad,u=a.extend({a:n?n[b]:c[b].substr(0,3),A:c[b],d:E(p),e:E(p,2," "),w:b,b:m.shortMonths[C],B:m.months[C],m:E(C+1),y:t.toString().substr(2,2),Y:t,H:E(d),k:d,I:E(d%12||12),l:d%12||12,M:E(l[u.hcGetMinutes]()),p:12>d?"AM":"PM",P:12>d?"am":"pm",S:E(l.getSeconds()),L:E(Math.round(g%
1E3),3)},a.dateFormats);for(q in u)for(;-1!==r.indexOf("%"+q);)r=r.replace("%"+q,"function"===typeof u[q]?u[q](g):u[q]);return f?r.substr(0,1).toUpperCase()+r.substr(1):r};a.formatSingle=function(r,g){var f=/\.([0-9])/,u=a.defaultOptions.lang;/f$/.test(r)?(f=(f=r.match(f))?f[1]:-1,null!==g&&(g=a.numberFormat(g,f,u.decimalPoint,-1<r.indexOf(",")?u.thousandsSep:""))):g=a.dateFormat(r,g);return g};a.format=function(r,g){for(var f="{",u=!1,l,q,d,b,p=[],C;r;){f=r.indexOf(f);if(-1===f)break;l=r.slice(0,
f);if(u){l=l.split(":");q=l.shift().split(".");b=q.length;C=g;for(d=0;d<b;d++)C=C[q[d]];l.length&&(C=a.formatSingle(l.join(":"),C));p.push(C)}else p.push(l);r=r.slice(f+1);f=(u=!u)?"}":"{"}p.push(r);return p.join("")};a.getMagnitude=function(a){return Math.pow(10,Math.floor(Math.log(a)/Math.LN10))};a.normalizeTickInterval=function(r,g,f,u,l){var q,d=r;f=a.pick(f,1);q=r/f;g||(g=l?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===u&&(1===f?g=a.grep(g,function(a){return 0===a%1}):.1>=f&&(g=[1/f])));
for(u=0;u<g.length&&!(d=g[u],l&&d*f>=r||!l&&q<=(g[u]+(g[u+1]||g[u]))/2);u++);return d=a.correctFloat(d*f,-Math.round(Math.log(.001)/Math.LN10))};a.stableSort=function(a,g){var f=a.length,r,l;for(l=0;l<f;l++)a[l].safeI=l;a.sort(function(a,d){r=g(a,d);return 0===r?a.safeI-d.safeI:r});for(l=0;l<f;l++)delete a[l].safeI};a.arrayMin=function(a){for(var g=a.length,f=a[0];g--;)a[g]<f&&(f=a[g]);return f};a.arrayMax=function(a){for(var g=a.length,f=a[0];g--;)a[g]>f&&(f=a[g]);return f};a.destroyObjectProperties=
function(a,g){for(var f in a)a[f]&&a[f]!==g&&a[f].destroy&&a[f].destroy(),delete a[f]};a.discardElement=function(r){var g=a.garbageBin;g||(g=a.createElement("div"));r&&g.appendChild(r);g.innerHTML=""};a.correctFloat=function(a,g){return parseFloat(a.toPrecision(g||14))};a.setAnimation=function(r,g){g.renderer.globalAnimation=a.pick(r,g.options.chart.animation,!0)};a.animObject=function(r){return a.isObject(r)?a.merge(r):{duration:r?500:0}};a.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,
day:864E5,week:6048E5,month:24192E5,year:314496E5};a.numberFormat=function(r,g,f,u){r=+r||0;g=+g;var l=a.defaultOptions.lang,q=(r.toString().split(".")[1]||"").length,d,b;-1===g?g=Math.min(q,20):a.isNumber(g)||(g=2);b=(Math.abs(r)+Math.pow(10,-Math.max(g,q)-1)).toFixed(g);q=String(a.pInt(b));d=3<q.length?q.length%3:0;f=a.pick(f,l.decimalPoint);u=a.pick(u,l.thousandsSep);r=(0>r?"-":"")+(d?q.substr(0,d)+u:"");r+=q.substr(d).replace(/(\d{3})(?=\d)/g,"$1"+u);g&&(r+=f+b.slice(-g));return r};Math.easeInOutSine=
function(a){return-.5*(Math.cos(Math.PI*a)-1)};a.getStyle=function(r,g){return"width"===g?Math.min(r.offsetWidth,r.scrollWidth)-a.getStyle(r,"padding-left")-a.getStyle(r,"padding-right"):"height"===g?Math.min(r.offsetHeight,r.scrollHeight)-a.getStyle(r,"padding-top")-a.getStyle(r,"padding-bottom"):(r=G.getComputedStyle(r,void 0))&&a.pInt(r.getPropertyValue(g))};a.inArray=function(a,g){return g.indexOf?g.indexOf(a):[].indexOf.call(g,a)};a.grep=function(a,g){return[].filter.call(a,g)};a.find=function(a,
g){return[].find.call(a,g)};a.map=function(a,g){for(var f=[],u=0,l=a.length;u<l;u++)f[u]=g.call(a[u],a[u],u,a);return f};a.offset=function(a){var g=H.documentElement;a=a.getBoundingClientRect();return{top:a.top+(G.pageYOffset||g.scrollTop)-(g.clientTop||0),left:a.left+(G.pageXOffset||g.scrollLeft)-(g.clientLeft||0)}};a.stop=function(a,g){for(var f=B.length;f--;)B[f].elem!==a||g&&g!==B[f].prop||(B[f].stopped=!0)};a.each=function(a,g,f){return Array.prototype.forEach.call(a,g,f)};a.addEvent=function(r,
g,f){function u(a){a.target=a.srcElement||G;f.call(r,a)}var l=r.hcEvents=r.hcEvents||{};r.addEventListener?r.addEventListener(g,f,!1):r.attachEvent&&(r.hcEventsIE||(r.hcEventsIE={}),r.hcEventsIE[f.toString()]=u,r.attachEvent("on"+g,u));l[g]||(l[g]=[]);l[g].push(f);return function(){a.removeEvent(r,g,f)}};a.removeEvent=function(r,g,f){function u(a,b){r.removeEventListener?r.removeEventListener(a,b,!1):r.attachEvent&&(b=r.hcEventsIE[b.toString()],r.detachEvent("on"+a,b))}function l(){var a,b;if(r.nodeName)for(b in g?
(a={},a[g]=!0):a=d,a)if(d[b])for(a=d[b].length;a--;)u(b,d[b][a])}var q,d=r.hcEvents,b;d&&(g?(q=d[g]||[],f?(b=a.inArray(f,q),-1<b&&(q.splice(b,1),d[g]=q),u(g,f)):(l(),d[g]=[])):(l(),r.hcEvents={}))};a.fireEvent=function(r,g,f,u){var l;l=r.hcEvents;var q,d;f=f||{};if(H.createEvent&&(r.dispatchEvent||r.fireEvent))l=H.createEvent("Events"),l.initEvent(g,!0,!0),a.extend(l,f),r.dispatchEvent?r.dispatchEvent(l):r.fireEvent(g,l);else if(l)for(l=l[g]||[],q=l.length,f.target||a.extend(f,{preventDefault:function(){f.defaultPrevented=
!0},target:r,type:g}),g=0;g<q;g++)(d=l[g])&&!1===d.call(r,f)&&f.preventDefault();u&&!f.defaultPrevented&&u(f)};a.animate=function(r,g,f){var u,l="",q,d,b;a.isObject(f)||(u=arguments,f={duration:u[2],easing:u[3],complete:u[4]});a.isNumber(f.duration)||(f.duration=400);f.easing="function"===typeof f.easing?f.easing:Math[f.easing]||Math.easeInOutSine;f.curAnim=a.merge(g);for(b in g)a.stop(r,b),d=new a.Fx(r,f,b),q=null,"d"===b?(d.paths=d.initPath(r,r.d,g.d),d.toD=g.d,u=0,q=1):r.attr?u=r.attr(b):(u=parseFloat(a.getStyle(r,
b))||0,"opacity"!==b&&(l="px")),q||(q=g[b]),q.match&&q.match("px")&&(q=q.replace(/px/g,"")),d.run(u,q,l)};a.seriesType=function(r,g,f,u,l){var q=a.getOptions(),d=a.seriesTypes;q.plotOptions[r]=a.merge(q.plotOptions[g],f);d[r]=a.extendClass(d[g]||function(){},u);d[r].prototype.type=r;l&&(d[r].prototype.pointClass=a.extendClass(a.Point,l));return d[r]};a.uniqueKey=function(){var a=Math.random().toString(36).substring(2,9),g=0;return function(){return"highcharts-"+a+"-"+g++}}();G.jQuery&&(G.jQuery.fn.highcharts=
function(){var r=[].slice.call(arguments);if(this[0])return r[0]?(new (a[a.isString(r[0])?r.shift():"Chart"])(this[0],r[0],r[1]),this):A[a.attr(this[0],"data-highcharts-chart")]});H&&!H.defaultView&&(a.getStyle=function(r,g){var f={width:"clientWidth",height:"clientHeight"}[g];if(r.style[g])return a.pInt(r.style[g]);"opacity"===g&&(g="filter");if(f)return r.style.zoom=1,Math.max(r[f]-2*a.getStyle(r,"padding"),0);r=r.currentStyle[g.replace(/\-(\w)/g,function(a,l){return l.toUpperCase()})];"filter"===
g&&(r=r.replace(/alpha\(opacity=([0-9]+)\)/,function(a,l){return l/100}));return""===r?1:a.pInt(r)});Array.prototype.forEach||(a.each=function(a,g,f){for(var u=0,l=a.length;u<l;u++)if(!1===g.call(f,a[u],u,a))return u});Array.prototype.indexOf||(a.inArray=function(a,g){var f,u=0;if(g)for(f=g.length;u<f;u++)if(g[u]===a)return u;return-1});Array.prototype.filter||(a.grep=function(a,g){for(var f=[],u=0,l=a.length;u<l;u++)g(a[u],u)&&f.push(a[u]);return f});Array.prototype.find||(a.find=function(a,g){var f,
u=a.length;for(f=0;f<u;f++)if(g(a[f],f))return a[f]})})(L);(function(a){var B=a.each,A=a.isNumber,H=a.map,G=a.merge,r=a.pInt;a.Color=function(g){if(!(this instanceof a.Color))return new a.Color(g);this.init(g)};a.Color.prototype={parsers:[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(a){return[r(a[1]),r(a[2]),r(a[3]),parseFloat(a[4],10)]}},{regex:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(a){return[r(a[1],
16),r(a[2],16),r(a[3],16),1]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(a){return[r(a[1]),r(a[2]),r(a[3]),1]}}],names:{white:"#ffffff",black:"#000000"},init:function(g){var f,u,l,q;if((this.input=g=this.names[g]||g)&&g.stops)this.stops=H(g.stops,function(d){return new a.Color(d[1])});else for(l=this.parsers.length;l--&&!u;)q=this.parsers[l],(f=q.regex.exec(g))&&(u=q.parse(f));this.rgba=u||[]},get:function(a){var f=this.input,g=this.rgba,l;this.stops?
(l=G(f),l.stops=[].concat(l.stops),B(this.stops,function(f,d){l.stops[d]=[l.stops[d][0],f.get(a)]})):l=g&&A(g[0])?"rgb"===a||!a&&1===g[3]?"rgb("+g[0]+","+g[1]+","+g[2]+")":"a"===a?g[3]:"rgba("+g.join(",")+")":f;return l},brighten:function(a){var f,g=this.rgba;if(this.stops)B(this.stops,function(l){l.brighten(a)});else if(A(a)&&0!==a)for(f=0;3>f;f++)g[f]+=r(255*a),0>g[f]&&(g[f]=0),255<g[f]&&(g[f]=255);return this},setOpacity:function(a){this.rgba[3]=a;return this}};a.color=function(g){return new a.Color(g)}})(L);
(function(a){var B,A,H=a.addEvent,G=a.animate,r=a.attr,g=a.charts,f=a.color,u=a.css,l=a.createElement,q=a.defined,d=a.deg2rad,b=a.destroyObjectProperties,p=a.doc,C=a.each,t=a.extend,m=a.erase,c=a.grep,n=a.hasTouch,E=a.inArray,z=a.isArray,e=a.isFirefox,x=a.isMS,F=a.isObject,w=a.isString,h=a.isWebKit,y=a.merge,J=a.noop,K=a.pick,I=a.pInt,k=a.removeEvent,D=a.stop,P=a.svg,N=a.SVG_NS,S=a.symbolSizes,O=a.win;B=a.SVGElement=function(){return this};B.prototype={opacity:1,SVG_NS:N,textProps:"direction fontSize fontWeight fontFamily fontStyle color lineHeight width textDecoration textOverflow textOutline".split(" "),
init:function(a,k){this.element="span"===k?l(k):p.createElementNS(this.SVG_NS,k);this.renderer=a},animate:function(v,k,e){k=a.animObject(K(k,this.renderer.globalAnimation,!0));0!==k.duration?(e&&(k.complete=e),G(this,v,k)):this.attr(v,null,e);return this},colorGradient:function(v,k,e){var b=this.renderer,h,D,c,x,M,m,n,d,F,t,p,w=[],l;v.linearGradient?D="linearGradient":v.radialGradient&&(D="radialGradient");if(D){c=v[D];M=b.gradients;n=v.stops;t=e.radialReference;z(c)&&(v[D]=c={x1:c[0],y1:c[1],x2:c[2],
y2:c[3],gradientUnits:"userSpaceOnUse"});"radialGradient"===D&&t&&!q(c.gradientUnits)&&(x=c,c=y(c,b.getRadialAttr(t,x),{gradientUnits:"userSpaceOnUse"}));for(p in c)"id"!==p&&w.push(p,c[p]);for(p in n)w.push(n[p]);w=w.join(",");M[w]?t=M[w].attr("id"):(c.id=t=a.uniqueKey(),M[w]=m=b.createElement(D).attr(c).add(b.defs),m.radAttr=x,m.stops=[],C(n,function(v){0===v[1].indexOf("rgba")?(h=a.color(v[1]),d=h.get("rgb"),F=h.get("a")):(d=v[1],F=1);v=b.createElement("stop").attr({offset:v[0],"stop-color":d,
"stop-opacity":F}).add(m);m.stops.push(v)}));l="url("+b.url+"#"+t+")";e.setAttribute(k,l);e.gradient=w;v.toString=function(){return l}}},applyTextOutline:function(a){var v=this.element,k,e,b,c;-1!==a.indexOf("contrast")&&(a=a.replace(/contrast/g,this.renderer.getContrast(v.style.fill)));this.fakeTS=!0;this.ySetter=this.xSetter;k=[].slice.call(v.getElementsByTagName("tspan"));a=a.split(" ");e=a[a.length-1];(b=a[0])&&"none"!==b&&(b=b.replace(/(^[\d\.]+)(.*?)$/g,function(a,v,k){return 2*v+k}),C(k,function(a){"highcharts-text-outline"===
a.getAttribute("class")&&m(k,v.removeChild(a))}),c=v.firstChild,C(k,function(a,k){0===k&&(a.setAttribute("x",v.getAttribute("x")),k=v.getAttribute("y"),a.setAttribute("y",k||0),null===k&&v.setAttribute("y",0));a=a.cloneNode(1);r(a,{"class":"highcharts-text-outline",fill:e,stroke:e,"stroke-width":b,"stroke-linejoin":"round"});v.insertBefore(a,c)}))},attr:function(a,k,e,b){var v,c=this.element,h,x=this,M;"string"===typeof a&&void 0!==k&&(v=a,a={},a[v]=k);if("string"===typeof a)x=(this[a+"Getter"]||
this._defaultGetter).call(this,a,c);else{for(v in a)k=a[v],M=!1,b||D(this,v),this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(v)&&(h||(this.symbolAttr(a),h=!0),M=!0),!this.rotation||"x"!==v&&"y"!==v||(this.doTransform=!0),M||(M=this[v+"Setter"]||this._defaultSetter,M.call(this,k,v,c),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(v)&&this.updateShadows(v,k,M));this.doTransform&&(this.updateTransform(),this.doTransform=!1)}e&&e();return x},updateShadows:function(a,
k,e){for(var v=this.shadows,b=v.length;b--;)e.call(v[b],"height"===a?Math.max(k-(v[b].cutHeight||0),0):"d"===a?this.d:k,a,v[b])},addClass:function(a,k){var v=this.attr("class")||"";-1===v.indexOf(a)&&(k||(a=(v+(v?" ":"")+a).replace("  "," ")),this.attr("class",a));return this},hasClass:function(a){return-1!==r(this.element,"class").indexOf(a)},removeClass:function(a){r(this.element,"class",(r(this.element,"class")||"").replace(a,""));return this},symbolAttr:function(a){var v=this;C("x y r start end width height innerR anchorX anchorY".split(" "),
function(k){v[k]=K(a[k],v[k])});v.attr({d:v.renderer.symbols[v.symbolName](v.x,v.y,v.width,v.height,v)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":"none")},crisp:function(a,k){var v,e={},b;k=k||a.strokeWidth||0;b=Math.round(k)%2/2;a.x=Math.floor(a.x||this.x||0)+b;a.y=Math.floor(a.y||this.y||0)+b;a.width=Math.floor((a.width||this.width||0)-2*b);a.height=Math.floor((a.height||this.height||0)-2*b);q(a.strokeWidth)&&(a.strokeWidth=k);for(v in a)this[v]!==a[v]&&
(this[v]=e[v]=a[v]);return e},css:function(a){var v=this.styles,k={},e=this.element,b,c,h="";b=!v;var D=["textOverflow","width"];a&&a.color&&(a.fill=a.color);if(v)for(c in a)a[c]!==v[c]&&(k[c]=a[c],b=!0);if(b){b=this.textWidth=a&&a.width&&"text"===e.nodeName.toLowerCase()&&I(a.width)||this.textWidth;v&&(a=t(v,k));this.styles=a;b&&!P&&this.renderer.forExport&&delete a.width;if(x&&!P)u(this.element,a);else{v=function(a,v){return"-"+v.toLowerCase()};for(c in a)-1===E(c,D)&&(h+=c.replace(/([A-Z])/g,v)+
":"+a[c]+";");h&&r(e,"style",h)}this.added&&(b&&this.renderer.buildText(this),a&&a.textOutline&&this.applyTextOutline(a.textOutline))}return this},strokeWidth:function(){return this["stroke-width"]||0},on:function(a,k){var v=this,e=v.element;n&&"click"===a?(e.ontouchstart=function(a){v.touchEventFired=Date.now();a.preventDefault();k.call(e,a)},e.onclick=function(a){(-1===O.navigator.userAgent.indexOf("Android")||1100<Date.now()-(v.touchEventFired||0))&&k.call(e,a)}):e["on"+a]=k;return this},setRadialReference:function(a){var v=
this.renderer.gradients[this.element.gradient];this.element.radialReference=a;v&&v.radAttr&&v.animate(this.renderer.getRadialAttr(a,v.radAttr));return this},translate:function(a,k){return this.attr({translateX:a,translateY:k})},invert:function(a){this.inverted=a;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,k=this.translateY||0,e=this.scaleX,b=this.scaleY,c=this.inverted,h=this.rotation,D=this.element;c&&(a+=this.width,k+=this.height);a=["translate("+a+","+
k+")"];c?a.push("rotate(90) scale(-1,1)"):h&&a.push("rotate("+h+" "+(D.getAttribute("x")||0)+" "+(D.getAttribute("y")||0)+")");(q(e)||q(b))&&a.push("scale("+K(e,1)+" "+K(b,1)+")");a.length&&D.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,k,e){var v,b,c,h,D={};b=this.renderer;c=b.alignedObjects;var x,y;if(a){if(this.alignOptions=a,this.alignByTranslate=k,!e||w(e))this.alignTo=v=e||"renderer",m(c,this),c.push(this),
e=null}else a=this.alignOptions,k=this.alignByTranslate,v=this.alignTo;e=K(e,b[v],b);v=a.align;b=a.verticalAlign;c=(e.x||0)+(a.x||0);h=(e.y||0)+(a.y||0);"right"===v?x=1:"center"===v&&(x=2);x&&(c+=(e.width-(a.width||0))/x);D[k?"translateX":"x"]=Math.round(c);"bottom"===b?y=1:"middle"===b&&(y=2);y&&(h+=(e.height-(a.height||0))/y);D[k?"translateY":"y"]=Math.round(h);this[this.placed?"animate":"attr"](D);this.placed=!0;this.alignAttr=D;return this},getBBox:function(a,k){var v,e=this.renderer,b,c=this.element,
h=this.styles,D,x=this.textStr,m,y=e.cache,n=e.cacheKeys,F;k=K(k,this.rotation);b=k*d;D=h&&h.fontSize;void 0!==x&&(F=x.toString(),-1===F.indexOf("\x3c")&&(F=F.replace(/[0-9]/g,"0")),F+=["",k||0,D,h&&h.width,h&&h.textOverflow].join());F&&!a&&(v=y[F]);if(!v){if(c.namespaceURI===this.SVG_NS||e.forExport){try{(m=this.fakeTS&&function(a){C(c.querySelectorAll(".highcharts-text-outline"),function(v){v.style.display=a})})&&m("none"),v=c.getBBox?t({},c.getBBox()):{width:c.offsetWidth,height:c.offsetHeight},
m&&m("")}catch(W){}if(!v||0>v.width)v={width:0,height:0}}else v=this.htmlGetBBox();e.isSVG&&(a=v.width,e=v.height,h&&"11px"===h.fontSize&&17===Math.round(e)&&(v.height=e=14),k&&(v.width=Math.abs(e*Math.sin(b))+Math.abs(a*Math.cos(b)),v.height=Math.abs(e*Math.cos(b))+Math.abs(a*Math.sin(b))));if(F&&0<v.height){for(;250<n.length;)delete y[n.shift()];y[F]||n.push(F);y[F]=v}}return v},show:function(a){return this.attr({visibility:a?"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},
fadeOut:function(a){var v=this;v.animate({opacity:0},{duration:a||150,complete:function(){v.attr({y:-9999})}})},add:function(a){var v=this.renderer,k=this.element,e;a&&(this.parentGroup=a);this.parentInverted=a&&a.inverted;void 0!==this.textStr&&v.buildText(this);this.added=!0;if(!a||a.handleZ||this.zIndex)e=this.zIndexSetter();e||(a?a.element:v.box).appendChild(k);if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var v=a.parentNode;v&&v.removeChild(a)},destroy:function(){var a=
this.element||{},k=this.renderer.isSVG&&"SPAN"===a.nodeName&&this.parentGroup,e,b;a.onclick=a.onmouseout=a.onmouseover=a.onmousemove=a.point=null;D(this);this.clipPath&&(this.clipPath=this.clipPath.destroy());if(this.stops){for(b=0;b<this.stops.length;b++)this.stops[b]=this.stops[b].destroy();this.stops=null}this.safeRemoveChild(a);for(this.destroyShadows();k&&k.div&&0===k.div.childNodes.length;)a=k.parentGroup,this.safeRemoveChild(k.div),delete k.div,k=a;this.alignTo&&m(this.renderer.alignedObjects,
this);for(e in this)delete this[e];return null},shadow:function(a,k,e){var v=[],b,c,h=this.element,D,x,m,y;if(!a)this.destroyShadows();else if(!this.shadows){x=K(a.width,3);m=(a.opacity||.15)/x;y=this.parentInverted?"(-1,-1)":"("+K(a.offsetX,1)+", "+K(a.offsetY,1)+")";for(b=1;b<=x;b++)c=h.cloneNode(0),D=2*x+1-2*b,r(c,{isShadow:"true",stroke:a.color||"#000000","stroke-opacity":m*b,"stroke-width":D,transform:"translate"+y,fill:"none"}),e&&(r(c,"height",Math.max(r(c,"height")-D,0)),c.cutHeight=D),k?
k.element.appendChild(c):h.parentNode.insertBefore(c,h),v.push(c);this.shadows=v}return this},destroyShadows:function(){C(this.shadows||[],function(a){this.safeRemoveChild(a)},this);this.shadows=void 0},xGetter:function(a){"circle"===this.element.nodeName&&("x"===a?a="cx":"y"===a&&(a="cy"));return this._defaultGetter(a)},_defaultGetter:function(a){a=K(this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,k,e){a&&a.join&&(a=
a.join(" "));/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");e.setAttribute(k,a);this[k]=a},dashstyleSetter:function(a){var v,k=this["stroke-width"];"inherit"===k&&(k=1);if(a=a&&a.toLowerCase()){a=a.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(v=a.length;v--;)a[v]=I(a[v])*k;a=a.join(",").replace(/NaN/g,"none");this.element.setAttribute("stroke-dasharray",
a)}},alignSetter:function(a){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,k,e){this[k]=a;e.setAttribute(k,a)},titleSetter:function(a){var v=this.element.getElementsByTagName("title")[0];v||(v=p.createElementNS(this.SVG_NS,"title"),this.element.appendChild(v));v.firstChild&&v.removeChild(v.firstChild);v.appendChild(p.createTextNode(String(K(a),"").replace(/<[^>]*>/g,"")))},textSetter:function(a){a!==this.textStr&&(delete this.bBox,
this.textStr=a,this.added&&this.renderer.buildText(this))},fillSetter:function(a,k,e){"string"===typeof a?e.setAttribute(k,a):a&&this.colorGradient(a,k,e)},visibilitySetter:function(a,k,e){"inherit"===a?e.removeAttribute(k):e.setAttribute(k,a)},zIndexSetter:function(a,k){var v=this.renderer,e=this.parentGroup,b=(e||v).element||v.box,c,h=this.element,D;c=this.added;var x;q(a)&&(h.zIndex=a,a=+a,this[k]===a&&(c=!1),this[k]=a);if(c){(a=this.zIndex)&&e&&(e.handleZ=!0);k=b.childNodes;for(x=0;x<k.length&&
!D;x++)e=k[x],c=e.zIndex,e!==h&&(I(c)>a||!q(a)&&q(c)||0>a&&!q(c)&&b!==v.box)&&(b.insertBefore(h,e),D=!0);D||b.appendChild(h)}return D},_defaultSetter:function(a,k,e){e.setAttribute(k,a)}};B.prototype.yGetter=B.prototype.xGetter;B.prototype.translateXSetter=B.prototype.translateYSetter=B.prototype.rotationSetter=B.prototype.verticalAlignSetter=B.prototype.scaleXSetter=B.prototype.scaleYSetter=function(a,k){this[k]=a;this.doTransform=!0};B.prototype["stroke-widthSetter"]=B.prototype.strokeSetter=function(a,
k,e){this[k]=a;this.stroke&&this["stroke-width"]?(B.prototype.fillSetter.call(this,this.stroke,"stroke",e),e.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===k&&0===a&&this.hasStroke&&(e.removeAttribute("stroke"),this.hasStroke=!1)};A=a.SVGRenderer=function(){this.init.apply(this,arguments)};A.prototype={Element:B,SVG_NS:N,init:function(a,k,b,c,D,x){var v;c=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"}).css(this.getStyle(c));v=c.element;
a.appendChild(v);-1===a.innerHTML.indexOf("xmlns")&&r(v,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=v;this.boxWrapper=c;this.alignedObjects=[];this.url=(e||h)&&p.getElementsByTagName("base").length?O.location.href.replace(/#.*?$/,"").replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(p.createTextNode("Created with Highcharts 5.0.7"));this.defs=this.createElement("defs").add();this.allowHTML=x;this.forExport=D;this.gradients=
{};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(k,b,!1);var m;e&&a.getBoundingClientRect&&(k=function(){u(a,{left:0,top:0});m=a.getBoundingClientRect();u(a,{left:Math.ceil(m.left)-m.left+"px",top:Math.ceil(m.top)-m.top+"px"})},k(),this.unSubPixelFix=H(O,"resize",k))},getStyle:function(a){return this.style=t({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},setStyle:function(a){this.boxWrapper.css(this.getStyle(a))},isHidden:function(){return!this.boxWrapper.getBBox().width},
destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();b(this.gradients||{});this.gradients=null;a&&(this.defs=a.destroy());this.unSubPixelFix&&this.unSubPixelFix();return this.alignedObjects=null},createElement:function(a){var k=new this.Element;k.init(this,a);return k},draw:J,getRadialAttr:function(a,k){return{cx:a[0]-a[2]/2+k.cx*a[2],cy:a[1]-a[2]/2+k.cy*a[2],r:k.r*a[2]}},buildText:function(a){var k=a.element,v=this,e=v.forExport,b=K(a.textStr,"").toString(),
h=-1!==b.indexOf("\x3c"),D=k.childNodes,x,m,y,n,F=r(k,"x"),d=a.styles,t=a.textWidth,w=d&&d.lineHeight,l=d&&d.textOutline,z=d&&"ellipsis"===d.textOverflow,f=d&&"nowrap"===d.whiteSpace,E=d&&d.fontSize,q,g=D.length,d=t&&!a.added&&this.box,J=function(a){var e;e=/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:E||v.style.fontSize||12;return w?I(w):v.fontMetrics(e,a.getAttribute("style")?a:k).h};q=[b,z,f,w,l,E,t].join();if(q!==a.textCache){for(a.textCache=q;g--;)k.removeChild(D[g]);h||l||z||t||-1!==
b.indexOf(" ")?(x=/<.*class="([^"]+)".*>/,m=/<.*style="([^"]+)".*>/,y=/<.*href="(http[^"]+)".*>/,d&&d.appendChild(k),b=h?b.replace(/<(b|strong)>/g,'\x3cspan style\x3d"font-weight:bold"\x3e').replace(/<(i|em)>/g,'\x3cspan style\x3d"font-style:italic"\x3e').replace(/<a/g,"\x3cspan").replace(/<\/(b|strong|i|em|a)>/g,"\x3c/span\x3e").split(/<br.*?>/g):[b],b=c(b,function(a){return""!==a}),C(b,function(b,c){var h,D=0;b=b.replace(/^\s+|\s+$/g,"").replace(/<span/g,"|||\x3cspan").replace(/<\/span>/g,"\x3c/span\x3e|||");
h=b.split("|||");C(h,function(b){if(""!==b||1===h.length){var d={},w=p.createElementNS(v.SVG_NS,"tspan"),l,E;x.test(b)&&(l=b.match(x)[1],r(w,"class",l));m.test(b)&&(E=b.match(m)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),r(w,"style",E));y.test(b)&&!e&&(r(w,"onclick",'location.href\x3d"'+b.match(y)[1]+'"'),u(w,{cursor:"pointer"}));b=(b.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"\x3c").replace(/&gt;/g,"\x3e");if(" "!==b){w.appendChild(p.createTextNode(b));D?d.dx=0:c&&null!==F&&(d.x=F);r(w,d);
k.appendChild(w);!D&&c&&(!P&&e&&u(w,{display:"block"}),r(w,"dy",J(w)));if(t){d=b.replace(/([^\^])-/g,"$1- ").split(" ");l=1<h.length||c||1<d.length&&!f;for(var q,g,M=[],C=J(w),K=a.rotation,I=b,Q=I.length;(l||z)&&(d.length||M.length);)a.rotation=0,q=a.getBBox(!0),g=q.width,!P&&v.forExport&&(g=v.measureSpanWidth(w.firstChild.data,a.styles)),q=g>t,void 0===n&&(n=q),z&&n?(Q/=2,""===I||!q&&.5>Q?d=[]:(I=b.substring(0,I.length+(q?-1:1)*Math.ceil(Q)),d=[I+(3<t?"\u2026":"")],w.removeChild(w.firstChild))):
q&&1!==d.length?(w.removeChild(w.firstChild),M.unshift(d.pop())):(d=M,M=[],d.length&&!f&&(w=p.createElementNS(N,"tspan"),r(w,{dy:C,x:F}),E&&r(w,"style",E),k.appendChild(w)),g>t&&(t=g)),d.length&&w.appendChild(p.createTextNode(d.join(" ").replace(/- /g,"-")));a.rotation=K}D++}}})}),n&&a.attr("title",a.textStr),d&&d.removeChild(k),l&&a.applyTextOutline&&a.applyTextOutline(l)):k.appendChild(p.createTextNode(b.replace(/&lt;/g,"\x3c").replace(/&gt;/g,"\x3e")))}},getContrast:function(a){a=f(a).rgba;return 510<
a[0]+a[1]+a[2]?"#000000":"#FFFFFF"},button:function(a,k,e,b,c,h,D,m,d){var v=this.label(a,k,e,d,null,null,null,null,"button"),n=0;v.attr(y({padding:8,r:2},c));var F,w,p,l;c=y({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer",fontWeight:"normal"}},c);F=c.style;delete c.style;h=y(c,{fill:"#e6e6e6"},h);w=h.style;delete h.style;D=y(c,{fill:"#e6ebf5",style:{color:"#000000",fontWeight:"bold"}},D);p=D.style;delete D.style;m=y(c,{style:{color:"#cccccc"}},m);l=m.style;
delete m.style;H(v.element,x?"mouseover":"mouseenter",function(){3!==n&&v.setState(1)});H(v.element,x?"mouseout":"mouseleave",function(){3!==n&&v.setState(n)});v.setState=function(a){1!==a&&(v.state=n=a);v.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][a||0]);v.attr([c,h,D,m][a||0]).css([F,w,p,l][a||0])};v.attr(c).css(t({cursor:"default"},F));return v.on("click",function(a){3!==n&&b.call(v,a)})},crispLine:function(a,
k){a[1]===a[4]&&(a[1]=a[4]=Math.round(a[1])-k%2/2);a[2]===a[5]&&(a[2]=a[5]=Math.round(a[2])+k%2/2);return a},path:function(a){var k={fill:"none"};z(a)?k.d=a:F(a)&&t(k,a);return this.createElement("path").attr(k)},circle:function(a,k,e){a=F(a)?a:{x:a,y:k,r:e};k=this.createElement("circle");k.xSetter=k.ySetter=function(a,k,e){e.setAttribute("c"+k,a)};return k.attr(a)},arc:function(a,k,e,b,c,h){F(a)&&(k=a.y,e=a.r,b=a.innerR,c=a.start,h=a.end,a=a.x);a=this.symbol("arc",a||0,k||0,e||0,e||0,{innerR:b||
0,start:c||0,end:h||0});a.r=e;return a},rect:function(a,k,e,b,c,h){c=F(a)?a.r:c;var v=this.createElement("rect");a=F(a)?a:void 0===a?{}:{x:a,y:k,width:Math.max(e,0),height:Math.max(b,0)};void 0!==h&&(a.strokeWidth=h,a=v.crisp(a));a.fill="none";c&&(a.r=c);v.rSetter=function(a,k,e){r(e,{rx:a,ry:a})};return v.attr(a)},setSize:function(a,k,e){var b=this.alignedObjects,v=b.length;this.width=a;this.height=k;for(this.boxWrapper.animate({width:a,height:k},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+
" "+this.attr("height")})},duration:K(e,!0)?void 0:0});v--;)b[v].align()},g:function(a){var k=this.createElement("g");return a?k.attr({"class":"highcharts-"+a}):k},image:function(a,k,e,b,c){var v={preserveAspectRatio:"none"};1<arguments.length&&t(v,{x:k,y:e,width:b,height:c});v=this.createElement("image").attr(v);v.element.setAttributeNS?v.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):v.element.setAttribute("hc-svg-href",a);return v},symbol:function(a,k,e,b,c,h){var v=this,D,x=this.symbols[a],
m=q(k)&&x&&this.symbols[a](Math.round(k),Math.round(e),b,c,h),y=/^url\((.*?)\)$/,d,n;x?(D=this.path(m),D.attr("fill","none"),t(D,{symbolName:a,x:k,y:e,width:b,height:c}),h&&t(D,h)):y.test(a)&&(d=a.match(y)[1],D=this.image(d),D.imgwidth=K(S[d]&&S[d].width,h&&h.width),D.imgheight=K(S[d]&&S[d].height,h&&h.height),n=function(){D.attr({width:D.width,height:D.height})},C(["width","height"],function(a){D[a+"Setter"]=function(a,k){var e={},b=this["img"+k],v="width"===k?"translateX":"translateY";this[k]=a;
q(b)&&(this.element&&this.element.setAttribute(k,b),this.alignByTranslate||(e[v]=((this[k]||0)-b)/2,this.attr(e)))}}),q(k)&&D.attr({x:k,y:e}),D.isImg=!0,q(D.imgwidth)&&q(D.imgheight)?n():(D.attr({width:0,height:0}),l("img",{onload:function(){var a=g[v.chartIndex];0===this.width&&(u(this,{position:"absolute",top:"-999em"}),p.body.appendChild(this));S[d]={width:this.width,height:this.height};D.imgwidth=this.width;D.imgheight=this.height;D.element&&n();this.parentNode&&this.parentNode.removeChild(this);
v.imgCount--;if(!v.imgCount&&a&&a.onload)a.onload()},src:d}),this.imgCount++));return D},symbols:{circle:function(a,k,e,b){return this.arc(a+e/2,k+b/2,e/2,b/2,{start:0,end:2*Math.PI,open:!1})},square:function(a,k,e,b){return["M",a,k,"L",a+e,k,a+e,k+b,a,k+b,"Z"]},triangle:function(a,k,e,b){return["M",a+e/2,k,"L",a+e,k+b,a,k+b,"Z"]},"triangle-down":function(a,k,e,b){return["M",a,k,"L",a+e,k,a+e/2,k+b,"Z"]},diamond:function(a,k,e,b){return["M",a+e/2,k,"L",a+e,k+b/2,a+e/2,k+b,a,k+b/2,"Z"]},arc:function(a,
k,e,b,c){var v=c.start,h=c.r||e,D=c.r||b||e,x=c.end-.001;e=c.innerR;b=c.open;var m=Math.cos(v),d=Math.sin(v),y=Math.cos(x),x=Math.sin(x);c=c.end-v<Math.PI?0:1;h=["M",a+h*m,k+D*d,"A",h,D,0,c,1,a+h*y,k+D*x];q(e)&&h.push(b?"M":"L",a+e*y,k+e*x,"A",e,e,0,c,0,a+e*m,k+e*d);h.push(b?"":"Z");return h},callout:function(a,k,e,b,c){var h=Math.min(c&&c.r||0,e,b),D=h+6,v=c&&c.anchorX;c=c&&c.anchorY;var x;x=["M",a+h,k,"L",a+e-h,k,"C",a+e,k,a+e,k,a+e,k+h,"L",a+e,k+b-h,"C",a+e,k+b,a+e,k+b,a+e-h,k+b,"L",a+h,k+b,"C",
a,k+b,a,k+b,a,k+b-h,"L",a,k+h,"C",a,k,a,k,a+h,k];v&&v>e?c>k+D&&c<k+b-D?x.splice(13,3,"L",a+e,c-6,a+e+6,c,a+e,c+6,a+e,k+b-h):x.splice(13,3,"L",a+e,b/2,v,c,a+e,b/2,a+e,k+b-h):v&&0>v?c>k+D&&c<k+b-D?x.splice(33,3,"L",a,c+6,a-6,c,a,c-6,a,k+h):x.splice(33,3,"L",a,b/2,v,c,a,b/2,a,k+h):c&&c>b&&v>a+D&&v<a+e-D?x.splice(23,3,"L",v+6,k+b,v,k+b+6,v-6,k+b,a+h,k+b):c&&0>c&&v>a+D&&v<a+e-D&&x.splice(3,3,"L",v-6,k,v,k-6,v+6,k,e-h,k);return x}},clipRect:function(k,e,b,c){var h=a.uniqueKey(),D=this.createElement("clipPath").attr({id:h}).add(this.defs);
k=this.rect(k,e,b,c,0).add(D);k.id=h;k.clipPath=D;k.count=0;return k},text:function(a,k,e,b){var c=!P&&this.forExport,h={};if(b&&(this.allowHTML||!this.forExport))return this.html(a,k,e);h.x=Math.round(k||0);e&&(h.y=Math.round(e));if(a||0===a)h.text=a;a=this.createElement("text").attr(h);c&&a.css({position:"absolute"});b||(a.xSetter=function(a,k,e){var b=e.getElementsByTagName("tspan"),c,h=e.getAttribute(k),D;for(D=0;D<b.length;D++)c=b[D],c.getAttribute(k)===h&&c.setAttribute(k,a);e.setAttribute(k,
a)});return a},fontMetrics:function(a,k){a=a||k&&k.style&&k.style.fontSize||this.style&&this.style.fontSize;a=/px/.test(a)?I(a):/em/.test(a)?parseFloat(a)*(k?this.fontMetrics(null,k.parentNode).f:16):12;k=24>a?a+3:Math.round(1.2*a);return{h:k,b:Math.round(.8*k),f:a}},rotCorr:function(a,k,e){var b=a;k&&e&&(b=Math.max(b*Math.cos(k*d),4));return{x:-a/3*Math.sin(k*d),y:b}},label:function(a,e,b,c,h,D,x,m,d){var v=this,n=v.g("button"!==d&&"label"),F=n.text=v.text("",0,0,x).attr({zIndex:1}),w,p,l=0,z=3,
E=0,f,g,J,K,P,N={},I,u,r=/^url\((.*?)\)$/.test(c),M=r,S,Q,R,O;d&&n.addClass("highcharts-"+d);M=r;S=function(){return(I||0)%2/2};Q=function(){var a=F.element.style,k={};p=(void 0===f||void 0===g||P)&&q(F.textStr)&&F.getBBox();n.width=(f||p.width||0)+2*z+E;n.height=(g||p.height||0)+2*z;u=z+v.fontMetrics(a&&a.fontSize,F).b;M&&(w||(n.box=w=v.symbols[c]||r?v.symbol(c):v.rect(),w.addClass(("button"===d?"":"highcharts-label-box")+(d?" highcharts-"+d+"-box":"")),w.add(n),a=S(),k.x=a,k.y=(m?-u:0)+a),k.width=
Math.round(n.width),k.height=Math.round(n.height),w.attr(t(k,N)),N={})};R=function(){var a=E+z,k;k=m?0:u;q(f)&&p&&("center"===P||"right"===P)&&(a+={center:.5,right:1}[P]*(f-p.width));if(a!==F.x||k!==F.y)F.attr("x",a),void 0!==k&&F.attr("y",k);F.x=a;F.y=k};O=function(a,k){w?w.attr(a,k):N[a]=k};n.onAdd=function(){F.add(n);n.attr({text:a||0===a?a:"",x:e,y:b});w&&q(h)&&n.attr({anchorX:h,anchorY:D})};n.widthSetter=function(a){f=a};n.heightSetter=function(a){g=a};n["text-alignSetter"]=function(a){P=a};
n.paddingSetter=function(a){q(a)&&a!==z&&(z=n.padding=a,R())};n.paddingLeftSetter=function(a){q(a)&&a!==E&&(E=a,R())};n.alignSetter=function(a){a={left:0,center:.5,right:1}[a];a!==l&&(l=a,p&&n.attr({x:J}))};n.textSetter=function(a){void 0!==a&&F.textSetter(a);Q();R()};n["stroke-widthSetter"]=function(a,k){a&&(M=!0);I=this["stroke-width"]=a;O(k,a)};n.strokeSetter=n.fillSetter=n.rSetter=function(a,k){"fill"===k&&a&&(M=!0);O(k,a)};n.anchorXSetter=function(a,k){h=a;O(k,Math.round(a)-S()-J)};n.anchorYSetter=
function(a,k){D=a;O(k,a-K)};n.xSetter=function(a){n.x=a;l&&(a-=l*((f||p.width)+2*z));J=Math.round(a);n.attr("translateX",J)};n.ySetter=function(a){K=n.y=Math.round(a);n.attr("translateY",K)};var V=n.css;return t(n,{css:function(a){if(a){var k={};a=y(a);C(n.textProps,function(e){void 0!==a[e]&&(k[e]=a[e],delete a[e])});F.css(k)}return V.call(n,a)},getBBox:function(){return{width:p.width+2*z,height:p.height+2*z,x:p.x-z,y:p.y-z}},shadow:function(a){a&&(Q(),w&&w.shadow(a));return n},destroy:function(){k(n.element,
"mouseenter");k(n.element,"mouseleave");F&&(F=F.destroy());w&&(w=w.destroy());B.prototype.destroy.call(n);n=v=Q=R=O=null}})}};a.Renderer=A})(L);(function(a){var B=a.attr,A=a.createElement,H=a.css,G=a.defined,r=a.each,g=a.extend,f=a.isFirefox,u=a.isMS,l=a.isWebKit,q=a.pInt,d=a.SVGRenderer,b=a.win,p=a.wrap;g(a.SVGElement.prototype,{htmlCss:function(a){var b=this.element;if(b=a&&"SPAN"===b.tagName&&a.width)delete a.width,this.textWidth=b,this.updateTransform();a&&"ellipsis"===a.textOverflow&&(a.whiteSpace=
"nowrap",a.overflow="hidden");this.styles=g(this.styles,a);H(this.element,a);return this},htmlGetBBox:function(){var a=this.element;"text"===a.nodeName&&(a.style.position="absolute");return{x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,m=this.translateX||0,c=this.translateY||0,n=this.x||0,d=this.y||0,p=this.textAlign||"left",e={left:0,center:.5,right:1}[p],x=this.styles;H(b,{marginLeft:m,marginTop:c});
this.shadows&&r(this.shadows,function(a){H(a,{marginLeft:m+1,marginTop:c+1})});this.inverted&&r(b.childNodes,function(e){a.invertChild(e,b)});if("SPAN"===b.tagName){var F=this.rotation,w=q(this.textWidth),h=x&&x.whiteSpace,y=[F,p,b.innerHTML,this.textWidth,this.textAlign].join();y!==this.cTT&&(x=a.fontMetrics(b.style.fontSize).b,G(F)&&this.setSpanRotation(F,e,x),H(b,{width:"",whiteSpace:h||"nowrap"}),b.offsetWidth>w&&/[ \-]/.test(b.textContent||b.innerText)&&H(b,{width:w+"px",display:"block",whiteSpace:h||
"normal"}),this.getSpanCorrection(b.offsetWidth,x,e,F,p));H(b,{left:n+(this.xCorr||0)+"px",top:d+(this.yCorr||0)+"px"});l&&(x=b.offsetHeight);this.cTT=y}}else this.alignOnAdd=!0},setSpanRotation:function(a,d,m){var c={},n=u?"-ms-transform":l?"-webkit-transform":f?"MozTransform":b.opera?"-o-transform":"";c[n]=c.transform="rotate("+a+"deg)";c[n+(f?"Origin":"-origin")]=c.transformOrigin=100*d+"% "+m+"px";H(this.element,c)},getSpanCorrection:function(a,b,m){this.xCorr=-a*m;this.yCorr=-b}});g(d.prototype,
{html:function(a,b,m){var c=this.createElement("span"),n=c.element,d=c.renderer,l=d.isSVG,e=function(a,e){r(["opacity","visibility"],function(b){p(a,b+"Setter",function(a,b,c,x){a.call(this,b,c,x);e[c]=b})})};c.textSetter=function(a){a!==n.innerHTML&&delete this.bBox;n.innerHTML=this.textStr=a;c.htmlUpdateTransform()};l&&e(c,c.element.style);c.xSetter=c.ySetter=c.alignSetter=c.rotationSetter=function(a,e){"align"===e&&(e="textAlign");c[e]=a;c.htmlUpdateTransform()};c.attr({text:a,x:Math.round(b),
y:Math.round(m)}).css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize,position:"absolute"});n.style.whiteSpace="nowrap";c.css=c.htmlCss;l&&(c.add=function(a){var b,x=d.box.parentNode,h=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)h.push(a),a=a.parentGroup;r(h.reverse(),function(a){var n,m=B(a.element,"class");m&&(m={className:m});b=a.div=a.div||A("div",m,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&
a.styles.pointerEvents},b||x);n=b.style;g(a,{on:function(){c.on.apply({element:h[0].div},arguments);return a},translateXSetter:function(e,k){n.left=e+"px";a[k]=e;a.doTransform=!0},translateYSetter:function(e,k){n.top=e+"px";a[k]=e;a.doTransform=!0}});e(a,n)})}}else b=x;b.appendChild(n);c.added=!0;c.alignOnAdd&&c.htmlUpdateTransform();return c});return c}})})(L);(function(a){var B,A,H=a.createElement,G=a.css,r=a.defined,g=a.deg2rad,f=a.discardElement,u=a.doc,l=a.each,q=a.erase,d=a.extend;B=a.extendClass;
var b=a.isArray,p=a.isNumber,C=a.isObject,t=a.merge;A=a.noop;var m=a.pick,c=a.pInt,n=a.SVGElement,E=a.SVGRenderer,z=a.win;a.svg||(A={docMode8:u&&8===u.documentMode,init:function(a,b){var e=["\x3c",b,' filled\x3d"f" stroked\x3d"f"'],c=["position: ","absolute",";"],h="div"===b;("shape"===b||h)&&c.push("left:0;top:0;width:1px;height:1px;");c.push("visibility: ",h?"hidden":"visible");e.push(' style\x3d"',c.join(""),'"/\x3e');b&&(e=h||"span"===b||"img"===b?e.join(""):a.prepVML(e),this.element=H(e));this.renderer=
a},add:function(a){var e=this.renderer,b=this.element,c=e.box,h=a&&a.inverted,c=a?a.element||a:c;a&&(this.parentGroup=a);h&&e.invertChild(b,c);c.appendChild(b);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();if(this.onAdd)this.onAdd();this.className&&this.attr("class",this.className);return this},updateTransform:n.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=Math.cos(a*g),c=Math.sin(a*g);G(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11\x3d",
b,", M12\x3d",-c,", M21\x3d",c,", M22\x3d",b,", sizingMethod\x3d'auto expand')"].join(""):"none"})},getSpanCorrection:function(a,b,c,n,h){var e=n?Math.cos(n*g):1,x=n?Math.sin(n*g):0,d=m(this.elemHeight,this.element.offsetHeight),F;this.xCorr=0>e&&-a;this.yCorr=0>x&&-d;F=0>e*x;this.xCorr+=x*b*(F?1-c:c);this.yCorr-=e*b*(n?F?c:1-c:1);h&&"left"!==h&&(this.xCorr-=a*c*(0>e?-1:1),n&&(this.yCorr-=d*c*(0>x?-1:1)),G(this.element,{textAlign:h}))},pathToVML:function(a){for(var b=a.length,e=[];b--;)p(a[b])?e[b]=
Math.round(10*a[b])-5:"Z"===a[b]?e[b]="x":(e[b]=a[b],!a.isArc||"wa"!==a[b]&&"at"!==a[b]||(e[b+5]===e[b+7]&&(e[b+7]+=a[b+7]>a[b+5]?1:-1),e[b+6]===e[b+8]&&(e[b+8]+=a[b+8]>a[b+6]?1:-1)));return e.join(" ")||"x"},clip:function(a){var b=this,e;a?(e=a.members,q(e,b),e.push(b),b.destroyClip=function(){q(e,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:b.docMode8?"inherit":"rect(auto)"});return b.css(a)},css:n.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&f(a)},destroy:function(){this.destroyClip&&
this.destroyClip();return n.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+a]=function(){var a=z.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a,b){var e;a=a.split(/[ ,]/);e=a.length;if(9===e||11===e)a[e-4]=a[e-2]=c(a[e-2])-10*b;return a.join(" ")},shadow:function(a,b,n){var e=[],h,d=this.element,x=this.renderer,p,F=d.style,k,D=d.path,l,t,z,f;D&&"string"!==typeof D.value&&(D="x");t=D;if(a){z=m(a.width,3);f=(a.opacity||.15)/z;for(h=1;3>=h;h++)l=2*z+1-2*h,n&&
(t=this.cutOffPath(D.value,l+.5)),k=['\x3cshape isShadow\x3d"true" strokeweight\x3d"',l,'" filled\x3d"false" path\x3d"',t,'" coordsize\x3d"10 10" style\x3d"',d.style.cssText,'" /\x3e'],p=H(x.prepVML(k),null,{left:c(F.left)+m(a.offsetX,1),top:c(F.top)+m(a.offsetY,1)}),n&&(p.cutOff=l+1),k=['\x3cstroke color\x3d"',a.color||"#000000",'" opacity\x3d"',f*h,'"/\x3e'],H(x.prepVML(k),null,null,p),b?b.element.appendChild(p):d.parentNode.insertBefore(p,d),e.push(p);this.shadows=e}return this},updateShadows:A,
setAttr:function(a,b){this.docMode8?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){(this.added?this.element:this).className=a},dashstyleSetter:function(a,b,c){(c.getElementsByTagName("stroke")[0]||H(this.renderer.prepVML(["\x3cstroke/\x3e"]),null,null,c))[b]=a||"solid";this[b]=a},dSetter:function(a,b,c){var e=this.shadows;a=a||[];this.d=a.join&&a.join(" ");c.path=a=this.pathToVML(a);if(e)for(c=e.length;c--;)e[c].path=e[c].cutOff?this.cutOffPath(a,e[c].cutOff):a;this.setAttr(b,
a)},fillSetter:function(a,b,c){var e=c.nodeName;"SPAN"===e?c.style.color=a:"IMG"!==e&&(c.filled="none"!==a,this.setAttr("fillcolor",this.renderer.color(a,c,b,this)))},"fill-opacitySetter":function(a,b,c){H(this.renderer.prepVML(["\x3c",b.split("-")[0],' opacity\x3d"',a,'"/\x3e']),null,null,c)},opacitySetter:A,rotationSetter:function(a,b,c){c=c.style;this[b]=c[b]=a;c.left=-Math.round(Math.sin(a*g)+1)+"px";c.top=Math.round(Math.cos(a*g))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",
this.renderer.color(a,c,b,this))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a;this[b]=a;p(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){"inherit"===a&&(a="visible");this.shadows&&l(this.shadows,function(c){c.style[b]=a});"DIV"===c.nodeName&&(a="hidden"===a?"-999em":0,this.docMode8||(c.style[b]=a?"visible":"hidden"),b="top");c.style[b]=a},xSetter:function(a,b,c){this[b]=a;"x"===b?b="left":"y"===b&&(b="top");this.updateClipping?
(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}},A["stroke-opacitySetter"]=A["fill-opacitySetter"],a.VMLElement=A=B(n,A),A.prototype.ySetter=A.prototype.widthSetter=A.prototype.heightSetter=A.prototype.xSetter,A={Element:A,isIE8:-1<z.navigator.userAgent.indexOf("MSIE 8.0"),init:function(a,b,c){var e,h;this.alignedObjects=[];e=this.createElement("div").css({position:"relative"});h=e.element;a.appendChild(e.element);this.isVML=!0;this.box=h;this.boxWrapper=
e;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(b,c,!1);if(!u.namespaces.hcv){u.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{u.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(y){u.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},
clipRect:function(a,b,c,n){var e=this.createElement(),m=C(a);return d(e,{members:[],count:0,left:(m?a.x:a)+1,top:(m?a.y:b)+1,width:(m?a.width:c)-1,height:(m?a.height:n)-1,getCSS:function(a){var b=a.element,c=b.nodeName,k=a.inverted,e=this.top-("shape"===c?b.offsetTop:0),h=this.left,b=h+this.width,n=e+this.height,e={clip:"rect("+Math.round(k?h:e)+"px,"+Math.round(k?n:b)+"px,"+Math.round(k?b:n)+"px,"+Math.round(k?e:h)+"px)"};!k&&a.docMode8&&"DIV"===c&&d(e,{width:b+"px",height:n+"px"});return e},updateClipping:function(){l(e.members,
function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(b,c,n,m){var e=this,d,x=/^rgba/,p,t,k="none";b&&b.linearGradient?t="gradient":b&&b.radialGradient&&(t="pattern");if(t){var D,w,z=b.linearGradient||b.radialGradient,f,E,v,q,g,F="";b=b.stops;var C,u=[],r=function(){p=['\x3cfill colors\x3d"'+u.join(",")+'" opacity\x3d"',v,'" o:opacity2\x3d"',E,'" type\x3d"',t,'" ',F,'focus\x3d"100%" method\x3d"any" /\x3e'];H(e.prepVML(p),null,null,c)};f=b[0];C=b[b.length-1];0<f[0]&&b.unshift([0,f[1]]);1>
C[0]&&b.push([1,C[1]]);l(b,function(k,b){x.test(k[1])?(d=a.color(k[1]),D=d.get("rgb"),w=d.get("a")):(D=k[1],w=1);u.push(100*k[0]+"% "+D);b?(v=w,q=D):(E=w,g=D)});if("fill"===n)if("gradient"===t)n=z.x1||z[0]||0,b=z.y1||z[1]||0,f=z.x2||z[2]||0,z=z.y2||z[3]||0,F='angle\x3d"'+(90-180*Math.atan((z-b)/(f-n))/Math.PI)+'"',r();else{var k=z.r,A=2*k,B=2*k,G=z.cx,U=z.cy,L=c.radialReference,T,k=function(){L&&(T=m.getBBox(),G+=(L[0]-T.x)/T.width-.5,U+=(L[1]-T.y)/T.height-.5,A*=L[2]/T.width,B*=L[2]/T.height);F=
'src\x3d"'+a.getOptions().global.VMLRadialGradientURL+'" size\x3d"'+A+","+B+'" origin\x3d"0.5,0.5" position\x3d"'+G+","+U+'" color2\x3d"'+g+'" ';r()};m.added?k():m.onAdd=k;k=q}else k=D}else x.test(b)&&"IMG"!==c.tagName?(d=a.color(b),m[n+"-opacitySetter"](d.get("a"),n,c),k=d.get("rgb")):(k=c.getElementsByTagName(n),k.length&&(k[0].opacity=1,k[0].type="solid"),k=b);return k},prepVML:function(a){var b=this.isIE8;a=a.join("");b?(a=a.replace("/\x3e",' xmlns\x3d"urn:schemas-microsoft-com:vml" /\x3e'),a=
-1===a.indexOf('style\x3d"')?a.replace("/\x3e",' style\x3d"display:inline-block;behavior:url(#default#VML);" /\x3e'):a.replace('style\x3d"','style\x3d"display:inline-block;behavior:url(#default#VML);')):a=a.replace("\x3c","\x3chcv:");return a},text:E.prototype.html,path:function(a){var c={coordsize:"10 10"};b(a)?c.d=a:C(a)&&d(c,a);return this.createElement("shape").attr(c)},circle:function(a,b,c){var e=this.symbol("circle");C(a)&&(c=a.r,b=a.y,a=a.x);e.isCircle=!0;e.r=c;return e.attr({x:a,y:b})},g:function(a){var b;
a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement("div").attr(b)},image:function(a,b,c,n,h){var e=this.createElement("img").attr({src:a});1<arguments.length&&e.attr({x:b,y:c,width:n,height:h});return e},createElement:function(a){return"rect"===a?this.symbol(a):E.prototype.createElement.call(this,a)},invertChild:function(a,b){var e=this;b=b.style;var n="IMG"===a.tagName&&a.style;G(a,{flip:"x",left:c(b.width)-(n?c(n.top):1),top:c(b.height)-(n?c(n.left):1),rotation:-90});
l(a.childNodes,function(b){e.invertChild(b,a)})},symbols:{arc:function(a,b,c,n,h){var e=h.start,m=h.end,d=h.r||c||n;c=h.innerR;n=Math.cos(e);var p=Math.sin(e),k=Math.cos(m),D=Math.sin(m);if(0===m-e)return["x"];e=["wa",a-d,b-d,a+d,b+d,a+d*n,b+d*p,a+d*k,b+d*D];h.open&&!c&&e.push("e","M",a,b);e.push("at",a-c,b-c,a+c,b+c,a+c*k,b+c*D,a+c*n,b+c*p,"x","e");e.isArc=!0;return e},circle:function(a,b,c,n,h){h&&r(h.r)&&(c=n=2*h.r);h&&h.isCircle&&(a-=c/2,b-=n/2);return["wa",a,b,a+c,b+n,a+c,b+n/2,a+c,b+n/2,"e"]},
rect:function(a,b,c,n,h){return E.prototype.symbols[r(h)&&h.r?"callout":"square"].call(0,a,b,c,n,h)}}},a.VMLRenderer=B=function(){this.init.apply(this,arguments)},B.prototype=t(E.prototype,A),a.Renderer=B);E.prototype.measureSpanWidth=function(a,b){var c=u.createElement("span");a=u.createTextNode(a);c.appendChild(a);G(c,b);this.box.appendChild(c);b=c.offsetWidth;f(c);return b}})(L);(function(a){function B(){var l=a.defaultOptions.global,f=u.moment;if(l.timezone){if(f)return function(a){return-f.tz(a,
l.timezone).utcOffset()};a.error(25)}return l.useUTC&&l.getTimezoneOffset}function A(){var l=a.defaultOptions.global,q,d=l.useUTC,b=d?"getUTC":"get",p=d?"setUTC":"set";a.Date=q=l.Date||u.Date;q.hcTimezoneOffset=d&&l.timezoneOffset;q.hcGetTimezoneOffset=B();q.hcMakeTime=function(a,b,m,c,n,p){var l;d?(l=q.UTC.apply(0,arguments),l+=r(l)):l=(new q(a,b,f(m,1),f(c,0),f(n,0),f(p,0))).getTime();return l};G("Minutes Hours Day Date Month FullYear".split(" "),function(a){q["hcGet"+a]=b+a});G("Milliseconds Seconds Minutes Hours Date Month FullYear".split(" "),
function(a){q["hcSet"+a]=p+a})}var H=a.color,G=a.each,r=a.getTZOffset,g=a.merge,f=a.pick,u=a.win;a.defaultOptions={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{useUTC:!0,VMLRadialGradientURL:"http://code.highcharts.com/5.0.7/gfx/vml-radial-gradient.png"},chart:{borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}},width:null,height:null,borderColor:"#335cad",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"},title:{text:"Chart title",
align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",
width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:a.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",
month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:a.isTouchDevice?25:10,backgroundColor:H("#f7f7f7").setOpacity(.85).get(),borderWidth:1,headerFormat:'\x3cspan style\x3d"font-size: 10px"\x3e{point.key}\x3c/span\x3e\x3cbr/\x3e',pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e',shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"http://www.highcharts.com",
position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};a.setOptions=function(l){a.defaultOptions=g(!0,a.defaultOptions,l);A();return a.defaultOptions};a.getOptions=function(){return a.defaultOptions};a.defaultPlotOptions=a.defaultOptions.plotOptions;A()})(L);(function(a){var B=a.arrayMax,A=a.arrayMin,H=a.defined,G=a.destroyObjectProperties,r=a.each,g=a.erase,f=a.merge,u=a.pick;a.PlotLineOrBand=function(a,f){this.axis=
a;f&&(this.options=f,this.id=f.id)};a.PlotLineOrBand.prototype={render:function(){var a=this,q=a.axis,d=q.horiz,b=a.options,p=b.label,g=a.label,t=b.to,m=b.from,c=b.value,n=H(m)&&H(t),E=H(c),z=a.svgElem,e=!z,x=[],F,w=b.color,h=u(b.zIndex,0),y=b.events,x={"class":"highcharts-plot-"+(n?"band ":"line ")+(b.className||"")},J={},K=q.chart.renderer,I=n?"bands":"lines",k=q.log2lin;q.isLog&&(m=k(m),t=k(t),c=k(c));E?(x={stroke:w,"stroke-width":b.width},b.dashStyle&&(x.dashstyle=b.dashStyle)):n&&(w&&(x.fill=
w),b.borderWidth&&(x.stroke=b.borderColor,x["stroke-width"]=b.borderWidth));J.zIndex=h;I+="-"+h;(w=q[I])||(q[I]=w=K.g("plot-"+I).attr(J).add());e&&(a.svgElem=z=K.path().attr(x).add(w));if(E)x=q.getPlotLinePath(c,z.strokeWidth());else if(n)x=q.getPlotBandPath(m,t,b);else return;if(e&&x&&x.length){if(z.attr({d:x}),y)for(F in b=function(b){z.on(b,function(k){y[b].apply(a,[k])})},y)b(F)}else z&&(x?(z.show(),z.animate({d:x})):(z.hide(),g&&(a.label=g=g.destroy())));p&&H(p.text)&&x&&x.length&&0<q.width&&
0<q.height&&!x.flat?(p=f({align:d&&n&&"center",x:d?!n&&4:10,verticalAlign:!d&&n&&"middle",y:d?n?16:10:n?6:-4,rotation:d&&!n&&90},p),this.renderLabel(p,x,n,h)):g&&g.hide();return a},renderLabel:function(a,f,d,b){var p=this.label,l=this.axis.chart.renderer;p||(p={align:a.textAlign||a.align,rotation:a.rotation,"class":"highcharts-plot-"+(d?"band":"line")+"-label "+(a.className||"")},p.zIndex=b,this.label=p=l.text(a.text,0,0,a.useHTML).attr(p).add(),p.css(a.style));b=[f[1],f[4],d?f[6]:f[1]];f=[f[2],f[5],
d?f[7]:f[2]];d=A(b);l=A(f);p.align(a,!1,{x:d,y:l,width:B(b)-d,height:B(f)-l});p.show()},destroy:function(){g(this.axis.plotLinesAndBands,this);delete this.axis;G(this)}};a.AxisPlotLineOrBandExtension={getPlotBandPath:function(a,f){f=this.getPlotLinePath(f,null,null,!0);(a=this.getPlotLinePath(a,null,null,!0))&&f?(a.flat=a.toString()===f.toString(),a.push(f[4],f[5],f[1],f[2],"z")):a=null;return a},addPlotBand:function(a){return this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){return this.addPlotBandOrLine(a,
"plotLines")},addPlotBandOrLine:function(f,g){var d=(new a.PlotLineOrBand(this,f)).render(),b=this.userOptions;d&&(g&&(b[g]=b[g]||[],b[g].push(f)),this.plotLinesAndBands.push(d));return d},removePlotBandOrLine:function(a){for(var f=this.plotLinesAndBands,d=this.options,b=this.userOptions,p=f.length;p--;)f[p].id===a&&f[p].destroy();r([d.plotLines||[],b.plotLines||[],d.plotBands||[],b.plotBands||[]],function(b){for(p=b.length;p--;)b[p].id===a&&g(b,b[p])})}}})(L);(function(a){var B=a.correctFloat,A=
a.defined,H=a.destroyObjectProperties,G=a.isNumber,r=a.merge,g=a.pick,f=a.deg2rad;a.Tick=function(a,f,g,d){this.axis=a;this.pos=f;this.type=g||"";this.isNew=!0;g||d||this.addLabel()};a.Tick.prototype={addLabel:function(){var a=this.axis,f=a.options,q=a.chart,d=a.categories,b=a.names,p=this.pos,C=f.labels,t=a.tickPositions,m=p===t[0],c=p===t[t.length-1],b=d?g(d[p],b[p],p):p,d=this.label,t=t.info,n;a.isDatetimeAxis&&t&&(n=f.dateTimeLabelFormats[t.higherRanks[p]||t.unitName]);this.isFirst=m;this.isLast=
c;f=a.labelFormatter.call({axis:a,chart:q,isFirst:m,isLast:c,dateTimeLabelFormat:n,value:a.isLog?B(a.lin2log(b)):b});A(d)?d&&d.attr({text:f}):(this.labelLength=(this.label=d=A(f)&&C.enabled?q.renderer.text(f,0,0,C.useHTML).css(r(C.style)).add(a.labelGroup):null)&&d.getBBox().width,this.rotation=0)},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(a){var l=this.axis,q=a.x,d=l.chart.chartWidth,b=l.chart.spacing,p=g(l.labelLeft,
Math.min(l.pos,b[3])),b=g(l.labelRight,Math.max(l.pos+l.len,d-b[1])),C=this.label,t=this.rotation,m={left:0,center:.5,right:1}[l.labelAlign],c=C.getBBox().width,n=l.getSlotWidth(),E=n,z=1,e,x={};if(t)0>t&&q-m*c<p?e=Math.round(q/Math.cos(t*f)-p):0<t&&q+m*c>b&&(e=Math.round((d-q)/Math.cos(t*f)));else if(d=q+(1-m)*c,q-m*c<p?E=a.x+E*(1-m)-p:d>b&&(E=b-a.x+E*m,z=-1),E=Math.min(n,E),E<n&&"center"===l.labelAlign&&(a.x+=z*(n-E-m*(n-Math.min(c,E)))),c>E||l.autoRotation&&(C.styles||{}).width)e=E;e&&(x.width=
e,(l.options.labels.style||{}).textOverflow||(x.textOverflow="ellipsis"),C.css(x))},getPosition:function(a,f,g,d){var b=this.axis,p=b.chart,l=d&&p.oldChartHeight||p.chartHeight;return{x:a?b.translate(f+g,null,null,d)+b.transB:b.left+b.offset+(b.opposite?(d&&p.oldChartWidth||p.chartWidth)-b.right-b.left:0),y:a?l-b.bottom+b.offset-(b.opposite?b.height:0):l-b.translate(f+g,null,null,d)-b.transB}},getLabelPosition:function(a,g,q,d,b,p,C,t){var m=this.axis,c=m.transA,n=m.reversed,E=m.staggerLines,z=m.tickRotCorr||
{x:0,y:0},e=b.y;A(e)||(e=0===m.side?q.rotation?-8:-q.getBBox().height:2===m.side?z.y+8:Math.cos(q.rotation*f)*(z.y-q.getBBox(!1,0).height/2));a=a+b.x+z.x-(p&&d?p*c*(n?-1:1):0);g=g+e-(p&&!d?p*c*(n?1:-1):0);E&&(q=C/(t||1)%E,m.opposite&&(q=E-q-1),g+=m.labelOffset/E*q);return{x:a,y:Math.round(g)}},getMarkPath:function(a,f,g,d,b,p){return p.crispLine(["M",a,f,"L",a+(b?0:-g),f+(b?g:0)],d)},render:function(a,f,q){var d=this.axis,b=d.options,p=d.chart.renderer,l=d.horiz,t=this.type,m=this.label,c=this.pos,
n=b.labels,E=this.gridLine,z=t?t+"Tick":"tick",e=d.tickSize(z),x=this.mark,F=!x,w=n.step,h={},y=!0,J=d.tickmarkOffset,K=this.getPosition(l,c,J,f),I=K.x,K=K.y,k=l&&I===d.pos+d.len||!l&&K===d.pos?-1:1,D=t?t+"Grid":"grid",P=b[D+"LineWidth"],N=b[D+"LineColor"],r=b[D+"LineDashStyle"],D=g(b[z+"Width"],!t&&d.isXAxis?1:0),z=b[z+"Color"];q=g(q,1);this.isActive=!0;E||(h.stroke=N,h["stroke-width"]=P,r&&(h.dashstyle=r),t||(h.zIndex=1),f&&(h.opacity=0),this.gridLine=E=p.path().attr(h).addClass("highcharts-"+(t?
t+"-":"")+"grid-line").add(d.gridGroup));if(!f&&E&&(c=d.getPlotLinePath(c+J,E.strokeWidth()*k,f,!0)))E[this.isNew?"attr":"animate"]({d:c,opacity:q});e&&(d.opposite&&(e[0]=-e[0]),F&&(this.mark=x=p.path().addClass("highcharts-"+(t?t+"-":"")+"tick").add(d.axisGroup),x.attr({stroke:z,"stroke-width":D})),x[F?"attr":"animate"]({d:this.getMarkPath(I,K,e[0],x.strokeWidth()*k,l,p),opacity:q}));m&&G(I)&&(m.xy=K=this.getLabelPosition(I,K,m,l,n,J,a,w),this.isFirst&&!this.isLast&&!g(b.showFirstLabel,1)||this.isLast&&
!this.isFirst&&!g(b.showLastLabel,1)?y=!1:!l||d.isRadial||n.step||n.rotation||f||0===q||this.handleOverflow(K),w&&a%w&&(y=!1),y&&G(K.y)?(K.opacity=q,m[this.isNew?"attr":"animate"](K)):m.attr("y",-9999),this.isNew=!1)},destroy:function(){H(this,this.axis)}}})(L);(function(a){var B=a.addEvent,A=a.animObject,H=a.arrayMax,G=a.arrayMin,r=a.AxisPlotLineOrBandExtension,g=a.color,f=a.correctFloat,u=a.defaultOptions,l=a.defined,q=a.deg2rad,d=a.destroyObjectProperties,b=a.each,p=a.extend,C=a.fireEvent,t=a.format,
m=a.getMagnitude,c=a.grep,n=a.inArray,E=a.isArray,z=a.isNumber,e=a.isString,x=a.merge,F=a.normalizeTickInterval,w=a.pick,h=a.PlotLineOrBand,y=a.removeEvent,J=a.splat,K=a.syncTimeout,I=a.Tick;a.Axis=function(){this.init.apply(this,arguments)};a.Axis.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,labels:{enabled:!0,style:{color:"#666666",cursor:"default",fontSize:"11px"},
x:0},minPadding:.01,maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle",style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"},defaultYAxisOptions:{endOnTick:!0,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},maxPadding:.05,
minPadding:.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return a.numberFormat(this.total,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"#000000",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],
x:0},title:{rotation:0}},init:function(a,b){var k=b.isX;this.chart=a;this.horiz=a.inverted?!k:k;this.isXAxis=k;this.coll=this.coll||(k?"xAxis":"yAxis");this.opposite=b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var c=this.options,e=c.type;this.labelFormatter=c.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.reversed=c.reversed;this.visible=!1!==c.visible;this.zoomEnabled=!1!==c.zoomEnabled;this.hasNames=
"category"===e||!0===c.categories;this.categories=c.categories||this.hasNames;this.names=this.names||[];this.isLog="logarithmic"===e;this.isDatetimeAxis="datetime"===e;this.isLinked=l(c.linkedTo);this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=c.minRange||c.maxZoom;this.range=c.range;this.offset=c.offset||0;this.stacks={};this.oldStacks={};this.stacksTouched=0;this.min=this.max=null;this.crosshair=w(c.crosshair,
J(a.options.tooltip.crosshairs)[k?0:1],!1);var h;b=this.options.events;-1===n(this,a.axes)&&(k?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];a.inverted&&k&&void 0===this.reversed&&(this.reversed=!0);this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(h in b)B(this,h,b[h]);this.isLog&&(this.val2lin=this.log2lin,this.lin2val=this.lin2log)},setOptions:function(a){this.options=x(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,
[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],x(u[this.coll],a))},defaultLabelFormatter:function(){var b=this.axis,c=this.value,e=b.categories,h=this.dateTimeLabelFormat,n=u.lang,d=n.numericSymbols,n=n.numericSymbolMagnitude||1E3,v=d&&d.length,m,f=b.options.labels.format,b=b.isLog?c:b.tickInterval;if(f)m=t(f,this);else if(e)m=c;else if(h)m=a.dateFormat(h,c);else if(v&&1E3<=b)for(;v--&&void 0===m;)e=Math.pow(n,v+1),b>=
e&&0===10*c%e&&null!==d[v]&&0!==c&&(m=a.numberFormat(c/e,-1)+d[v]);void 0===m&&(m=1E4<=Math.abs(c)?a.numberFormat(c,-1):a.numberFormat(c,-1,void 0,""));return m},getSeriesExtremes:function(){var a=this,e=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();b(a.series,function(b){if(b.visible||!e.options.chart.ignoreHiddenSeries){var k=b.options,h=k.threshold,D;a.hasVisibleSeries=!0;a.isLog&&0>=h&&(h=null);if(a.isXAxis)k=b.xData,
k.length&&(b=G(k),z(b)||b instanceof Date||(k=c(k,function(a){return z(a)}),b=G(k)),a.dataMin=Math.min(w(a.dataMin,k[0]),b),a.dataMax=Math.max(w(a.dataMax,k[0]),H(k)));else if(b.getExtremes(),D=b.dataMax,b=b.dataMin,l(b)&&l(D)&&(a.dataMin=Math.min(w(a.dataMin,b),b),a.dataMax=Math.max(w(a.dataMax,D),D)),l(h)&&(a.threshold=h),!k.softThreshold||a.isLog)a.softThreshold=!1}})},translate:function(a,b,c,e,h,n){var k=this.linkedParent||this,D=1,m=0,d=e?k.oldTransA:k.transA;e=e?k.oldMin:k.min;var f=k.minPixelPadding;
h=(k.isOrdinal||k.isBroken||k.isLog&&h)&&k.lin2val;d||(d=k.transA);c&&(D*=-1,m=k.len);k.reversed&&(D*=-1,m-=D*(k.sector||k.len));b?(a=(a*D+m-f)/d+e,h&&(a=k.lin2val(a))):(h&&(a=k.val2lin(a)),a=D*(a-e)*d+m+D*f+(z(n)?d*n:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,e,h){var k=this.chart,D=this.left,n=this.top,m,d,f=c&&k.oldChartHeight||
k.chartHeight,p=c&&k.oldChartWidth||k.chartWidth,y;m=this.transB;var t=function(a,b,k){if(a<b||a>k)e?a=Math.min(Math.max(b,a),k):y=!0;return a};h=w(h,this.translate(a,null,null,c));a=c=Math.round(h+m);m=d=Math.round(f-h-m);z(h)?this.horiz?(m=n,d=f-this.bottom,a=c=t(a,D,D+this.width)):(a=D,c=p-this.right,m=d=t(m,n,n+this.height)):y=!0;return y&&!e?null:k.renderer.crispLine(["M",a,m,"L",c,d],b||1)},getLinearTickPositions:function(a,b,c){var k,e=f(Math.floor(b/a)*a),h=f(Math.ceil(c/a)*a),D=[];if(b===
c&&z(b))return[b];for(b=e;b<=h;){D.push(b);b=f(b+a);if(b===k)break;k=b}return D},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,c=this.minorTickInterval,e=[],h,n=this.pointRangePadding||0;h=this.min-n;var n=this.max+n,m=n-h;if(m&&m/c<this.len/3)if(this.isLog)for(n=b.length,h=1;h<n;h++)e=e.concat(this.getLogTickPositions(c,b[h-1],b[h],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)e=e.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),h,n,a.startOfWeek));
else for(b=h+(b[0]-h)%c;b<=n&&b!==e[0];b+=c)e.push(b);0!==e.length&&this.trimTicks(e,a.startOnTick,a.endOnTick);return e},adjustForMinRange:function(){var a=this.options,c=this.min,e=this.max,h,n=this.dataMax-this.dataMin>=this.minRange,m,v,d,f,p,y;this.isXAxis&&void 0===this.minRange&&!this.isLog&&(l(a.min)||l(a.max)?this.minRange=null:(b(this.series,function(a){f=a.xData;for(v=p=a.xIncrement?1:f.length-1;0<v;v--)if(d=f[v]-f[v-1],void 0===m||d<m)m=d}),this.minRange=Math.min(5*m,this.dataMax-this.dataMin)));
e-c<this.minRange&&(y=this.minRange,h=(y-e+c)/2,h=[c-h,w(a.min,c-h)],n&&(h[2]=this.isLog?this.log2lin(this.dataMin):this.dataMin),c=H(h),e=[c+y,w(a.max,c+y)],n&&(e[2]=this.isLog?this.log2lin(this.dataMax):this.dataMax),e=G(e),e-c<y&&(h[0]=e-y,h[1]=w(a.min,e-y),c=H(h)));this.min=c;this.max=e},getClosest:function(){var a;this.categories?a=1:b(this.series,function(b){var k=b.closestPointRange,c=b.visible||!b.chart.options.chart.ignoreHiddenSeries;!b.noSharedTooltip&&l(k)&&c&&(a=l(a)?Math.min(a,k):k)});
return a},nameToX:function(a){var b=E(this.categories),k=b?this.categories:this.names,c=a.options.x,e;a.series.requireSorting=!1;l(c)||(c=!1===this.options.uniqueNames?a.series.autoIncrement():n(a.name,k));-1===c?b||(e=k.length):e=c;this.names[e]=a.name;return e},updateNames:function(){var a=this;0<this.names.length&&(this.names.length=0,this.minRange=void 0,b(this.series||[],function(k){k.xIncrement=null;if(!k.points||k.isDirtyData)k.processData(),k.generatePoints();b(k.points,function(b,c){var e;
b.options&&(e=a.nameToX(b),e!==b.x&&(b.x=e,k.xData[c]=e))})}))},setAxisTranslation:function(a){var k=this,c=k.max-k.min,h=k.axisPointRange||0,n,m=0,d=0,f=k.linkedParent,y=!!k.categories,p=k.transA,t=k.isXAxis;if(t||y||h)n=k.getClosest(),f?(m=f.minPointOffset,d=f.pointRangePadding):b(k.series,function(a){var b=y?1:t?w(a.options.pointRange,n,0):k.axisPointRange||0;a=a.options.pointPlacement;h=Math.max(h,b);k.single||(m=Math.max(m,e(a)?0:b/2),d=Math.max(d,"on"===a?0:b))}),f=k.ordinalSlope&&n?k.ordinalSlope/
n:1,k.minPointOffset=m*=f,k.pointRangePadding=d*=f,k.pointRange=Math.min(h,c),t&&(k.closestPointRange=n);a&&(k.oldTransA=p);k.translationSlope=k.transA=p=k.len/(c+d||1);k.transB=k.horiz?k.left:k.bottom;k.minPixelPadding=p*m},minFromRange:function(){return this.max-this.range},setTickInterval:function(k){var c=this,e=c.chart,h=c.options,n=c.isLog,d=c.log2lin,v=c.isDatetimeAxis,y=c.isXAxis,p=c.isLinked,t=h.maxPadding,x=h.minPadding,g=h.tickInterval,E=h.tickPixelInterval,q=c.categories,J=c.threshold,
K=c.softThreshold,I,r,u,A;v||q||p||this.getTickAmount();u=w(c.userMin,h.min);A=w(c.userMax,h.max);p?(c.linkedParent=e[c.coll][h.linkedTo],e=c.linkedParent.getExtremes(),c.min=w(e.min,e.dataMin),c.max=w(e.max,e.dataMax),h.type!==c.linkedParent.options.type&&a.error(11,1)):(!K&&l(J)&&(c.dataMin>=J?(I=J,x=0):c.dataMax<=J&&(r=J,t=0)),c.min=w(u,I,c.dataMin),c.max=w(A,r,c.dataMax));n&&(!k&&0>=Math.min(c.min,w(c.dataMin,c.min))&&a.error(10,1),c.min=f(d(c.min),15),c.max=f(d(c.max),15));c.range&&l(c.max)&&
(c.userMin=c.min=u=Math.max(c.min,c.minFromRange()),c.userMax=A=c.max,c.range=null);C(c,"foundExtremes");c.beforePadding&&c.beforePadding();c.adjustForMinRange();!(q||c.axisPointRange||c.usePercentage||p)&&l(c.min)&&l(c.max)&&(d=c.max-c.min)&&(!l(u)&&x&&(c.min-=d*x),!l(A)&&t&&(c.max+=d*t));z(h.floor)?c.min=Math.max(c.min,h.floor):z(h.softMin)&&(c.min=Math.min(c.min,h.softMin));z(h.ceiling)?c.max=Math.min(c.max,h.ceiling):z(h.softMax)&&(c.max=Math.max(c.max,h.softMax));K&&l(c.dataMin)&&(J=J||0,!l(u)&&
c.min<J&&c.dataMin>=J?c.min=J:!l(A)&&c.max>J&&c.dataMax<=J&&(c.max=J));c.tickInterval=c.min===c.max||void 0===c.min||void 0===c.max?1:p&&!g&&E===c.linkedParent.options.tickPixelInterval?g=c.linkedParent.tickInterval:w(g,this.tickAmount?(c.max-c.min)/Math.max(this.tickAmount-1,1):void 0,q?1:(c.max-c.min)*E/Math.max(c.len,E));y&&!k&&b(c.series,function(a){a.processData(c.min!==c.oldMin||c.max!==c.oldMax)});c.setAxisTranslation(!0);c.beforeSetTickPositions&&c.beforeSetTickPositions();c.postProcessTickInterval&&
(c.tickInterval=c.postProcessTickInterval(c.tickInterval));c.pointRange&&!g&&(c.tickInterval=Math.max(c.pointRange,c.tickInterval));k=w(h.minTickInterval,c.isDatetimeAxis&&c.closestPointRange);!g&&c.tickInterval<k&&(c.tickInterval=k);v||n||g||(c.tickInterval=F(c.tickInterval,null,m(c.tickInterval),w(h.allowDecimals,!(.5<c.tickInterval&&5>c.tickInterval&&1E3<c.max&&9999>c.max)),!!this.tickAmount));this.tickAmount||(c.tickInterval=c.unsquish());this.setTickPositions()},setTickPositions:function(){var a=
this.options,b,c=a.tickPositions,e=a.tickPositioner,h=a.startOnTick,n=a.endOnTick,m;this.tickmarkOffset=this.categories&&"between"===a.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===a.minorTickInterval&&this.tickInterval?this.tickInterval/5:a.minorTickInterval;this.tickPositions=b=c&&c.slice();!b&&(b=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,a.units),this.min,this.max,a.startOfWeek,this.ordinalPositions,this.closestPointRange,
!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),b.length>this.len&&(b=[b[0],b.pop()]),this.tickPositions=b,e&&(e=e.apply(this,[this.min,this.max])))&&(this.tickPositions=b=e);this.trimTicks(b,h,n);this.isLinked||(this.min===this.max&&l(this.min)&&!this.tickAmount&&(m=!0,this.min-=.5,this.max+=.5),this.single=m,c||e||this.adjustTickAmount())},trimTicks:function(a,b,c){var k=a[0],e=a[a.length-1],h=this.minPointOffset||
0;if(!this.isLinked){if(b)this.min=k;else for(;this.min-h>a[0];)a.shift();if(c)this.max=e;else for(;this.max+h<a[a.length-1];)a.pop();0===a.length&&l(k)&&a.push((e+k)/2)}},alignToOthers:function(){var a={},c,e=this.options;!1===this.chart.options.chart.alignTicks||!1===e.alignTicks||this.isLog||b(this.chart[this.coll],function(b){var k=b.options,k=[b.horiz?k.left:k.top,k.width,k.height,k.pane].join();b.series.length&&(a[k]?c=!0:a[k]=1)});return c},getTickAmount:function(){var a=this.options,b=a.tickAmount,
c=a.tickPixelInterval;!l(a.tickInterval)&&this.len<c&&!this.isRadial&&!this.isLog&&a.startOnTick&&a.endOnTick&&(b=2);!b&&this.alignToOthers()&&(b=Math.ceil(this.len/c)+1);4>b&&(this.finalTickAmt=b,b=5);this.tickAmount=b},adjustTickAmount:function(){var a=this.tickInterval,b=this.tickPositions,c=this.tickAmount,e=this.finalTickAmt,h=b&&b.length;if(h<c){for(;b.length<c;)b.push(f(b[b.length-1]+a));this.transA*=(h-1)/(c-1);this.max=b[b.length-1]}else h>c&&(this.tickInterval*=2,this.setTickPositions());
if(l(e)){for(a=c=b.length;a--;)(3===e&&1===a%2||2>=e&&0<a&&a<c-1)&&b.splice(a,1);this.finalTickAmt=void 0}},setScale:function(){var a,c;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();c=this.len!==this.oldAxisLength;b(this.series,function(b){if(b.isDirtyData||b.isDirty||b.xAxis.isDirty)a=!0});c||a||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?(this.resetStacks&&this.resetStacks(),this.forceRedraw=
!1,this.getSeriesExtremes(),this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=c||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks()},setExtremes:function(a,c,e,h,n){var k=this,m=k.chart;e=w(e,!0);b(k.series,function(a){delete a.kdTree});n=p(n,{min:a,max:c});C(k,"setExtremes",n,function(){k.userMin=a;k.userMax=c;k.eventArgs=n;e&&m.redraw(h)})},zoom:function(a,b){var c=this.dataMin,k=this.dataMax,e=this.options,
h=Math.min(c,w(e.min,c)),e=Math.max(k,w(e.max,k));if(a!==this.min||b!==this.max)this.allowZoomOutside||(l(c)&&(a<h&&(a=h),a>e&&(a=e)),l(k)&&(b<h&&(b=h),b>e&&(b=e))),this.displayBtn=void 0!==a||void 0!==b,this.setExtremes(a,b,!1,void 0,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsets||[0,0,0,0],e=this.horiz,h=w(b.width,a.plotWidth-c[3]+c[1]),n=w(b.height,a.plotHeight-c[0]+c[2]),m=w(b.top,a.plotTop+c[0]),b=w(b.left,a.plotLeft+c[3]),c=/%$/;c.test(n)&&(n=
Math.round(parseFloat(n)/100*a.plotHeight));c.test(m)&&(m=Math.round(parseFloat(m)/100*a.plotHeight+a.plotTop));this.left=b;this.top=m;this.width=h;this.height=n;this.bottom=a.chartHeight-n-m;this.right=a.chartWidth-h-b;this.len=Math.max(e?h:n,0);this.pos=e?b:m},getExtremes:function(){var a=this.isLog,b=this.lin2log;return{min:a?f(b(this.min)):this.min,max:a?f(b(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=
this.isLog,c=this.lin2log,k=b?c(this.min):this.min,b=b?c(this.max):this.max;null===a?a=k:k>a?a=k:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(w(a,0)-90*this.side+720)%360;return 15<a&&165>a?"right":195<a&&345>a?"left":"center"},tickSize:function(a){var b=this.options,c=b[a+"Length"],k=w(b[a+"Width"],"tick"===a&&this.isXAxis?1:0);if(k&&c)return"inside"===b[a+"Position"]&&(c=-c),[c,k]},labelMetrics:function(){return this.chart.renderer.fontMetrics(this.options.labels.style&&
this.options.labels.style.fontSize,this.ticks[0]&&this.ticks[0].label)},unsquish:function(){var a=this.options.labels,c=this.horiz,e=this.tickInterval,h=e,n=this.len/(((this.categories?1:0)+this.max-this.min)/e),m,d=a.rotation,f=this.labelMetrics(),p,y=Number.MAX_VALUE,t,x=function(a){a/=n||1;a=1<a?Math.ceil(a):1;return a*e};c?(t=!a.staggerLines&&!a.step&&(l(d)?[d]:n<w(a.autoRotationLimit,80)&&a.autoRotation))&&b(t,function(a){var b;if(a===d||a&&-90<=a&&90>=a)p=x(Math.abs(f.h/Math.sin(q*a))),b=p+
Math.abs(a/360),b<y&&(y=b,m=a,h=p)}):a.step||(h=x(f.h));this.autoRotation=t;this.labelRotation=w(m,d);return h},getSlotWidth:function(){var a=this.chart,b=this.horiz,c=this.options.labels,e=Math.max(this.tickPositions.length-(this.categories?0:1),1),h=a.margin[3];return b&&2>(c.step||0)&&!c.rotation&&(this.staggerLines||1)*this.len/e||!b&&(h&&h-a.spacing[3]||.33*a.chartWidth)},renderUnsquish:function(){var a=this.chart,c=a.renderer,h=this.tickPositions,n=this.ticks,m=this.options.labels,d=this.horiz,
v=this.getSlotWidth(),f=Math.max(1,Math.round(v-2*(m.padding||5))),p={},y=this.labelMetrics(),t=m.style&&m.style.textOverflow,g,z=0,E,w;e(m.rotation)||(p.rotation=m.rotation||0);b(h,function(a){(a=n[a])&&a.labelLength>z&&(z=a.labelLength)});this.maxLabelLength=z;if(this.autoRotation)z>f&&z>y.h?p.rotation=this.labelRotation:this.labelRotation=0;else if(v&&(g={width:f+"px"},!t))for(g.textOverflow="clip",E=h.length;!d&&E--;)if(w=h[E],f=n[w].label)f.styles&&"ellipsis"===f.styles.textOverflow?f.css({textOverflow:"clip"}):
n[w].labelLength>v&&f.css({width:v+"px"}),f.getBBox().height>this.len/h.length-(y.h-y.f)&&(f.specCss={textOverflow:"ellipsis"});p.rotation&&(g={width:(z>.5*a.chartHeight?.33*a.chartHeight:a.chartHeight)+"px"},t||(g.textOverflow="ellipsis"));if(this.labelAlign=m.align||this.autoLabelAlign(this.labelRotation))p.align=this.labelAlign;b(h,function(a){var b=(a=n[a])&&a.label;b&&(b.attr(p),g&&b.css(x(g,b.specCss)),delete b.specCss,a.rotation=p.rotation)});this.tickRotCorr=c.rotCorr(y.b,this.labelRotation||
0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||l(this.min)&&l(this.max)&&!!this.tickPositions},addTitle:function(a){var b=this.chart.renderer,c=this.horiz,k=this.opposite,e=this.options.title,h;this.axisTitle||((h=e.textAlign)||(h=(c?{low:"left",middle:"center",high:"right"}:{low:k?"right":"left",middle:"center",high:k?"left":"right"})[e.align]),this.axisTitle=b.text(e.text,0,0,e.useHTML).attr({zIndex:7,rotation:e.rotation||0,align:h}).addClass("highcharts-axis-title").css(e.style).add(this.axisGroup),
this.axisTitle.isNew=!0);this.axisTitle[a?"show":"hide"](!0)},generateTick:function(a){var b=this.ticks;b[a]?b[a].addLabel():b[a]=new I(this,a)},getOffset:function(){var a=this,c=a.chart,e=c.renderer,h=a.options,n=a.tickPositions,m=a.ticks,d=a.horiz,f=a.side,p=c.inverted?[1,0,3,2][f]:f,y,t,x=0,g,z=0,E=h.title,q=h.labels,F=0,J=c.axisOffset,c=c.clipOffset,K=[-1,1,1,-1][f],C,I=h.className,r=a.axisParent,u=this.tickSize("tick");y=a.hasData();a.showAxis=t=y||w(h.showEmpty,!0);a.staggerLines=a.horiz&&q.staggerLines;
a.axisGroup||(a.gridGroup=e.g("grid").attr({zIndex:h.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(I||"")).add(r),a.axisGroup=e.g("axis").attr({zIndex:h.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(I||"")).add(r),a.labelGroup=e.g("axis-labels").attr({zIndex:q.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels "+(I||"")).add(r));if(y||a.isLinked)b(n,function(b,c){a.generateTick(b,c)}),a.renderUnsquish(),!1===q.reserveSpace||0!==f&&2!==f&&
{1:"left",3:"right"}[f]!==a.labelAlign&&"center"!==a.labelAlign||b(n,function(a){F=Math.max(m[a].getLabelSize(),F)}),a.staggerLines&&(F*=a.staggerLines,a.labelOffset=F*(a.opposite?-1:1));else for(C in m)m[C].destroy(),delete m[C];E&&E.text&&!1!==E.enabled&&(a.addTitle(t),t&&(x=a.axisTitle.getBBox()[d?"height":"width"],g=E.offset,z=l(g)?0:w(E.margin,d?5:10)));a.renderLine();a.offset=K*w(h.offset,J[f]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};e=0===f?-a.labelMetrics().h:2===f?a.tickRotCorr.y:0;z=Math.abs(F)+
z;F&&(z=z-e+K*(d?w(q.y,a.tickRotCorr.y+8*K):q.x));a.axisTitleMargin=w(g,z);J[f]=Math.max(J[f],a.axisTitleMargin+x+K*a.offset,z,y&&n.length&&u?u[0]:0);h=h.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);c[p]=Math.max(c[p],h)},getLinePath:function(a){var b=this.chart,c=this.opposite,k=this.offset,e=this.horiz,h=this.left+(c?this.width:0)+k,k=b.chartHeight-this.bottom-(c?this.height:0)+k;c&&(a*=-1);return b.renderer.crispLine(["M",e?this.left:h,e?k:this.top,"L",e?b.chartWidth-this.right:h,e?k:b.chartHeight-
this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,e=this.len,h=this.options.title,n=a?b:c,m=this.opposite,d=this.offset,f=h.x||0,p=h.y||0,y=this.chart.renderer.fontMetrics(h.style&&h.style.fontSize,this.axisTitle).f,e={low:n+(a?0:e),
middle:n+e/2,high:n+(a?e:0)}[h.align],b=(a?c+this.height:b)+(a?1:-1)*(m?-1:1)*this.axisTitleMargin+(2===this.side?y:0);return{x:a?e+f:b+(m?this.width:0)+d+f,y:a?b+p-(m?this.height:0)+d:e+p}},renderMinorTick:function(a){var b=this.chart.hasRendered&&z(this.oldMin),c=this.minorTicks;c[a]||(c[a]=new I(this,a,"minor"));b&&c[a].isNew&&c[a].render(null,!0);c[a].render(null,!1,1)},renderTick:function(a,b){var c=this.isLinked,e=this.ticks,k=this.chart.hasRendered&&z(this.oldMin);if(!c||a>=this.min&&a<=this.max)e[a]||
(e[a]=new I(this,a)),k&&e[a].isNew&&e[a].render(b,!0,.1),e[a].render(b)},render:function(){var a=this,c=a.chart,e=a.options,n=a.isLog,m=a.lin2log,d=a.isLinked,v=a.tickPositions,f=a.axisTitle,p=a.ticks,y=a.minorTicks,t=a.alternateBands,x=e.stackLabels,z=e.alternateGridColor,g=a.tickmarkOffset,E=a.axisLine,w=a.showAxis,l=A(c.renderer.globalAnimation),q,F;a.labelEdge.length=0;a.overlap=!1;b([p,y,t],function(a){for(var b in a)a[b].isActive=!1});if(a.hasData()||d)a.minorTickInterval&&!a.categories&&b(a.getMinorTickPositions(),
function(b){a.renderMinorTick(b)}),v.length&&(b(v,function(b,c){a.renderTick(b,c)}),g&&(0===a.min||a.single)&&(p[-1]||(p[-1]=new I(a,-1,null,!0)),p[-1].render(-1))),z&&b(v,function(b,e){F=void 0!==v[e+1]?v[e+1]+g:a.max-g;0===e%2&&b<a.max&&F<=a.max+(c.polar?-g:g)&&(t[b]||(t[b]=new h(a)),q=b+g,t[b].options={from:n?m(q):q,to:n?m(F):F,color:z},t[b].render(),t[b].isActive=!0)}),a._addedPlotLB||(b((e.plotLines||[]).concat(e.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0);b([p,y,t],
function(a){var b,e,h=[],k=l.duration;for(b in a)a[b].isActive||(a[b].render(b,!1,0),a[b].isActive=!1,h.push(b));K(function(){for(e=h.length;e--;)a[h[e]]&&!a[h[e]].isActive&&(a[h[e]].destroy(),delete a[h[e]])},a!==t&&c.hasRendered&&k?k:0)});E&&(E[E.isPlaced?"animate":"attr"]({d:this.getLinePath(E.strokeWidth())}),E.isPlaced=!0,E[w?"show":"hide"](!0));f&&w&&(f[f.isNew?"attr":"animate"](a.getTitlePosition()),f.isNew=!1);x&&x.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){this.visible&&
(this.render(),b(this.plotLinesAndBands,function(a){a.render()}));b(this.series,function(a){a.isDirty=!0})},keepProps:"extKey hcEvents names series userMax userMin".split(" "),destroy:function(a){var c=this,e=c.stacks,h,k=c.plotLinesAndBands,m;a||y(c);for(h in e)d(e[h]),e[h]=null;b([c.ticks,c.minorTicks,c.alternateBands],function(a){d(a)});if(k)for(a=k.length;a--;)k[a].destroy();b("stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross".split(" "),function(a){c[a]&&(c[a]=c[a].destroy())});
for(m in c)c.hasOwnProperty(m)&&-1===n(m,c.keepProps)&&delete c[m]},drawCrosshair:function(a,b){var c,e=this.crosshair,h=w(e.snap,!0),k,n=this.cross;a||(a=this.cross&&this.cross.e);this.crosshair&&!1!==(l(b)||!h)?(h?l(b)&&(k=this.isXAxis?b.plotX:this.len-b.plotY):k=a&&(this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos),l(k)&&(c=this.getPlotLinePath(b&&(this.isXAxis?b.x:w(b.stackY,b.y)),null,null,null,k)||null),l(c)?(b=this.categories&&!this.isRadial,n||(this.cross=n=this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+
(b?"category ":"thin ")+e.className).attr({zIndex:w(e.zIndex,2)}).add(),n.attr({stroke:e.color||(b?g("#ccd6eb").setOpacity(.25).get():"#cccccc"),"stroke-width":w(e.width,1)}),e.dashStyle&&n.attr({dashstyle:e.dashStyle})),n.show().attr({d:c}),b&&!e.width&&n.attr({"stroke-width":this.transA}),this.cross.e=a):this.hideCrosshair()):this.hideCrosshair()},hideCrosshair:function(){this.cross&&this.cross.hide()}};p(a.Axis.prototype,r)})(L);(function(a){var B=a.Axis,A=a.Date,H=a.dateFormat,G=a.defaultOptions,
r=a.defined,g=a.each,f=a.extend,u=a.getMagnitude,l=a.getTZOffset,q=a.normalizeTickInterval,d=a.pick,b=a.timeUnits;B.prototype.getTimeTicks=function(a,q,t,m){var c=[],n={},p=G.global.useUTC,z,e=new A(q-l(q)),x=A.hcMakeTime,F=a.unitRange,w=a.count,h;if(r(q)){e[A.hcSetMilliseconds](F>=b.second?0:w*Math.floor(e.getMilliseconds()/w));if(F>=b.second)e[A.hcSetSeconds](F>=b.minute?0:w*Math.floor(e.getSeconds()/w));if(F>=b.minute)e[A.hcSetMinutes](F>=b.hour?0:w*Math.floor(e[A.hcGetMinutes]()/w));if(F>=b.hour)e[A.hcSetHours](F>=
b.day?0:w*Math.floor(e[A.hcGetHours]()/w));if(F>=b.day)e[A.hcSetDate](F>=b.month?1:w*Math.floor(e[A.hcGetDate]()/w));F>=b.month&&(e[A.hcSetMonth](F>=b.year?0:w*Math.floor(e[A.hcGetMonth]()/w)),z=e[A.hcGetFullYear]());if(F>=b.year)e[A.hcSetFullYear](z-z%w);if(F===b.week)e[A.hcSetDate](e[A.hcGetDate]()-e[A.hcGetDay]()+d(m,1));z=e[A.hcGetFullYear]();m=e[A.hcGetMonth]();var y=e[A.hcGetDate](),J=e[A.hcGetHours]();if(A.hcTimezoneOffset||A.hcGetTimezoneOffset)h=(!p||!!A.hcGetTimezoneOffset)&&(t-q>4*b.month||
l(q)!==l(t)),e=e.getTime(),e=new A(e+l(e));p=e.getTime();for(q=1;p<t;)c.push(p),p=F===b.year?x(z+q*w,0):F===b.month?x(z,m+q*w):!h||F!==b.day&&F!==b.week?h&&F===b.hour?x(z,m,y,J+q*w):p+F*w:x(z,m,y+q*w*(F===b.day?1:7)),q++;c.push(p);F<=b.hour&&1E4>c.length&&g(c,function(a){0===a%18E5&&"000000000"===H("%H%M%S%L",a)&&(n[a]="day")})}c.info=f(a,{higherRanks:n,totalRange:F*w});return c};B.prototype.normalizeTimeTickInterval=function(a,d){var f=d||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",
[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]];d=f[f.length-1];var m=b[d[0]],c=d[1],n;for(n=0;n<f.length&&!(d=f[n],m=b[d[0]],c=d[1],f[n+1]&&a<=(m*c[c.length-1]+b[f[n+1][0]])/2);n++);m===b.year&&a<5*m&&(c=[1,2,5]);a=q(a/m,c,"year"===d[0]?Math.max(u(a/m),1):1);return{unitRange:m,count:a,unitName:d[0]}}})(L);(function(a){var B=a.Axis,A=a.getMagnitude,H=a.map,G=a.normalizeTickInterval,r=a.pick;B.prototype.getLogTickPositions=
function(a,f,u,l){var g=this.options,d=this.len,b=this.lin2log,p=this.log2lin,C=[];l||(this._minorAutoInterval=null);if(.5<=a)a=Math.round(a),C=this.getLinearTickPositions(a,f,u);else if(.08<=a)for(var d=Math.floor(f),t,m,c,n,E,g=.3<a?[1,2,4]:.15<a?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];d<u+1&&!E;d++)for(m=g.length,t=0;t<m&&!E;t++)c=p(b(d)*g[t]),c>f&&(!l||n<=u)&&void 0!==n&&C.push(n),n>u&&(E=!0),n=c;else f=b(f),u=b(u),a=g[l?"minorTickInterval":"tickInterval"],a=r("auto"===a?null:a,this._minorAutoInterval,
g.tickPixelInterval/(l?5:1)*(u-f)/((l?d/this.tickPositions.length:d)||1)),a=G(a,null,A(a)),C=H(this.getLinearTickPositions(a,f,u),p),l||(this._minorAutoInterval=a/5);l||(this.tickInterval=a);return C};B.prototype.log2lin=function(a){return Math.log(a)/Math.LN10};B.prototype.lin2log=function(a){return Math.pow(10,a)}})(L);(function(a){var B=a.dateFormat,A=a.each,H=a.extend,G=a.format,r=a.isNumber,g=a.map,f=a.merge,u=a.pick,l=a.splat,q=a.syncTimeout,d=a.timeUnits;a.Tooltip=function(){this.init.apply(this,
arguments)};a.Tooltip.prototype={init:function(a,d){this.chart=a;this.options=d;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=d.split&&!a.inverted;this.shared=d.shared||this.split},cleanSplit:function(a){A(this.chart.series,function(b){var d=b&&b.tt;d&&(!d.isActive||a?b.tt=d.destroy():d.isActive=!1)})},getLabel:function(){var a=this.chart.renderer,d=this.options;this.label||(this.split?this.label=a.g("tooltip"):(this.label=a.label("",0,0,d.shape||"callout",null,null,d.useHTML,
null,"tooltip").attr({padding:d.padding,r:d.borderRadius}),this.label.attr({fill:d.backgroundColor,"stroke-width":d.borderWidth}).css(d.style).shadow(d.shadow)),this.label.attr({zIndex:8}).add());return this.label},update:function(a){this.destroy();this.init(this.chart,f(!0,this.options,a))},destroy:function(){this.label&&(this.label=this.label.destroy());this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy());clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},
move:function(a,d,f,t){var b=this,c=b.now,n=!1!==b.options.animation&&!b.isHidden&&(1<Math.abs(a-c.x)||1<Math.abs(d-c.y)),p=b.followPointer||1<b.len;H(c,{x:n?(2*c.x+a)/3:a,y:n?(c.y+d)/2:d,anchorX:p?void 0:n?(2*c.anchorX+f)/3:f,anchorY:p?void 0:n?(c.anchorY+t)/2:t});b.getLabel().attr(c);n&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){b&&b.move(a,d,f,t)},32))},hide:function(a){var b=this;clearTimeout(this.hideTimer);a=u(a,this.options.hideDelay,500);this.isHidden||(this.hideTimer=
q(function(){b.getLabel()[a?"fadeOut":"hide"]();b.isHidden=!0},a))},getAnchor:function(a,d){var b,f=this.chart,m=f.inverted,c=f.plotTop,n=f.plotLeft,p=0,z=0,e,x;a=l(a);b=a[0].tooltipPos;this.followPointer&&d&&(void 0===d.chartX&&(d=f.pointer.normalize(d)),b=[d.chartX-f.plotLeft,d.chartY-c]);b||(A(a,function(a){e=a.series.yAxis;x=a.series.xAxis;p+=a.plotX+(!m&&x?x.left-n:0);z+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!m&&e?e.top-c:0)}),p/=a.length,z/=a.length,b=[m?f.plotWidth-z:p,this.shared&&
!m&&1<a.length&&d?d.chartY-c:m?f.plotHeight-p:z]);return g(b,Math.round)},getPosition:function(a,d,f){var b=this.chart,m=this.distance,c={},n=f.h||0,p,z=["y",b.chartHeight,d,f.plotY+b.plotTop,b.plotTop,b.plotTop+b.plotHeight],e=["x",b.chartWidth,a,f.plotX+b.plotLeft,b.plotLeft,b.plotLeft+b.plotWidth],x=!this.followPointer&&u(f.ttBelow,!b.inverted===!!f.negative),g=function(a,b,e,h,d,f){var k=e<h-m,y=h+m+e<b,p=h-m-e;h+=m;if(x&&y)c[a]=h;else if(!x&&k)c[a]=p;else if(k)c[a]=Math.min(f-e,0>p-n?p:p-n);
else if(y)c[a]=Math.max(d,h+n+e>b?h:h+n);else return!1},w=function(a,b,e,h){var k;h<m||h>b-m?k=!1:c[a]=h<e/2?1:h>b-e/2?b-e-2:h-e/2;return k},h=function(a){var b=z;z=e;e=b;p=a},y=function(){!1!==g.apply(0,z)?!1!==w.apply(0,e)||p||(h(!0),y()):p?c.x=c.y=0:(h(!0),y())};(b.inverted||1<this.len)&&h();y();return c},defaultFormatter:function(a){var b=this.points||l(this),d;d=[a.tooltipFooterHeaderFormatter(b[0])];d=d.concat(a.bodyFormatter(b));d.push(a.tooltipFooterHeaderFormatter(b[0],!0));return d},refresh:function(a,
d){var b=this.chart,f,m=this.options,c,n,p={},z=[];f=m.formatter||this.defaultFormatter;var p=b.hoverPoints,e=this.shared;clearTimeout(this.hideTimer);this.followPointer=l(a)[0].series.tooltipOptions.followPointer;n=this.getAnchor(a,d);d=n[0];c=n[1];!e||a.series&&a.series.noSharedTooltip?p=a.getLabelConfig():(b.hoverPoints=a,p&&A(p,function(a){a.setState()}),A(a,function(a){a.setState("hover");z.push(a.getLabelConfig())}),p={x:a[0].category,y:a[0].y},p.points=z,a=a[0]);this.len=z.length;p=f.call(p,
this);e=a.series;this.distance=u(e.tooltipOptions.distance,16);!1===p?this.hide():(f=this.getLabel(),this.isHidden&&f.attr({opacity:1}).show(),this.split?this.renderSplit(p,b.hoverPoints):(f.attr({text:p&&p.join?p.join(""):p}),f.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+u(a.colorIndex,e.colorIndex)),f.attr({stroke:m.borderColor||a.color||e.color||"#666666"}),this.updatePosition({plotX:d,plotY:c,negative:a.negative,ttBelow:a.ttBelow,h:n[2]||0})),this.isHidden=!1)},renderSplit:function(b,
d){var f=this,p=[],m=this.chart,c=m.renderer,n=!0,g=this.options,z,e=this.getLabel();A(b.slice(0,d.length+1),function(a,b){b=d[b-1]||{isHeader:!0,plotX:d[0].plotX};var x=b.series||f,h=x.tt,y=b.series||{},t="highcharts-color-"+u(b.colorIndex,y.colorIndex,"none");h||(x.tt=h=c.label(null,null,null,"callout").addClass("highcharts-tooltip-box "+t).attr({padding:g.padding,r:g.borderRadius,fill:g.backgroundColor,stroke:b.color||y.color||"#333333","stroke-width":g.borderWidth}).add(e));h.isActive=!0;h.attr({text:a});
h.css(g.style);a=h.getBBox();y=a.width+h.strokeWidth();b.isHeader?(z=a.height,y=Math.max(0,Math.min(b.plotX+m.plotLeft-y/2,m.chartWidth-y))):y=b.plotX+m.plotLeft-u(g.distance,16)-y;0>y&&(n=!1);a=(b.series&&b.series.yAxis&&b.series.yAxis.pos)+(b.plotY||0);a-=m.plotTop;p.push({target:b.isHeader?m.plotHeight+z:a,rank:b.isHeader?1:0,size:x.tt.getBBox().height+1,point:b,x:y,tt:h})});this.cleanSplit();a.distribute(p,m.plotHeight+z);A(p,function(a){var b=a.point,c=b.series;a.tt.attr({visibility:void 0===
a.pos?"hidden":"inherit",x:n||b.isHeader?a.x:b.plotX+m.plotLeft+u(g.distance,16),y:a.pos+m.plotTop,anchorX:b.isHeader?b.plotX+m.plotLeft:b.plotX+c.xAxis.pos,anchorY:b.isHeader?a.pos+m.plotTop-15:b.plotY+c.yAxis.pos})})},updatePosition:function(a){var b=this.chart,d=this.getLabel(),d=(this.options.positioner||this.getPosition).call(this,d.width,d.height,a);this.move(Math.round(d.x),Math.round(d.y||0),a.plotX+b.plotLeft,a.plotY+b.plotTop)},getDateFormat:function(a,f,g,t){var b=B("%m-%d %H:%M:%S.%L",
f),c,n,p={millisecond:15,second:12,minute:9,hour:6,day:3},z="millisecond";for(n in d){if(a===d.week&&+B("%w",f)===g&&"00:00:00.000"===b.substr(6)){n="week";break}if(d[n]>a){n=z;break}if(p[n]&&b.substr(p[n])!=="01-01 00:00:00.000".substr(p[n]))break;"week"!==n&&(z=n)}n&&(c=t[n]);return c},getXDateFormat:function(a,d,f){d=d.dateTimeLabelFormats;var b=f&&f.closestPointRange;return(b?this.getDateFormat(b,a.x,f.options.startOfWeek,d):d.day)||d.year},tooltipFooterHeaderFormatter:function(a,d){var b=d?"footer":
"header";d=a.series;var f=d.tooltipOptions,m=f.xDateFormat,c=d.xAxis,n=c&&"datetime"===c.options.type&&r(a.key),b=f[b+"Format"];n&&!m&&(m=this.getXDateFormat(a,f,c));n&&m&&(b=b.replace("{point.key}","{point.key:"+m+"}"));return G(b,{point:a,series:d})},bodyFormatter:function(a){return g(a,function(a){var b=a.series.tooltipOptions;return(b.pointFormatter||a.point.tooltipFormatter).call(a.point,b.pointFormat)})}}})(L);(function(a){var B=a.addEvent,A=a.attr,H=a.charts,G=a.color,r=a.css,g=a.defined,f=
a.doc,u=a.each,l=a.extend,q=a.fireEvent,d=a.offset,b=a.pick,p=a.removeEvent,C=a.splat,t=a.Tooltip,m=a.win;a.Pointer=function(a,b){this.init(a,b)};a.Pointer.prototype={init:function(a,d){this.options=d;this.chart=a;this.runChartClick=d.chart.events&&!!d.chart.events.click;this.pinchDown=[];this.lastValidTouch={};t&&d.tooltip.enabled&&(a.tooltip=new t(a,d.tooltip),this.followTouchMove=b(d.tooltip.followTouchMove,!0));this.setDOMEvents()},zoomOption:function(a){var c=this.chart,d=c.options.chart,m=d.zoomType||
"",c=c.inverted;/touch/.test(a.type)&&(m=b(d.pinchType,m));this.zoomX=a=/x/.test(m);this.zoomY=m=/y/.test(m);this.zoomHor=a&&!c||m&&c;this.zoomVert=m&&!c||a&&c;this.hasZoom=a||m},normalize:function(a,b){var c,n;a=a||m.event;a.target||(a.target=a.srcElement);n=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;b||(this.chartPosition=b=d(this.chart.container));void 0===n.pageX?(c=Math.max(a.x,a.clientX-b.left),b=a.y):(c=n.pageX-b.left,b=n.pageY-b.top);return l(a,{chartX:Math.round(c),
chartY:Math.round(b)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};u(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},runPointActions:function(c){var d=this.chart,m=d.series,p=d.tooltip,e=p?p.shared:!1,g=!0,t=d.hoverPoint,w=d.hoverSeries,h,y,l,q=[],r;if(!e&&!w)for(h=0;h<m.length;h++)if(m[h].directTouch||!m[h].options.stickyTracking)m=[];w&&(e?w.noSharedTooltip:w.directTouch)&&t?q=[t]:(e||!w||w.options.stickyTracking||
(m=[w]),u(m,function(a){y=a.noSharedTooltip&&e;l=!e&&a.directTouch;a.visible&&!y&&!l&&b(a.options.enableMouseTracking,!0)&&(r=a.searchPoint(c,!y&&1===a.kdDimensions))&&r.series&&q.push(r)}),q.sort(function(a,b){var c=a.distX-b.distX,h=a.dist-b.dist,k=(b.series.group&&b.series.group.zIndex)-(a.series.group&&a.series.group.zIndex);return 0!==c&&e?c:0!==h?h:0!==k?k:a.series.index>b.series.index?-1:1}));if(e)for(h=q.length;h--;)(q[h].x!==q[0].x||q[h].series.noSharedTooltip)&&q.splice(h,1);if(q[0]&&(q[0]!==
this.prevKDPoint||p&&p.isHidden)){if(e&&!q[0].series.noSharedTooltip){for(h=0;h<q.length;h++)q[h].onMouseOver(c,q[h]!==(w&&w.directTouch&&t||q[0]));q.length&&p&&p.refresh(q.sort(function(a,b){return a.series.index-b.series.index}),c)}else if(p&&p.refresh(q[0],c),!w||!w.directTouch)q[0].onMouseOver(c);this.prevKDPoint=q[0];g=!1}g&&(m=w&&w.tooltipOptions.followPointer,p&&m&&!p.isHidden&&(m=p.getAnchor([{}],c),p.updatePosition({plotX:m[0],plotY:m[1]})));this.unDocMouseMove||(this.unDocMouseMove=B(f,
"mousemove",function(b){if(H[a.hoverChartIndex])H[a.hoverChartIndex].pointer.onDocumentMouseMove(b)}));u(e?q:[b(t,q[0])],function(a){u(d.axes,function(b){(!a||a.series&&a.series[b.coll]===b)&&b.drawCrosshair(c,a)})})},reset:function(a,b){var c=this.chart,d=c.hoverSeries,e=c.hoverPoint,n=c.hoverPoints,m=c.tooltip,f=m&&m.shared?n:e;a&&f&&u(C(f),function(b){b.series.isCartesian&&void 0===b.plotX&&(a=!1)});if(a)m&&f&&(m.refresh(f),e&&(e.setState(e.state,!0),u(c.axes,function(a){a.crosshair&&a.drawCrosshair(null,
e)})));else{if(e)e.onMouseOut();n&&u(n,function(a){a.setState()});if(d)d.onMouseOut();m&&m.hide(b);this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove());u(c.axes,function(a){a.hideCrosshair()});this.hoverX=this.prevKDPoint=c.hoverPoints=c.hoverPoint=null}},scaleGroups:function(a,b){var c=this.chart,d;u(c.series,function(e){d=a||e.getPlotBox();e.xAxis&&e.xAxis.zoomEnabled&&e.group&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&
e.dataLabelsGroup.attr(d))});c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,m=this.zoomHor,f=this.zoomVert,p=b.plotLeft,h=b.plotTop,y=b.plotWidth,g=b.plotHeight,t,q=this.selectionMarker,k=this.mouseDownX,l=this.mouseDownY,r=c.panKey&&a[c.panKey+"Key"];q&&q.touch||(d<p?d=p:d>p+y&&(d=p+y),e<
h?e=h:e>h+g&&(e=h+g),this.hasDragged=Math.sqrt(Math.pow(k-d,2)+Math.pow(l-e,2)),10<this.hasDragged&&(t=b.isInsidePlot(k-p,l-h),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&t&&!r&&!q&&(this.selectionMarker=q=b.renderer.rect(p,h,m?1:y,f?1:g,0).attr({fill:c.selectionMarkerFill||G("#335cad").setOpacity(.25).get(),"class":"highcharts-selection-marker",zIndex:7}).add()),q&&m&&(d-=k,q.attr({width:Math.abs(d),x:(0<d?0:d)+k})),q&&f&&(d=e-l,q.attr({height:Math.abs(d),y:(0<d?0:d)+l})),t&&!q&&c.panning&&b.pan(a,
c.panning)))},drop:function(a){var b=this,c=this.chart,d=this.hasPinched;if(this.selectionMarker){var e={originalEvent:a,xAxis:[],yAxis:[]},m=this.selectionMarker,f=m.attr?m.attr("x"):m.x,p=m.attr?m.attr("y"):m.y,h=m.attr?m.attr("width"):m.width,y=m.attr?m.attr("height"):m.height,t;if(this.hasDragged||d)u(c.axes,function(c){if(c.zoomEnabled&&g(c.min)&&(d||b[{xAxis:"zoomX",yAxis:"zoomY"}[c.coll]])){var m=c.horiz,k="touchend"===a.type?c.minPixelPadding:0,n=c.toValue((m?f:p)+k),m=c.toValue((m?f+h:p+
y)-k);e[c.coll].push({axis:c,min:Math.min(n,m),max:Math.max(n,m)});t=!0}}),t&&q(c,"selection",e,function(a){c.zoom(l(a,d?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();d&&this.scaleGroups()}c&&(r(c.container,{cursor:c._cursor}),c.cancelClick=10<this.hasDragged,c.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a);this.zoomOption(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(b){H[a.hoverChartIndex]&&
H[a.hoverChartIndex].pointer.drop(b)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition;a=this.normalize(a,c);!c||this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)||this.reset()},onContainerMouseLeave:function(b){var c=H[a.hoverChartIndex];c&&(b.relatedTarget||b.toElement)&&(c.pointer.reset(),c.pointer.chartPosition=null)},onContainerMouseMove:function(b){var c=this.chart;g(a.hoverChartIndex)&&H[a.hoverChartIndex]&&H[a.hoverChartIndex].mouseIsDown||
(a.hoverChartIndex=c.index);b=this.normalize(b);b.returnValue=!1;"mousedown"===c.mouseIsDown&&this.drag(b);!this.inClass(b.target,"highcharts-tracker")&&!c.isInsidePlot(b.chartX-c.plotLeft,b.chartY-c.plotTop)||c.openMenu||this.runPointActions(b)},inClass:function(a,b){for(var c;a;){if(c=A(a,"class")){if(-1!==c.indexOf(b))return!0;if(-1!==c.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries;a=a.relatedTarget||a.toElement;if(!(!b||!a||
b.options.stickyTracking||this.inClass(a,"highcharts-tooltip")||this.inClass(a,"highcharts-series-"+b.index)&&this.inClass(a,"highcharts-tracker")))b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop;a=this.normalize(a);b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(q(c.series,"click",l(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(l(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&q(b,"click",a)))},setDOMEvents:function(){var b=
this,d=b.chart.container;d.onmousedown=function(a){b.onContainerMouseDown(a)};d.onmousemove=function(a){b.onContainerMouseMove(a)};d.onclick=function(a){b.onContainerClick(a)};B(d,"mouseleave",b.onContainerMouseLeave);1===a.chartCount&&B(f,"mouseup",b.onDocumentMouseUp);a.hasTouch&&(d.ontouchstart=function(a){b.onContainerTouchStart(a)},d.ontouchmove=function(a){b.onContainerTouchMove(a)},1===a.chartCount&&B(f,"touchend",b.onDocumentTouchEnd))},destroy:function(){var b;p(this.chart.container,"mouseleave",
this.onContainerMouseLeave);a.chartCount||(p(f,"mouseup",this.onDocumentMouseUp),p(f,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(b in this)this[b]=null}}})(L);(function(a){var B=a.charts,A=a.each,H=a.extend,G=a.map,r=a.noop,g=a.pick;H(a.Pointer.prototype,{pinchTranslate:function(a,g,l,q,d,b){this.zoomHor&&this.pinchTranslateDirection(!0,a,g,l,q,d,b);this.zoomVert&&this.pinchTranslateDirection(!1,a,g,l,q,d,b)},pinchTranslateDirection:function(a,g,l,q,d,b,p,r){var f=
this.chart,m=a?"x":"y",c=a?"X":"Y",n="chart"+c,E=a?"width":"height",z=f["plot"+(a?"Left":"Top")],e,x,F=r||1,w=f.inverted,h=f.bounds[a?"h":"v"],y=1===g.length,J=g[0][n],u=l[0][n],I=!y&&g[1][n],k=!y&&l[1][n],D;l=function(){!y&&20<Math.abs(J-I)&&(F=r||Math.abs(u-k)/Math.abs(J-I));x=(z-u)/F+J;e=f["plot"+(a?"Width":"Height")]/F};l();g=x;g<h.min?(g=h.min,D=!0):g+e>h.max&&(g=h.max-e,D=!0);D?(u-=.8*(u-p[m][0]),y||(k-=.8*(k-p[m][1])),l()):p[m]=[u,k];w||(b[m]=x-z,b[E]=e);b=w?1/F:F;d[E]=e;d[m]=g;q[w?a?"scaleY":
"scaleX":"scale"+c]=F;q["translate"+c]=b*z+(u-b*J)},pinch:function(a){var f=this,l=f.chart,q=f.pinchDown,d=a.touches,b=d.length,p=f.lastValidTouch,C=f.hasZoom,t=f.selectionMarker,m={},c=1===b&&(f.inClass(a.target,"highcharts-tracker")&&l.runTrackerClick||f.runChartClick),n={};1<b&&(f.initiated=!0);C&&f.initiated&&!c&&a.preventDefault();G(d,function(a){return f.normalize(a)});"touchstart"===a.type?(A(d,function(a,b){q[b]={chartX:a.chartX,chartY:a.chartY}}),p.x=[q[0].chartX,q[1]&&q[1].chartX],p.y=[q[0].chartY,
q[1]&&q[1].chartY],A(l.axes,function(a){if(a.zoomEnabled){var b=l.bounds[a.horiz?"h":"v"],c=a.minPixelPadding,d=a.toPixels(g(a.options.min,a.dataMin)),m=a.toPixels(g(a.options.max,a.dataMax)),f=Math.max(d,m);b.min=Math.min(a.pos,Math.min(d,m)-c);b.max=Math.max(a.pos+a.len,f+c)}}),f.res=!0):f.followTouchMove&&1===b?this.runPointActions(f.normalize(a)):q.length&&(t||(f.selectionMarker=t=H({destroy:r,touch:!0},l.plotBox)),f.pinchTranslate(q,d,m,t,n,p),f.hasPinched=C,f.scaleGroups(m,n),f.res&&(f.res=
!1,this.reset(!1,0)))},touch:function(f,r){var l=this.chart,q,d;if(l.index!==a.hoverChartIndex)this.onContainerMouseLeave({relatedTarget:!0});a.hoverChartIndex=l.index;1===f.touches.length?(f=this.normalize(f),(d=l.isInsidePlot(f.chartX-l.plotLeft,f.chartY-l.plotTop))&&!l.openMenu?(r&&this.runPointActions(f),"touchmove"===f.type&&(r=this.pinchDown,q=r[0]?4<=Math.sqrt(Math.pow(r[0].chartX-f.chartX,2)+Math.pow(r[0].chartY-f.chartY,2)):!1),g(q,!0)&&this.pinch(f)):r&&this.reset()):2===f.touches.length&&
this.pinch(f)},onContainerTouchStart:function(a){this.zoomOption(a);this.touch(a,!0)},onContainerTouchMove:function(a){this.touch(a)},onDocumentTouchEnd:function(f){B[a.hoverChartIndex]&&B[a.hoverChartIndex].pointer.drop(f)}})})(L);(function(a){var B=a.addEvent,A=a.charts,H=a.css,G=a.doc,r=a.extend,g=a.noop,f=a.Pointer,u=a.removeEvent,l=a.win,q=a.wrap;if(l.PointerEvent||l.MSPointerEvent){var d={},b=!!l.PointerEvent,p=function(){var a,b=[];b.item=function(a){return this[a]};for(a in d)d.hasOwnProperty(a)&&
b.push({pageX:d[a].pageX,pageY:d[a].pageY,target:d[a].target});return b},C=function(b,d,c,f){"touch"!==b.pointerType&&b.pointerType!==b.MSPOINTER_TYPE_TOUCH||!A[a.hoverChartIndex]||(f(b),f=A[a.hoverChartIndex].pointer,f[d]({type:c,target:b.currentTarget,preventDefault:g,touches:p()}))};r(f.prototype,{onContainerPointerDown:function(a){C(a,"onContainerTouchStart","touchstart",function(a){d[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){C(a,"onContainerTouchMove",
"touchmove",function(a){d[a.pointerId]={pageX:a.pageX,pageY:a.pageY};d[a.pointerId].target||(d[a.pointerId].target=a.currentTarget)})},onDocumentPointerUp:function(a){C(a,"onDocumentTouchEnd","touchend",function(a){delete d[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,b?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,b?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(G,b?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});q(f.prototype,
"init",function(a,b,c){a.call(this,b,c);this.hasZoom&&H(b.container,{"-ms-touch-action":"none","touch-action":"none"})});q(f.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(B)});q(f.prototype,"destroy",function(a){this.batchMSEvents(u);a.call(this)})}})(L);(function(a){var B,A=a.addEvent,H=a.css,G=a.discardElement,r=a.defined,g=a.each,f=a.extend,u=a.isFirefox,l=a.marginNames,q=a.merge,d=a.pick,b=a.setAnimation,p=a.stableSort,C=a.win,t=a.wrap;
B=a.Legend=function(a,b){this.init(a,b)};B.prototype={init:function(a,b){this.chart=a;this.setOptions(b);b.enabled&&(this.render(),A(this.chart,"endResize",function(){this.legend.positionCheckboxes()}))},setOptions:function(a){var b=d(a.padding,8);this.options=a;this.itemStyle=a.itemStyle;this.itemHiddenStyle=q(this.itemStyle,a.itemHiddenStyle);this.itemMarginTop=a.itemMarginTop||0;this.initialItemX=this.padding=b;this.initialItemY=b-5;this.itemHeight=this.maxItemWidth=0;this.symbolWidth=d(a.symbolWidth,
16);this.pages=[]},update:function(a,b){var c=this.chart;this.setOptions(q(!0,this.options,a));this.destroy();c.isDirtyLegend=c.isDirtyBox=!0;d(b,!0)&&c.redraw()},colorizeItem:function(a,b){a.legendGroup[b?"removeClass":"addClass"]("highcharts-legend-item-hidden");var c=this.options,d=a.legendItem,m=a.legendLine,e=a.legendSymbol,f=this.itemHiddenStyle.color,c=b?c.itemStyle.color:f,p=b?a.color||f:f,g=a.options&&a.options.marker,h={fill:p},y;d&&d.css({fill:c,color:c});m&&m.attr({stroke:p});if(e){if(g&&
e.isMarker&&(h=a.pointAttribs(),!b))for(y in h)h[y]=f;e.attr(h)}},positionItem:function(a){var b=this.options,d=b.symbolPadding,b=!b.rtl,m=a._legendItemPos,f=m[0],m=m[1],e=a.checkbox;(a=a.legendGroup)&&a.element&&a.translate(b?f:this.legendWidth-f-2*d-4,m);e&&(e.x=f,e.y=m)},destroyItem:function(a){var b=a.checkbox;g(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&G(a.checkbox)},destroy:function(){function a(a){this[a]&&(this[a]=this[a].destroy())}
g(this.getAllItems(),function(b){g(["legendItem","legendGroup"],a,b)});g(["box","title","group"],a,this);this.display=null},positionCheckboxes:function(a){var b=this.group&&this.group.alignAttr,d,m=this.clipHeight||this.legendHeight,f=this.titleHeight;b&&(d=b.translateY,g(this.allItems,function(c){var e=c.checkbox,n;e&&(n=d+f+e.y+(a||0)+3,H(e,{left:b.translateX+c.checkboxOffset+e.x-20+"px",top:n+"px",display:n>d-6&&n<d+m-6?"":"none"}))}))},renderTitle:function(){var a=this.padding,b=this.options.title,
d=0;b.text&&(this.title||(this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group)),a=this.title.getBBox(),d=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:d}));this.titleHeight=d},setText:function(b){var c=this.options;b.legendItem.attr({text:c.labelFormat?a.format(c.labelFormat,b):c.labelFormatter.call(b)})},renderItem:function(a){var b=this.chart,f=b.renderer,m=this.options,p="horizontal"===
m.layout,e=this.symbolWidth,g=m.symbolPadding,l=this.itemStyle,t=this.itemHiddenStyle,h=this.padding,y=p?d(m.itemDistance,20):0,J=!m.rtl,r=m.width,I=m.itemMarginBottom||0,k=this.itemMarginTop,u=this.initialItemX,C=a.legendItem,N=!a.series,A=!N&&a.series.drawLegendSymbol?a.series:a,B=A.options,B=this.createCheckboxForItem&&B&&B.showCheckbox,v=m.useHTML;C||(a.legendGroup=f.g("legend-item").addClass("highcharts-"+A.type+"-series highcharts-color-"+a.colorIndex+(a.options.className?" "+a.options.className:
"")+(N?" highcharts-series-"+a.index:"")).attr({zIndex:1}).add(this.scrollGroup),a.legendItem=C=f.text("",J?e+g:-g,this.baseline||0,v).css(q(a.visible?l:t)).attr({align:J?"left":"right",zIndex:2}).add(a.legendGroup),this.baseline||(l=l.fontSize,this.fontMetrics=f.fontMetrics(l,C),this.baseline=this.fontMetrics.f+3+k,C.attr("y",this.baseline)),this.symbolHeight=m.symbolHeight||this.fontMetrics.f,A.drawLegendSymbol(this,a),this.setItemEvents&&this.setItemEvents(a,C,v),B&&this.createCheckboxForItem(a));
this.colorizeItem(a,a.visible);this.setText(a);f=C.getBBox();e=a.checkboxOffset=m.itemWidth||a.legendItemWidth||e+g+f.width+y+(B?20:0);this.itemHeight=g=Math.round(a.legendItemHeight||f.height);p&&this.itemX-u+e>(r||b.chartWidth-2*h-u-m.x)&&(this.itemX=u,this.itemY+=k+this.lastLineHeight+I,this.lastLineHeight=0);this.maxItemWidth=Math.max(this.maxItemWidth,e);this.lastItemY=k+this.itemY+I;this.lastLineHeight=Math.max(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];p?this.itemX+=e:
(this.itemY+=k+g+I,this.lastLineHeight=g);this.offsetWidth=r||Math.max((p?this.itemX-u-y:e)+h,this.offsetWidth)},getAllItems:function(){var a=[];g(this.chart.series,function(b){var c=b&&b.options;b&&d(c.showInLegend,r(c.linkedTo)?!1:void 0,!0)&&(a=a.concat(b.legendItems||("point"===c.legendType?b.data:b)))});return a},adjustMargins:function(a,b){var c=this.chart,f=this.options,m=f.align.charAt(0)+f.verticalAlign.charAt(0)+f.layout.charAt(0);f.floating||g([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,
/(lbv|lm|ltv)/],function(e,n){e.test(m)&&!r(a[n])&&(c[l[n]]=Math.max(c[l[n]],c.legend[(n+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][n]*f[n%2?"x":"y"]+d(f.margin,12)+b[n]))})},render:function(){var a=this,b=a.chart,d=b.renderer,q=a.group,l,e,t,r,w=a.box,h=a.options,y=a.padding;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;q||(a.group=q=d.g("legend").attr({zIndex:7}).add(),a.contentGroup=d.g().attr({zIndex:1}).add(q),a.scrollGroup=d.g().add(a.contentGroup));a.renderTitle();
l=a.getAllItems();p(l,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});h.reversed&&l.reverse();a.allItems=l;a.display=e=!!l.length;a.lastLineHeight=0;g(l,function(b){a.renderItem(b)});t=(h.width||a.offsetWidth)+y;r=a.lastItemY+a.lastLineHeight+a.titleHeight;r=a.handleOverflow(r);r+=y;w||(a.box=w=d.rect().addClass("highcharts-legend-box").attr({r:h.borderRadius}).add(q),w.isNew=!0);w.attr({stroke:h.borderColor,"stroke-width":h.borderWidth||0,fill:h.backgroundColor||
"none"}).shadow(h.shadow);0<t&&0<r&&(w[w.isNew?"attr":"animate"](w.crisp({x:0,y:0,width:t,height:r},w.strokeWidth())),w.isNew=!1);w[e?"show":"hide"]();a.legendWidth=t;a.legendHeight=r;g(l,function(b){a.positionItem(b)});e&&q.align(f({width:t,height:r},h),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,f=this.chart,m=f.renderer,p=this.options,e=p.y,f=f.spacingBox.height+("top"===p.verticalAlign?-e:e)-this.padding,e=p.maxHeight,q,l=this.clipRect,t=p.navigation,
h=d(t.animation,!0),y=t.arrowSize||12,r=this.nav,u=this.pages,I=this.padding,k,D=this.allItems,C=function(a){a?l.attr({height:a}):l&&(b.clipRect=l.destroy(),b.contentGroup.clip());b.contentGroup.div&&(b.contentGroup.div.style.clip=a?"rect("+I+"px,9999px,"+(I+a)+"px,0)":"auto")};"horizontal"!==p.layout||"middle"===p.verticalAlign||p.floating||(f/=2);e&&(f=Math.min(f,e));u.length=0;a>f&&!1!==t.enabled?(this.clipHeight=q=Math.max(f-20-this.titleHeight-I,0),this.currentPage=d(this.currentPage,1),this.fullHeight=
a,g(D,function(a,b){var c=a._legendItemPos[1];a=Math.round(a.legendItem.getBBox().height);var e=u.length;if(!e||c-u[e-1]>q&&(k||c)!==u[e-1])u.push(k||c),e++;b===D.length-1&&c+a-u[e-1]>q&&u.push(c);c!==k&&(k=c)}),l||(l=b.clipRect=m.clipRect(0,I,9999,0),b.contentGroup.clip(l)),C(q),r||(this.nav=r=m.g().attr({zIndex:1}).add(this.group),this.up=m.symbol("triangle",0,0,y,y).on("click",function(){b.scroll(-1,h)}).add(r),this.pager=m.text("",15,10).addClass("highcharts-legend-navigation").css(t.style).add(r),
this.down=m.symbol("triangle-down",0,0,y,y).on("click",function(){b.scroll(1,h)}).add(r)),b.scroll(0),a=f):r&&(C(),r.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a},scroll:function(a,c){var d=this.pages,f=d.length;a=this.currentPage+a;var m=this.clipHeight,e=this.options.navigation,p=this.pager,g=this.padding;a>f&&(a=f);0<a&&(void 0!==c&&b(c,this.chart),this.nav.attr({translateX:g,translateY:m+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({"class":1===
a?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),p.attr({text:a+"/"+f}),this.down.attr({x:18+this.pager.getBBox().width,"class":a===f?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),this.up.attr({fill:1===a?e.inactiveColor:e.activeColor}).css({cursor:1===a?"default":"pointer"}),this.down.attr({fill:a===f?e.inactiveColor:e.activeColor}).css({cursor:a===f?"default":"pointer"}),c=-d[a-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=
a,this.positionCheckboxes(c))}};a.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.symbolHeight,f=a.options.squareSymbol;b.legendSymbol=this.chart.renderer.rect(f?(a.symbolWidth-c)/2:0,a.baseline-c+1,f?c:a.symbolWidth,c,d(a.options.symbolRadius,c/2)).addClass("highcharts-point").attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options,f=b.marker,m=a.symbolWidth,p=a.symbolHeight,e=p/2,g=this.chart.renderer,l=this.legendGroup;a=a.baseline-Math.round(.3*a.fontMetrics.b);
var t;t={"stroke-width":b.lineWidth||0};b.dashStyle&&(t.dashstyle=b.dashStyle);this.legendLine=g.path(["M",0,a,"L",m,a]).addClass("highcharts-graph").attr(t).add(l);f&&!1!==f.enabled&&(b=Math.min(d(f.radius,e),e),0===this.symbol.indexOf("url")&&(f=q(f,{width:p,height:p}),b=0),this.legendSymbol=f=g.symbol(this.symbol,m/2-b,a-b,2*b,2*b,f).addClass("highcharts-point").add(l),f.isMarker=!0)}};(/Trident\/7\.0/.test(C.navigator.userAgent)||u)&&t(B.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&
a.call(c,b)};d();setTimeout(d)})})(L);(function(a){var B=a.addEvent,A=a.animate,H=a.animObject,G=a.attr,r=a.doc,g=a.Axis,f=a.createElement,u=a.defaultOptions,l=a.discardElement,q=a.charts,d=a.css,b=a.defined,p=a.each,C=a.extend,t=a.find,m=a.fireEvent,c=a.getStyle,n=a.grep,E=a.isNumber,z=a.isObject,e=a.isString,x=a.Legend,F=a.marginNames,w=a.merge,h=a.Pointer,y=a.pick,J=a.pInt,K=a.removeEvent,I=a.seriesTypes,k=a.splat,D=a.svg,P=a.syncTimeout,N=a.win,S=a.Renderer,O=a.Chart=function(){this.getArgs.apply(this,
arguments)};a.chart=function(a,b,c){return new O(a,b,c)};O.prototype={callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(e(a[0])||a[0].nodeName)this.renderTo=a.shift();this.init(a[0],a[1])},init:function(b,c){var e,h=b.series;b.series=null;e=w(u,b);e.series=b.series=h;this.userOptions=b;this.respRules=[];b=e.chart;h=b.events;this.margin=[];this.spacing=[];this.bounds={h:{},v:{}};this.callback=c;this.isResizing=0;this.options=e;this.axes=[];this.series=[];this.hasCartesianSeries=b.showAxes;
var d;this.index=q.length;q.push(this);a.chartCount++;if(h)for(d in h)B(this,d,h[d]);this.xAxis=[];this.yAxis=[];this.pointCount=this.colorCounter=this.symbolCounter=0;this.firstRender()},initSeries:function(b){var c=this.options.chart;(c=I[b.type||c.type||c.defaultSeriesType])||a.error(17,!0);c=new c;c.init(this,b);return c},orderSeries:function(a){var b=this.series;for(a=a||0;a<b.length;a++)b[a]&&(b[a].index=a,b[a].name=b[a].name||"Series "+(b[a].index+1))},isInsidePlot:function(a,b,c){var e=c?
b:a;a=c?a:b;return 0<=e&&e<=this.plotWidth&&0<=a&&a<=this.plotHeight},redraw:function(b){var c=this.axes,e=this.series,h=this.pointer,d=this.legend,k=this.isDirtyLegend,f,n,y=this.hasCartesianSeries,g=this.isDirtyBox,v=e.length,l=v,q=this.renderer,t=q.isHidden(),w=[];this.setResponsive&&this.setResponsive(!1);a.setAnimation(b,this);t&&this.cloneRenderTo();for(this.layOutTitles();l--;)if(b=e[l],b.options.stacking&&(f=!0,b.isDirty)){n=!0;break}if(n)for(l=v;l--;)b=e[l],b.options.stacking&&(b.isDirty=
!0);p(e,function(a){a.isDirty&&"point"===a.options.legendType&&(a.updateTotals&&a.updateTotals(),k=!0);a.isDirtyData&&m(a,"updatedData")});k&&d.options.enabled&&(d.render(),this.isDirtyLegend=!1);f&&this.getStacks();y&&p(c,function(a){a.updateNames();a.setScale()});this.getMargins();y&&(p(c,function(a){a.isDirty&&(g=!0)}),p(c,function(a){var b=a.min+","+a.max;a.extKey!==b&&(a.extKey=b,w.push(function(){m(a,"afterSetExtremes",C(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(g||f)&&a.redraw()}));
g&&this.drawChartBox();m(this,"predraw");p(e,function(a){(g||a.isDirty)&&a.visible&&a.redraw();a.isDirtyData=!1});h&&h.reset(!0);q.draw();m(this,"redraw");m(this,"render");t&&this.cloneRenderTo(!0);p(w,function(a){a.call()})},get:function(a){function b(b){return b.id===a||b.options&&b.options.id===a}var c,e=this.series,h;c=t(this.axes,b)||t(this.series,b);for(h=0;!c&&h<e.length;h++)c=t(e[h].points||[],b);return c},getAxes:function(){var a=this,b=this.options,c=b.xAxis=k(b.xAxis||{}),b=b.yAxis=k(b.yAxis||
{});p(c,function(a,b){a.index=b;a.isX=!0});p(b,function(a,b){a.index=b});c=c.concat(b);p(c,function(b){new g(a,b)})},getSelectedPoints:function(){var a=[];p(this.series,function(b){a=a.concat(n(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return n(this.series,function(a){return a.selected})},setTitle:function(a,b,c){var e=this,h=e.options,d;d=h.title=w({style:{color:"#333333",fontSize:h.isStock?"16px":"18px"}},h.title,a);h=h.subtitle=w({style:{color:"#666666"}},
h.subtitle,b);p([["title",a,d],["subtitle",b,h]],function(a,b){var c=a[0],h=e[c],d=a[1];a=a[2];h&&d&&(e[c]=h=h.destroy());a&&a.text&&!h&&(e[c]=e.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+c,zIndex:a.zIndex||4}).add(),e[c].update=function(a){e.setTitle(!b&&a,b&&a)},e[c].css(a.style))});e.layOutTitles(c)},layOutTitles:function(a){var b=0,c,e=this.renderer,h=this.spacingBox;p(["title","subtitle"],function(a){var c=this[a],d=this.options[a],k;c&&(k=d.style.fontSize,
k=e.fontMetrics(k,c).b,c.css({width:(d.width||h.width+d.widthAdjust)+"px"}).align(C({y:b+k+("title"===a?-3:2)},d),!1,"spacingBox"),d.floating||d.verticalAlign||(b=Math.ceil(b+c.getBBox().height)))},this);c=this.titleOffset!==b;this.titleOffset=b;!this.isDirtyBox&&c&&(this.isDirtyBox=c,this.hasRendered&&y(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,e=a.width,a=a.height,h=this.renderToClone||this.renderTo;b(e)||(this.containerWidth=c(h,"width"));b(a)||(this.containerHeight=
c(h,"height"));this.chartWidth=Math.max(0,e||this.containerWidth||600);this.chartHeight=Math.max(0,a||this.containerHeight||400)},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;if(a){if(b){for(;b.childNodes.length;)this.renderTo.appendChild(b.firstChild);l(b);delete this.renderToClone}}else c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),d(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&
b.style.setProperty("display","block","important"),r.body.appendChild(b),c&&b.appendChild(c)},setClassName:function(a){this.container.className="highcharts-container "+(a||"")},getContainer:function(){var b,c=this.options,h=c.chart,d,k;b=this.renderTo;var m=a.uniqueKey(),n;b||(this.renderTo=b=h.renderTo);e(b)&&(this.renderTo=b=r.getElementById(b));b||a.error(13,!0);d=J(G(b,"data-highcharts-chart"));E(d)&&q[d]&&q[d].hasRendered&&q[d].destroy();G(b,"data-highcharts-chart",this.index);b.innerHTML="";
h.skipClone||b.offsetWidth||this.cloneRenderTo();this.getChartSize();d=this.chartWidth;k=this.chartHeight;n=C({position:"relative",overflow:"hidden",width:d+"px",height:k+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},h.style);this.container=b=f("div",{id:m},n,this.renderToClone||b);this._cursor=b.style.cursor;this.renderer=new (a[h.renderer]||S)(b,d,k,null,h.forExport,c.exporting&&c.exporting.allowHTML);this.setClassName(h.className);this.renderer.setStyle(h.style);
this.renderer.chartIndex=this.index},getMargins:function(a){var c=this.spacing,e=this.margin,h=this.titleOffset;this.resetMargins();h&&!b(e[0])&&(this.plotTop=Math.max(this.plotTop,h+this.options.title.margin+c[0]));this.legend.display&&this.legend.adjustMargins(e,c);this.extraMargin&&(this[this.extraMargin.type]=(this[this.extraMargin.type]||0)+this.extraMargin.value);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);a||this.getAxisMargins()},getAxisMargins:function(){var a=this,c=a.axisOffset=
[0,0,0,0],e=a.margin;a.hasCartesianSeries&&p(a.axes,function(a){a.visible&&a.getOffset()});p(F,function(h,d){b(e[d])||(a[h]+=c[d])});a.setChartSize()},reflow:function(a){var e=this,h=e.options.chart,d=e.renderTo,k=b(h.width),f=h.width||c(d,"width"),h=h.height||c(d,"height"),d=a?a.target:N;if(!k&&!e.isPrinting&&f&&h&&(d===N||d===r)){if(f!==e.containerWidth||h!==e.containerHeight)clearTimeout(e.reflowTimeout),e.reflowTimeout=P(function(){e.container&&e.setSize(void 0,void 0,!1)},a?100:0);e.containerWidth=
f;e.containerHeight=h}},initReflow:function(){var a=this,b;b=B(N,"resize",function(b){a.reflow(b)});B(a,"destroy",b)},setSize:function(b,c,e){var h=this,k=h.renderer;h.isResizing+=1;a.setAnimation(e,h);h.oldChartHeight=h.chartHeight;h.oldChartWidth=h.chartWidth;void 0!==b&&(h.options.chart.width=b);void 0!==c&&(h.options.chart.height=c);h.getChartSize();b=k.globalAnimation;(b?A:d)(h.container,{width:h.chartWidth+"px",height:h.chartHeight+"px"},b);h.setChartSize(!0);k.setSize(h.chartWidth,h.chartHeight,
e);p(h.axes,function(a){a.isDirty=!0;a.setScale()});h.isDirtyLegend=!0;h.isDirtyBox=!0;h.layOutTitles();h.getMargins();h.redraw(e);h.oldChartHeight=null;m(h,"resize");P(function(){h&&m(h,"endResize",null,function(){--h.isResizing})},H(b).duration)},setChartSize:function(a){var b=this.inverted,c=this.renderer,e=this.chartWidth,h=this.chartHeight,d=this.options.chart,k=this.spacing,f=this.clipOffset,m,n,y,g;this.plotLeft=m=Math.round(this.plotLeft);this.plotTop=n=Math.round(this.plotTop);this.plotWidth=
y=Math.max(0,Math.round(e-m-this.marginRight));this.plotHeight=g=Math.max(0,Math.round(h-n-this.marginBottom));this.plotSizeX=b?g:y;this.plotSizeY=b?y:g;this.plotBorderWidth=d.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:k[3],y:k[0],width:e-k[3]-k[1],height:h-k[0]-k[2]};this.plotBox=c.plotBox={x:m,y:n,width:y,height:g};e=2*Math.floor(this.plotBorderWidth/2);b=Math.ceil(Math.max(e,f[3])/2);c=Math.ceil(Math.max(e,f[0])/2);this.clipBox={x:b,y:c,width:Math.floor(this.plotSizeX-Math.max(e,f[1])/
2-b),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(e,f[2])/2-c))};a||p(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this,b=a.options.chart;p(["margin","spacing"],function(c){var e=b[c],h=z(e)?e:[e,e,e,e];p(["Top","Right","Bottom","Left"],function(e,d){a[c][d]=y(b[c+e],h[d])})});p(F,function(b,c){a[b]=y(a.margin[c],a.spacing[c])});a.axisOffset=[0,0,0,0];a.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=
this.chartWidth,e=this.chartHeight,h=this.chartBackground,d=this.plotBackground,k=this.plotBorder,f,m=this.plotBGImage,n=a.backgroundColor,p=a.plotBackgroundColor,y=a.plotBackgroundImage,g,l=this.plotLeft,q=this.plotTop,t=this.plotWidth,w=this.plotHeight,x=this.plotBox,r=this.clipRect,z=this.clipBox,J="animate";h||(this.chartBackground=h=b.rect().addClass("highcharts-background").add(),J="attr");f=a.borderWidth||0;g=f+(a.shadow?8:0);n={fill:n||"none"};if(f||h["stroke-width"])n.stroke=a.borderColor,
n["stroke-width"]=f;h.attr(n).shadow(a.shadow);h[J]({x:g/2,y:g/2,width:c-g-f%2,height:e-g-f%2,r:a.borderRadius});J="animate";d||(J="attr",this.plotBackground=d=b.rect().addClass("highcharts-plot-background").add());d[J](x);d.attr({fill:p||"none"}).shadow(a.plotShadow);y&&(m?m.animate(x):this.plotBGImage=b.image(y,l,q,t,w).add());r?r.animate({width:z.width,height:z.height}):this.clipRect=b.clipRect(z);J="animate";k||(J="attr",this.plotBorder=k=b.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());
k.attr({stroke:a.plotBorderColor,"stroke-width":a.plotBorderWidth||0,fill:"none"});k[J](k.crisp({x:l,y:q,width:t,height:w},-k.strokeWidth()));this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,e=a.options.series,h,d;p(["inverted","angular","polar"],function(k){c=I[b.type||b.defaultSeriesType];d=b[k]||c&&c.prototype[k];for(h=e&&e.length;!d&&h--;)(c=I[e[h].type])&&c.prototype[k]&&(d=!0);a[k]=d})},linkSeries:function(){var a=this,b=a.series;p(b,function(a){a.linkedSeries.length=
0});p(b,function(b){var c=b.options.linkedTo;e(c)&&(c=":previous"===c?a.series[b.index-1]:a.get(c))&&c.linkedParent!==b&&(c.linkedSeries.push(b),b.linkedParent=c,b.visible=y(b.options.visible,c.options.visible,b.visible))})},renderSeries:function(){p(this.series,function(a){a.translate();a.render()})},renderLabels:function(){var a=this,b=a.options.labels;b.items&&p(b.items,function(c){var e=C(b.style,c.style),h=J(e.left)+a.plotLeft,d=J(e.top)+a.plotTop+12;delete e.left;delete e.top;a.renderer.text(c.html,
h,d).attr({zIndex:2}).css(e).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options,e,h,d;this.setTitle();this.legend=new x(this,c.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();c=this.plotWidth;e=this.plotHeight-=21;p(a,function(a){a.setScale()});this.getAxisMargins();h=1.1<c/this.plotWidth;d=1.05<e/this.plotHeight;if(h||d)p(a,function(a){(a.horiz&&h||!a.horiz&&d)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries&&
p(a,function(a){a.visible&&a.render()});this.seriesGroup||(this.seriesGroup=b.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.hasRendered=!0},addCredits:function(a){var b=this;a=w(!0,this.options.credits,a);a.enabled&&!this.credits&&(this.credits=this.renderer.text(a.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",function(){a.href&&(N.location.href=a.href)}).attr({align:a.position.align,
zIndex:8}).css(a.style).add().align(a.position),this.credits.update=function(a){b.credits=b.credits.destroy();b.addCredits(a)})},destroy:function(){var b=this,c=b.axes,e=b.series,h=b.container,d,k=h&&h.parentNode;m(b,"destroy");q[b.index]=void 0;a.chartCount--;b.renderTo.removeAttribute("data-highcharts-chart");K(b);for(d=c.length;d--;)c[d]=c[d].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(d=e.length;d--;)e[d]=e[d].destroy();p("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" "),
function(a){var c=b[a];c&&c.destroy&&(b[a]=c.destroy())});h&&(h.innerHTML="",K(h),k&&l(h));for(d in b)delete b[d]},isReadyToRender:function(){var a=this;return D||N!=N.top||"complete"===r.readyState?!0:(r.attachEvent("onreadystatechange",function(){r.detachEvent("onreadystatechange",a.firstRender);"complete"===r.readyState&&a.firstRender()}),!1)},firstRender:function(){var a=this,b=a.options;if(a.isReadyToRender()){a.getContainer();m(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();
a.getAxes();p(b.series||[],function(b){a.initSeries(b)});a.linkSeries();m(a,"beforeRender");h&&(a.pointer=new h(a,b));a.render();if(!a.renderer.imgCount&&a.onload)a.onload();a.cloneRenderTo(!0)}},onload:function(){p([this.callback].concat(this.callbacks),function(a){a&&void 0!==this.index&&a.apply(this,[this])},this);m(this,"load");m(this,"render");b(this.index)&&!1!==this.options.chart.reflow&&this.initReflow();this.onload=null}}})(L);(function(a){var B,A=a.each,H=a.extend,G=a.erase,r=a.fireEvent,
g=a.format,f=a.isArray,u=a.isNumber,l=a.pick,q=a.removeEvent;B=a.Point=function(){};B.prototype={init:function(a,b,f){this.series=a;this.color=a.color;this.applyOptions(b,f);a.options.colorByPoint?(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter],b=b.length,f=a.colorCounter,a.colorCounter++,a.colorCounter===b&&(a.colorCounter=0)):f=a.colorIndex;this.colorIndex=l(this.colorIndex,f);a.chart.pointCount++;return this},applyOptions:function(a,b){var d=this.series,f=d.options.pointValKey||
d.pointValKey;a=B.prototype.optionsToObject.call(this,a);H(this,a);this.options=this.options?H(this.options,a):a;a.group&&delete this.group;f&&(this.y=this[f]);this.isNull=l(this.isValid&&!this.isValid(),null===this.x||!u(this.y,!0));this.selected&&(this.state="select");"name"in this&&void 0===b&&d.xAxis&&d.xAxis.hasNames&&(this.x=d.xAxis.nameToX(this));void 0===this.x&&d&&(this.x=void 0===b?d.autoIncrement(this):b);return this},optionsToObject:function(a){var b={},d=this.series,g=d.options.keys,
l=g||d.pointArrayMap||["y"],m=l.length,c=0,n=0;if(u(a)||null===a)b[l[0]]=a;else if(f(a))for(!g&&a.length>m&&(d=typeof a[0],"string"===d?b.name=a[0]:"number"===d&&(b.x=a[0]),c++);n<m;)g&&void 0===a[c]||(b[l[n]]=a[c]),c++,n++;else"object"===typeof a&&(b=a,a.dataLabels&&(d._hasPointLabels=!0),a.marker&&(d._hasPointMarkers=!0));return b},getClassName:function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":
"")+(void 0!==this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")},getZone:function(){var a=this.series,b=a.zones,a=a.zoneAxis||"y",f=0,g;for(g=b[f];this[a]>=g.value;)g=b[++f];g&&g.color&&!this.options.color&&(this.color=g.color);return g},destroy:function(){var a=this.series.chart,b=a.hoverPoints,f;a.pointCount--;b&&(this.setState(),G(b,this),b.length||
(a.hoverPoints=null));if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)q(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(f in this)this[f]=null},destroyElements:function(){for(var a=["graphic","dataLabel","dataLabelUpper","connector","shadowGroup"],b,f=6;f--;)b=a[f],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,
point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=this.series,d=b.tooltipOptions,f=l(d.valueDecimals,""),q=d.valuePrefix||"",m=d.valueSuffix||"";A(b.pointArrayMap||["y"],function(b){b="{point."+b;if(q||m)a=a.replace(b+"}",q+b+"}"+m);a=a.replace(b+"}",b+":,."+f+"f}")});return g(a,{point:this,series:this.series})},firePointEvent:function(a,b,f){var d=this,g=this.series.options;(g.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&
this.importEvents();"click"===a&&g.allowPointSelect&&(f=function(a){d.select&&d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});r(this,a,b,f)},visible:!0}})(L);(function(a){var B=a.addEvent,A=a.animObject,H=a.arrayMax,G=a.arrayMin,r=a.correctFloat,g=a.Date,f=a.defaultOptions,u=a.defaultPlotOptions,l=a.defined,q=a.each,d=a.erase,b=a.extend,p=a.fireEvent,C=a.grep,t=a.isArray,m=a.isNumber,c=a.isString,n=a.merge,E=a.pick,z=a.removeEvent,e=a.splat,x=a.SVGElement,F=a.syncTimeout,w=a.win;a.Series=a.seriesType("line",
null,{lineWidth:2,allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{lineWidth:0,lineColor:"#ffffff",radius:4,states:{hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":a.numberFormat(this.y,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",
x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3},{isCartesian:!0,pointClass:a.Point,sorted:!0,requireSorting:!0,directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],coll:"series",init:function(a,c){var e=this,h,d,k=a.series,f;e.chart=a;e.options=c=e.setOptions(c);e.linkedSeries=[];e.bindAxes();b(e,{name:c.name,state:"",visible:!1!==
c.visible,selected:!0===c.selected});d=c.events;for(h in d)B(e,h,d[h]);if(d&&d.click||c.point&&c.point.events&&c.point.events.click||c.allowPointSelect)a.runTrackerClick=!0;e.getColor();e.getSymbol();q(e.parallelArrays,function(a){e[a+"Data"]=[]});e.setData(c.data,!1);e.isCartesian&&(a.hasCartesianSeries=!0);k.length&&(f=k[k.length-1]);e._i=E(f&&f._i,-1)+1;a.orderSeries(this.insert(k))},insert:function(a){var b=this.options.index,c;if(m(b)){for(c=a.length;c--;)if(b>=E(a[c].options.index,a[c]._i)){a.splice(c+
1,0,this);break}-1===c&&a.unshift(this);c+=1}else a.push(this);return E(c,a.length-1)},bindAxes:function(){var b=this,c=b.options,e=b.chart,d;q(b.axisTypes||[],function(h){q(e[h],function(a){d=a.options;if(c[h]===d.index||void 0!==c[h]&&c[h]===d.id||void 0===c[h]&&0===d.index)b.insert(a.series),b[h]=a,a.isDirty=!0});b[h]||b.optionalAxis===h||a.error(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,e=arguments,h=m(b)?function(e){var h="y"===e&&c.toYData?c.toYData(a):a[e];c[e+"Data"][b]=
h}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(e,2))};q(c.parallelArrays,h)},autoIncrement:function(){var a=this.options,b=this.xIncrement,c,e=a.pointIntervalUnit,b=E(b,a.pointStart,0);this.pointInterval=c=E(this.pointInterval,a.pointInterval,1);e&&(a=new g(b),"day"===e?a=+a[g.hcSetDate](a[g.hcGetDate]()+c):"month"===e?a=+a[g.hcSetMonth](a[g.hcGetMonth]()+c):"year"===e&&(a=+a[g.hcSetFullYear](a[g.hcGetFullYear]()+c)),c=a-b);this.xIncrement=b+c;return b},setOptions:function(a){var b=
this.chart,c=b.options.plotOptions,b=b.userOptions||{},e=b.plotOptions||{},h=c[this.type];this.userOptions=a;c=n(h,c.series,a);this.tooltipOptions=n(f.tooltip,f.plotOptions[this.type].tooltip,b.tooltip,e.series&&e.series.tooltip,e[this.type]&&e[this.type].tooltip,a.tooltip);null===h.marker&&delete c.marker;this.zoneAxis=c.zoneAxis;a=this.zones=(c.zones||[]).slice();!c.negativeColor&&!c.negativeFillColor||c.zones||a.push({value:c[this.zoneAxis+"Threshold"]||c.threshold||0,className:"highcharts-negative",
color:c.negativeColor,fillColor:c.negativeFillColor});a.length&&l(a[a.length-1].value)&&a.push({color:this.color,fillColor:this.fillColor});return c},getCyclic:function(a,b,c){var e,h=this.chart,d=this.userOptions,f=a+"Index",n=a+"Counter",m=c?c.length:E(h.options.chart[a+"Count"],h[a+"Count"]);b||(e=E(d[f],d["_"+f]),l(e)||(h.series.length||(h[n]=0),d["_"+f]=e=h[n]%m,h[n]+=1),c&&(b=c[e]));void 0!==e&&(this[f]=e);this[a]=b},getColor:function(){this.options.colorByPoint?this.options.color=null:this.getCyclic("color",
this.options.color||u[this.type].color,this.chart.options.colors)},getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol,this.chart.options.symbols)},drawLegendSymbol:a.LegendSymbolMixin.drawLineMarker,setData:function(b,e,d,f){var h=this,k=h.points,n=k&&k.length||0,g,p=h.options,y=h.chart,l=null,w=h.xAxis,x=p.turboThreshold,r=this.xData,z=this.yData,F=(g=h.pointArrayMap)&&g.length;b=b||[];g=b.length;e=E(e,!0);if(!1!==f&&g&&n===g&&!h.cropped&&!h.hasGroupedData&&h.visible)q(b,function(a,
b){k[b].update&&a!==p.data[b]&&k[b].update(a,!1,null,!1)});else{h.xIncrement=null;h.colorCounter=0;q(this.parallelArrays,function(a){h[a+"Data"].length=0});if(x&&g>x){for(d=0;null===l&&d<g;)l=b[d],d++;if(m(l))for(d=0;d<g;d++)r[d]=this.autoIncrement(),z[d]=b[d];else if(t(l))if(F)for(d=0;d<g;d++)l=b[d],r[d]=l[0],z[d]=l.slice(1,F+1);else for(d=0;d<g;d++)l=b[d],r[d]=l[0],z[d]=l[1];else a.error(12)}else for(d=0;d<g;d++)void 0!==b[d]&&(l={series:h},h.pointClass.prototype.applyOptions.apply(l,[b[d]]),h.updateParallelArrays(l,
d));c(z[0])&&a.error(14,!0);h.data=[];h.options.data=h.userOptions.data=b;for(d=n;d--;)k[d]&&k[d].destroy&&k[d].destroy();w&&(w.minRange=w.userMinRange);h.isDirty=y.isDirtyBox=!0;h.isDirtyData=!!k;d=!1}"point"===p.legendType&&(this.processData(),this.generatePoints());e&&y.redraw(d)},processData:function(b){var c=this.xData,e=this.yData,h=c.length,d;d=0;var k,f,n=this.xAxis,m,g=this.options;m=g.cropThreshold;var p=this.getExtremesFromAll||g.getExtremesFromAll,l=this.isCartesian,g=n&&n.val2lin,q=n&&
n.isLog,t,w;if(l&&!this.isDirty&&!n.isDirty&&!this.yAxis.isDirty&&!b)return!1;n&&(b=n.getExtremes(),t=b.min,w=b.max);if(l&&this.sorted&&!p&&(!m||h>m||this.forceCrop))if(c[h-1]<t||c[0]>w)c=[],e=[];else if(c[0]<t||c[h-1]>w)d=this.cropData(this.xData,this.yData,t,w),c=d.xData,e=d.yData,d=d.start,k=!0;for(m=c.length||1;--m;)h=q?g(c[m])-g(c[m-1]):c[m]-c[m-1],0<h&&(void 0===f||h<f)?f=h:0>h&&this.requireSorting&&a.error(15);this.cropped=k;this.cropStart=d;this.processedXData=c;this.processedYData=e;this.closestPointRange=
f},cropData:function(a,b,c,e){var h=a.length,d=0,f=h,n=E(this.cropShoulder,1),m;for(m=0;m<h;m++)if(a[m]>=c){d=Math.max(0,m-n);break}for(c=m;c<h;c++)if(a[c]>e){f=c+n;break}return{xData:a.slice(d,f),yData:b.slice(d,f),start:d,end:f}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,f=this.processedYData,k=this.pointClass,n=d.length,m=this.cropStart||0,g,p=this.hasGroupedData,l,q=[],t;b||p||(b=[],b.length=a.length,b=this.data=b);for(t=0;t<n;t++)g=m+t,p?(l=(new k).init(this,
[d[t]].concat(e(f[t]))),l.dataGroup=this.groupMap[t]):(l=b[g])||void 0===a[g]||(b[g]=l=(new k).init(this,a[g],d[t])),l.index=g,q[t]=l;if(b&&(n!==(c=b.length)||p))for(t=0;t<c;t++)t!==m||p||(t+=n),b[t]&&(b[t].destroyElements(),b[t].plotX=void 0);this.data=b;this.points=q},getExtremes:function(a){var b=this.yAxis,c=this.processedXData,e,h=[],d=0;e=this.xAxis.getExtremes();var f=e.min,n=e.max,g,p,l,q;a=a||this.stackedYData||this.processedYData||[];e=a.length;for(q=0;q<e;q++)if(p=c[q],l=a[q],g=(m(l,!0)||
t(l))&&(!b.isLog||l.length||0<l),p=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(c[q+1]||p)>=f&&(c[q-1]||p)<=n,g&&p)if(g=l.length)for(;g--;)null!==l[g]&&(h[d++]=l[g]);else h[d++]=l;this.dataMin=G(h);this.dataMax=H(h)},translate:function(){this.processedXData||this.processData();this.generatePoints();var a=this.options,b=a.stacking,c=this.xAxis,e=c.categories,d=this.yAxis,k=this.points,f=k.length,n=!!this.modifyValue,g=a.pointPlacement,p="between"===g||m(g),q=a.threshold,
t=a.startFromThreshold?q:0,w,x,z,F,u=Number.MAX_VALUE;"between"===g&&(g=.5);m(g)&&(g*=E(a.pointRange||c.pointRange));for(a=0;a<f;a++){var C=k[a],A=C.x,B=C.y;x=C.low;var H=b&&d.stacks[(this.negStacks&&B<(t?0:q)?"-":"")+this.stackKey],G;d.isLog&&null!==B&&0>=B&&(C.isNull=!0);C.plotX=w=r(Math.min(Math.max(-1E5,c.translate(A,0,0,0,1,g,"flags"===this.type)),1E5));b&&this.visible&&!C.isNull&&H&&H[A]&&(F=this.getStackIndicator(F,A,this.index),G=H[A],B=G.points[F.key],x=B[0],B=B[1],x===t&&F.key===H[A].base&&
(x=E(q,d.min)),d.isLog&&0>=x&&(x=null),C.total=C.stackTotal=G.total,C.percentage=G.total&&C.y/G.total*100,C.stackY=B,G.setOffset(this.pointXOffset||0,this.barW||0));C.yBottom=l(x)?d.translate(x,0,1,0,1):null;n&&(B=this.modifyValue(B,C));C.plotY=x="number"===typeof B&&Infinity!==B?Math.min(Math.max(-1E5,d.translate(B,0,1,0,1)),1E5):void 0;C.isInside=void 0!==x&&0<=x&&x<=d.len&&0<=w&&w<=c.len;C.clientX=p?r(c.translate(A,0,0,0,1,g)):w;C.negative=C.y<(q||0);C.category=e&&void 0!==e[C.x]?e[C.x]:C.x;C.isNull||
(void 0!==z&&(u=Math.min(u,Math.abs(w-z))),z=w);C.zone=this.zones.length&&C.getZone()}this.closestPointRangePx=u},getValidPoints:function(a,b){var c=this.chart;return C(a||this.points||[],function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY,c.inverted)?!1:!a.isNull})},setClip:function(a){var b=this.chart,c=this.options,e=b.renderer,d=b.inverted,h=this.clipBox,f=h||b.clipBox,n=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,f.height,c.xAxis,c.yAxis].join(),m=b[n],g=b[n+"m"];m||(a&&(f.width=
0,b[n+"m"]=g=e.clipRect(-99,d?-b.plotLeft:-b.plotTop,99,d?b.chartWidth:b.chartHeight)),b[n]=m=e.clipRect(f),m.count={length:0});a&&!m.count[this.index]&&(m.count[this.index]=!0,m.count.length+=1);!1!==c.clip&&(this.group.clip(a||h?m:b.clipRect),this.markerGroup.clip(g),this.sharedClipKey=n);a||(m.count[this.index]&&(delete m.count[this.index],--m.count.length),0===m.count.length&&n&&b[n]&&(h||(b[n]=b[n].destroy()),b[n+"m"]&&(this.markerGroup.clip(),b[n+"m"]=b[n+"m"].destroy())))},animate:function(a){var b=
this.chart,c=A(this.options.animation),e;a?this.setClip(c):(e=this.sharedClipKey,(a=b[e])&&a.animate({width:b.plotSizeX},c),b[e+"m"]&&b[e+"m"].animate({width:b.plotSizeX+99},c),this.animate=null)},afterAnimate:function(){this.setClip();p(this,"afterAnimate")},drawPoints:function(){var a=this.points,b=this.chart,c,e,d,k,f=this.options.marker,n,g,p,l,q=this.markerGroup,t=E(f.enabled,this.xAxis.isRadial?!0:null,this.closestPointRangePx>2*f.radius);if(!1!==f.enabled||this._hasPointMarkers)for(e=0;e<a.length;e++)d=
a[e],c=d.plotY,k=d.graphic,n=d.marker||{},g=!!d.marker,p=t&&void 0===n.enabled||n.enabled,l=d.isInside,p&&m(c)&&null!==d.y?(c=E(n.symbol,this.symbol),d.hasImage=0===c.indexOf("url"),p=this.markerAttribs(d,d.selected&&"select"),k?k[l?"show":"hide"](!0).animate(p):l&&(0<p.width||d.hasImage)&&(d.graphic=k=b.renderer.symbol(c,p.x,p.y,p.width,p.height,g?n:f).add(q)),k&&k.attr(this.pointAttribs(d,d.selected&&"select")),k&&k.addClass(d.getClassName(),!0)):k&&(d.graphic=k.destroy())},markerAttribs:function(a,
b){var c=this.options.marker,e=a.marker||{},d=E(e.radius,c.radius);b&&(c=c.states[b],b=e.states&&e.states[b],d=E(b&&b.radius,c&&c.radius,d+(c&&c.radiusPlus||0)));a.hasImage&&(d=0);a={x:Math.floor(a.plotX)-d,y:a.plotY-d};d&&(a.width=a.height=2*d);return a},pointAttribs:function(a,b){var c=this.options.marker,e=a&&a.options,d=e&&e.marker||{},h=this.color,f=e&&e.color,n=a&&a.color,e=E(d.lineWidth,c.lineWidth);a=a&&a.zone&&a.zone.color;h=f||a||n||h;a=d.fillColor||c.fillColor||h;h=d.lineColor||c.lineColor||
h;b&&(c=c.states[b],b=d.states&&d.states[b]||{},e=E(b.lineWidth,c.lineWidth,e+E(b.lineWidthPlus,c.lineWidthPlus,0)),a=b.fillColor||c.fillColor||a,h=b.lineColor||c.lineColor||h);return{stroke:h,"stroke-width":e,fill:a}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(w.navigator.userAgent),e,f=a.data||[],k,n,m;p(a,"destroy");z(a);q(a.axisTypes||[],function(b){(m=a[b])&&m.series&&(d(m.series,a),m.isDirty=m.forceRedraw=!0)});a.legendItem&&a.chart.legend.destroyItem(a);for(e=f.length;e--;)(k=
f[e])&&k.destroy&&k.destroy();a.points=null;clearTimeout(a.animationTimeout);for(n in a)a[n]instanceof x&&!a[n].survive&&(e=c&&"group"===n?"hide":"destroy",a[n][e]());b.hoverSeries===a&&(b.hoverSeries=null);d(b.series,a);b.orderSeries();for(n in a)delete a[n]},getGraphPath:function(a,b,c){var e=this,d=e.options,h=d.step,f,n=[],m=[],g;a=a||e.points;(f=a.reversed)&&a.reverse();(h={right:1,center:2}[h]||h&&3)&&f&&(h=4-h);!d.connectNulls||b||c||(a=this.getValidPoints(a));q(a,function(f,k){var p=f.plotX,
q=f.plotY,t=a[k-1];(f.leftCliff||t&&t.rightCliff)&&!c&&(g=!0);f.isNull&&!l(b)&&0<k?g=!d.connectNulls:f.isNull&&!b?g=!0:(0===k||g?k=["M",f.plotX,f.plotY]:e.getPointSpline?k=e.getPointSpline(a,f,k):h?(k=1===h?["L",t.plotX,q]:2===h?["L",(t.plotX+p)/2,t.plotY,"L",(t.plotX+p)/2,q]:["L",p,t.plotY],k.push("L",p,q)):k=["L",p,q],m.push(f.x),h&&m.push(f.x),n.push.apply(n,k),g=!1)});n.xMap=m;return e.graphPath=n},drawGraph:function(){var a=this,b=this.options,c=(this.gappedPath||this.getGraphPath).call(this),
e=[["graph","highcharts-graph",b.lineColor||this.color,b.dashStyle]];q(this.zones,function(c,d){e.push(["zone-graph-"+d,"highcharts-graph highcharts-zone-graph-"+d+" "+(c.className||""),c.color||a.color,c.dashStyle||b.dashStyle])});q(e,function(e,d){var h=e[0],f=a[h];f?(f.endX=c.xMap,f.animate({d:c})):c.length&&(a[h]=a.chart.renderer.path(c).addClass(e[1]).attr({zIndex:1}).add(a.group),f={stroke:e[2],"stroke-width":b.lineWidth,fill:a.fillGraph&&a.color||"none"},e[3]?f.dashstyle=e[3]:"square"!==b.linecap&&
(f["stroke-linecap"]=f["stroke-linejoin"]="round"),f=a[h].attr(f).shadow(2>d&&b.shadow));f&&(f.startX=c.xMap,f.isArea=c.isArea)})},applyZones:function(){var a=this,b=this.chart,c=b.renderer,e=this.zones,d,f,n=this.clips||[],m,g=this.graph,p=this.area,l=Math.max(b.chartWidth,b.chartHeight),t=this[(this.zoneAxis||"y")+"Axis"],w,x,r=b.inverted,z,F,u,C,A=!1;e.length&&(g||p)&&t&&void 0!==t.min&&(x=t.reversed,z=t.horiz,g&&g.hide(),p&&p.hide(),w=t.getExtremes(),q(e,function(e,h){d=x?z?b.plotWidth:0:z?0:
t.toPixels(w.min);d=Math.min(Math.max(E(f,d),0),l);f=Math.min(Math.max(Math.round(t.toPixels(E(e.value,w.max),!0)),0),l);A&&(d=f=t.toPixels(w.max));F=Math.abs(d-f);u=Math.min(d,f);C=Math.max(d,f);t.isXAxis?(m={x:r?C:u,y:0,width:F,height:l},z||(m.x=b.plotHeight-m.x)):(m={x:0,y:r?C:u,width:l,height:F},z&&(m.y=b.plotWidth-m.y));r&&c.isVML&&(m=t.isXAxis?{x:0,y:x?u:C,height:m.width,width:b.chartWidth}:{x:m.y-b.plotLeft-b.spacingBox.x,y:0,width:m.height,height:b.chartHeight});n[h]?n[h].animate(m):(n[h]=
c.clipRect(m),g&&a["zone-graph-"+h].clip(n[h]),p&&a["zone-area-"+h].clip(n[h]));A=e.value>w.max}),this.clips=n)},invertGroups:function(a){function b(){q(["group","markerGroup"],function(b){c[b]&&(c[b].width=c.yAxis.len,c[b].height=c.xAxis.len,c[b].invert(a))})}var c=this,e;c.xAxis&&(e=B(c.chart,"resize",b),B(c,"destroy",e),b(a),c.invertGroups=b)},plotGroup:function(a,b,c,e,d){var h=this[a],f=!h;f&&(this[a]=h=this.chart.renderer.g(b).attr({zIndex:e||.1}).add(d),h.addClass("highcharts-series-"+this.index+
" highcharts-"+this.type+"-series highcharts-color-"+this.colorIndex+" "+(this.options.className||"")));h.attr({visibility:c})[f?"attr":"animate"](this.getPlotBox());return h},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;a.inverted&&(b=c,c=this.xAxis);return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,e=a.options,d=!!a.animate&&b.renderer.isSVG&&A(e.animation).duration,f=a.visible?"inherit":"hidden",n=
e.zIndex,m=a.hasRendered,g=b.seriesGroup,p=b.inverted;c=a.plotGroup("group","series",f,n,g);a.markerGroup=a.plotGroup("markerGroup","markers",f,n,g);d&&a.animate(!0);c.inverted=a.isCartesian?p:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(p);!1===e.clip||a.sharedClipKey||m||c.clip(b.clipRect);d&&a.animate();m||(a.animationTimeout=F(function(){a.afterAnimate()},
d));a.isDirty=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirty||this.isDirtyData,c=this.group,e=this.xAxis,d=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:E(e&&e.left,a.plotLeft),translateY:E(d&&d.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var c=this.xAxis,e=this.yAxis,d=this.chart.inverted;return this.searchKDTree({clientX:d?
c.len-a.chartY+c.pos:a.chartX-c.pos,plotY:d?e.len-a.chartX+e.pos:a.chartY-e.pos},b)},buildKDTree:function(){function a(c,e,d){var h,f;if(f=c&&c.length)return h=b.kdAxisArray[e%d],c.sort(function(a,b){return a[h]-b[h]}),f=Math.floor(f/2),{point:c[f],left:a(c.slice(0,f),e+1,d),right:a(c.slice(f+1),e+1,d)}}this.buildingKdTree=!0;var b=this,c=b.kdDimensions;delete b.kdTree;F(function(){b.kdTree=a(b.getValidPoints(null,!b.directTouch),c,c);b.buildingKdTree=!1},b.options.kdNow?0:1)},searchKDTree:function(a,
b){function c(a,b,k,n){var m=b.point,g=e.kdAxisArray[k%n],p,t,q=m;t=l(a[d])&&l(m[d])?Math.pow(a[d]-m[d],2):null;p=l(a[h])&&l(m[h])?Math.pow(a[h]-m[h],2):null;p=(t||0)+(p||0);m.dist=l(p)?Math.sqrt(p):Number.MAX_VALUE;m.distX=l(t)?Math.sqrt(t):Number.MAX_VALUE;g=a[g]-m[g];p=0>g?"left":"right";t=0>g?"right":"left";b[p]&&(p=c(a,b[p],k+1,n),q=p[f]<q[f]?p:m);b[t]&&Math.sqrt(g*g)<q[f]&&(a=c(a,b[t],k+1,n),q=a[f]<q[f]?a:q);return q}var e=this,d=this.kdAxisArray[0],h=this.kdAxisArray[1],f=b?"distX":"dist";
this.kdTree||this.buildingKdTree||this.buildKDTree();if(this.kdTree)return c(a,this.kdTree,this.kdDimensions,this.kdDimensions)}})})(L);(function(a){function B(a,d,b,f,g){var p=a.chart.inverted;this.axis=a;this.isNegative=b;this.options=d;this.x=f;this.total=null;this.points={};this.stack=g;this.rightCliff=this.leftCliff=0;this.alignOptions={align:d.align||(p?b?"left":"right":"center"),verticalAlign:d.verticalAlign||(p?"middle":b?"bottom":"top"),y:l(d.y,p?4:b?14:-6),x:l(d.x,p?b?-6:6:0)};this.textAlign=
d.textAlign||(p?b?"right":"left":"center")}var A=a.Axis,H=a.Chart,G=a.correctFloat,r=a.defined,g=a.destroyObjectProperties,f=a.each,u=a.format,l=a.pick;a=a.Series;B.prototype={destroy:function(){g(this,this.axis)},render:function(a){var d=this.options,b=d.format,b=b?u(b,this):d.formatter.call(this);this.label?this.label.attr({text:b,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(b,null,null,d.useHTML).css(d.style).attr({align:this.textAlign,rotation:d.rotation,visibility:"hidden"}).add(a)},
setOffset:function(a,d){var b=this.axis,f=b.chart,g=f.inverted,l=b.reversed,l=this.isNegative&&!l||!this.isNegative&&l,m=b.translate(b.usePercentage?100:this.total,0,0,0,1),b=b.translate(0),b=Math.abs(m-b);a=f.xAxis[0].translate(this.x)+a;var c=f.plotHeight,g={x:g?l?m:m-b:a,y:g?c-a-d:l?c-m-b:c-m,width:g?b:d,height:g?d:b};if(d=this.label)d.align(this.alignOptions,null,g),g=d.alignAttr,d[!1===this.options.crop||f.isInsidePlot(g.x,g.y)?"show":"hide"](!0)}};H.prototype.getStacks=function(){var a=this;
f(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&&(a.oldStacks=a.stacks)});f(a.series,function(d){!d.options.stacking||!0!==d.visible&&!1!==a.options.chart.ignoreHiddenSeries||(d.stackKey=d.type+l(d.options.stack,""))})};A.prototype.buildStacks=function(){var a=this.series,d,b=l(this.options.reversedStacks,!0),f=a.length,g;if(!this.isXAxis){this.usePercentage=!1;for(g=f;g--;)a[b?g:f-g-1].setStackedPoints();for(g=f;g--;)d=a[b?g:f-g-1],d.setStackCliffs&&d.setStackCliffs();if(this.usePercentage)for(g=
0;g<f;g++)a[g].setPercentStacks()}};A.prototype.renderStackTotals=function(){var a=this.chart,d=a.renderer,b=this.stacks,f,g,l=this.stackTotalGroup;l||(this.stackTotalGroup=l=d.g("stack-labels").attr({visibility:"visible",zIndex:6}).add());l.translate(a.plotLeft,a.plotTop);for(f in b)for(g in a=b[f],a)a[g].render(l)};A.prototype.resetStacks=function(){var a=this.stacks,d,b;if(!this.isXAxis)for(d in a)for(b in a[d])a[d][b].touched<this.stacksTouched?(a[d][b].destroy(),delete a[d][b]):(a[d][b].total=
null,a[d][b].cum=null)};A.prototype.cleanStacks=function(){var a,d,b;if(!this.isXAxis)for(d in this.oldStacks&&(a=this.stacks=this.oldStacks),a)for(b in a[d])a[d][b].cum=a[d][b].total};a.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var a=this.processedXData,d=this.processedYData,b=[],f=d.length,g=this.options,t=g.threshold,m=g.startFromThreshold?t:0,c=g.stack,g=g.stacking,n=this.stackKey,u="-"+n,z=this.negStacks,
e=this.yAxis,x=e.stacks,F=e.oldStacks,w,h,y,A,K,I,k;e.stacksTouched+=1;for(K=0;K<f;K++)I=a[K],k=d[K],w=this.getStackIndicator(w,I,this.index),A=w.key,y=(h=z&&k<(m?0:t))?u:n,x[y]||(x[y]={}),x[y][I]||(F[y]&&F[y][I]?(x[y][I]=F[y][I],x[y][I].total=null):x[y][I]=new B(e,e.options.stackLabels,h,I,c)),y=x[y][I],null!==k&&(y.points[A]=y.points[this.index]=[l(y.cum,m)],r(y.cum)||(y.base=A),y.touched=e.stacksTouched,0<w.index&&!1===this.singleStacks&&(y.points[A][0]=y.points[this.index+","+I+",0"][0])),"percent"===
g?(h=h?n:u,z&&x[h]&&x[h][I]?(h=x[h][I],y.total=h.total=Math.max(h.total,y.total)+Math.abs(k)||0):y.total=G(y.total+(Math.abs(k)||0))):y.total=G(y.total+(k||0)),y.cum=l(y.cum,m)+(k||0),null!==k&&(y.points[A].push(y.cum),b[K]=y.cum);"percent"===g&&(e.usePercentage=!0);this.stackedYData=b;e.oldStacks={}}};a.prototype.setPercentStacks=function(){var a=this,d=a.stackKey,b=a.yAxis.stacks,g=a.processedXData,l;f([d,"-"+d],function(d){for(var f=g.length,c,n;f--;)if(c=g[f],l=a.getStackIndicator(l,c,a.index,
d),c=(n=b[d]&&b[d][c])&&n.points[l.key])n=n.total?100/n.total:0,c[0]=G(c[0]*n),c[1]=G(c[1]*n),a.stackedYData[f]=c[1]})};a.prototype.getStackIndicator=function(a,d,b,f){!r(a)||a.x!==d||f&&a.key!==f?a={x:d,index:0,key:f}:a.index++;a.key=[b,d,a.index].join();return a}})(L);(function(a){var B=a.addEvent,A=a.animate,H=a.Axis,G=a.createElement,r=a.css,g=a.defined,f=a.each,u=a.erase,l=a.extend,q=a.fireEvent,d=a.inArray,b=a.isNumber,p=a.isObject,C=a.merge,t=a.pick,m=a.Point,c=a.Series,n=a.seriesTypes,E=a.setAnimation,
z=a.splat;l(a.Chart.prototype,{addSeries:function(a,b,c){var e,d=this;a&&(b=t(b,!0),q(d,"addSeries",{options:a},function(){e=d.initSeries(a);d.isDirtyLegend=!0;d.linkSeries();b&&d.redraw(c)}));return e},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;a=C(a,{index:this[e].length,isX:b});new H(this,a);f[e]=z(f[e]||{});f[e].push(a);t(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this,c=b.options,e=b.loadingDiv,d=c.loading,f=function(){e&&r(e,{left:b.plotLeft+"px",top:b.plotTop+
"px",width:b.plotWidth+"px",height:b.plotHeight+"px"})};e||(b.loadingDiv=e=G("div",{className:"highcharts-loading highcharts-loading-hidden"},null,b.container),b.loadingSpan=G("span",{className:"highcharts-loading-inner"},null,e),B(b,"redraw",f));e.className="highcharts-loading";b.loadingSpan.innerHTML=a||c.lang.loading;r(e,l(d.style,{zIndex:10}));r(b.loadingSpan,d.labelStyle);b.loadingShown||(r(e,{opacity:0,display:""}),A(e,{opacity:d.style.opacity||.5},{duration:d.showDuration||0}));b.loadingShown=
!0;f()},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&(b.className="highcharts-loading highcharts-loading-hidden",A(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){r(b,{display:"none"})}}));this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),
propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions".split(" "),update:function(a,c){var e,n={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle"},h=a.chart,m,p;if(h){C(!0,this.options.chart,h);"className"in h&&this.setClassName(h.className);if("inverted"in h||"polar"in h)this.propFromSeries(),m=!0;for(e in h)h.hasOwnProperty(e)&&(-1!==d("chart."+e,this.propsRequireUpdateSeries)&&(p=!0),-1!==d(e,this.propsRequireDirtyBox)&&(this.isDirtyBox=
!0));"style"in h&&this.renderer.setStyle(h.style)}for(e in a){if(this[e]&&"function"===typeof this[e].update)this[e].update(a[e],!1);else if("function"===typeof this[n[e]])this[n[e]](a[e]);"chart"!==e&&-1!==d(e,this.propsRequireUpdateSeries)&&(p=!0)}a.colors&&(this.options.colors=a.colors);a.plotOptions&&C(!0,this.options.plotOptions,a.plotOptions);f(["xAxis","yAxis","series"],function(b){a[b]&&f(z(a[b]),function(a,c){(c=g(a.id)&&this.get(a.id)||this[b][c])&&c.coll===b&&c.update(a,!1)},this)},this);
m&&f(this.axes,function(a){a.update({},!1)});p&&f(this.series,function(a){a.update({},!1)});a.loading&&C(!0,this.options.loading,a.loading);e=h&&h.width;h=h&&h.height;b(e)&&e!==this.chartWidth||b(h)&&h!==this.chartHeight?this.setSize(e,h):t(c,!0)&&this.redraw()},setSubtitle:function(a){this.setTitle(void 0,a)}});l(m.prototype,{update:function(a,b,c,d){function e(){f.applyOptions(a);null===f.y&&n&&(f.graphic=n.destroy());p(a,!0)&&(n&&n.element&&a&&a.marker&&a.marker.symbol&&(f.graphic=n.destroy()),
a&&a.dataLabels&&f.dataLabel&&(f.dataLabel=f.dataLabel.destroy()));m=f.index;g.updateParallelArrays(f,m);l.data[m]=p(l.data[m],!0)?f.options:a;g.isDirty=g.isDirtyData=!0;!g.fixedBox&&g.hasCartesianSeries&&(k.isDirtyBox=!0);"point"===l.legendType&&(k.isDirtyLegend=!0);b&&k.redraw(c)}var f=this,g=f.series,n=f.graphic,m,k=g.chart,l=g.options;b=t(b,!0);!1===d?e():f.firePointEvent("update",{options:a},e)},remove:function(a,b){this.series.removePoint(d(this,this.series.data),a,b)}});l(c.prototype,{addPoint:function(a,
b,c,d){var e=this.options,f=this.data,g=this.chart,n=this.xAxis,n=n&&n.hasNames&&n.names,m=e.data,k,p,l=this.xData,q,w;b=t(b,!0);k={series:this};this.pointClass.prototype.applyOptions.apply(k,[a]);w=k.x;q=l.length;if(this.requireSorting&&w<l[q-1])for(p=!0;q&&l[q-1]>w;)q--;this.updateParallelArrays(k,"splice",q,0,0);this.updateParallelArrays(k,q);n&&k.name&&(n[w]=k.name);m.splice(q,0,a);p&&(this.data.splice(q,0,null),this.processData());"point"===e.legendType&&this.generatePoints();c&&(f[0]&&f[0].remove?
f[0].remove(!1):(f.shift(),this.updateParallelArrays(k,"shift"),m.shift()));this.isDirtyData=this.isDirty=!0;b&&g.redraw(d)},removePoint:function(a,b,c){var e=this,d=e.data,f=d[a],g=e.points,n=e.chart,m=function(){g&&g.length===d.length&&g.splice(a,1);d.splice(a,1);e.options.data.splice(a,1);e.updateParallelArrays(f||{series:e},"splice",a,1);f&&f.destroy();e.isDirty=!0;e.isDirtyData=!0;b&&n.redraw()};E(c,n);b=t(b,!0);f?f.firePointEvent("remove",null,m):m()},remove:function(a,b,c){function e(){d.destroy();
f.isDirtyLegend=f.isDirtyBox=!0;f.linkSeries();t(a,!0)&&f.redraw(b)}var d=this,f=d.chart;!1!==c?q(d,"remove",null,e):e()},update:function(a,b){var c=this,e=this.chart,d=this.userOptions,g=this.type,m=a.type||d.type||e.options.chart.type,p=n[g].prototype,q=["group","markerGroup","dataLabelsGroup"],k;if(m&&m!==g||void 0!==a.zIndex)q.length=0;f(q,function(a){q[a]=c[a];delete c[a]});a=C(d,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1,null,!1);for(k in p)this[k]=
void 0;l(this,n[m||g].prototype);f(q,function(a){c[a]=q[a]});this.init(e,a);e.linkSeries();t(b,!0)&&e.redraw(!1)}});l(H.prototype,{update:function(a,b){var c=this.chart;a=c.options[this.coll][this.options.index]=C(this.userOptions,a);this.destroy(!0);this.init(c,l(a,{events:void 0}));c.isDirtyBox=!0;t(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,e=this.series,d=e.length;d--;)e[d]&&e[d].remove(!1);u(b.axes,this);u(b[c],this);b.options[c].splice(this.options.index,1);f(b[c],
function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;t(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}})})(L);(function(a){var B=a.color,A=a.each,H=a.map,G=a.pick,r=a.Series,g=a.seriesType;g("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(){var a=[],g=[],l=this.xAxis,q=this.yAxis,d=q.stacks[this.stackKey],b={},p=this.points,r=this.index,t=q.series,m=t.length,c,n=G(q.options.reversedStacks,
!0)?1:-1,E,z;if(this.options.stacking){for(E=0;E<p.length;E++)b[p[E].x]=p[E];for(z in d)null!==d[z].total&&g.push(z);g.sort(function(a,b){return a-b});c=H(t,function(){return this.visible});A(g,function(e,f){var p=0,t,h;if(b[e]&&!b[e].isNull)a.push(b[e]),A([-1,1],function(a){var p=1===a?"rightNull":"leftNull",l=0,q=d[g[f+a]];if(q)for(E=r;0<=E&&E<m;)t=q.points[E],t||(E===r?b[e][p]=!0:c[E]&&(h=d[e].points[E])&&(l-=h[1]-h[0])),E+=n;b[e][1===a?"rightCliff":"leftCliff"]=l});else{for(E=r;0<=E&&E<m;){if(t=
d[e].points[E]){p=t[1];break}E+=n}p=q.toPixels(p,!0);a.push({isNull:!0,plotX:l.toPixels(e,!0),plotY:p,yBottom:p})}})}return a},getGraphPath:function(a){var f=r.prototype.getGraphPath,g=this.options,q=g.stacking,d=this.yAxis,b,p,C=[],t=[],m=this.index,c,n=d.stacks[this.stackKey],E=g.threshold,z=d.getThreshold(g.threshold),e,g=g.connectNulls||"percent"===q,x=function(b,e,f){var h=a[b];b=q&&n[h.x].points[m];var g=h[f+"Null"]||0;f=h[f+"Cliff"]||0;var p,l,h=!0;f||g?(p=(g?b[0]:b[1])+f,l=b[0]+f,h=!!g):!q&&
a[e]&&a[e].isNull&&(p=l=E);void 0!==p&&(t.push({plotX:c,plotY:null===p?z:d.getThreshold(p),isNull:h}),C.push({plotX:c,plotY:null===l?z:d.getThreshold(l),doCurve:!1}))};a=a||this.points;q&&(a=this.getStackPoints());for(b=0;b<a.length;b++)if(p=a[b].isNull,c=G(a[b].rectPlotX,a[b].plotX),e=G(a[b].yBottom,z),!p||g)g||x(b,b-1,"left"),p&&!q&&g||(t.push(a[b]),C.push({x:b,plotX:c,plotY:e})),g||x(b,b+1,"right");b=f.call(this,t,!0,!0);C.reversed=!0;p=f.call(this,C,!0,!0);p.length&&(p[0]="L");p=b.concat(p);f=
f.call(this,t,!1,g);p.xMap=b.xMap;this.areaPath=p;return f},drawGraph:function(){this.areaPath=[];r.prototype.drawGraph.apply(this);var a=this,g=this.areaPath,l=this.options,q=[["area","highcharts-area",this.color,l.fillColor]];A(this.zones,function(d,b){q.push(["zone-area-"+b,"highcharts-area highcharts-zone-area-"+b+" "+d.className,d.color||a.color,d.fillColor||l.fillColor])});A(q,function(d){var b=d[0],f=a[b];f?(f.endX=g.xMap,f.animate({d:g})):(f=a[b]=a.chart.renderer.path(g).addClass(d[1]).attr({fill:G(d[3],
B(d[2]).setOpacity(G(l.fillOpacity,.75)).get()),zIndex:0}).add(a.group),f.isArea=!0);f.startX=g.xMap;f.shiftUnit=l.step?2:1})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(L);(function(a){var B=a.pick;a=a.seriesType;a("spline","line",{},{getPointSpline:function(a,H,G){var r=H.plotX,g=H.plotY,f=a[G-1];G=a[G+1];var u,l,q,d;if(f&&!f.isNull&&!1!==f.doCurve&&G&&!G.isNull&&!1!==G.doCurve){a=f.plotY;q=G.plotX;G=G.plotY;var b=0;u=(1.5*r+f.plotX)/2.5;l=(1.5*g+a)/2.5;q=(1.5*r+q)/2.5;d=(1.5*g+G)/2.5;
q!==u&&(b=(d-l)*(q-r)/(q-u)+g-d);l+=b;d+=b;l>a&&l>g?(l=Math.max(a,g),d=2*g-l):l<a&&l<g&&(l=Math.min(a,g),d=2*g-l);d>G&&d>g?(d=Math.max(G,g),l=2*g-d):d<G&&d<g&&(d=Math.min(G,g),l=2*g-d);H.rightContX=q;H.rightContY=d}H=["C",B(f.rightContX,f.plotX),B(f.rightContY,f.plotY),B(u,r),B(l,g),r,g];f.rightContX=f.rightContY=null;return H}})})(L);(function(a){var B=a.seriesTypes.area.prototype,A=a.seriesType;A("areaspline","spline",a.defaultPlotOptions.area,{getStackPoints:B.getStackPoints,getGraphPath:B.getGraphPath,
setStackCliffs:B.setStackCliffs,drawGraph:B.drawGraph,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(L);(function(a){var B=a.animObject,A=a.color,H=a.each,G=a.extend,r=a.isNumber,g=a.merge,f=a.pick,u=a.Series,l=a.seriesType,q=a.svg;l("column","line",{borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1,shadow:!1},select:{color:"#cccccc",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,
y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:"#ffffff"},{cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){u.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&H(b.series,function(b){b.type===a.type&&(b.isDirty=!0)})},getColumnMetrics:function(){var a=this,b=a.options,g=a.xAxis,l=a.yAxis,t=g.reversed,m,c={},n=0;!1===b.grouping?n=1:H(a.chart.series,function(b){var e=
b.options,d=b.yAxis,f;b.type===a.type&&b.visible&&l.len===d.len&&l.pos===d.pos&&(e.stacking?(m=b.stackKey,void 0===c[m]&&(c[m]=n++),f=c[m]):!1!==e.grouping&&(f=n++),b.columnIndex=f)});var q=Math.min(Math.abs(g.transA)*(g.ordinalSlope||b.pointRange||g.closestPointRange||g.tickInterval||1),g.len),r=q*b.groupPadding,e=(q-2*r)/(n||1),b=Math.min(b.maxPointWidth||g.len,f(b.pointWidth,e*(1-2*b.pointPadding)));a.columnMetrics={width:b,offset:(e-b)/2+(r+((a.columnIndex||0)+(t?1:0))*e-q/2)*(t?-1:1)};return a.columnMetrics},
crispCol:function(a,b,f,g){var d=this.chart,m=this.borderWidth,c=-(m%2?.5:0),m=m%2?.5:1;d.inverted&&d.renderer.isVML&&(m+=1);f=Math.round(a+f)+c;a=Math.round(a)+c;g=Math.round(b+g)+m;c=.5>=Math.abs(b)&&.5<g;b=Math.round(b)+m;g-=b;c&&g&&(--b,g+=1);return{x:a,y:b,width:f-a,height:g}},translate:function(){var a=this,b=a.chart,g=a.options,l=a.dense=2>a.closestPointRange*a.xAxis.transA,l=a.borderWidth=f(g.borderWidth,l?0:1),t=a.yAxis,m=a.translatedThreshold=t.getThreshold(g.threshold),c=f(g.minPointLength,
5),n=a.getColumnMetrics(),q=n.width,r=a.barW=Math.max(q,1+2*l),e=a.pointXOffset=n.offset;b.inverted&&(m-=.5);g.pointPadding&&(r=Math.ceil(r));u.prototype.translate.apply(a);H(a.points,function(d){var g=f(d.yBottom,m),n=999+Math.abs(g),n=Math.min(Math.max(-n,d.plotY),t.len+n),h=d.plotX+e,l=r,p=Math.min(n,g),z,x=Math.max(n,g)-p;Math.abs(x)<c&&c&&(x=c,z=!t.reversed&&!d.negative||t.reversed&&d.negative,p=Math.abs(p-m)>c?g-c:m-(z?c:0));d.barX=h;d.pointWidth=q;d.tooltipPos=b.inverted?[t.len+t.pos-b.plotLeft-
n,a.xAxis.len-h-l/2,x]:[h+l/2,n+t.pos-b.plotTop,x];d.shapeType="rect";d.shapeArgs=a.crispCol.apply(a,d.isNull?[d.plotX,t.len/2,0,0]:[h,p,l,x])})},getSymbol:a.noop,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(a,b){var d=this.options,f,g=this.pointAttrToOptions||{};f=g.stroke||"borderColor";var m=g["stroke-width"]||"borderWidth",c=a&&a.color||this.color,n=a[f]||d[f]||this.color||
c,l=a[m]||d[m]||this[m]||0,g=d.dashStyle;a&&this.zones.length&&(c=(c=a.getZone())&&c.color||a.options.color||this.color);b&&(a=d.states[b],b=a.brightness,c=a.color||void 0!==b&&A(c).brighten(a.brightness).get()||c,n=a[f]||n,l=a[m]||l,g=a.dashStyle||g);f={fill:c,stroke:n,"stroke-width":l};d.borderRadius&&(f.r=d.borderRadius);g&&(f.dashstyle=g);return f},drawPoints:function(){var a=this,b=this.chart,f=a.options,l=b.renderer,t=f.animationLimit||250,m;H(a.points,function(c){var d=c.graphic;if(r(c.plotY)&&
null!==c.y){m=c.shapeArgs;if(d)d[b.pointCount<t?"animate":"attr"](g(m));else c.graphic=d=l[c.shapeType](m).attr({"class":c.getClassName()}).add(c.group||a.group);d.attr(a.pointAttribs(c,c.selected&&"select")).shadow(f.shadow,null,f.stacking&&!f.borderRadius)}else d&&(c.graphic=d.destroy())})},animate:function(a){var b=this,d=this.yAxis,f=b.options,g=this.chart.inverted,m={};q&&(a?(m.scaleY=.001,a=Math.min(d.pos+d.len,Math.max(d.pos,d.toPixels(f.threshold))),g?m.translateX=a-d.len:m.translateY=a,b.group.attr(m)):
(m[g?"translateX":"translateY"]=d.pos,b.group.animate(m,G(B(b.options.animation),{step:function(a,d){b.group.attr({scaleY:Math.max(.001,d.pos)})}})),b.animate=null))},remove:function(){var a=this,b=a.chart;b.hasRendered&&H(b.series,function(b){b.type===a.type&&(b.isDirty=!0)});u.prototype.remove.apply(a,arguments)}})})(L);(function(a){a=a.seriesType;a("bar","column",null,{inverted:!0})})(L);(function(a){var B=a.Series;a=a.seriesType;a("scatter","line",{lineWidth:0,marker:{enabled:!0},tooltip:{headerFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e \x3cspan style\x3d"font-size: 0.85em"\x3e {series.name}\x3c/span\x3e\x3cbr/\x3e',
pointFormat:"x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,kdDimensions:2,drawGraph:function(){this.options.lineWidth&&B.prototype.drawGraph.call(this)}})})(L);(function(a){var B=a.pick,A=a.relativeLength;a.CenteredSeriesMixin={getCenter:function(){var a=this.options,G=this.chart,r=2*(a.slicedOffset||0),g=G.plotWidth-2*r,G=G.plotHeight-
2*r,f=a.center,f=[B(f[0],"50%"),B(f[1],"50%"),a.size||"100%",a.innerSize||0],u=Math.min(g,G),l,q;for(l=0;4>l;++l)q=f[l],a=2>l||2===l&&/%$/.test(q),f[l]=A(q,[g,G,u,f[2]][l])+(a?r:0);f[3]>f[2]&&(f[3]=f[2]);return f}}})(L);(function(a){var B=a.addEvent,A=a.defined,H=a.each,G=a.extend,r=a.inArray,g=a.noop,f=a.pick,u=a.Point,l=a.Series,q=a.seriesType,d=a.setAnimation;q("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y?
void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,states:{hover:{brightness:.1,shadow:!1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:a.seriesTypes.column.prototype.pointAttribs,animate:function(a){var b=this,d=b.points,f=b.startAngleRad;a||(H(d,function(a){var c=
a.graphic,d=a.shapeArgs;c&&(c.attr({r:a.startR||b.center[3]/2,start:f,end:f}),c.animate({r:d.r,start:d.start,end:d.end},b.options.animation))}),b.animate=null)},updateTotals:function(){var a,d=0,f=this.points,g=f.length,m,c=this.options.ignoreHiddenPoint;for(a=0;a<g;a++)m=f[a],0>m.y&&(m.y=null),d+=c&&!m.visible?0:m.y;this.total=d;for(a=0;a<g;a++)m=f[a],m.percentage=0<d&&(m.visible||!c)?m.y/d*100:0,m.total=d},generatePoints:function(){l.prototype.generatePoints.call(this);this.updateTotals()},translate:function(a){this.generatePoints();
var b=0,d=this.options,g=d.slicedOffset,m=g+(d.borderWidth||0),c,n,l,q=d.startAngle||0,e=this.startAngleRad=Math.PI/180*(q-90),q=(this.endAngleRad=Math.PI/180*(f(d.endAngle,q+360)-90))-e,r=this.points,u=d.dataLabels.distance,d=d.ignoreHiddenPoint,w,h=r.length,y;a||(this.center=a=this.getCenter());this.getX=function(b,c){l=Math.asin(Math.min((b-a[1])/(a[2]/2+u),1));return a[0]+(c?-1:1)*Math.cos(l)*(a[2]/2+u)};for(w=0;w<h;w++){y=r[w];c=e+b*q;if(!d||y.visible)b+=y.percentage/100;n=e+b*q;y.shapeType=
"arc";y.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:Math.round(1E3*c)/1E3,end:Math.round(1E3*n)/1E3};l=(n+c)/2;l>1.5*Math.PI?l-=2*Math.PI:l<-Math.PI/2&&(l+=2*Math.PI);y.slicedTranslation={translateX:Math.round(Math.cos(l)*g),translateY:Math.round(Math.sin(l)*g)};c=Math.cos(l)*a[2]/2;n=Math.sin(l)*a[2]/2;y.tooltipPos=[a[0]+.7*c,a[1]+.7*n];y.half=l<-Math.PI/2||l>Math.PI/2?1:0;y.angle=l;m=Math.min(m,u/5);y.labelPos=[a[0]+c+Math.cos(l)*u,a[1]+n+Math.sin(l)*u,a[0]+c+Math.cos(l)*m,a[1]+n+Math.sin(l)*
m,a[0]+c,a[1]+n,0>u?"center":y.half?"right":"left",l]}},drawGraph:null,drawPoints:function(){var a=this,d=a.chart.renderer,f,g,m,c,n=a.options.shadow;n&&!a.shadowGroup&&(a.shadowGroup=d.g("shadow").add(a.group));H(a.points,function(b){if(null!==b.y){g=b.graphic;c=b.shapeArgs;f=b.sliced?b.slicedTranslation:{};var l=b.shadowGroup;n&&!l&&(l=b.shadowGroup=d.g("shadow").add(a.shadowGroup));l&&l.attr(f);m=a.pointAttribs(b,b.selected&&"select");g?g.setRadialReference(a.center).attr(m).animate(G(c,f)):(b.graphic=
g=d[b.shapeType](c).addClass(b.getClassName()).setRadialReference(a.center).attr(f).add(a.group),b.visible||g.attr({visibility:"hidden"}),g.attr(m).attr({"stroke-linejoin":"round"}).shadow(n,l))}})},searchPoint:g,sortByAngle:function(a,d){a.sort(function(a,b){return void 0!==a.angle&&(b.angle-a.angle)*d})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,getCenter:a.CenteredSeriesMixin.getCenter,getSymbol:g},{init:function(){u.prototype.init.apply(this,arguments);var a=this,d;a.name=f(a.name,"Slice");
d=function(b){a.slice("select"===b.type)};B(a,"select",d);B(a,"unselect",d);return a},setVisible:function(a,d){var b=this,g=b.series,m=g.chart,c=g.options.ignoreHiddenPoint;d=f(d,c);a!==b.visible&&(b.visible=b.options.visible=a=void 0===a?!b.visible:a,g.options.data[r(b,g.data)]=b.options,H(["graphic","dataLabel","connector","shadowGroup"],function(c){if(b[c])b[c][a?"show":"hide"](!0)}),b.legendItem&&m.legend.colorizeItem(b,a),a||"hover"!==b.state||b.setState(""),c&&(g.isDirty=!0),d&&m.redraw())},
slice:function(a,g,l){var b=this.series;d(l,b.chart);f(g,!0);this.sliced=this.options.sliced=a=A(a)?a:!this.sliced;b.options.data[r(this,b.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(b.x,b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}})})(L);(function(a){var B=
a.addEvent,A=a.arrayMax,H=a.defined,G=a.each,r=a.extend,g=a.format,f=a.map,u=a.merge,l=a.noop,q=a.pick,d=a.relativeLength,b=a.Series,p=a.seriesTypes,C=a.stableSort;a.distribute=function(a,b){function c(a,b){return a.target-b.target}var d,g=!0,m=a,e=[],l;l=0;for(d=a.length;d--;)l+=a[d].size;if(l>b){C(a,function(a,b){return(b.rank||0)-(a.rank||0)});for(l=d=0;l<=b;)l+=a[d].size,d++;e=a.splice(d-1,a.length)}C(a,c);for(a=f(a,function(a){return{size:a.size,targets:[a.target]}});g;){for(d=a.length;d--;)g=
a[d],l=(Math.min.apply(0,g.targets)+Math.max.apply(0,g.targets))/2,g.pos=Math.min(Math.max(0,l-g.size/2),b-g.size);d=a.length;for(g=!1;d--;)0<d&&a[d-1].pos+a[d-1].size>a[d].pos&&(a[d-1].size+=a[d].size,a[d-1].targets=a[d-1].targets.concat(a[d].targets),a[d-1].pos+a[d-1].size>b&&(a[d-1].pos=b-a[d-1].size),a.splice(d,1),g=!0)}d=0;G(a,function(a){var b=0;G(a.targets,function(){m[d].pos=a.pos+b;b+=m[d].size;d++})});m.push.apply(m,e);C(m,c)};b.prototype.drawDataLabels=function(){var a=this,b=a.options,
c=b.dataLabels,d=a.points,f,l,e=a.hasRendered||0,p,r,w=q(c.defer,!0),h=a.chart.renderer;if(c.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(c),r=a.plotGroup("dataLabelsGroup","data-labels",w&&!e?"hidden":"visible",c.zIndex||6),w&&(r.attr({opacity:+e}),e||B(a,"afterAnimate",function(){a.visible&&r.show(!0);r[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),l=c,G(d,function(e){var d,m=e.dataLabel,n,k,t,z=e.connector,w=!m,x;f=e.dlOptions||e.options&&e.options.dataLabels;
if(d=q(f&&f.enabled,l.enabled)&&null!==e.y)for(k in c=u(l,f),n=e.getLabelConfig(),p=c.format?g(c.format,n):c.formatter.call(n,c),x=c.style,t=c.rotation,x.color=q(c.color,x.color,a.color,"#000000"),"contrast"===x.color&&(x.color=c.inside||0>c.distance||b.stacking?h.getContrast(e.color||a.color):"#000000"),b.cursor&&(x.cursor=b.cursor),n={fill:c.backgroundColor,stroke:c.borderColor,"stroke-width":c.borderWidth,r:c.borderRadius||0,rotation:t,padding:c.padding,zIndex:1},n)void 0===n[k]&&delete n[k];!m||
d&&H(p)?d&&H(p)&&(m?n.text=p:(m=e.dataLabel=h[t?"text":"label"](p,0,-9999,c.shape,null,null,c.useHTML,null,"data-label"),m.addClass("highcharts-data-label-color-"+e.colorIndex+" "+(c.className||"")+(c.useHTML?"highcharts-tracker":""))),m.attr(n),m.css(x).shadow(c.shadow),m.added||m.add(r),a.alignDataLabel(e,m,c,null,w)):(e.dataLabel=m.destroy(),z&&(e.connector=z.destroy()))})};b.prototype.alignDataLabel=function(a,b,c,d,f){var g=this.chart,e=g.inverted,m=q(a.plotX,-9999),n=q(a.plotY,-9999),l=b.getBBox(),
h,p=c.rotation,t=c.align,u=this.visible&&(a.series.forceDL||g.isInsidePlot(m,Math.round(n),e)||d&&g.isInsidePlot(m,e?d.x+1:d.y+d.height-1,e)),E="justify"===q(c.overflow,"justify");u&&(h=c.style.fontSize,h=g.renderer.fontMetrics(h,b).b,d=r({x:e?g.plotWidth-n:m,y:Math.round(e?g.plotHeight-m:n),width:0,height:0},d),r(c,{width:l.width,height:l.height}),p?(E=!1,e=g.renderer.rotCorr(h,p),e={x:d.x+c.x+d.width/2+e.x,y:d.y+c.y+{top:0,middle:.5,bottom:1}[c.verticalAlign]*d.height},b[f?"attr":"animate"](e).attr({align:t}),
m=(p+720)%360,m=180<m&&360>m,"left"===t?e.y-=m?l.height:0:"center"===t?(e.x-=l.width/2,e.y-=l.height/2):"right"===t&&(e.x-=l.width,e.y-=m?0:l.height)):(b.align(c,null,d),e=b.alignAttr),E?this.justifyDataLabel(b,c,e,l,d,f):q(c.crop,!0)&&(u=g.isInsidePlot(e.x,e.y)&&g.isInsidePlot(e.x+l.width,e.y+l.height)),c.shape&&!p&&b.attr({anchorX:a.plotX,anchorY:a.plotY}));u||(b.attr({y:-9999}),b.placed=!1)};b.prototype.justifyDataLabel=function(a,b,c,d,f,g){var e=this.chart,m=b.align,n=b.verticalAlign,l,h,p=a.box?
0:a.padding||0;l=c.x+p;0>l&&("right"===m?b.align="left":b.x=-l,h=!0);l=c.x+d.width-p;l>e.plotWidth&&("left"===m?b.align="right":b.x=e.plotWidth-l,h=!0);l=c.y+p;0>l&&("bottom"===n?b.verticalAlign="top":b.y=-l,h=!0);l=c.y+d.height-p;l>e.plotHeight&&("top"===n?b.verticalAlign="bottom":b.y=e.plotHeight-l,h=!0);h&&(a.placed=!g,a.align(b,null,f))};p.pie&&(p.pie.prototype.drawDataLabels=function(){var d=this,g=d.data,c,l=d.chart,p=d.options.dataLabels,r=q(p.connectorPadding,10),e=q(p.connectorWidth,1),u=
l.plotWidth,F=l.plotHeight,w,h=p.distance,y=d.center,C=y[2]/2,B=y[1],H=0<h,k,D,L,N,S=[[],[]],O,v,M,Q,R=[0,0,0,0];d.visible&&(p.enabled||d._hasPointLabels)&&(b.prototype.drawDataLabels.apply(d),G(g,function(a){a.dataLabel&&a.visible&&(S[a.half].push(a),a.dataLabel._pos=null)}),G(S,function(b,e){var g,m,n=b.length,q,t,z;if(n)for(d.sortByAngle(b,e-.5),0<h&&(g=Math.max(0,B-C-h),m=Math.min(B+C+h,l.plotHeight),q=f(b,function(a){if(a.dataLabel)return z=a.dataLabel.getBBox().height||21,{target:a.labelPos[1]-
g+z/2,size:z,rank:a.y}}),a.distribute(q,m+z-g)),Q=0;Q<n;Q++)c=b[Q],L=c.labelPos,k=c.dataLabel,M=!1===c.visible?"hidden":"inherit",t=L[1],q?void 0===q[Q].pos?M="hidden":(N=q[Q].size,v=g+q[Q].pos):v=t,O=p.justify?y[0]+(e?-1:1)*(C+h):d.getX(v<g+2||v>m-2?t:v,e),k._attr={visibility:M,align:L[6]},k._pos={x:O+p.x+({left:r,right:-r}[L[6]]||0),y:v+p.y-10},L.x=O,L.y=v,null===d.options.size&&(D=k.width,O-D<r?R[3]=Math.max(Math.round(D-O+r),R[3]):O+D>u-r&&(R[1]=Math.max(Math.round(O+D-u+r),R[1])),0>v-N/2?R[0]=
Math.max(Math.round(-v+N/2),R[0]):v+N/2>F&&(R[2]=Math.max(Math.round(v+N/2-F),R[2])))}),0===A(R)||this.verifyDataLabelOverflow(R))&&(this.placeDataLabels(),H&&e&&G(this.points,function(a){var b;w=a.connector;if((k=a.dataLabel)&&k._pos&&a.visible){M=k._attr.visibility;if(b=!w)a.connector=w=l.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex).add(d.dataLabelsGroup),w.attr({"stroke-width":e,stroke:p.connectorColor||a.color||"#666666"});w[b?"attr":"animate"]({d:d.connectorPath(a.labelPos)});
w.attr("visibility",M)}else w&&(a.connector=w.destroy())}))},p.pie.prototype.connectorPath=function(a){var b=a.x,c=a.y;return q(this.options.dataLabels.softConnector,!0)?["M",b+("left"===a[6]?5:-5),c,"C",b,c,2*a[2]-a[4],2*a[3]-a[5],a[2],a[3],"L",a[4],a[5]]:["M",b+("left"===a[6]?5:-5),c,"L",a[2],a[3],"L",a[4],a[5]]},p.pie.prototype.placeDataLabels=function(){G(this.points,function(a){var b=a.dataLabel;b&&a.visible&&((a=b._pos)?(b.attr(b._attr),b[b.moved?"animate":"attr"](a),b.moved=!0):b&&b.attr({y:-9999}))})},
p.pie.prototype.alignDataLabel=l,p.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,f=c.center,g=c.minSize||80,l,e;null!==f[0]?l=Math.max(b[2]-Math.max(a[1],a[3]),g):(l=Math.max(b[2]-a[1]-a[3],g),b[0]+=(a[3]-a[1])/2);null!==f[1]?l=Math.max(Math.min(l,b[2]-Math.max(a[0],a[2])),g):(l=Math.max(Math.min(l,b[2]-a[0]-a[2]),g),b[1]+=(a[0]-a[2])/2);l<b[2]?(b[2]=l,b[3]=Math.min(d(c.innerSize||0,l),l),this.translate(b),this.drawDataLabels&&this.drawDataLabels()):e=!0;return e});
p.column&&(p.column.prototype.alignDataLabel=function(a,d,c,f,g){var l=this.chart.inverted,e=a.series,m=a.dlBox||a.shapeArgs,n=q(a.below,a.plotY>q(this.translatedThreshold,e.yAxis.len)),p=q(c.inside,!!this.options.stacking);m&&(f=u(m),0>f.y&&(f.height+=f.y,f.y=0),m=f.y+f.height-e.yAxis.len,0<m&&(f.height-=m),l&&(f={x:e.yAxis.len-f.y-f.height,y:e.xAxis.len-f.x-f.width,width:f.height,height:f.width}),p||(l?(f.x+=n?0:f.width,f.width=0):(f.y+=n?f.height:0,f.height=0)));c.align=q(c.align,!l||p?"center":
n?"right":"left");c.verticalAlign=q(c.verticalAlign,l||p?"middle":n?"top":"bottom");b.prototype.alignDataLabel.call(this,a,d,c,f,g)})})(L);(function(a){var B=a.Chart,A=a.each,H=a.pick,G=a.addEvent;B.prototype.callbacks.push(function(a){function g(){var f=[];A(a.series,function(a){var g=a.options.dataLabels,q=a.dataLabelCollections||["dataLabel"];(g.enabled||a._hasPointLabels)&&!g.allowOverlap&&a.visible&&A(q,function(d){A(a.points,function(a){a[d]&&(a[d].labelrank=H(a.labelrank,a.shapeArgs&&a.shapeArgs.height),
f.push(a[d]))})})});a.hideOverlappingLabels(f)}g();G(a,"redraw",g)});B.prototype.hideOverlappingLabels=function(a){var g=a.length,f,r,l,q,d,b,p,C,t,m=function(a,b,d,f,e,g,l,m){return!(e>a+d||e+l<a||g>b+f||g+m<b)};for(r=0;r<g;r++)if(f=a[r])f.oldOpacity=f.opacity,f.newOpacity=1;a.sort(function(a,b){return(b.labelrank||0)-(a.labelrank||0)});for(r=0;r<g;r++)for(l=a[r],f=r+1;f<g;++f)if(q=a[f],l&&q&&l.placed&&q.placed&&0!==l.newOpacity&&0!==q.newOpacity&&(d=l.alignAttr,b=q.alignAttr,p=l.parentGroup,C=q.parentGroup,
t=2*(l.box?0:l.padding),d=m(d.x+p.translateX,d.y+p.translateY,l.width-t,l.height-t,b.x+C.translateX,b.y+C.translateY,q.width-t,q.height-t)))(l.labelrank<q.labelrank?l:q).newOpacity=0;A(a,function(a){var b,c;a&&(c=a.newOpacity,a.oldOpacity!==c&&a.placed&&(c?a.show(!0):b=function(){a.hide()},a.alignAttr.opacity=c,a[a.isOld?"animate":"attr"](a.alignAttr,null,b)),a.isOld=!0)})}})(L);(function(a){var B=a.addEvent,A=a.Chart,H=a.createElement,G=a.css,r=a.defaultOptions,g=a.defaultPlotOptions,f=a.each,u=
a.extend,l=a.fireEvent,q=a.hasTouch,d=a.inArray,b=a.isObject,p=a.Legend,C=a.merge,t=a.pick,m=a.Point,c=a.Series,n=a.seriesTypes,E=a.svg;a=a.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=function(a){for(var c=a.target,e;c&&!e;)e=c.point,c=c.parentNode;if(void 0!==e&&e!==b.hoverPoint)e.onMouseOver(a)};f(a.points,function(a){a.graphic&&(a.graphic.element.point=a);a.dataLabel&&(a.dataLabel.div?a.dataLabel.div.point=a:a.dataLabel.element.point=a)});a._hasTracking||(f(a.trackerGroups,
function(b){if(a[b]){a[b].addClass("highcharts-tracker").on("mouseover",d).on("mouseout",function(a){c.onTrackerMouseOut(a)});if(q)a[b].on("touchstart",d);a.options.cursor&&a[b].css(G).css({cursor:a.options.cursor})}}),a._hasTracking=!0)},drawTrackerGraph:function(){var a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),g=d.length,h=a.chart,l=h.pointer,m=h.renderer,n=h.options.tooltip.snap,p=a.tracker,k,r=function(){if(h.hoverSeries!==a)a.onMouseOver()},t="rgba(192,192,192,"+
(E?.0001:.002)+")";if(g&&!c)for(k=g+1;k--;)"M"===d[k]&&d.splice(k+1,0,d[k+1]-n,d[k+2],"L"),(k&&"M"===d[k]||k===g)&&d.splice(k,0,"L",d[k-2]+n,d[k-1]);p?p.attr({d:d}):a.graph&&(a.tracker=m.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:t,fill:c?t:"none","stroke-width":a.graph.strokeWidth()+(c?0:2*n),zIndex:2}).add(a.group),f([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",r).on("mouseout",function(a){l.onTrackerMouseOut(a)});
b.cursor&&a.css({cursor:b.cursor});if(q)a.on("touchstart",r)}))}};n.column&&(n.column.prototype.drawTracker=a.drawTrackerPoint);n.pie&&(n.pie.prototype.drawTracker=a.drawTrackerPoint);n.scatter&&(n.scatter.prototype.drawTracker=a.drawTrackerPoint);u(p.prototype,{setItemEvents:function(a,b,c){var e=this,d=e.chart,f="highcharts-legend-"+(a.series?"point":"series")+"-active";(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");d.seriesGroup.addClass(f);b.css(e.options.itemHoverStyle)}).on("mouseout",
function(){b.css(a.visible?e.itemStyle:e.itemHiddenStyle);d.seriesGroup.removeClass(f);a.setState()}).on("click",function(b){var c=function(){a.setVisible&&a.setVisible()};b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):l(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=H("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);B(a.checkbox,"click",function(b){l(a.series||a,"checkboxClick",
{checked:b.target.checked,item:a},function(){a.select()})})}});r.legend.itemStyle.cursor="pointer";u(A.prototype,{showResetZoom:function(){var a=this,b=r.lang,c=a.options.chart.resetZoomButton,d=c.theme,f=d.states,g="chart"===c.relativeTo?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,f&&f.hover).attr({align:c.position.align,title:b.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(c.position,!1,g)},zoomOut:function(){var a=this;
l(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var c,d=this.pointer,g=!1,l;!a||a.resetSelection?f(this.axes,function(a){c=a.zoom()}):f(a.xAxis.concat(a.yAxis),function(a){var b=a.axis;d[b.isXAxis?"zoomX":"zoomY"]&&(c=b.zoom(a.min,a.max),b.displayBtn&&(g=!0))});l=this.resetZoomButton;g&&!l?this.showResetZoom():!g&&b(l)&&(this.resetZoomButton=l.destroy());c&&this.redraw(t(this.options.chart.animation,a&&a.animation,100>this.pointCount))},pan:function(a,b){var c=this,d=c.hoverPoints,
e;d&&f(d,function(a){a.setState()});f("xy"===b?[1,0]:[1],function(b){b=c[b?"xAxis":"yAxis"][0];var d=b.horiz,f=a[d?"chartX":"chartY"],d=d?"mouseDownX":"mouseDownY",g=c[d],h=(b.pointRange||0)/2,k=b.getExtremes(),l=b.toValue(g-f,!0)+h,h=b.toValue(g+b.len-f,!0)-h,m=h<l,g=m?h:l,l=m?l:h,h=Math.min(k.dataMin,k.min)-g,k=l-Math.max(k.dataMax,k.max);b.series.length&&0>h&&0>k&&(b.setExtremes(g,l,!1,!1,{trigger:"pan"}),e=!0);c[d]=f});e&&c.redraw(!1);G(c.container,{cursor:"move"})}});u(m.prototype,{select:function(a,
b){var c=this,e=c.series,g=e.chart;a=t(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;e.options.data[d(c,e.data)]=c.options;c.setState(a&&"select");b||f(g.getSelectedPoints(),function(a){a.selected&&a!==c&&(a.selected=a.options.selected=!1,e.options.data[d(a,e.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},onMouseOver:function(a,b){var c=this.series,d=c.chart,e=d.tooltip,f=d.hoverPoint;if(this.series){if(!b){if(f&&
f!==this)f.onMouseOut();if(d.hoverSeries!==c)c.onMouseOver();d.hoverPoint=this}!e||e.shared&&!c.noSharedTooltip?e||this.setState("hover"):(this.setState("hover"),e.refresh(this,a));this.firePointEvent("mouseOver")}},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;this.firePointEvent("mouseOut");b&&-1!==d(this,b)||(this.setState(),a.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var a=C(this.series.options.point,this.options).events,b;this.events=a;for(b in a)B(this,
b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var c=Math.floor(this.plotX),d=this.plotY,e=this.series,f=e.options.states[a]||{},l=g[e.type].marker&&e.options.marker,m=l&&!1===l.enabled,n=l&&l.states&&l.states[a]||{},p=!1===n.enabled,k=e.stateMarkerGraphic,q=this.marker||{},r=e.chart,z=e.halo,C,A=l&&e.markerAttribs;a=a||"";if(!(a===this.state&&!b||this.selected&&"select"!==a||!1===f.enabled||a&&(p||m&&!1===n.enabled)||a&&q.states&&q.states[a]&&!1===q.states[a].enabled)){A&&(C=e.markerAttribs(this,
a));if(this.graphic)this.state&&this.graphic.removeClass("highcharts-point-"+this.state),a&&this.graphic.addClass("highcharts-point-"+a),this.graphic.attr(e.pointAttribs(this,a)),C&&this.graphic.animate(C,t(r.options.chart.animation,n.animation,l.animation)),k&&k.hide();else{if(a&&n){l=q.symbol||e.symbol;k&&k.currentSymbol!==l&&(k=k.destroy());if(k)k[b?"animate":"attr"]({x:C.x,y:C.y});else l&&(e.stateMarkerGraphic=k=r.renderer.symbol(l,C.x,C.y,C.width,C.height).add(e.markerGroup),k.currentSymbol=
l);k&&k.attr(e.pointAttribs(this,a))}k&&(k[a&&r.isInsidePlot(c,d,r.inverted)?"show":"hide"](),k.element.point=this)}(c=f.halo)&&c.size?(z||(e.halo=z=r.renderer.path().add(A?e.markerGroup:e.group)),z[b?"animate":"attr"]({d:this.haloPath(c.size)}),z.attr({"class":"highcharts-halo highcharts-color-"+t(this.colorIndex,e.colorIndex)}),z.point=this,z.attr(u({fill:this.color||e.color,"fill-opacity":c.opacity,zIndex:-1},c.attributes))):z&&z.point&&z.point.haloPath&&z.animate({d:z.point.haloPath(0)});this.state=
a}},haloPath:function(a){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-a,this.plotY-a,2*a,2*a)}});u(c.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&l(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;b.hoverSeries=null;if(d)d.onMouseOut();this&&a.events.mouseOut&&l(this,"mouseOut");!c||a.stickyTracking||
c.shared&&!this.noSharedTooltip||c.hide();this.setState()},setState:function(a){var b=this,c=b.options,d=b.graph,g=c.states,h=c.lineWidth,c=0;a=a||"";if(b.state!==a&&(f([b.group,b.markerGroup],function(c){c&&(b.state&&c.removeClass("highcharts-series-"+b.state),a&&c.addClass("highcharts-series-"+a))}),b.state=a,!g[a]||!1!==g[a].enabled)&&(a&&(h=g[a].lineWidth||h+(g[a].lineWidthPlus||0)),d&&!d.dashstyle))for(g={"stroke-width":h},d.attr(g);b["zone-graph-"+c];)b["zone-graph-"+c].attr(g),c+=1},setVisible:function(a,
b){var c=this,d=c.chart,e=c.legendItem,g,m=d.options.chart.ignoreHiddenSeries,n=c.visible;g=(c.visible=a=c.options.visible=c.userOptions.visible=void 0===a?!n:a)?"show":"hide";f(["group","dataLabelsGroup","markerGroup","tracker","tt"],function(a){if(c[a])c[a][g]()});if(d.hoverSeries===c||(d.hoverPoint&&d.hoverPoint.series)===c)c.onMouseOut();e&&d.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&f(d.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});f(c.linkedSeries,function(b){b.setVisible(a,
!1)});m&&(d.isDirtyBox=!0);!1!==b&&d.redraw();l(c,g)},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=void 0===a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);l(this,a?"select":"unselect")},drawTracker:a.drawTrackerGraph})})(L);(function(a){var B=a.Chart,A=a.each,H=a.inArray,G=a.isObject,r=a.pick,g=a.splat;B.prototype.setResponsive=function(a){var f=this.options.responsive;f&&f.rules&&A(f.rules,function(f){this.matchResponsiveRule(f,
a)},this)};B.prototype.matchResponsiveRule=function(f,g){var l=this.respRules,q=f.condition,d;d=q.callback||function(){return this.chartWidth<=r(q.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=r(q.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=r(q.minWidth,0)&&this.chartHeight>=r(q.minHeight,0)};void 0===f._id&&(f._id=a.uniqueKey());d=d.call(this);!l[f._id]&&d?f.chartOptions&&(l[f._id]=this.currentOptions(f.chartOptions),this.update(f.chartOptions,g)):l[f._id]&&!d&&(this.update(l[f._id],g),delete l[f._id])};
B.prototype.currentOptions=function(a){function f(a,d,b,l){var p,q;for(p in a)if(!l&&-1<H(p,["series","xAxis","yAxis"]))for(a[p]=g(a[p]),b[p]=[],q=0;q<a[p].length;q++)b[p][q]={},f(a[p][q],d[p][q],b[p][q],l+1);else G(a[p])?(b[p]={},f(a[p],d[p]||{},b[p],l+1)):b[p]=d[p]||null}var l={};f(a,this.options,l,0);return l}})(L);return L});
;
/**
 * @license AngularJS v1.4.8
 * (c) 2010-2015 Google, Inc. http://angularjs.org
 * License: MIT
 */
(function(n,t,i){"use strict";function y(n,t){return t=t||Error,function(){var f=2,i=arguments,o=i[0],u="["+(n?n+":":"")+o+"] ",s=i[1],e,r;for(u+=s.replace(/\{\d+\}/g,function(n){var r=+n.slice(1,-1),t=r+f;return t<i.length?fs(i[t]):n}),u+="\nhttp://errors.angularjs.org/1.4.8/"+(n?n+"/":"")+o,r=f,e="?";r<i.length;r++,e="&")u+=e+"p"+(r-f)+"="+encodeURIComponent(fs(i[r]));return new t(u)}}function oi(n){if(n==null||fr(n))return!1;if(a(n)||h(n)||o&&n instanceof o)return!0;var t="length"in Object(n)&&n.length;return k(t)&&(t>=0&&t-1 in n||typeof n.item=="function")}function r(n,t,i){var u,f,e;if(n)if(l(n))for(u in n)u!="prototype"&&u!="length"&&u!="name"&&(!n.hasOwnProperty||n.hasOwnProperty(u))&&t.call(i,n[u],u,n);else if(a(n)||oi(n))for(e=typeof n!="object",u=0,f=n.length;u<f;u++)(e||u in n)&&t.call(i,n[u],u,n);else if(n.forEach&&n.forEach!==r)n.forEach(t,i,n);else if(lo(n))for(u in n)t.call(i,n[u],u,n);else if(typeof n.hasOwnProperty=="function")for(u in n)n.hasOwnProperty(u)&&t.call(i,n[u],u,n);else for(u in n)pt.call(n,u)&&t.call(i,n[u],u,n);return n}function oo(n,t,i){for(var r=Object.keys(n).sort(),u=0;u<r.length;u++)t.call(i,n[r[u]],r[u]);return r}function so(n){return function(t,i){n(i,t)}}function ou(){return++fa}function ho(n,t){t?n.$$hashKey=t:delete n.$$hashKey}function vf(n,t,i){for(var f,s,e,h,u,r,v=n.$$hashKey,o=0,y=t.length;o<y;++o)if(f=t[o],c(f)||l(f))for(s=Object.keys(f),e=0,h=s.length;e<h;e++)u=s[e],r=f[u],i&&c(r)?et(r)?n[u]=new Date(r.valueOf()):wi(r)?n[u]=new RegExp(r):r.nodeName?n[u]=r.cloneNode(!0):wf(r)?n[u]=r.clone():(c(n[u])||(n[u]=a(r)?[]:{}),vf(n[u],[r],!0)):n[u]=r;return ho(n,v),n}function p(n){return vf(n,rr.call(arguments,1),!1)}function ea(n){return vf(n,rr.call(arguments,1),!0)}function ut(n){return parseInt(n,10)}function yf(n,t){return p(Object.create(n),t)}function s(){}function ur(n){return n}function vt(n){return function(){return n}}function co(n){return l(n.toString)&&n.toString!==wt}function f(n){return typeof n=="undefined"}function e(n){return typeof n!="undefined"}function c(n){return n!==null&&typeof n=="object"}function lo(n){return n!==null&&typeof n=="object"&&!eo(n)}function h(n){return typeof n=="string"}function k(n){return typeof n=="number"}function et(n){return wt.call(n)==="[object Date]"}function l(n){return typeof n=="function"}function wi(n){return wt.call(n)==="[object RegExp]"}function fr(n){return n&&n.window===n}function er(n){return n&&n.$evalAsync&&n.$watch}function oa(n){return wt.call(n)==="[object File]"}function sa(n){return wt.call(n)==="[object FormData]"}function ha(n){return wt.call(n)==="[object Blob]"}function or(n){return typeof n=="boolean"}function su(n){return n&&l(n.then)}function vo(n){return n&&k(n.length)&&ao.test(wt.call(n))}function wf(n){return!!(n&&(n.nodeName||n.prop&&n.attr&&n.find))}function ca(n){for(var i={},r=n.split(","),t=0;t<r.length;t++)i[r[t]]=!0;return i}function bt(n){return v(n.nodeName||n[0]&&n[0].nodeName)}function sr(n,t){var i=n.indexOf(t);return i>=0&&n.splice(i,1),i}function hr(n,t){function e(n,t){var e=t.$$hashKey,r,u,f;if(a(n))for(u=0,f=n.length;u<f;u++)t.push(i(n[u]));else if(lo(n))for(r in n)t[r]=i(n[r]);else if(n&&typeof n.hasOwnProperty=="function")for(r in n)n.hasOwnProperty(r)&&(t[r]=i(n[r]));else for(r in n)pt.call(n,r)&&(t[r]=i(n[r]));return ho(t,e),t}function i(n){var r,i,t;if(!c(n))return n;if(r=u.indexOf(n),r!==-1)return f[r];if(fr(n)||er(n))throw ei("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");return i=!1,a(n)?(t=[],i=!0):vo(n)?t=new n.constructor(n):et(n)?t=new Date(n.getTime()):wi(n)?(t=new RegExp(n.source,n.toString().match(/[^\/]*$/)[0]),t.lastIndex=n.lastIndex):l(n.cloneNode)?t=n.cloneNode(!0):(t=Object.create(eo(n)),i=!0),u.push(n),f.push(t),i?e(n,t):t}var u=[],f=[];if(t){if(vo(t))throw ei("cpta","Can't copy! TypedArray destination cannot be mutated.");if(n===t)throw ei("cpi","Can't copy! Source and destination are identical.");return a(t)?t.length=0:r(t,function(n,i){i!=="$$hashKey"&&delete t[i]}),u.push(n),f.push(t),e(n,t)}return i(n)}function ct(n,t){var i,u,r;if(a(n))for(t=t||[],i=0,u=n.length;i<u;i++)t[i]=n[i];else if(c(n)){t=t||{};for(r in n)r.charAt(0)==="$"&&r.charAt(1)==="$"||(t[r]=n[r])}return t||n}function ot(n,t){if(n===t)return!0;if(n===null||t===null)return!1;if(n!==n&&t!==t)return!0;var u=typeof n,o=typeof t,f,i,r;if(u==o&&u=="object")if(a(n)){if(!a(t))return!1;if((f=n.length)==t.length){for(i=0;i<f;i++)if(!ot(n[i],t[i]))return!1;return!0}}else{if(et(n))return et(t)?ot(n.getTime(),t.getTime()):!1;if(wi(n))return wi(t)?n.toString()==t.toString():!1;if(er(n)||er(t)||fr(n)||fr(t)||a(t)||et(t)||wi(t))return!1;r=d();for(i in n)if(i.charAt(0)!=="$"&&!l(n[i])){if(!ot(n[i],t[i]))return!1;r[i]=!0}for(i in t)if(!(i in r)&&i.charAt(0)!=="$"&&e(t[i])&&!l(t[i]))return!1;return!0}return!1}function lr(n,t,i){return n.concat(rr.call(t,i))}function ar(n,t){return rr.call(n,t||0)}function yo(n,t){var i=arguments.length>2?ar(arguments,2):[];return!l(t)||t instanceof RegExp?t:i.length?function(){return arguments.length?t.apply(n,lr(i,arguments,0)):t.apply(n,i)}:function(){return arguments.length?t.apply(n,arguments):t.call(n)}}function po(n,r){var u=r;return typeof n=="string"&&n.charAt(0)==="$"&&n.charAt(1)==="$"?u=i:fr(r)?u="$WINDOW":r&&t===r?u="$DOCUMENT":er(r)&&(u="$SCOPE"),u}function vr(n,t){return typeof n=="undefined"?i:(k(t)||(t=t?2:null),JSON.stringify(n,po,t))}function wo(n){return h(n)?JSON.parse(n):n}function bo(n,t){var i=Date.parse("Jan 01, 1970 00:00:00 "+n)/6e4;return isNaN(i)?t:i}function la(n,t){return n=new Date(n.getTime()),n.setMinutes(n.getMinutes()+t),n}function bf(n,t,i){i=i?-1:1;var r=bo(t,n.getTimezoneOffset());return la(n,i*(r-n.getTimezoneOffset()))}function kt(n){n=o(n).clone();try{n.empty()}catch(i){}var t=o("<div>").append(n).html();try{return n[0].nodeType===di?v(t):t.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(n,t){return"<"+v(t)})}catch(i){return v(t)}}function ko(n){try{return decodeURIComponent(n)}catch(t){}}function go(n){var t={};return r((n||"").split("&"),function(n){var u,i,r;n&&(i=n=n.replace(/\+/g,"%20"),u=n.indexOf("="),u!==-1&&(i=n.substring(0,u),r=n.substring(u+1)),i=ko(i),e(i)&&(r=e(r)?ko(r):!0,pt.call(t,i)?a(t[i])?t[i].push(r):t[i]=[t[i],r]:t[i]=r))}),t}function kf(n){var t=[];return r(n,function(n,i){a(n)?r(n,function(n){t.push(lt(i,!0)+(n===!0?"":"="+lt(n,!0)))}):t.push(lt(i,!0)+(n===!0?"":"="+lt(n,!0)))}),t.length?t.join("&"):""}function hu(n){return lt(n,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function lt(n,t){return encodeURIComponent(n).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,t?"%20":"+")}function aa(n,t){for(var i,u=si.length,r=0;r<u;++r)if(i=si[r]+t,h(i=n.getAttribute(i)))return i;return null}function va(n,t){var i,u,f={};r(si,function(t){var r=t+"app";!i&&n.hasAttribute&&n.hasAttribute(r)&&(i=n,u=n.getAttribute(r))});r(si,function(t){var f=t+"app",r;!i&&(r=n.querySelector("["+f.replace(":","\\:")+"]"))&&(i=r,u=r.getAttribute(f))});i&&(f.strictDi=aa(i,"strict-di")!==null,t(i,u?[u]:[],f))}function ns(i,u,f){var e;c(f)||(f={});e={strictDi:!1};f=p(e,f);var s=function(){var r,n;if(i=o(i),i.injector()){r=i[0]===t?"document":kt(i);throw ei("btstrpd","App Already Bootstrapped with this Element '{0}'",r.replace(/</,"&lt;").replace(/>/,"&gt;"));}return u=u||[],u.unshift(["$provide",function(n){n.value("$rootElement",i)}]),f.debugInfoEnabled&&u.push(["$compileProvider",function(n){n.debugInfoEnabled(!0)}]),u.unshift("ng"),n=kr(u,f.strictDi),n.invoke(["$rootScope","$rootElement","$compile","$injector",function(n,t,i,r){n.$apply(function(){t.data("$injector",r);i(t)(n)})}]),n},h=/^NG_ENABLE_DEBUG_INFO!/,a=/^NG_DEFER_BOOTSTRAP!/;if(n&&h.test(n.name)&&(f.debugInfoEnabled=!0,n.name=n.name.replace(h,"")),n&&!a.test(n.name))return s();n.name=n.name.replace(a,"");ft.resumeBootstrap=function(n){return r(n,function(n){u.push(n)}),s()};l(ft.resumeDeferredBootstrap)&&ft.resumeDeferredBootstrap()}function ya(){n.name="NG_ENABLE_DEBUG_INFO!"+n.name;n.location.reload()}function pa(n){var t=ft.element(n).injector();if(!t)throw ei("test","no injector found for element argument to getTestability");return t.get("$$testability")}function is(n,t){return t=t||"_",n.replace(ts,function(n,i){return(i?t:"")+n.toLowerCase()})}function wa(){var r,t;df||(t=cr(),ht=f(t)?n.jQuery:t?n[t]:i,ht&&ht.fn.on?(o=ht,p(ht.fn,{scope:hi.scope,isolateScope:hi.isolateScope,controller:hi.controller,injector:hi.injector,inheritedData:hi.inheritedData}),r=ht.cleanData,ht.cleanData=function(n){var t,i,u;if(gf)gf=!1;else for(i=0;(u=n[i])!=null;i++)t=ht._data(u,"events"),t&&t.$destroy&&ht(u).triggerHandler("$destroy");r(n)}):o=b,ft.element=o,df=!0)}function cu(n,t,i){if(!n)throw ei("areq","Argument '{0}' is {1}",t||"?",i||"required");return n}function bi(n,t,i){return i&&a(n)&&(n=n[n.length-1]),cu(l(n),t,"not a function, got "+(n&&typeof n=="object"?n.constructor.name||"Object":typeof n)),n}function ki(n,t){if(n==="hasOwnProperty")throw ei("badname","hasOwnProperty is not a valid {0} name",t);}function rs(n,t,i){var r;if(!t)return n;var u=t.split("."),f,e=n,o=u.length;for(r=0;r<o;r++)f=u[r],n&&(n=(e=n)[f]);return!i&&l(n)?yo(e,n):n}function lu(n){for(var t=n[0],u=n[n.length-1],i,r=1;t!==u&&(t=t.nextSibling);r++)(i||n[r]!==t)&&(i||(i=o(rr.call(n,0,r))),i.push(t));return i||n}function d(){return Object.create(null)}function ka(n){function t(n,t,i){return n[t]||(n[t]=i())}var r=y("$injector"),u=y("ng"),i=t(n,"angular",Object);return i.$$minErr=i.$$minErr||y,t(i,"module",function(){var n={};return function(i,f,e){var o=function(n,t){if(n==="hasOwnProperty")throw u("badname","hasOwnProperty is not a valid {0} name",t);};return o(i,"module"),f&&n.hasOwnProperty(i)&&(n[i]=null),t(n,i,function(){function o(n,i,r,f){return f||(f=t),function(){return f[r||"push"]([n,i,arguments]),u}}function n(n,r){return function(f,e){return e&&l(e)&&(e.$$moduleName=i),t.push([n,r,arguments]),u}}if(!f)throw r("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",i);var t=[],s=[],h=[],c=o("$injector","invoke","push",s),u={_invokeQueue:t,_configBlocks:s,_runBlocks:h,requires:f,name:i,provider:n("$provide","provider"),factory:n("$provide","factory"),service:n("$provide","service"),value:o("$provide","value"),constant:o("$provide","constant","unshift"),decorator:n("$provide","decorator"),animation:n("$animateProvider","register"),filter:n("$filterProvider","register"),controller:n("$controllerProvider","register"),directive:n("$compileProvider","directive"),config:c,run:function(n){return h.push(n),this}};return e&&c(e),u})}})}function da(n){var t=[];return JSON.stringify(n,function(n,i){if(i=po(n,i),c(i)){if(t.indexOf(i)>=0)return"...";t.push(i)}return i})}function fs(n){return typeof n=="function"?n.toString().replace(/ \{[\s\S]*$/,""):f(n)?"undefined":typeof n!="string"?da(n):n}function ga(t){p(t,{bootstrap:ns,copy:hr,extend:p,merge:ea,equals:ot,element:o,forEach:r,injector:kr,noop:s,bind:yo,toJson:vr,fromJson:wo,identity:ur,isUndefined:f,isDefined:e,isString:h,isFunction:l,isObject:c,isNumber:k,isElement:wf,isArray:a,version:es,isDate:et,lowercase:v,uppercase:ir,callbacks:{counter:0},getTestability:pa,$$minErr:y,$$csp:ti,reloadWithDebugInfo:ya});af=ka(n);af("ng",["ngLocale"],["$provide",function(n){n.provider({$$sanitizeUri:fw});n.provider("$compile",ks).directive({a:kc,input:ol,textarea:ol,form:eb,script:ld,select:pd,style:bd,option:wd,ngBind:nk,ngBindHtml:ik,ngBindTemplate:tk,ngClass:uk,ngClassEven:ek,ngClassOdd:fk,ngCloak:ok,ngController:sk,ngForm:ob,ngHide:fd,ngIf:ck,ngInclude:lk,ngInit:vk,ngNonBindable:dk,ngPluralize:id,ngRepeat:rd,ngShow:ud,ngStyle:ed,ngSwitch:od,ngSwitchWhen:sd,ngSwitchDefault:hd,ngOptions:td,ngTransclude:cd,ngModel:wk,ngList:yk,ngChange:rk,pattern:bl,ngPattern:bl,required:wl,ngRequired:wl,minlength:dl,ngMinlength:dl,maxlength:kl,ngMaxlength:kl,ngValue:gb,ngModelOptions:kk}).directive({ngInclude:ak}).directive(tu).directive(sl);n.provider({$anchorScroll:ny,$animate:ey,$animateCss:oy,$$animateQueue:fy,$$AnimateRunner:uy,$browser:hy,$cacheFactory:cy,$controller:vy,$document:yy,$exceptionHandler:py,$filter:sc,$$forceReflow:wy,$interpolate:op,$interval:sp,$http:rp,$httpParamSerializer:np,$httpParamSerializerJQLike:tp,$httpBackend:fp,$xhrFactory:up,$location:vp,$log:yp,$parse:nw,$rootScope:uw,$q:tw,$$q:iw,$sce:sw,$sceDelegate:ow,$sniffer:hw,$templateCache:ly,$templateRequest:cw,$$testability:lw,$timeout:aw,$window:vw,$$rAF:rw,$$jqLite:pv,$$HashMap:wv,$$cookieReader:yw})}])}function tv(){return++nv}function wr(n){return n.replace(iv,function(n,t,i,r){return r?i.toUpperCase():i}).replace(rv,"Moz$1")}function ie(n){return!fv.test(n)}function os(n){var t=n.nodeType;return t===dt||!t||t===us}function sv(n){for(var t in yr[n.ng339])return!0;return!1}function ss(n,t){var i,o,f,u=t.createDocumentFragment(),e=[],s;if(ie(n))e.push(t.createTextNode(n));else{for(i=i||u.appendChild(t.createElement("div")),o=(ev.exec(n)||["",""])[1].toLowerCase(),f=at[o]||at._default,i.innerHTML=f[1]+n.replace(ov,"<$1><\/$2>")+f[2],s=f[0];s--;)i=i.lastChild;e=lr(e,i.childNodes);i=u.firstChild;i.textContent=""}return u.textContent="",u.innerHTML="",r(e,function(n){u.appendChild(n)}),u}function hv(n,i){i=i||t;var r;return(r=uv.exec(n))?[i.createElement(r[1])]:(r=ss(n,i))?r.childNodes:[]}function b(n){if(n instanceof b)return n;var t;if(h(n)&&(n=w(n),t=!0),!(this instanceof b)){if(t&&n.charAt(0)!="<")throw te("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new b(n)}t?fe(this,hv(n)):fe(this,n)}function re(n){return n.cloneNode(!0)}function pu(n,t){var r,i,u;if(t||wu(n),n.querySelectorAll)for(r=n.querySelectorAll("*"),i=0,u=r.length;i<u;i++)wu(r[i])}function cs(n,t,i,u){var h;if(e(u))throw te("offargs","jqLite#off() does not support the `selector` argument");var f=bu(n),o=f&&f.events,s=f&&f.handle;if(s)if(t)h=function(t){var r=o[t];e(i)&&sr(r||[],i);e(i)&&r&&r.length>0||(pr(n,t,s),delete o[t])},r(t.split(" "),function(n){h(n);yu[n]&&h(yu[n])});else for(t in o)t!=="$destroy"&&pr(n,t,s),delete o[t]}function wu(n,t){var u=n.ng339,r=u&&yr[u];if(r){if(t){delete r.data[t];return}r.handle&&(r.events.$destroy&&r.handle({},"$destroy"),cs(n));delete yr[u];n.ng339=i}}function bu(n,t){var r=n.ng339,u=r&&yr[r];return t&&!u&&(n.ng339=r=tv(),u=yr[r]={events:{},data:{},handle:i}),u}function ue(n,t,i){if(os(n)){var u=e(i),f=!u&&t&&!c(t),s=!t,o=bu(n,!f),r=o&&o.data;if(u)r[t]=i;else{if(s)return r;if(f)return r&&r[t];p(r,t)}}}function ku(n,t){return n.getAttribute?(" "+(n.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+t+" ")>-1:!1}function du(n,t){t&&n.setAttribute&&r(t.split(" "),function(t){n.setAttribute("class",w((" "+(n.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+w(t)+" "," ")))})}function gu(n,t){if(t&&n.setAttribute){var i=(" "+(n.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");r(t.split(" "),function(n){n=w(n);i.indexOf(" "+n+" ")===-1&&(i+=n+" ")});n.setAttribute("class",w(i))}}function fe(n,t){var i,r;if(t)if(t.nodeType)n[n.length++]=t;else if(i=t.length,typeof i=="number"&&t.window!==t){if(i)for(r=0;r<i;r++)n[n.length++]=t[r]}else n[n.length++]=t}function ls(n,t){return nf(n,"$"+(t||"ngController")+"Controller")}function nf(n,t,i){var u,r,f;for(n.nodeType==us&&(n=n.documentElement),u=a(t)?t:[t];n;){for(r=0,f=u.length;r<f;r++)if(e(i=o.data(n,u[r])))return i;n=n.parentNode||n.nodeType===ne&&n.host}}function as(n){for(pu(n,!0);n.firstChild;)n.removeChild(n.firstChild)}function ee(n,t){t||pu(n);var i=n.parentNode;i&&i.removeChild(n)}function cv(t,i){if(i=i||n,i.document.readyState==="complete")i.setTimeout(t);else o(i).on("load",t)}function vs(n,t){var i=br[t.toLowerCase()];return i&&oe[bt(n)]&&i}function lv(n){return se[n]}function av(n,t){var i=function(i,r){var u,e,s,h,o;if(i.isDefaultPrevented=function(){return i.defaultPrevented},u=t[r||i.type],e=u?u.length:0,e)for(f(i.immediatePropagationStopped)&&(s=i.stopImmediatePropagation,i.stopImmediatePropagation=function(){i.immediatePropagationStopped=!0;i.stopPropagation&&i.stopPropagation();s&&s.call(i)}),i.isImmediatePropagationStopped=function(){return i.immediatePropagationStopped===!0},h=u.specialHandlerWrapper||vv,e>1&&(u=ct(u)),o=0;o<e;o++)i.isImmediatePropagationStopped()||h(n,i,u[o])};return i.elem=n,i}function vv(n,t,i){i.call(n,t)}function yv(n,t,i){var r=t.relatedTarget;r&&(r===n||hs.call(n,r))||i.call(n,t)}function pv(){this.$get=function(){return p(b,{hasClass:function(n,t){return n.attr&&(n=n[0]),ku(n,t)},addClass:function(n,t){return n.attr&&(n=n[0]),gu(n,t)},removeClass:function(n,t){return n.attr&&(n=n[0]),du(n,t)}})}}function ci(n,t){var r=n&&n.$$hashKey,i;return r?(typeof r=="function"&&(r=n.$$hashKey()),r):(i=typeof n,i=="function"||i=="object"&&n!==null?n.$$hashKey=i+":"+(t||ou)():i+":"+n)}function gi(n,t){if(t){var i=0;this.nextUid=function(){return++i}}r(n,this.put,this)}function dv(n){var i=n.toString().replace(ps,""),t=i.match(ys);return t?"function("+(t[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function gv(n,t,i){var u,e,o,f;if(typeof n=="function"){if(!(u=n.$inject)){if(u=[],n.length){if(t){h(i)&&i||(i=n.name||dv(n));throw li("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",i);}e=n.toString().replace(ps,"");o=e.match(ys);r(o[1].split(bv),function(n){n.replace(kv,function(n,t,i){u.push(i)})})}n.$inject=u}}else a(n)?(f=n.length-1,bi(n[f],"fn"),u=n.slice(0,f)):bi(n,"fn",!0);return u}function kr(n,t){function v(n){return function(t,i){if(c(t))r(t,so(n));else return n(t,i)}}function d(n,t){if(ki(n,"service"),(l(t)||a(t))&&(t=u.instantiate(t)),!t.$get)throw li("pget","Provider '{0}' must define $get factory method.",n);return s[n+y]=t}function tt(n,t){return function(){var i=e.invoke(t,this);if(f(i))throw li("undef","Provider '{0}' must return a value from $get factory method.",n);return i}}function b(n,t,i){return d(n,{$get:i!==!1?tt(n,t):t})}function it(n,t){return b(n,["$injector",function(n){return n.instantiate(t)}])}function rt(n,t){return b(n,vt(t),!1)}function ut(n,t){ki(n,"constant");s[n]=t;w[n]=t}function et(n,t){var i=u.get(n+y),r=i.$get;i.$get=function(){var n=e.invoke(r,i);return e.invoke(t,null,{$delegate:n})}}function g(n){cu(f(n)||a(n),"modulesToLoad","not an array");var t=[],i;return r(n,function(n){function f(n){for(var i,r,t=0,f=n.length;t<f;t++)i=n[t],r=u.get(i[0]),r[i[1]].apply(r,i[2])}if(!k.get(n)){k.put(n,!0);try{h(n)?(i=af(n),t=t.concat(g(i.requires)).concat(i._runBlocks),f(i._invokeQueue),f(i._configBlocks)):l(n)?t.push(u.invoke(n)):a(n)?t.push(u.invoke(n)):bi(n,"module")}catch(r){a(n)&&(n=n[n.length-1]);r.message&&r.stack&&r.stack.indexOf(r.message)==-1&&(r=r.message+"\n"+r.stack);throw li("modulerr","Failed to instantiate module {0} due to:\n{1}",n,r.stack||r.message||r);}}}),t}function nt(n,i){function r(t,r){if(n.hasOwnProperty(t)){if(n[t]===p)throw li("cdep","Circular dependency found: {0}",t+" <- "+o.join(" <- "));return n[t]}try{return o.unshift(t),n[t]=p,n[t]=i(t,r)}catch(u){n[t]===p&&delete n[t];throw u;}finally{o.shift()}}function u(n,i,u,f){typeof u=="string"&&(f=u,u=null);for(var h=[],c=kr.$$annotate(n,t,f),e,o=0,s=c.length;o<s;o++){if(e=c[o],typeof e!="string")throw li("itkn","Incorrect injection token! Expected service name as string, got {0}",e);h.push(u&&u.hasOwnProperty(e)?u[e]:r(e,f))}return a(n)&&(n=n[s]),n.apply(i,h)}function f(n,t,i){var f=Object.create((a(n)?n[n.length-1]:n).prototype||null),r=u(n,f,t,i);return c(r)||l(r)?r:f}return{invoke:u,instantiate:f,get:r,annotate:kr.$$annotate,has:function(t){return s.hasOwnProperty(t+y)||n.hasOwnProperty(t)}}}t=t===!0;var p={},y="Provider",o=[],k=new gi([],!0),s={$provide:{provider:v(d),factory:v(b),service:v(it),value:v(rt),constant:v(ut),decorator:et}},u=s.$injector=nt(s,function(n,t){ft.isString(t)&&o.push(t);throw li("unpr","Unknown provider: {0}",o.join(" <- "));}),w={},e=w.$injector=nt(w,function(n,t){var r=u.get(n+y,t);return e.invoke(r.$get,r,i,n)});return r(g(n),function(n){n&&e.invoke(n)}),e}function ny(){var n=!0;this.disableAutoScrolling=function(){n=!1};this.$get=["$window","$location","$rootScope",function(t,i,r){function o(n){var t=null;return Array.prototype.some.call(n,function(n){if(bt(n)==="a")return t=n,!0}),t}function s(){var n=f.yOffset,i,r;return l(n)?n=n():wf(n)?(i=n[0],r=t.getComputedStyle(i),n=r.position!=="fixed"?0:i.getBoundingClientRect().bottom):k(n)||(n=0),n}function u(n){var i,r;n?(n.scrollIntoView(),i=s(),i&&(r=n.getBoundingClientRect().top,t.scrollBy(0,r-i))):t.scrollTo(0,0)}function f(n){n=h(n)?n:i.hash();var t;n?(t=e.getElementById(n))?u(t):(t=o(e.getElementsByName(n)))?u(t):n==="top"&&u(null):u(null)}var e=t.document;return n&&r.$watch(function(){return i.hash()},function(n,t){(n!==t||n!=="")&&cv(function(){r.$evalAsync(f)})}),f}]}function dr(n,t){return!n&&!t?"":n?t?(a(n)&&(n=n.join(" ")),a(t)&&(t=t.join(" ")),n+" "+t):n:t}function iy(n){for(var i,t=0;t<n.length;t++)if(i=n[t],i.nodeType===ty)return i}function ry(n){h(n)&&(n=n.split(" "));var t=d();return r(n,function(n){n.length&&(t[n]=!0)}),t}function ai(n){return c(n)?n:{}}function sy(n,t,i,u){function d(n){try{n.apply(null,ar(arguments,1))}finally{if(l--,l===0)while(b.length)try{b.pop()()}catch(t){i.error(t)}}}function et(n){var t=n.indexOf("#");return t===-1?"":n.substr(t)}function tt(){y=null;it();rt()}function ht(){try{return p.state}catch(n){}}function it(){h=ht();h=f(h)?null:h;ot(h,k)&&(h=k);k=h}function rt(){(v!==e.url()||a!==h)&&(v=e.url(),a=h,r(g,function(n){n(e.url(),h)}))}var e=this,ct=t[0],c=n.location,p=n.history,ut=n.setTimeout,ft=n.clearTimeout,w={},l,b,g,nt,k;e.isMock=!1;l=0;b=[];e.$$completeOutstandingRequest=d;e.$$incOutstandingRequestCount=function(){l++};e.notifyWhenNoOutstandingRequests=function(n){l===0?n():b.push(n)};var h,a,v=c.href,st=t.find("base"),y=null;it();a=h;e.url=function(t,i,r){var s,o;return f(r)&&(r=null),c!==n.location&&(c=n.location),p!==n.history&&(p=n.history),t?(s=a===r,v===t&&(!u.history||s))?e:(o=v&&vi(v)===vi(t),v=t,a=r,!u.history||o&&s?((!o||y)&&(y=t),i?c.replace(t):o?c.hash=et(t):c.href=t,c.href!==t&&(y=t)):(p[i?"replaceState":"pushState"](r,"",t),it(),a=h),e):y||c.href.replace(/%27/g,"'")};e.state=function(){return h};g=[];nt=!1;k=null;e.onUrlChange=function(t){if(!nt){if(u.history)o(n).on("popstate",tt);o(n).on("hashchange",tt);nt=!0}return g.push(t),t};e.$$applicationDestroyed=function(){o(n).off("hashchange popstate",tt)};e.$$checkUrlChange=rt;e.baseHref=function(){var n=st.attr("href");return n?n.replace(/^(https?\:)?\/\/[^\/]*/,""):""};e.defer=function(n,t){var i;return l++,i=ut(function(){delete w[i];d(n)},t||0),w[i]=!0,i};e.defer.cancel=function(n){return w[n]?(delete w[n],ft(n),d(s),!0):!1}}function hy(){this.$get=["$window","$log","$sniffer","$document",function(n,t,i,r){return new sy(n,r,t,i)}]}function cy(){this.$get=function(){function t(t,i){function a(n){n!=o&&(r?r==n&&(r=n.n):r=n,c(n.n,n.p),c(n,o),o=n,o.n=null)}function c(n,t){n!=t&&(n&&(n.p=t),t&&(t.n=n))}if(t in n)throw y("$cacheFactory")("iid","CacheId '{0}' is already taken!",t);var s=0,l=p({},i,{id:t}),u=d(),h=i&&i.capacity||Number.MAX_VALUE,e=d(),o=null,r=null;return n[t]={put:function(n,t){if(!f(t)){if(h<Number.MAX_VALUE){var i=e[n]||(e[n]={key:n});a(i)}return n in u||s++,u[n]=t,s>h&&this.remove(r.key),t}},get:function(n){if(h<Number.MAX_VALUE){var t=e[n];if(!t)return;a(t)}return u[n]},remove:function(n){if(h<Number.MAX_VALUE){var t=e[n];if(!t)return;t==o&&(o=t.p);t==r&&(r=t.n);c(t.n,t.p);delete e[n]}n in u&&(delete u[n],s--)},removeAll:function(){u=d();s=0;e=d();o=r=null},destroy:function(){u=null;l=null;e=null;delete n[t]},info:function(){return p({},l,{size:s})}}}var n={};return t.info=function(){var t={};return r(n,function(n,i){t[i]=n.info()}),t},t.get=function(t){return n[t]},t}}function ly(){this.$get=["$cacheFactory",function(n){return n("templates")}]}function ks(n,u){function g(n,t,i){var f=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,u={};return r(n,function(n,r){var e=n.match(f);if(!e)throw tt("iscp","Invalid {3} for directive '{0}'. Definition: {... {1}: '{2}' ...}",t,r,n,i?"controller bindings definition":"isolate scope definition");u[r]={mode:e[1][0],collection:e[2]==="*",optional:e[3]==="?",attrName:e[4]||r}}),u}function et(n,t){var i={isolateScope:null,bindToController:null},r,u;if(c(n.scope)&&(n.bindToController===!0?(i.bindToController=g(n.scope,t,!0),i.isolateScope={}):i.isolateScope=g(n.scope,t,!1)),c(n.bindToController)&&(i.bindToController=g(n.bindToController,t,!0)),c(i.bindToController))if(r=n.controller,u=n.controllerAs,r){if(!ay(r,u))throw tt("noident","Cannot bind to controller without identifier for directive '{0}'.",t);}else throw tt("noctrl","Cannot bind to controller without directive '{0}'s controller.",t);return i}function st(n){var t=n.charAt(0);if(!t||t!==v(t))throw tt("baddir","Directive name '{0}' is invalid. The first character must be a lowercase letter",n);if(n!==n.trim())throw tt("baddir","Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces",n);}var b={},k="Directive",nt=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,it=/(([\w\-]+)(?:\:([^;]+))?;?)/,rt=ca("ngSrc,ngSrcset,src,srcset"),ut=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,ft=/^(on[a-z]+|formaction)$/,y;this.directive=function ct(t,i){return ki(t,"directive"),h(t)?(st(t),cu(i,"directiveFactory"),b.hasOwnProperty(t)||(b[t]=[],n.factory(t+k,["$injector","$exceptionHandler",function(n,i){var u=[];return r(b[t],function(r,f){var e,o;try{e=n.invoke(r);l(e)?e={compile:vt(e)}:!e.compile&&e.link&&(e.compile=vt(e.link));e.priority=e.priority||0;e.index=f;e.name=e.name||t;e.require=e.require||e.controller&&e.name;e.restrict=e.restrict||"EA";o=e.$$bindings=et(e,e.name);c(o.isolateScope)&&(e.$$isolateBindings=o.isolateScope);e.$$moduleName=r.$$moduleName;u.push(e)}catch(s){i(s)}}),u}])),b[t].push(i)):r(t,so(ct)),this};this.aHrefSanitizationWhitelist=function(n){return e(n)?(u.aHrefSanitizationWhitelist(n),this):u.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(n){return e(n)?(u.imgSrcSanitizationWhitelist(n),this):u.imgSrcSanitizationWhitelist()};y=!0;this.debugInfoEnabled=function(n){return e(n)?(y=n,this):y};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(n,u,e,g,et,st,ct,lt,at,vt,yt){function ti(n,t){try{n.addClass(t)}catch(i){}}function wt(n,t,i,u,f){var s,e;return n instanceof o||(n=o(n)),r(n,function(t,i){t.nodeType==di&&t.nodeValue.match(/\S+/)&&(n[i]=o(t).wrap("<span><\/span>").parent()[0])}),s=oi(n,t,n,i,u,f),wt.$$addScopeClass(n),e=null,function(t,i,r){var u,l;cu(t,"scope");f&&f.needsNewScope&&(t=t.$parent.$new());r=r||{};var h=r.parentBoundTranscludeFn,c=r.transcludeControllers,a=r.futureParentElement;if(h&&h.$$boundTransclude&&(h=h.$$boundTransclude),e||(e=fr(a)),u=e!=="html"?o(ci(e,o("<div>").append(n).html())):i?hi.clone.call(n):n,c)for(l in c)u.data("$"+l+"Controller",c[l].instance);return wt.$$addScopeInfo(u,t),i&&i(u,t),s&&s(t,u,u,h),u}}function fr(n){var t=n&&n[0];return t?bt(t)!=="foreignobject"&&t.toString().match(/SVG/)?"svg":"html":"html"}function oi(n,t,r,u,f,e){function b(n,r,u,f){var s,c,l,a,e,w,y,b,v,k;if(p)for(k=r.length,v=new Array(k),e=0;e<h.length;e+=3)y=h[e],v[y]=r[y];else v=r;for(e=0,w=h.length;e<w;)l=v[h[e++]],s=h[e++],c=h[e++],s?(s.scope?(a=n.$new(),wt.$$addScopeInfo(o(l),a)):a=n,b=s.transcludeOnThisElement?ii(n,s.transclude,f):!s.templateOnThisElement&&f?f:!f&&t?ii(n,t):null,s(c,a,l,u,b)):c&&c(n,l.childNodes,i,f)}for(var h=[],l,a,s,v,y,w,p,c=0;c<n.length;c++)l=new ei,a=si(n[c],[],l,c===0?u:i,f),s=a.length?bi(a,n[c],l,t,r,null,[],[],e):null,s&&s.scope&&wt.$$addScopeClass(l.$$element),y=s&&s.terminal||!(v=n[c].childNodes)||!v.length?null:oi(v,s?(s.transcludeOnThisElement||!s.templateOnThisElement)&&s.transclude:t),(s||y)&&(h.push(c,s,y),w=!0,p=p||s),e=null;return w?b:null}function ii(n,t,i){return function(r,u,f,e,o){return r||(r=n.$new(!1,o),r.$$transcluded=!0),t(r,u,{parentBoundTranscludeFn:i,transcludeControllers:f,futureParentElement:e})}}function si(n,t,i,r,u){var tt=n.nodeType,rt=i.$attr,o,s,k,d,g;switch(tt){case dt:ri(t,gt(bt(n)),"E",r,u);for(var l,e,f,a,v,y,p=n.attributes,b=0,ut=p&&p.length;b<ut;b++)k=!1,d=!1,l=p[b],e=l.name,v=w(l.value),a=gt(e),(y=ir.test(a))&&(e=e.replace(he,"").substr(8).replace(/_(.)/g,function(n,t){return t.toUpperCase()})),g=a.match(rr),g&&or(g[1])&&(k=e,d=e.substr(0,e.length-5)+"end",e=e.substr(0,e.length-6)),f=gt(e.toLowerCase()),rt[f]=e,(y||!i.hasOwnProperty(f))&&(i[f]=v,vs(n,f)&&(i[f]=!0)),yr(n,t,v,f,y),ri(t,f,"A",r,u,k,d);if(s=n.className,c(s)&&(s=s.animVal),h(s)&&s!=="")while(o=it.exec(s))f=gt(o[2]),ri(t,f,"C",r,u)&&(i[f]=w(o[3])),s=s.substr(o.index+o[0].length);break;case di:if(fi===11)while(n.parentNode&&n.nextSibling&&n.nextSibling.nodeType===di)n.nodeValue=n.nodeValue+n.nextSibling.nodeValue,n.parentNode.removeChild(n.nextSibling);lr(t,n.nodeValue);break;case au:try{o=nt.exec(n.nodeValue);o&&(f=gt(o[1]),ri(t,f,"M",r,u)&&(i[f]=w(o[2])))}catch(ft){}}return t.sort(cr),t}function pi(n,t,i){var r=[],u=0;if(t&&n.hasAttribute&&n.hasAttribute(t)){do{if(!n)throw tt("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",t,i);n.nodeType==dt&&(n.hasAttribute(t)&&u++,n.hasAttribute(i)&&u--);r.push(n);n=n.nextSibling}while(u>0)}else r.push(n);return o(r)}function wi(n,t,i){return function(r,u,f,e,o){return u=pi(u[0],t,i),n(r,u,f,e,o)}}function bi(n,r,u,f,s,v,y,p,b){function bi(n,t,i,r){n&&(i&&(n=wi(n,i,r)),n.require=k.require,n.directiveName=et,(g===k||k.$$isolateScope)&&(n=nr(n,{isolateScope:!0})),y.push(n));t&&(i&&(t=wi(t,i,r)),t.require=k.require,t.directiveName=et,(g===k||k.$$isolateScope)&&(t=nr(t,{isolateScope:!0})),p.push(t))}function hi(n,t,i,r){var u,s,f,l;if(h(t)){var e=t.match(ut),o=t.substring(e[0].length),c=e[1]||e[3],v=e[2]==="?";if(c==="^^"?i=i.parent():(u=r&&r[o],u=u&&u.instance),u||(s="$"+o+"Controller",u=c?i.inheritedData(s):i.data(s)),!u&&!v)throw tt("ctreq","Controller '{0}', required by directive '{1}', can't be found!",o,n);}else if(a(t))for(u=[],f=0,l=t.length;f<l;f++)u[f]=hi(n,t[f],i,r);return u||null}function rr(n,t,i,r,u,f){var h=d(),c,s;for(c in r){var e=r[c],l={$scope:e===g||e.$$isolateScope?u:f,$element:n,$attrs:t,$transclude:i},o=e.controller;o=="@"&&(o=t[e.name]);s=st(o,l,!0,e.controllerAs);h[e.name]=s;pt||n.data("$"+e.name+"Controller",s.instance)}return h}function lt(n,t,f,e,s){function st(n,t,r){var u;return er(n)||(r=t,t=n,n=i),pt&&(u=v),r||(r=pt?h.parent():h),s(n,t,u,r,rt)}var c,l,k,v,b,h,a,ut,d,et,tt,rt;r===f?(a=u,h=u.$$element):(h=o(f),a=new ei(h,u));k=t;g?l=t.$new(!0):ft&&(k=t.$parent);s&&(b=st,b.$$boundTransclude=s);ht&&(v=rr(h,a,b,ht,l,t));g&&(wt.$$addScopeInfo(h,l,!0,!(ct&&(ct===g||ct===g.$$originalDirective))),wt.$$addScopeClass(h,!0),l.$$isolateBindings=g.$$isolateBindings,ut=li(t,a,l,l.$$isolateBindings,g),ut&&l.$on("$destroy",ut));for(et in v){var nt=ht[et],w=v[et],ot=nt.$$bindings.bindToController;w.identifier&&ot&&(d=li(k,a,w.instance,ot,nt));tt=w();tt!==w.instance&&(w.instance=tt,h.data("$"+nt.name+"Controller",tt),d&&d(),d=li(k,a,w.instance,ot,nt))}for(it=0,vt=y.length;it<vt;it++)c=y[it],tr(c,c.isolateScope?l:t,h,a,c.require&&hi(c.directiveName,c.require,h,v),b);for(rt=t,g&&(g.template||g.templateUrl===null)&&(rt=l),n&&n(rt,f.childNodes,i,s),it=p.length-1;it>=0;it--)c=p[it],tr(c,c.isolateScope?l:t,h,a,c.require&&hi(c.directiveName,c.require,h,v),b)}var it,vt,gt,ri;b=b||{};var yt=-Number.MAX_VALUE,ft=b.newScopeDirective,ht=b.controllerDirectives,g=b.newIsolateScopeDirective,ct=b.templateDirective,ti=b.nonTlbTranscludeDirective,fi=!1,oi=!1,pt=b.hasElementTranscludeDirective,nt=u.$$element=o(r),k,et,ot,ii=v,bt=f,at,rt;for(it=0,vt=n.length;it<vt;it++){if(k=n[it],gt=k.$$start,ri=k.$$end,gt&&(nt=pi(r,gt,ri)),ot=i,yt>k.priority)break;if((rt=k.scope)&&(k.templateUrl||(c(rt)?(ni("new/isolated scope",g||ft,k,nt),g=k):ni("new/isolated scope",g,k,nt)),ft=ft||k),et=k.name,!k.templateUrl&&k.controller&&(rt=k.controller,ht=ht||d(),ni("'"+et+"' controller",ht[et],k,nt),ht[et]=k),(rt=k.transclude)&&(fi=!0,k.$$tlb||(ni("transclusion",ti,k,nt),ti=k),rt=="element"?(pt=!0,yt=k.priority,ot=nt,nt=u.$$element=o(t.createComment(" "+et+": "+u[et]+" ")),r=nt[0],ui(s,ar(ot),r),bt=wt(ot,f,yt,ii&&ii.name,{nonTlbTranscludeDirective:ti})):(ot=o(re(r)).contents(),nt.empty(),bt=wt(ot,f,i,i,{needsNewScope:k.$$isolateScope||k.$$newScope}))),k.template)if(oi=!0,ni("template",ct,k,nt),ct=k,rt=l(k.template)?k.template(nt,u):k.template,rt=yi(rt),k.replace){if(ii=k,ot=ie(rt)?[]:gs(ci(k.templateNamespace,w(rt))),r=ot[0],ot.length!=1||r.nodeType!==dt)throw tt("tplrt","Template for directive '{0}' must have exactly one root element. {1}",et,"");ui(s,nt,r);var ai={$attr:{}},vi=si(r,[],ai),di=n.splice(it+1,n.length-(it+1));(g||ft)&&ki(vi,g,ft);n=n.concat(vi).concat(di);gi(u,ai);vt=n.length}else nt.html(rt);if(k.templateUrl)oi=!0,ni("template",ct,k,nt),ct=k,k.replace&&(ii=k),lt=hr(n.splice(it,n.length-it),nt,u,s,fi&&bt,y,p,{controllerDirectives:ht,newScopeDirective:ft!==k&&ft,newIsolateScopeDirective:g,templateDirective:ct,nonTlbTranscludeDirective:ti}),vt=n.length;else if(k.compile)try{at=k.compile(nt,u,bt);l(at)?bi(null,at,gt,ri):at&&bi(at.pre,at.post,gt,ri)}catch(ir){e(ir,kt(nt))}k.terminal&&(lt.terminal=!0,yt=Math.max(yt,k.priority))}return lt.scope=ft&&ft.scope===!0,lt.transcludeOnThisElement=fi,lt.templateOnThisElement=oi,lt.transclude=bt,b.hasElementTranscludeDirective=pt,lt}function ki(n,t,i){for(var r=0,u=n.length;r<u;r++)n[r]=yf(n[r],{$$isolateScope:t,$$newScope:i})}function ri(t,i,r,u,o,s,h){var l;if(i===o)return null;if(l=null,b.hasOwnProperty(i))for(var c,v=n.get(i+k),a=0,y=v.length;a<y;a++)try{c=v[a];(f(u)||u>c.priority)&&c.restrict.indexOf(r)!=-1&&(s&&(c=yf(c,{$$start:s,$$end:h})),t.push(c),l=c)}catch(p){e(p)}return l}function or(t){if(b.hasOwnProperty(t))for(var r,u=n.get(t+k),i=0,f=u.length;i<f;i++)if(r=u[i],r.multiElement)return!0;return!1}function gi(n,t){var u=t.$attr,f=n.$attr,i=n.$$element;r(n,function(i,r){r.charAt(0)!="$"&&(t[r]&&t[r]!==i&&(i+=(r==="style"?";":" ")+t[r]),n.$set(r,i,!0,u[r]))});r(t,function(t,r){r=="class"?(ti(i,t),n["class"]=(n["class"]?n["class"]+" ":"")+t):r=="style"?(i.attr("style",i.attr("style")+";"+t),n.style=(n.style?n.style+";":"")+t):r.charAt(0)=="$"||n.hasOwnProperty(r)||(n[r]=t,f[r]=u[r])})}function hr(n,t,i,u,f,e,s,h){var v=[],y,p,b=t[0],a=n.shift(),d=yf(a,{templateUrl:null,transclude:null,replace:null,$$originalDirective:a}),k=l(a.templateUrl)?a.templateUrl(t,i):a.templateUrl,nt=a.templateNamespace;return t.empty(),g(k).then(function(l){var g,rt,ut,st,ft,ct;if(l=yi(l),a.replace){if(ut=ie(l)?[]:gs(ci(nt,w(l))),g=ut[0],ut.length!=1||g.nodeType!==dt)throw tt("tplrt","Template for directive '{0}' must have exactly one root element. {1}",a.name,k);rt={$attr:{}};ui(u,t,g);ft=si(g,[],rt);c(a.scope)&&ki(ft,!0);n=ft.concat(n);gi(i,rt)}else g=b,t.html(l);for(n.unshift(d),y=bi(n,g,i,f,t,a,e,s,h),r(u,function(n,i){n==g&&(u[i]=t[0])}),p=oi(t[0].childNodes,f);v.length;){var et=v.shift(),ot=v.shift(),lt=v.shift(),ht=v.shift(),it=t[0];et.$$destroyed||(ot!==b&&(ct=ot.className,h.hasElementTranscludeDirective&&a.replace||(it=re(g)),ui(lt,o(ot),it),ti(o(it),ct)),st=y.transcludeOnThisElement?ii(et,y.transclude,ht):ht,y(p,et,it,u,st))}v=null}),function(n,t,i,r,u){var f=u;t.$$destroyed||(v?v.push(t,i,r,f):(y.transcludeOnThisElement&&(f=ii(t,y.transclude,u)),y(p,t,i,r,f)))}}function cr(n,t){var i=t.priority-n.priority;return i!==0?i:n.name!==t.name?n.name<t.name?-1:1:n.index-t.index}function ni(n,t,i,r){function u(n){return n?" (module: "+n+")":""}if(t)throw tt("multidir","Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}",t.name,u(t.$$moduleName),i.name,u(i.$$moduleName),n,kt(r));}function lr(n,t){var i=u(t,!0);i&&n.push({priority:0,compile:function(n){var t=n.parent(),r=!!t.length;return r&&wt.$$addBindingClass(t),function(n,t){var u=t.parent();r||wt.$$addBindingClass(u);wt.$$addBindingInfo(u,i.expressions);n.$watch(i,function(n){t[0].nodeValue=n})}}})}function ci(n,i){n=v(n||"html");switch(n){case"svg":case"math":var r=t.createElement("div");return r.innerHTML="<"+n+">"+i+"<\/"+n+">",r.childNodes[0].childNodes;default:return i}}function vr(n,t){if(t=="srcdoc")return at.HTML;var i=bt(n);if(t=="xlinkHref"||i=="form"&&t=="action"||i!="img"&&(t=="src"||t=="ngSrc"))return at.RESOURCE_URL}function yr(n,t,i,r,f){var o=vr(n,r),e;if(f=rt[r]||f,e=u(i,!0,o,f),e){if(r==="multiple"&&bt(n)==="select")throw tt("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",kt(n));t.push({priority:100,compile:function(){return{pre:function(n,t,s){var c=s.$$observers||(s.$$observers=d()),h;if(ft.test(r))throw tt("nodomevents","Interpolations for HTML DOM event attributes are disallowed.  Please use the ng- versions (such as ng-click instead of onclick) instead.");(h=s[r],h!==i&&(e=h&&u(h,!0,o,f),i=h),e)&&(s[r]=e(n),(c[r]||(c[r]=[])).$$inter=!0,(s.$$observers&&s.$$observers[r].$$scope||n).$watch(e,function(n,t){r==="class"&&n!=t?s.$updateClass(n,t):s.$set(r,n)}))}}}})}}function ui(n,i,r){var u=i[0],a=i.length,v=u.parentNode,f,y,c,s,w,l;if(n)for(f=0,y=n.length;f<y;f++)if(n[f]==u){n[f++]=r;for(var e=f,h=e+a-1,p=n.length;e<p;e++,h++)h<p?n[e]=n[h]:delete n[e];n.length-=a-1;n.context===u&&(n.context=r);break}for(v&&v.replaceChild(r,u),c=t.createDocumentFragment(),c.appendChild(u),o.hasData(u)&&(o.data(r,o.data(u)),ht?(gf=!0,ht.cleanData([u])):delete o.cache[u[o.expando]]),s=1,w=i.length;s<w;s++)l=i[s],o(l).remove(),c.appendChild(l),delete i[s];i[0]=r;i.length=1}function nr(n,t){return p(function(){return n.apply(null,arguments)},n,t)}function tr(n,t,i,r,u,f){try{n(t,i,r,u,f)}catch(o){e(o,kt(i))}}function li(n,t,i,f,e){var o=[];return r(f,function(r,f){var c=r.attrName,a=r.optional,k=r.mode,v,l,w,p,y,b;switch(k){case"@":a||pt.call(t,c)||(i[f]=t[c]=void 0);t.$observe(c,function(n){h(n)&&(i[f]=n)});t.$$observers[c].$$scope=n;h(t[c])&&(i[f]=u(t[c])(n));break;case"=":if(!pt.call(t,c)){if(a)break;t[c]=void 0}if(a&&!t[c])break;l=et(t[c]);p=l.literal?ot:function(n,t){return n===t||n!==n&&t!==t};w=l.assign||function(){v=i[f]=l(n);throw tt("nonassign","Expression '{0}' used with directive '{1}' is non-assignable!",t[c],e.name);};v=i[f]=l(n);y=function(t){return p(t,i[f])||(p(t,v)?w(n,t=i[f]):i[f]=t),v=t};y.$stateful=!0;b=r.collection?n.$watchCollection(t[c],y):n.$watch(et(t[c],y),null,l.literal);o.push(b);break;case"&":if(l=t.hasOwnProperty(c)?et(t[c]):s,l===s&&a)break;i[f]=function(t){return l(n,t)}}}),o.length&&function(){for(var n=0,t=o.length;n<t;++n)o[n]()}}var ei=function(n,t){if(t)for(var u=Object.keys(t),r,i=0,f=u.length;i<f;i++)r=u[i],this[r]=t[r];else this.$attr={};this.$$element=n};ei.prototype={$normalize:gt,$addClass:function(n){n&&n.length>0&&vt.addClass(this.$$element,n)},$removeClass:function(n){n&&n.length>0&&vt.removeClass(this.$$element,n)},$updateClass:function(n,t){var r=ds(n,t),i;r&&r.length&&vt.addClass(this.$$element,r);i=ds(t,n);i&&i.length&&vt.removeClass(this.$$element,i)},$set:function(n,t,i,u){var d=this.$$element[0],p=vs(d,n),a=lv(n),b=n,h,s,v,l,y;if(p?(this.$$element.prop(n,t),u=p):a&&(this[a]=t,b=a),this[n]=t,u?this.$attr[n]=u:(u=this.$attr[n],u||(this.$attr[n]=u=is(n,"-"))),h=bt(this.$$element),h==="a"&&n==="href"||h==="img"&&n==="src")this[n]=t=yt(t,n==="src");else if(h==="img"&&n==="srcset"){var o="",k=w(t),g=/\s/.test(k)?/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/:/(,)/,c=k.split(g),nt=Math.floor(c.length/2);for(s=0;s<nt;s++)v=s*2,o+=yt(w(c[v]),!0),o+=" "+w(c[v+1]);l=w(c[s*2]).split(/\s/);o+=yt(w(l[0]),!0);l.length===2&&(o+=" "+w(l[1]));this[n]=t=o}i!==!1&&(t===null||f(t)?this.$$element.removeAttr(u):this.$$element.attr(u,t));y=this.$$observers;y&&r(y[b],function(n){try{n(t)}catch(i){e(i)}})},$observe:function(n,t){var i=this,u=i.$$observers||(i.$$observers=d()),r=u[n]||(u[n]=[]);return r.push(t),ct.$evalAsync(function(){r.$$inter||!i.hasOwnProperty(n)||f(i[n])||t(i[n])}),function(){sr(r,t)}}};var ai=u.startSymbol(),vi=u.endSymbol(),yi=ai=="{{"||vi=="}}"?ur:function(n){return n.replace(/\{\{/g,ai).replace(/}}/g,vi)},ir=/^ngAttr[A-Z]/,rr=/^(.+)Start$/;return wt.$$addBindingInfo=y?function(n,t){var i=n.data("$binding")||[];a(t)?i=i.concat(t):i.push(t);n.data("$binding",i)}:s,wt.$$addBindingClass=y?function(n){ti(n,"ng-binding")}:s,wt.$$addScopeInfo=y?function(n,t,i,r){var u=i?r?"$isolateScopeNoTemplate":"$isolateScope":"$scope";n.data(u,t)}:s,wt.$$addScopeClass=y?function(n,t){ti(n,t?"ng-isolate-scope":"ng-scope")}:s,wt}]}function gt(n){return wr(n.replace(he,""))}function ds(n,t){var u="",e=n.split(/\s+/),o=t.split(/\s+/),i,f,r;n:for(i=0;i<e.length;i++){for(f=e[i],r=0;r<o.length;r++)if(f==o[r])continue n;u+=(u.length>0?" ":"")+f}return u}function gs(n){var t,i;if(n=o(n),t=n.length,t<=1)return n;while(t--)i=n[t],i.nodeType===au&&ra.call(n,t,1);return n}function ay(n,t){if(t&&h(t))return t;if(h(n)){var i=ce.exec(n);if(i)return i[3]}}function vy(){var n={},t=!1;this.register=function(t,i){ki(t,"controller");c(t)?p(n,t):n[t]=i};this.allowGlobals=function(){t=!0};this.$get=["$injector","$window",function(r,u){function f(n,t,i,r){if(!(n&&c(n.$scope)))throw y("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",r,t);n.$scope[t]=i}return function(e,o,s,v){var y,k,w,b,d;if(s=s===!0,v&&h(v)&&(b=v),h(e)){if(k=e.match(ce),!k)throw nh("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",e);w=k[1];b=b||k[3];e=n.hasOwnProperty(w)?n[w]:rs(o.$scope,w,!0)||(t?rs(u,w,!0):i);bi(e,w,!0)}return s?(d=(a(e)?e[e.length-1]:e).prototype,y=Object.create(d||null),b&&f(o,b,y,w||e.name),p(function(){var n=r.invoke(e,y,o,w);return n!==y&&(c(n)||l(n))&&(y=n,b&&f(o,b,y,w||e.name)),y},{instance:y,identifier:b})):(y=r.instantiate(e,o,w),b&&f(o,b,y,w||e.name),y)}}]}function yy(){this.$get=["$window",function(n){return o(n.document)}]}function py(){this.$get=["$log",function(n){return function(){n.error.apply(n,arguments)}}]}function ae(n){return c(n)?et(n)?n.toISOString():vr(n):n}function np(){this.$get=function(){return function(n){if(!n)return"";var t=[];return oo(n,function(n,i){n===null||f(n)||(a(n)?r(n,function(n){t.push(lt(i)+"="+lt(ae(n)))}):t.push(lt(i)+"="+lt(ae(n))))}),t.join("&")}}}function tp(){this.$get=function(){return function(n){function t(n,u,e){n===null||f(n)||(a(n)?r(n,function(n,i){t(n,u+"["+(c(n)?i:"")+"]")}):c(n)&&!et(n)?oo(n,function(n,i){t(n,u+(e?"":"[")+i+(e?"":"]"))}):i.push(lt(u)+"="+lt(ae(n))))}if(!n)return"";var i=[];return t(n,"",!0),i.join("&")}}}function ve(n,t){var i,r;return h(n)&&(i=n.replace(dy,"").trim(),i&&(r=t("Content-Type"),(r&&r.indexOf(th)===0||ip(i))&&(n=wo(i)))),n}function ip(n){var t=n.match(by);return t&&ky[t[0]].test(n)}function rh(n){function u(n,i){n&&(t[n]=t[n]?t[n]+", "+i:i)}var t=d(),i;return h(n)?r(n.split("\n"),function(n){i=n.indexOf(":");u(v(w(n.substr(0,i))),w(n.substr(i+1)))}):c(n)&&r(n,function(n,t){u(v(t),w(n))}),t}function uh(n){var t;return function(i){if(t||(t=rh(n)),i){var r=t[v(i)];return r===void 0&&(r=null),r}return t}}function fh(n,t,i,u){return l(u)?u(n,t,i):(r(u,function(r){n=r(n,t,i)}),n)}function ye(n){return 200<=n&&n<300}function rp(){var n=this.defaults={transformResponse:[ve],transformRequest:[function(n){return c(n)&&!oa(n)&&!ha(n)&&!sa(n)?vr(n):n}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ct(le),put:ct(le),patch:ct(le)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},u=!1,t,o;this.useApplyAsync=function(n){return e(n)?(u=!!n,this):u};t=!0;this.useLegacyPromiseExtensions=function(n){return e(n)?(t=!!n,this):t};o=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(s,w,b,k,d,g){function nt(u){function w(n){var t=p({},n);return t.data=fh(n.data,n.headers,n.status,e.transformResponse),ye(n.status)?t:d.reject(t)}function k(n,t){var i,u={};return r(n,function(n,r){l(n)?(i=n(t),i!=null&&(u[r]=i)):u[r]=n}),u}function nt(t){var i=n.headers,u=p({},t.headers),r,f,e;i=p({},i.common,i[v(t.method)]);n:for(r in i){f=v(r);for(e in u)if(v(e)===f)continue n;u[r]=i[r]}return k(u,ct(t))}var e,c,a;if(!ft.isObject(u))throw y("$http")("badreq","Http request configuration must be an object.  Received: {0}",u);e=p({method:"get",transformRequest:n.transformRequest,transformResponse:n.transformResponse,paramSerializer:n.paramSerializer},u);e.headers=nt(u);e.method=ir(e.method);e.paramSerializer=h(e.paramSerializer)?g.get(e.paramSerializer):e.paramSerializer;var b=function(t){var u=t.headers,e=fh(t.data,uh(u),i,t.transformRequest);return f(e)&&r(u,function(n,t){v(t)==="content-type"&&delete u[t]}),f(t.withCredentials)&&!f(n.withCredentials)&&(t.withCredentials=n.withCredentials),et(t,e).then(w,w)},s=[b,i],o=d.when(e);for(r(tt,function(n){(n.request||n.requestError)&&s.unshift(n.request,n.requestError);(n.response||n.responseError)&&s.push(n.response,n.responseError)});s.length;)c=s.shift(),a=s.shift(),o=o.then(c,a);return t?(o.success=function(n){return bi(n,"fn"),o.then(function(t){n(t.data,t.status,t.headers,e)}),o},o.error=function(n){return bi(n,"fn"),o.then(null,function(t){n(t.data,t.status,t.headers,e)}),o}):(o.success=ih("success"),o.error=ih("error")),o}function rt(){r(arguments,function(n){nt[n]=function(t,i){return nt(p({},i||{},{method:n,url:t}))}})}function ut(){r(arguments,function(n){nt[n]=function(t,i,r){return nt(p({},r||{},{method:n,url:t,data:i}))}})}function et(t,r){function ut(n,t,i,r){function f(){v(t,n,i,r)}h&&(ye(n)?h.put(l,[n,t,rh(i),r]):h.remove(l));u?k.$applyAsync(f):(f(),k.$$phase||k.$apply())}function v(n,i,r,u){i=i>=-1?i:0;(ye(i)?y.resolve:y.reject)({data:n,status:i,headers:uh(r),config:t,statusText:u})}function tt(n){v(n.data,n.status,ct(n.headers()),n.statusText)}function rt(){var n=nt.pendingRequests.indexOf(t);n!==-1&&nt.pendingRequests.splice(n,1)}var y=d.defer(),p=y.promise,h,o,g=t.headers,l=ot(t.url,t.paramSerializer(t.params)),b;return nt.pendingRequests.push(t),p.then(rt,rt),(t.cache||n.cache)&&t.cache!==!1&&(t.method==="GET"||t.method==="JSONP")&&(h=c(t.cache)?t.cache:c(n.cache)?n.cache:it),h&&(o=h.get(l),e(o)?su(o)?o.then(tt,tt):a(o)?v(o[1],o[0],ct(o[2]),o[3]):v(o,200,{},"OK"):h.put(l,p)),f(o)&&(b=ec(t.url)?w()[t.xsrfCookieName||n.xsrfCookieName]:i,b&&(g[t.xsrfHeaderName||n.xsrfHeaderName]=b),s(t.method,l,r,ut,g,t.timeout,t.withCredentials,t.responseType)),p}function ot(n,t){return t.length>0&&(n+=(n.indexOf("?")==-1?"?":"&")+t),n}var it=b("$http"),tt;return n.paramSerializer=h(n.paramSerializer)?g.get(n.paramSerializer):n.paramSerializer,tt=[],r(o,function(n){tt.unshift(h(n)?g.get(n):g.invoke(n))}),nt.pendingRequests=[],rt("get","delete","head","jsonp"),ut("post","put","patch"),nt.defaults=n,nt}]}function up(){this.$get=function(){return function(){return new n.XMLHttpRequest}}}function fp(){this.$get=["$browser","$window","$document","$xhrFactory",function(n,t,i,r){return ep(n,r,n.defer,t.angular.callbacks,i[0])}]}function ep(n,t,i,u,o){function h(n,t,i){var r=o.createElement("script"),f=null;return r.type="text/javascript",r.src=n,r.async=!0,f=function(n){pr(r,"load",f);pr(r,"error",f);o.body.removeChild(r);r=null;var e=-1,s="unknown";n&&(n.type!=="load"||u[t].called||(n={type:"error"}),s=n.type,e=n.type==="error"?404:200);i&&i(e,s)},vu(r,"load",f),vu(r,"error",f),o.body.appendChild(r),f}return function(o,c,l,a,y,p,w,b){function rt(){g&&g();k&&k.abort()}function it(t,r,u,f,o){e(tt)&&i.cancel(tt);g=k=null;t(r,u,f,o);n.$$completeOutstandingRequest(s)}var d,g,k,nt,tt;if(n.$$incOutstandingRequestCount(),c=c||n.url(),v(o)=="jsonp")d="_"+(u.counter++).toString(36),u[d]=function(n){u[d].data=n;u[d].called=!0},g=h(c.replace("JSON_CALLBACK","angular.callbacks."+d),d,function(n,t){it(a,n,u[d].data,"",t);u[d]=s});else{if(k=t(o,c),k.open(o,c,!0),r(y,function(n,t){e(n)&&k.setRequestHeader(t,n)}),k.onload=function(){var i=k.statusText||"",t="response"in k?k.response:k.responseText,n=k.status===1223?204:k.status;n===0&&(n=t?200:ui(c).protocol=="file"?404:0);it(a,n,t,k.getAllResponseHeaders(),i)},nt=function(){it(a,-1,null,null,"")},k.onerror=nt,k.onabort=nt,w&&(k.withCredentials=!0),b)try{k.responseType=b}catch(ut){if(b!=="json")throw ut;}k.send(f(l)?null:l)}p>0?tt=i(rt,p):su(p)&&p.then(rt)}}function op(){var n="{{",t="}}";this.startSymbol=function(t){return t?(n=t,this):n};this.endSymbol=function(n){return n?(t=n,this):t};this.$get=["$parse","$exceptionHandler","$sce",function(i,r,u){function h(n){return"\\\\\\"+n}function c(i){return i.replace(v,n).replace(y,t)}function w(n){if(n==null)return"";switch(typeof n){case"string":break;case"number":n=""+n;break;default:n=vr(n)}return n}function o(o,h,v,y){function ot(n){try{return n=et(n),y&&!e(n)?n:w(n)}catch(t){r(ii.interr(o,t))}}var rt,et;y=!!y;for(var d,nt,b=0,g=[],tt=[],ut=o.length,it,k=[],ft=[];b<ut;)if((d=o.indexOf(n,b))!=-1&&(nt=o.indexOf(t,d+s))!=-1)b!==d&&k.push(c(o.substring(b,d))),it=o.substring(d+s,nt),g.push(it),tt.push(i(it,ot)),b=nt+a,ft.push(k.length),k.push("");else{b!==ut&&k.push(c(o.substring(b)));break}return v&&k.length>1&&ii.throwNoconcat(o),!h||g.length?(rt=function(n){for(var t=0,i=g.length;t<i;t++){if(y&&f(n[t]))return;k[ft[t]]=n[t]}return k.join("")},et=function(n){return v?u.getTrusted(v,n):u.valueOf(n)},p(function(n){var t=0,i=g.length,u=new Array(i);try{for(;t<i;t++)u[t]=tt[t](n);return rt(u)}catch(f){r(ii.interr(o,f))}},{exp:o,expressions:g,$$watchDelegate:function(n,t){var i;return n.$watchGroup(tt,function(r,u){var f=rt(r);l(t)&&t.call(this,f,r!==u?i:f,n);i=f})}})):void 0}var s=n.length,a=t.length,v=new RegExp(n.replace(/./g,h),"g"),y=new RegExp(t.replace(/./g,h),"g");return o.startSymbol=function(){return n},o.endSymbol=function(){return t},o}]}function sp(){this.$get=["$rootScope","$window","$q","$$q",function(n,t,i,r){function f(f,o,s,h){var v=arguments.length>4,p=v?ar(arguments,4):[],w=t.setInterval,b=t.clearInterval,a=0,y=e(h)&&!h,l=(y?r:i).defer(),c=l.promise;return s=e(s)?s:0,c.then(null,null,v?function(){f.apply(null,p)}:f),c.$$intervalId=w(function(){l.notify(a++);s>0&&a>=s&&(l.resolve(a),b(c.$$intervalId),delete u[c.$$intervalId]);y||n.$apply()},o),u[c.$$intervalId]=l,c}var u={};return f.cancel=function(n){return n&&n.$$intervalId in u?(u[n.$$intervalId].reject("canceled"),t.clearInterval(n.$$intervalId),delete u[n.$$intervalId],!0):!1},f}]}function pe(n){for(var t=n.split("/"),i=t.length;i--;)t[i]=hu(t[i]);return t.join("/")}function eh(n,t){var i=ui(n);t.$$protocol=i.protocol;t.$$host=i.hostname;t.$$port=ut(i.port)||cp[i.protocol]||null}function oh(n,t){var r=n.charAt(0)!=="/",i;r&&(n="/"+n);i=ui(n);t.$$path=decodeURIComponent(r&&i.pathname.charAt(0)==="/"?i.pathname.substring(1):i.pathname);t.$$search=go(i.search);t.$$hash=decodeURIComponent(i.hash);t.$$path&&t.$$path.charAt(0)!="/"&&(t.$$path="/"+t.$$path)}function yt(n,t){if(t.indexOf(n)===0)return t.substr(n.length)}function vi(n){var t=n.indexOf("#");return t==-1?n:n.substr(0,t)}function gr(n){return n.replace(/(#.+)|#$/,"$1")}function lp(n){return n.substr(0,vi(n).lastIndexOf("/")+1)}function ap(n){return n.substring(0,n.indexOf("/",n.indexOf("//")+2))}function we(n,t,i){this.$$html5=!0;i=i||"";eh(n,this);this.$$parse=function(n){var i=yt(t,n);if(!h(i))throw tf("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',n,t);oh(i,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var n=kf(this.$$search),i=this.$$hash?"#"+hu(this.$$hash):"";this.$$url=pe(this.$$path)+(n?"?"+n:"")+i;this.$$absUrl=t+this.$$url.substr(1)};this.$$parseLinkUrl=function(r,u){if(u&&u[0]==="#")return this.hash(u.slice(1)),!0;var f,s,o;return e(f=yt(n,r))?(s=f,o=e(f=yt(i,f))?t+(yt("/",f)||f):n+s):e(f=yt(t,r))?o=t+f:t==r+"/"&&(o=t),o&&this.$$parse(o),!!o}}function be(n,t,i){eh(n,this);this.$$parse=function(r){function o(n,t,i){var u=/^\/[A-Z]:(\/.*)/,r;return(t.indexOf(i)===0&&(t=t.replace(i,"")),u.exec(t))?n:(r=u.exec(n),r?r[1]:n)}var e=yt(n,r)||yt(t,r),u;f(e)||e.charAt(0)!=="#"?this.$$html5?u=e:(u="",f(e)&&(n=r,this.replace())):(u=yt(i,e),f(u)&&(u=e));oh(u,this);this.$$path=o(this.$$path,u,n);this.$$compose()};this.$$compose=function(){var t=kf(this.$$search),r=this.$$hash?"#"+hu(this.$$hash):"";this.$$url=pe(this.$$path)+(t?"?"+t:"")+r;this.$$absUrl=n+(this.$$url?i+this.$$url:"")};this.$$parseLinkUrl=function(t){return vi(n)==vi(t)?(this.$$parse(t),!0):!1}}function sh(n,t,i){this.$$html5=!0;be.apply(this,arguments);this.$$parseLinkUrl=function(r,u){if(u&&u[0]==="#")return this.hash(u.slice(1)),!0;var f,e;return n==vi(r)?f=r:(e=yt(t,r))?f=n+i+e:t===r+"/"&&(f=t),f&&this.$$parse(f),!!f};this.$$compose=function(){var t=kf(this.$$search),r=this.$$hash?"#"+hu(this.$$hash):"";this.$$url=pe(this.$$path)+(t?"?"+t:"")+r;this.$$absUrl=n+i+this.$$url}}function rf(n){return function(){return this[n]}}function ch(n,t){return function(i){return f(i)?this[n]:(this[n]=t(i),this.$$compose(),this)}}function vp(){var t="",n={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(n){return e(n)?(t=n,this):t};this.html5Mode=function(t){return or(t)?(n.enabled=t,this):c(t)?(or(t.enabled)&&(n.enabled=t.enabled),or(t.requireBase)&&(n.requireBase=t.requireBase),or(t.rewriteLinks)&&(n.rewriteLinks=t.rewriteLinks),this):n};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(i,r,u,e,s){function k(n,t,i){var u=h.url(),f=h.$$state;try{r.url(n,t,i);h.$$state=r.state()}catch(e){h.url(u);h.$$state=f;throw e;}}function d(n,t){i.$broadcast("$locationChangeSuccess",h.absUrl(),n,h.$$state,t)}var h,y,w=r.baseHref(),l=r.url(),a,p,b,v;if(n.enabled){if(!w&&n.requireBase)throw tf("nobase","$location in HTML5 mode requires a <base> tag to be present!");a=ap(l)+(w||"/");y=u.history?we:sh}else a=vi(l),y=be;p=lp(a);h=new y(a,p,"#"+t);h.$$parseLinkUrl(l,l);h.$$state=r.state();b=/^\s*(javascript|mailto):/i;e.on("click",function(t){var u,f,l;if(n.rewriteLinks&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&t.which!=2&&t.button!=2){for(u=o(t.target);bt(u[0])!=="a";)if(u[0]===e[0]||!(u=u.parent())[0])return;(f=u.prop("href"),l=u.attr("href")||u.attr("xlink:href"),c(f)&&f.toString()==="[object SVGAnimatedString]"&&(f=ui(f.animVal).href),b.test(f))||!f||u.attr("target")||t.isDefaultPrevented()||h.$$parseLinkUrl(f,l)&&(t.preventDefault(),h.absUrl()!=r.url()&&(i.$apply(),s.angular["ff-684208-preventDefault"]=!0))}});gr(h.absUrl())!=gr(l)&&r.url(h.absUrl(),!0);v=!0;r.onUrlChange(function(n,t){if(f(yt(p,n))){s.location.href=n;return}i.$evalAsync(function(){var r=h.absUrl(),u=h.$$state,f;(n=gr(n),h.$$parse(n),h.$$state=t,f=i.$broadcast("$locationChangeStart",n,r,t,u).defaultPrevented,h.absUrl()===n)&&(f?(h.$$parse(r),h.$$state=u,k(r,!1,u)):(v=!1,d(r,u)))});i.$$phase||i.$digest()});return i.$watch(function(){var t=gr(r.url()),e=gr(h.absUrl()),n=r.state(),o=h.$$replace,f=t!==e||h.$$html5&&u.history&&n!==h.$$state;(v||f)&&(v=!1,i.$evalAsync(function(){var r=h.absUrl(),u=i.$broadcast("$locationChangeStart",r,t,h.$$state,n).defaultPrevented;h.absUrl()===r&&(u?(h.$$parse(t),h.$$state=n):(f&&k(r,o,n===h.$$state?null:h.$$state),d(t,n)))}));h.$$replace=!1}),h}]}function yp(){var n=!0,t=this;this.debugEnabled=function(t){return e(t)?(n=t,this):n};this.$get=["$window",function(i){function f(n){return n instanceof Error&&(n.stack?n=n.message&&n.stack.indexOf(n.message)===-1?"Error: "+n.message+"\n"+n.stack:n.stack:n.sourceURL&&(n=n.message+"\n"+n.sourceURL+":"+n.line)),n}function u(n){var t=i.console||{},u=t[n]||t.log||s,e=!1;try{e=!!u.apply}catch(o){}return e?function(){var n=[];return r(arguments,function(t){n.push(f(t))}),u.apply(t,n)}:function(n,t){u(n,t==null?"":t)}}return{log:u("log"),info:u("info"),warn:u("warn"),error:u("error"),debug:function(){var i=u("debug");return function(){n&&i.apply(t,arguments)}}()}}]}function nr(n,t){if(n==="__defineGetter__"||n==="__defineSetter__"||n==="__lookupGetter__"||n==="__lookupSetter__"||n==="__proto__")throw it("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);return n}function lh(n,t){if(n=n+"",!h(n))throw it("iseccst","Cannot convert object to primitive value! Expression: {0}",t);return n}function ri(n,t){if(n)if(n.constructor===n)throw it("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);else if(n.window===n)throw it("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);else if(n.children&&(n.nodeName||n.prop&&n.attr&&n.find))throw it("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);else if(n===Object)throw it("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t);return n}function ah(n,t){if(n)if(n.constructor===n)throw it("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);else if(n===pp||n===wp||n===bp)throw it("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t);}function vh(n,t){if(n&&(n===0..constructor||n===(!1).constructor||n==="".constructor||n==={}.constructor||n===[].constructor||n===Function.constructor))throw it("isecaf","Assigning to a constructor is disallowed! Expression: {0}",t);}function kp(n,t){return typeof n!="undefined"?n:t}function ph(n,t){return typeof n=="undefined"?t:typeof t=="undefined"?n:n+t}function wh(n,t){var i=n(t);return!i.$stateful}function g(n,t){var i,f;switch(n.type){case u.Program:i=!0;r(n.body,function(n){g(n.expression,t);i=i&&n.expression.constant});n.constant=i;break;case u.Literal:n.constant=!0;n.toWatch=[];break;case u.UnaryExpression:g(n.argument,t);n.constant=n.argument.constant;n.toWatch=n.argument.toWatch;break;case u.BinaryExpression:g(n.left,t);g(n.right,t);n.constant=n.left.constant&&n.right.constant;n.toWatch=n.left.toWatch.concat(n.right.toWatch);break;case u.LogicalExpression:g(n.left,t);g(n.right,t);n.constant=n.left.constant&&n.right.constant;n.toWatch=n.constant?[]:[n];break;case u.ConditionalExpression:g(n.test,t);g(n.alternate,t);g(n.consequent,t);n.constant=n.test.constant&&n.alternate.constant&&n.consequent.constant;n.toWatch=n.constant?[]:[n];break;case u.Identifier:n.constant=!1;n.toWatch=[n];break;case u.MemberExpression:g(n.object,t);n.computed&&g(n.property,t);n.constant=n.object.constant&&(!n.computed||n.property.constant);n.toWatch=[n];break;case u.CallExpression:i=n.filter?wh(t,n.callee.name):!1;f=[];r(n.arguments,function(n){g(n,t);i=i&&n.constant;n.constant||f.push.apply(f,n.toWatch)});n.constant=i;n.toWatch=n.filter&&wh(t,n.callee.name)?f:[n];break;case u.AssignmentExpression:g(n.left,t);g(n.right,t);n.constant=n.left.constant&&n.right.constant;n.toWatch=[n];break;case u.ArrayExpression:i=!0;f=[];r(n.elements,function(n){g(n,t);i=i&&n.constant;n.constant||f.push.apply(f,n.toWatch)});n.constant=i;n.toWatch=f;break;case u.ObjectExpression:i=!0;f=[];r(n.properties,function(n){g(n.value,t);i=i&&n.value.constant;n.value.constant||f.push.apply(f,n.value.toWatch)});n.constant=i;n.toWatch=f;break;case u.ThisExpression:n.constant=!1;n.toWatch=[]}}function bh(n){if(n.length==1){var r=n[0].expression,t=r.toWatch;return t.length!==1?t:t[0]!==r?t:i}}function kh(n){return n.type===u.Identifier||n.type===u.MemberExpression}function dh(n){if(n.body.length===1&&kh(n.body[0].expression))return{type:u.AssignmentExpression,left:n.body[0].expression,right:{type:u.NGValueParameter},operator:"="}}function gh(n){return n.body.length===0||n.body.length===1&&(n.body[0].expression.type===u.Literal||n.body[0].expression.type===u.ArrayExpression||n.body[0].expression.type===u.ObjectExpression)}function nc(n){return n.constant}function tc(n,t){this.astBuilder=n;this.$filter=t}function ic(n,t){this.astBuilder=n;this.$filter=t}function ef(n){return n=="constructor"}function ke(n){return l(n.valueOf)?n.valueOf():rc.call(n)}function nw(){var n=d(),t=d();this.$get=["$filter",function(u){function f(n,t){return n==null||t==null?n===t:typeof n=="object"&&(n=ke(n),typeof n=="object")?!1:n===t||n!==n&&t!==t}function o(n,t,r,u,e){var o=u.inputs,h,a,c,l,s,v;if(o.length===1)return a=f,o=o[0],n.$watch(function(n){var t=o(n);return f(t,a)||(h=u(n,i,i,[t]),a=t&&ke(t)),h},t,r,e);for(c=[],l=[],s=0,v=o.length;s<v;s++)c[s]=f,l[s]=null;return n.$watch(function(n){for(var r,e=!1,t=0,s=o.length;t<s;t++)r=o[t](n),(e||(e=!f(r,c[t])))&&(l[t]=r,c[t]=r&&ke(r));return e&&(h=u(n,i,i,l)),h},t,r,e)}function c(n,t,i,r){var u,f;return u=n.$watch(function(n){return r(n)},function(n,i,r){f=n;l(t)&&t.apply(this,arguments);e(n)&&r.$$postDigest(function(){e(f)&&u()})},i)}function a(n,t,i,u){function s(n){var t=!0;return r(n,function(n){e(n)||(t=!1)}),t}var f,o;return f=n.$watch(function(n){return u(n)},function(n,i,r){o=n;l(t)&&t.call(this,n,i,r);s(n)&&r.$$postDigest(function(){s(o)&&f()})},i)}function w(n,t,i,r){var u;return u=n.$watch(function(n){return r(n)},function(){l(t)&&t.apply(this,arguments);u()},i)}function v(n,t){if(!t)return n;var r=n.$$watchDelegate,u=!1,f=r!==a&&r!==c,i=f?function(i,r,f,e){var o=u&&e?e[0]:n(i,r,f,e);return t(o,i,r)}:function(i,r,u,f){var o=n(i,r,u,f),s=t(o,i,r);return e(o)?s:o};return n.$$watchDelegate&&n.$$watchDelegate!==o?i.$$watchDelegate=n.$$watchDelegate:t.$stateful||(i.$$watchDelegate=o,u=!n.inputs,i.inputs=n.inputs?n.inputs:[n]),i}var h=ti().noUnsafeEval,y={csp:h,expensiveChecks:!1},p={csp:h,expensiveChecks:!0};return function(i,r,f){var e,b,h,l;switch(typeof i){case"string":if(i=i.trim(),h=i,l=f?t:n,e=l[h],!e){i.charAt(0)===":"&&i.charAt(1)===":"&&(b=!0,i=i.substring(2));var k=f?p:y,d=new uf(k),g=new ff(d,u,k);e=g.parse(i);e.constant?e.$$watchDelegate=w:b?e.$$watchDelegate=e.literal?a:c:e.inputs&&(e.$$watchDelegate=o);l[h]=e}return v(e,r);case"function":return v(i,r);default:return s}}}]}function tw(){this.$get=["$rootScope","$exceptionHandler",function(n,t){return uc(function(t){n.$evalAsync(t)},t)}]}function iw(){this.$get=["$browser","$exceptionHandler",function(n,t){return uc(function(t){n.defer(t)},t)}]}function uc(n,t){function g(n,t,i){function u(t){return function(i){r||(r=!0,t.call(n,i))}}var r=!1;return[u(t),u(i)]}function b(){this.$$state={status:0}}function s(n,t){return function(i){t.call(n,i)}}function tt(n){var e,r,f,u,o;for(f=n.pending,n.processScheduled=!1,n.pending=i,u=0,o=f.length;u<o;++u){r=f[u][0];e=f[u][n.status];try{l(e)?r.resolve(e(n.value)):n.status===1?r.resolve(n.value):r.reject(n.value)}catch(s){r.reject(s);t(s)}}}function h(t){!t.processScheduled&&t.pending&&(t.processScheduled=!0,n(function(){tt(t)}))}function u(){this.promise=new b;this.resolve=s(this,this.resolve);this.reject=s(this,this.reject);this.notify=s(this,this.notify)}function ut(n){var i=new u,f=0,t=a(n)?[]:{};return r(n,function(n,r){f++;v(n).then(function(n){t.hasOwnProperty(r)||(t[r]=n,--f||i.resolve(t))},function(n){t.hasOwnProperty(r)||i.reject(n)})}),f===0&&i.resolve(t),i.promise}var w=y("$q",TypeError),nt=function(){return new u},e;p(b.prototype,{then:function(n,t,i){if(f(n)&&f(t)&&f(i))return this;var r=new u;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([r,n,t,i]),this.$$state.status>0&&h(this.$$state),r.promise},"catch":function(n){return this.then(null,n)},"finally":function(n,t){return this.then(function(t){return k(t,!0,n)},function(t){return k(t,!1,n)},t)}});p(u.prototype,{resolve:function(n){this.promise.$$state.status||(n===this.promise?this.$$reject(w("qcycle","Expected promise to be resolved with value other than itself '{0}'",n)):this.$$resolve(n))},$$resolve:function(n){var i,r=g(this,this.$$resolve,this.$$reject);try{(c(n)||l(n))&&(i=n&&n.then);l(i)?(this.promise.$$state.status=-1,i.call(n,r[0],r[1],this.notify)):(this.promise.$$state.value=n,this.promise.$$state.status=1,h(this.promise.$$state))}catch(u){r[1](u);t(u)}},reject:function(n){this.promise.$$state.status||this.$$reject(n)},$$reject:function(n){this.promise.$$state.value=n;this.promise.$$state.status=2;h(this.promise.$$state)},notify:function(i){var r=this.promise.$$state.pending;this.promise.$$state.status<=0&&r&&r.length&&n(function(){for(var u,f,n=0,e=r.length;n<e;n++){f=r[n][0];u=r[n][3];try{f.notify(l(u)?u(i):i)}catch(o){t(o)}}})}});var it=function(n){var t=new u;return t.reject(n),t.promise},o=function(n,t){var i=new u;return t?i.resolve(n):i.reject(n),i.promise},k=function(n,t,i){var r=null;try{l(i)&&(r=i())}catch(u){return o(u,!1)}return su(r)?r.then(function(){return o(n,t)},function(n){return o(n,!1)}):o(n,t)},v=function(n,t,i,r){var f=new u;return f.resolve(n),f.promise.then(t,i,r)},rt=v;return e=function d(n){function i(n){t.resolve(n)}function r(n){t.reject(n)}if(!l(n))throw w("norslvr","Expected resolverFn, got '{0}'",n);if(!(this instanceof d))return new d(n);var t=new u;return n(i,r),t.promise},e.defer=nt,e.reject=it,e.when=v,e.resolve=rt,e.all=ut,e}function rw(){this.$get=["$window","$timeout",function(n,t){var i=n.requestAnimationFrame||n.webkitRequestAnimationFrame,f=n.cancelAnimationFrame||n.webkitCancelAnimationFrame||n.webkitCancelRequestAnimationFrame,r=!!i,u=r?function(n){var t=i(n);return function(){f(t)}}:function(n){var i=t(n,16.66,!1);return function(){t.cancel(i)}};return u.supported=r,u}]}function uw(){function e(n){function t(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=ou();this.$$ChildScope=null}return t.prototype=n,t}var i=10,u=y("$rootScope"),n=null,t=null;this.digestTtl=function(n){return arguments.length&&(i=n),i};this.$get=["$injector","$exceptionHandler","$parse","$browser",function(o,h,a,v){function ft(n){n.currentScope.$$destroyed=!0}function b(n){fi===9&&(n.$$childHead&&b(n.$$childHead),n.$$nextSibling&&b(n.$$nextSibling));n.$parent=n.$$nextSibling=n.$$prevSibling=n.$$childHead=n.$$childTail=n.$root=n.$$watchers=null}function w(){this.$id=ou();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function tt(n){if(y.$$phase)throw u("inprog","{0} already in progress",y.$$phase);y.$$phase=n}function g(){y.$$phase=null}function nt(n,t){do n.$$watchersCount+=t;while(n=n.$parent)}function it(n,t,i){do n.$$listenerCount[i]-=t,n.$$listenerCount[i]===0&&delete n.$$listenerCount[i];while(n=n.$parent)}function rt(){}function ut(){while(d.length)try{d.shift()()}catch(n){h(n)}t=null}function et(){t===null&&(t=v.defer(function(){y.$apply(ut)}))}w.prototype={constructor:w,$new:function(n,t){var i;return t=t||this,n?(i=new w,i.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=e(this)),i=new this.$$ChildScope),i.$parent=t,i.$$prevSibling=t.$$childTail,t.$$childHead?(t.$$childTail.$$nextSibling=i,t.$$childTail=i):t.$$childHead=t.$$childTail=i,(n||t!=this)&&i.$on("$destroy",ft),i},$watch:function(t,i,r,u){var f=a(t);if(f.$$watchDelegate)return f.$$watchDelegate(this,i,r,f,t);var o=this,e=o.$$watchers,h={fn:i,last:rt,get:f,exp:u||t,eq:!!r};return n=null,l(i)||(h.fn=s),e||(e=o.$$watchers=[]),e.unshift(h),nt(this,1),function(){sr(e,h)>=0&&nt(o,-1);n=null}},$watchGroup:function(n,t){function c(){o=!1;h?(h=!1,t(i,i,u)):t(i,f,u)}var f=new Array(n.length),i=new Array(n.length),e=[],u=this,o=!1,h=!0,s;return n.length?n.length===1?this.$watch(n[0],function(n,r,u){i[0]=n;f[0]=r;t(i,n===r?i:f,u)}):(r(n,function(n,t){var r=u.$watch(n,function(n,r){i[t]=n;f[t]=r;o||(o=!0,u.$evalAsync(c))});e.push(r)}),function(){while(e.length)e.shift()()}):(s=!0,u.$evalAsync(function(){s&&t(i,i,u)}),function(){s=!1})},$watchCollection:function(n,t){function y(n){var a,o,y,t,s,v;if(i=n,!f(i)){if(c(i))if(oi(i))for(r!==h&&(r=h,e=r.length=0,u++),a=i.length,e!==a&&(u++,r.length=e=a),v=0;v<a;v++)s=r[v],t=i[v],y=s!==s&&t!==t,y||s===t||(u++,r[v]=t);else{r!==l&&(r=l={},e=0,u++);a=0;for(o in i)pt.call(i,o)&&(a++,t=i[o],s=r[o],o in r?(y=s!==s&&t!==t,y||s===t||(u++,r[o]=t)):(e++,r[o]=t,u++));if(e>a){u++;for(o in r)pt.call(i,o)||(e--,delete r[o])}}else r!==i&&(r=i,u++);return u}}function b(){var n,r;if(v?(v=!1,t(i,i,s)):t(i,o,s),p)if(c(i))if(oi(i))for(o=new Array(i.length),n=0;n<i.length;n++)o[n]=i[n];else{o={};for(r in i)pt.call(i,r)&&(o[r]=i[r])}else o=i}y.$stateful=!0;var s=this,i,r,o,p=t.length>1,u=0,w=a(n,y),h=[],l={},v=!0,e=0;return this.$watch(w,b)},$digest:function(){var r,e,o,b,d,s,nt=i,it,f,ft=this,c=[],a,w;tt("$digest");v.$$checkUrlChange();this===y&&t!==null&&(v.defer.cancel(t),ut());n=null;do{for(s=!1,f=ft;p.length;){try{w=p.shift();w.scope.$eval(w.expression,w.locals)}catch(et){h(et)}n=null}n:do{if(b=f.$$watchers)for(d=b.length;d--;)try{if(r=b[d],r)if((e=r.get(f))===(o=r.last)||(r.eq?ot(e,o):typeof e=="number"&&typeof o=="number"&&isNaN(e)&&isNaN(o))){if(r===n){s=!1;break n}}else s=!0,n=r,r.last=r.eq?hr(e,null):e,r.fn(e,o===rt?e:o,f),nt<5&&(a=4-nt,c[a]||(c[a]=[]),c[a].push({msg:l(r.exp)?"fn: "+(r.exp.name||r.exp.toString()):r.exp,newVal:e,oldVal:o}))}catch(et){h(et)}if(!(it=f.$$watchersCount&&f.$$childHead||f!==ft&&f.$$nextSibling))while(f!==ft&&!(it=f.$$nextSibling))f=f.$parent}while(f=it);if((s||p.length)&&!nt--){g();throw u("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",i,c);}}while(s||p.length);for(g();k.length;)try{k.shift()()}catch(et){h(et)}},$destroy:function(){var n,t;if(!this.$$destroyed){n=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===y&&v.$$applicationDestroyed();nt(this,-this.$$watchersCount);for(t in this.$$listenerCount)it(this,this.$$listenerCount[t],t);n&&n.$$childHead==this&&(n.$$childHead=this.$$nextSibling);n&&n.$$childTail==this&&(n.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=s;this.$on=this.$watch=this.$watchGroup=function(){return s};this.$$listeners={};this.$$nextSibling=null;b(this)}},$eval:function(n,t){return a(n)(this,t)},$evalAsync:function(n,t){y.$$phase||p.length||v.defer(function(){p.length&&y.$digest()});p.push({scope:this,expression:n,locals:t})},$$postDigest:function(n){k.push(n)},$apply:function(n){try{tt("$apply");try{return this.$eval(n)}finally{g()}}catch(t){h(t)}finally{try{y.$digest()}catch(t){h(t);throw t;}}},$applyAsync:function(n){function i(){t.$eval(n)}var t=this;n&&d.push(i);et()},$on:function(n,t){var r=this.$$listeners[n],i,u;r||(this.$$listeners[n]=r=[]);r.push(t);i=this;do i.$$listenerCount[n]||(i.$$listenerCount[n]=0),i.$$listenerCount[n]++;while(i=i.$parent);return u=this,function(){var i=r.indexOf(t);i!==-1&&(r[i]=null,it(u,1,n))}},$emit:function(n){var o=[],u,r=this,e=!1,t={name:n,targetScope:r,stopPropagation:function(){e=!0},preventDefault:function(){t.defaultPrevented=!0},defaultPrevented:!1},s=lr([t],arguments,1),i,f;do{for(u=r.$$listeners[n]||o,t.currentScope=r,i=0,f=u.length;i<f;i++){if(!u[i]){u.splice(i,1);i--;f--;continue}try{u[i].apply(null,s)}catch(c){h(c)}}if(e)return t.currentScope=null,t;r=r.$parent}while(r);return t.currentScope=null,t},$broadcast:function(n){var r=this,t=r,e=r,u={name:n,targetScope:r,preventDefault:function(){u.defaultPrevented=!0},defaultPrevented:!1},s,f,i,o;if(!r.$$listenerCount[n])return u;for(s=lr([u],arguments,1);t=e;){for(u.currentScope=t,f=t.$$listeners[n]||[],i=0,o=f.length;i<o;i++){if(!f[i]){f.splice(i,1);i--;o--;continue}try{f[i].apply(null,s)}catch(c){h(c)}}if(!(e=t.$$listenerCount[n]&&t.$$childHead||t!==r&&t.$$nextSibling))while(t!==r&&!(e=t.$$nextSibling))t=t.$parent}return u.currentScope=null,u}};var y=new w,p=y.$$asyncQueue=[],k=y.$$postDigestQueue=[],d=y.$$applyAsyncQueue=[];return y}]}function fw(){var n=/^\s*(https?|ftp|mailto|tel|file):/,t=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(t){return e(t)?(n=t,this):n};this.imgSrcSanitizationWhitelist=function(n){return e(n)?(t=n,this):t};this.$get=function(){return function(i,r){var f=r?t:n,u;return(u=ui(i).href,u!==""&&!u.match(f))?"unsafe:"+u:i}}}function ew(n){if(n==="self")return n;if(h(n)){if(n.indexOf("***")>-1)throw ni("iwcard","Illegal sequence *** in string matcher.  String: {0}",n);return n=pf(n).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+n+"$")}if(wi(n))return new RegExp("^"+n.source+"$");throw ni("imatcher",'Matchers may only be "self", string patterns or RegExp objects');}function fc(n){var t=[];return e(n)&&r(n,function(n){t.push(ew(n))}),t}function ow(){this.SCE_CONTEXTS=st;var n=["self"],t=[];this.resourceUrlWhitelist=function(t){return arguments.length&&(n=fc(t)),n};this.resourceUrlBlacklist=function(n){return arguments.length&&(t=fc(n)),t};this.$get=["$injector",function(i){function s(n,t){return n==="self"?ec(t):!!n.exec(t.href)}function h(i){for(var e=ui(i.toString()),f=!1,r=0,u=n.length;r<u;r++)if(s(n[r],e)){f=!0;break}if(f)for(r=0,u=t.length;r<u;r++)if(s(t[r],e)){f=!1;break}return f}function u(n){var t=function(n){this.$$unwrapTrustedValue=function(){return n}};return n&&(t.prototype=new n),t.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},t.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},t}function c(n,t){var i=r.hasOwnProperty(n)?r[n]:null;if(!i)throw ni("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",n,t);if(t===null||f(t)||t==="")return t;if(typeof t!="string")throw ni("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",n);return new i(t)}function l(n){return n instanceof e?n.$$unwrapTrustedValue():n}function a(n,t){if(t===null||f(t)||t==="")return t;var i=r.hasOwnProperty(n)?r[n]:null;if(i&&t instanceof i)return t.$$unwrapTrustedValue();if(n===st.RESOURCE_URL){if(h(t))return t;throw ni("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}",t.toString());}else if(n===st.HTML)return o(t);throw ni("unsafe","Attempting to use an unsafe value in a safe context.");}var o=function(){throw ni("unsafe","Attempting to use an unsafe value in a safe context.");},e,r;return i.has("$sanitize")&&(o=i.get("$sanitize")),e=u(),r={},r[st.HTML]=u(e),r[st.CSS]=u(e),r[st.URL]=u(e),r[st.JS]=u(e),r[st.RESOURCE_URL]=u(r[st.URL]),{trustAs:c,getTrusted:a,valueOf:l}}]}function sw(){var n=!0;this.enabled=function(t){return arguments.length&&(n=!!t),n};this.$get=["$parse","$sceDelegate",function(t,i){var u;if(n&&fi<8)throw ni("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode.  You can fix this by adding the text <!doctype html> to the top of your HTML document.  See http://docs.angularjs.org/api/ng.$sce for more information.");u=ct(st);u.isEnabled=function(){return n};u.trustAs=i.trustAs;u.getTrusted=i.getTrusted;u.valueOf=i.valueOf;n||(u.trustAs=u.getTrusted=function(n,t){return t},u.valueOf=ur);u.parseAs=function(n,i){var r=t(i);return r.literal&&r.constant?r:t(i,function(t){return u.getTrusted(n,t)})};var f=u.parseAs,e=u.getTrusted,o=u.trustAs;return r(st,function(n,t){var i=v(t);u[wr("parse_as_"+i)]=function(t){return f(n,t)};u[wr("get_trusted_"+i)]=function(t){return e(n,t)};u[wr("trust_as_"+i)]=function(t){return o(n,t)}}),u}]}function hw(){this.$get=["$window","$document",function(n,t){var o={},s=ut((/android (\d+)/.exec(v((n.navigator||{}).userAgent))||[])[1]),y=/Boxee/i.test((n.navigator||{}).userAgent),c=t[0]||{},i,r=c.body&&c.body.style,u=!1,e=!1,l,a;if(r){for(a in r)if(l=/^(Moz|webkit|ms)(?=[A-Z])/.exec(a)){i=l[0];i=i.substr(0,1).toUpperCase()+i.substr(1);break}i||(i="WebkitOpacity"in r&&"webkit");u=!!("transition"in r||i+"Transition"in r);e=!!("animation"in r||i+"Animation"in r);!s||u&&e||(u=h(r.webkitTransition),e=h(r.webkitAnimation))}return{history:!!(n.history&&n.history.pushState&&!(s<4)&&!y),hasEvent:function(n){if(n==="input"&&fi<=11)return!1;if(f(o[n])){var t=c.createElement("div");o[n]="on"+n in t}return o[n]},csp:ti(),vendorPrefix:i,transitions:u,animations:e,android:s}}]}function cw(){this.$get=["$templateCache","$http","$q","$sce",function(n,t,i,r){function u(f,e){function c(n){if(!e)throw tt("tpload","Failed to load template: {0} (HTTP status: {1} {2})",f,n.status,n.statusText);return i.reject(n)}var o,s;return u.totalPendingRequests++,h(f)&&n.get(f)||(f=r.getTrustedResourceUrl(f)),o=t.defaults&&t.defaults.transformResponse,a(o)?o=o.filter(function(n){return n!==ve}):o===ve&&(o=null),s={cache:n,transformResponse:o},t.get(f,s)["finally"](function(){u.totalPendingRequests--}).then(function(t){return n.put(f,t.data),t.data},c)}return u.totalPendingRequests=0,u}]}function lw(){this.$get=["$rootScope","$browser","$location",function(n,t,i){var u={};return u.findBindings=function(n,t,i){var f=n.getElementsByClassName("ng-binding"),u=[];return r(f,function(n){var f=ft.element(n).data("$binding");f&&r(f,function(r){if(i){var f=new RegExp("(^|\\s)"+pf(t)+"(\\s|\\||$)");f.test(r)&&u.push(n)}else r.indexOf(t)!=-1&&u.push(n)})}),u},u.findModels=function(n,t,i){for(var u=["ng-","data-ng-","ng\\:"],r=0;r<u.length;++r){var e=i?"=":"*=",o="["+u[r]+"model"+e+'"'+t+'"]',f=n.querySelectorAll(o);if(f.length)return f}},u.getLocation=function(){return i.url()},u.setLocation=function(t){t!==i.url()&&(i.url(t),n.$digest())},u.whenStable=function(n){t.notifyWhenNoOutstandingRequests(n)},u}]}function aw(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(n,t,i,r,u){function o(o,h,c){l(o)||(c=h,h=o,o=s);var w=ar(arguments,3),p=e(c)&&!c,a=(p?r:i).defer(),v=a.promise,y;return y=t.defer(function(){try{a.resolve(o.apply(null,w))}catch(t){a.reject(t);u(t)}finally{delete f[v.$$timeoutId]}p||n.$apply()},h),v.$$timeoutId=y,f[y]=a,v}var f={};return o.cancel=function(n){return n&&n.$$timeoutId in f?(f[n.$$timeoutId].reject("canceled"),delete f[n.$$timeoutId],t.defer.cancel(n.$$timeoutId)):!1},o}]}function ui(n){var t=n;return fi&&(nt.setAttribute("href",t),t=nt.href),nt.setAttribute("href",t),{href:nt.href,protocol:nt.protocol?nt.protocol.replace(/:$/,""):"",host:nt.host,search:nt.search?nt.search.replace(/^\?/,""):"",hash:nt.hash?nt.hash.replace(/^#/,""):"",hostname:nt.hostname,port:nt.port,pathname:nt.pathname.charAt(0)==="/"?nt.pathname:"/"+nt.pathname}}function ec(n){var t=h(n)?ui(n):n;return t.protocol===de.protocol&&t.host===de.host}function vw(){this.$get=vt(n)}function oc(n){function r(n){try{return decodeURIComponent(n)}catch(t){return n}}var u=n[0]||{},t={},i="";return function(){var s,n,e,o,h,c=u.cookie||"";if(c!==i)for(i=c,s=i.split("; "),t={},e=0;e<s.length;e++)n=s[e],o=n.indexOf("="),o>0&&(h=r(n.substring(0,o)),f(t[h])&&(t[h]=r(n.substring(o+1))));return t}}function yw(){this.$get=oc}function sc(n){function t(u,f){if(c(u)){var e={};return r(u,function(n,i){e[i]=t(i,n)}),e}return n.factory(u+i,f)}var i="Filter";this.register=t;this.$get=["$injector",function(n){return function(t){return n.get(t+i)}}];t("currency",hc);t("date",yc);t("filter",pw);t("json",rb);t("limitTo",ub);t("lowercase",pc);t("number",cc);t("orderBy",bc);t("uppercase",wc)}function pw(){return function(n,t,i){if(!oi(n)){if(n==null)return n;throw y("filter")("notarray","Expected array but received: {0}",n);}var f=ge(t),r,u;switch(f){case"function":r=t;break;case"boolean":case"null":case"number":case"string":u=!0;case"object":r=ww(t,i,u);break;default:return n}return Array.prototype.filter.call(n,r)}}function ww(n,t,i){var r=c(n)&&"$"in n;return t===!0?t=ot:l(t)||(t=function(n,t){return f(n)?!1:n===null||t===null?n===t:c(t)||c(n)&&!co(n)?!1:(n=v(""+n),t=v(""+t),n.indexOf(t)!==-1)}),function(u){return r&&!c(u)?yi(u,n.$,t,!1):yi(u,n,t,i)}}function yi(n,t,i,r,u){var v=ge(n),h=ge(t),e,o,s,c;if(h==="string"&&t.charAt(0)==="!")return!yi(n,t.substring(1),i,r);if(a(n))return n.some(function(n){return yi(n,t,i,r)});switch(v){case"object":if(r){for(e in n)if(e.charAt(0)!=="$"&&yi(n[e],t,i,!0))return!0;return u?!1:yi(n,t,i,!1)}if(h==="object"){for(e in t)if((o=t[e],!l(o)&&!f(o))&&(s=e==="$",c=s?n:n[e],!yi(c,o,i,s,s)))return!1;return!0}return i(n,t);case"function":return!1;default:return i(n,t)}}function ge(n){return n===null?"null":typeof n}function hc(n){var t=n.NUMBER_FORMATS;return function(n,i,r){return f(i)&&(i=t.CURRENCY_SYM),f(r)&&(r=t.PATTERNS[1].maxFrac),n==null?n:lc(n,t.PATTERNS[1],t.GROUP_SEP,t.DECIMAL_SEP,r).replace(/\u00A4/g,i)}}function cc(n){var t=n.NUMBER_FORMATS;return function(n,i){return n==null?n:lc(n,t.PATTERNS[0],t.GROUP_SEP,t.DECIMAL_SEP,i)}}function lc(n,t,i,r,u){var a,l,y,d,s,h;if(c(n)||(a=n<0,n=Math.abs(n),l=n===Infinity,!l&&!isFinite(n)))return"";var v=n+"",e="",b=!1,k=[];if(l&&(e="∞"),l||v.indexOf("e")===-1||(y=v.match(/([\d\.]+)e(-?)(\d+)/),y&&y[2]=="-"&&y[3]>u+1?n=0:(e=v,b=!0)),l||b)u>0&&n<1&&(e=n.toFixed(u),n=parseFloat(e),e=e.replace(of,r));else{d=(v.split(of)[1]||"").length;f(u)&&(u=Math.min(Math.max(t.minFrac,d),t.maxFrac));n=+(Math.round(+(n.toString()+"e"+u)).toString()+"e"+-u);s=(""+n).split(of);h=s[0];s=s[1]||"";var o,p=0,w=t.lgSize,g=t.gSize;if(h.length>=w+g)for(p=h.length-w,o=0;o<p;o++)(p-o)%g==0&&o!==0&&(e+=i),e+=h.charAt(o);for(o=p;o<h.length;o++)(h.length-o)%w==0&&o!==0&&(e+=i),e+=h.charAt(o);while(s.length<u)s+="0";u&&u!=="0"&&(e+=r+s.substr(0,u))}return n===0&&(a=!1),k.push(a?t.negPre:t.posPre,e,a?t.negSuf:t.posSuf),k.join("")}function sf(n,t,i){var r="";for(n<0&&(r="-",n=-n),n=""+n;n.length<t;)n="0"+n;return i&&(n=n.substr(n.length-t)),r+n}function rt(n,t,i,r){return i=i||0,function(u){var f=u["get"+n]();return(i>0||f>-i)&&(f+=i),f===0&&i==-12&&(f=12),sf(f,t,r)}}function hf(n,t){return function(i,r){var u=i["get"+n](),f=ir(t?"SHORT"+n:n);return r[f][u]}}function bw(n,t,i){var r=-1*i,u=r>=0?"+":"";return u+(sf(Math[r>0?"floor":"ceil"](r/60),2)+sf(Math.abs(r%60),2))}function ac(n){var t=new Date(n,0,1).getDay();return new Date(n,0,(t<=4?5:12)-t)}function kw(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate()+(4-n.getDay()))}function vc(n){return function(t){var i=ac(t.getFullYear()),r=kw(t),u=+r-+i,f=1+Math.round(u/6048e5);return sf(f,n)}}function dw(n,t){return n.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function no(n,t){return n.getFullYear()<=0?t.ERAS[0]:t.ERAS[1]}function gw(n,t){return n.getFullYear()<=0?t.ERANAMES[0]:t.ERANAMES[1]}function yc(n){function i(n){var i;if(i=n.match(t)){var r=new Date(0),u=0,f=0,e=i[8]?r.setUTCFullYear:r.setFullYear,o=i[8]?r.setUTCHours:r.setHours;i[9]&&(u=ut(i[9]+i[10]),f=ut(i[9]+i[11]));e.call(r,ut(i[1]),ut(i[2])-1,ut(i[3]));var s=ut(i[4]||0)-u,h=ut(i[5]||0)-f,c=ut(i[6]||0),l=Math.round(parseFloat("0."+(i[7]||0))*1e3);return o.call(r,s,h,c,l),r}return n}var t=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(t,u,f){var l="",e=[],o,s,c;if(u=u||"mediumDate",u=n.DATETIME_FORMATS[u]||u,h(t)&&(t=ib.test(t)?ut(t):i(t)),k(t)&&(t=new Date(t)),!et(t)||!isFinite(t.getTime()))return t;while(u)s=tb.exec(u),s?(e=lr(e,s,1),u=e.pop()):(e.push(u),u=null);return c=t.getTimezoneOffset(),f&&(c=bo(f,t.getTimezoneOffset()),t=bf(t,f,!0)),r(e,function(i){o=nb[i];l+=o?o(t,n.DATETIME_FORMATS,c):i.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}}function rb(){return function(n,t){return f(t)&&(t=2),vr(n,t)}}function ub(){return function(n,t,i){return(t=Math.abs(Number(t))===Infinity?Number(t):ut(t),isNaN(t))?n:(k(n)&&(n=n.toString()),!a(n)&&!h(n))?n:(i=!i||isNaN(i)?0:ut(i),i=i<0?Math.max(0,n.length+i):i,t>=0?n.slice(i,i+t):i===0?n.slice(t,n.length):n.slice(Math.max(0,i+t),i))}}function bc(n){function i(t,i){return i=i?-1:1,t.map(function(t){var u=1,r=ur,f;return l(t)?r=t:h(t)&&((t.charAt(0)=="+"||t.charAt(0)=="-")&&(u=t.charAt(0)=="-"?-1:1,t=t.substring(1)),t!==""&&(r=n(t),r.constant&&(f=r(),r=function(n){return n[f]}))),{get:r,descending:u*i}})}function t(n){switch(typeof n){case"number":case"boolean":case"string":return!0;default:return!1}}function r(n,i){return typeof n.valueOf=="function"&&(n=n.valueOf(),t(n))?n:co(n)&&(n=n.toString(),t(n))?n:i}function u(n,t){var i=typeof n;return n===null?(i="string",n="null"):i==="string"?n=n.toLowerCase():i==="object"&&(n=r(n,t)),{value:n,type:i}}function f(n,t){var i=0;return n.type===t.type?n.value!==t.value&&(i=n.value<t.value?-1:1):i=n.type<t.type?-1:1,i}return function(n,t,r){function s(n,t){return{value:n,predicateValues:e.map(function(i){return u(i.get(n),t)})}}function h(n,t){for(var r=0,i=0,u=e.length;i<u;++i)if(r=f(n.predicateValues[i],t.predicateValues[i])*e[i].descending,r)break;return r}var e,o;return oi(n)?(a(t)||(t=[t]),t.length===0&&(t=["+"]),e=i(t,r),e.push({get:function(){return{}},descending:r?-1:1}),o=Array.prototype.map.call(n,s),o.sort(h),o.map(function(n){return n.value})):n}}function pi(n){return l(n)&&(n={link:n}),n.restrict=n.restrict||"AC",vt(n)}function fb(n,t){n.$name=t}function dc(n,t,u,f,e){var o=this,s=[];o.$error={};o.$$success={};o.$pending=i;o.$name=e(t.name||t.ngForm||"")(u);o.$dirty=!1;o.$pristine=!0;o.$valid=!0;o.$invalid=!1;o.$submitted=!1;o.$$parentForm=iu;o.$rollbackViewValue=function(){r(s,function(n){n.$rollbackViewValue()})};o.$commitViewValue=function(){r(s,function(n){n.$commitViewValue()})};o.$addControl=function(n){ki(n.$name,"input");s.push(n);n.$name&&(o[n.$name]=n);n.$$parentForm=o};o.$$renameControl=function(n,t){var i=n.$name;o[i]===n&&delete o[i];o[t]=n;n.$name=t};o.$removeControl=function(n){n.$name&&o[n.$name]===n&&delete o[n.$name];r(o.$pending,function(t,i){o.$setValidity(i,null,n)});r(o.$error,function(t,i){o.$setValidity(i,null,n)});r(o.$$success,function(t,i){o.$setValidity(i,null,n)});sr(s,n);n.$$parentForm=iu};al({ctrl:this,$element:n,set:function(n,t,i){var r=n[t],u;r?(u=r.indexOf(i),u===-1&&r.push(i)):n[t]=[i]},unset:function(n,t,i){var r=n[t];r&&(sr(r,i),r.length===0&&delete n[t])},$animate:f});o.$setDirty=function(){f.removeClass(n,tr);f.addClass(n,lf);o.$dirty=!0;o.$pristine=!1;o.$$parentForm.$setDirty()};o.$setPristine=function(){f.setClass(n,tr,lf+" "+to);o.$dirty=!1;o.$pristine=!0;o.$submitted=!1;r(s,function(n){n.$setPristine()})};o.$setUntouched=function(){r(s,function(n){n.$setUntouched()})};o.$setSubmitted=function(){f.addClass(n,to);o.$submitted=!0;o.$$parentForm.$setSubmitted()}}function ro(n){n.$formatters.push(function(t){return n.$isEmpty(t)?t:t.toString()})}function ab(n,t,i,r,u,f){ru(n,t,i,r,u,f);ro(r)}function ru(n,t,i,r,u,f){var c=v(t[0].type),s,o,e,h;if(!u.android){s=!1;t.on("compositionstart",function(){s=!0});t.on("compositionend",function(){s=!1;o()})}if(o=function(n){if(e&&(f.defer.cancel(e),e=null),!s){var u=t.val(),o=n&&n.type;c==="password"||i.ngTrim&&i.ngTrim==="false"||(u=w(u));(r.$viewValue!==u||u===""&&r.$$hasNativeValidators)&&r.$setViewValue(u,o)}},u.hasEvent("input"))t.on("input",o);else{h=function(n,t,i){e||(e=f.defer(function(){e=null;t&&t.value===i||o(n)}))};t.on("keydown",function(n){var t=n.keyCode;t===91||15<t&&t<19||37<=t&&t<=40||h(n,this,this.value)});if(u.hasEvent("paste"))t.on("paste cut",h)}t.on("change",o);r.$render=function(){var n=r.$isEmpty(r.$viewValue)?"":r.$viewValue;t.val()!==n&&t.val(n)}}function vb(n,t){var i;if(et(n))return n;if(h(n)&&(io.lastIndex=0,i=io.exec(n),i)){var r=+i[1],s=+i[2],u=0,f=0,e=0,o=0,c=ac(r),l=(s-1)*7;return t&&(u=t.getHours(),f=t.getMinutes(),e=t.getSeconds(),o=t.getMilliseconds()),new Date(r,0,c.getDate()+l,u,f,e,o)}return NaN}function cf(n,t){return function(i,u){var e,f;if(et(i))return i;if(h(i)){if(i.charAt(0)=='"'&&i.charAt(i.length-1)=='"'&&(i=i.substring(1,i.length-1)),sb.test(i))return new Date(i);if(n.lastIndex=0,e=n.exec(i),e)return e.shift(),f=u?{yyyy:u.getFullYear(),MM:u.getMonth()+1,dd:u.getDate(),HH:u.getHours(),mm:u.getMinutes(),ss:u.getSeconds(),sss:u.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(n,i){i<t.length&&(f[t[i]]=+n)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,f.sss*1e3||0)}return NaN}}function uu(n,t,r,u){return function(o,s,h,c,l,a,v){function k(n){return n&&!(n.getTime&&n.getTime()!==n.getTime())}function d(n){return e(n)&&!et(n)?r(n)||i:n}var y,p,w,b;fl(o,s,h,c);ru(o,s,h,c,l,a);y=c&&c.$options&&c.$options.timezone;c.$$parserName=n;c.$parsers.push(function(n){if(c.$isEmpty(n))return null;if(t.test(n)){var u=r(n,p);return y&&(u=bf(u,y)),u}return i});c.$formatters.push(function(n){if(n&&!et(n))throw eu("datefmt","Expected `{0}` to be a date",n);return k(n)?(p=n,p&&y&&(p=bf(p,y,!0)),v("date")(n,u,y)):(p=null,"")});(e(h.min)||h.ngMin)&&(c.$validators.min=function(n){return!k(n)||f(w)||r(n)>=w},h.$observe("min",function(n){w=d(n);c.$validate()}));(e(h.max)||h.ngMax)&&(c.$validators.max=function(n){return!k(n)||f(b)||r(n)<=b},h.$observe("max",function(n){b=d(n);c.$validate()}))}}function fl(n,t,r,u){var f=t[0],e=u.$$hasNativeValidators=c(f.validity);e&&u.$parsers.push(function(n){var r=t.prop(na)||{};return r.badInput&&!r.typeMismatch?i:n})}function yb(n,t,r,u,o,s){var h,c;fl(n,t,r,u);ru(n,t,r,u,o,s);u.$$parserName="number";u.$parsers.push(function(n){return u.$isEmpty(n)?null:lb.test(n)?parseFloat(n):i});u.$formatters.push(function(n){if(!u.$isEmpty(n)){if(!k(n))throw eu("numfmt","Expected `{0}` to be a number",n);n=n.toString()}return n});(e(r.min)||r.ngMin)&&(u.$validators.min=function(n){return u.$isEmpty(n)||f(h)||n>=h},r.$observe("min",function(n){e(n)&&!k(n)&&(n=parseFloat(n,10));h=k(n)&&!isNaN(n)?n:i;u.$validate()}));(e(r.max)||r.ngMax)&&(u.$validators.max=function(n){return u.$isEmpty(n)||f(c)||n<=c},r.$observe("max",function(n){e(n)&&!k(n)&&(n=parseFloat(n,10));c=k(n)&&!isNaN(n)?n:i;u.$validate()}))}function pb(n,t,i,r,u,f){ru(n,t,i,r,u,f);ro(r);r.$$parserName="url";r.$validators.url=function(n,t){var i=n||t;return r.$isEmpty(i)||hb.test(i)}}function wb(n,t,i,r,u,f){ru(n,t,i,r,u,f);ro(r);r.$$parserName="email";r.$validators.email=function(n,t){var i=n||t;return r.$isEmpty(i)||cb.test(i)}}function bb(n,t,i,r){f(i.name)&&t.attr("name",ou());var u=function(n){t[0].checked&&r.$setViewValue(i.value,n&&n.type)};t.on("click",u);r.$render=function(){var n=i.value;t[0].checked=n==r.$viewValue};i.$observe("value",r.$render)}function el(n,t,i,r,u){var f;if(e(r)){if(f=n(r),!f.constant)throw eu("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",i,r);return f(t)}return u}function kb(n,t,i,r,u,f,e,o){var s=el(o,n,"ngTrueValue",i.ngTrueValue,!0),h=el(o,n,"ngFalseValue",i.ngFalseValue,!1),c=function(n){r.$setViewValue(t[0].checked,n&&n.type)};t.on("click",c);r.$render=function(){t[0].checked=r.$viewValue};r.$isEmpty=function(n){return n===!1};r.$formatters.push(function(n){return ot(n,s)});r.$parsers.push(function(n){return n?s:h})}function uo(n,t){return n="ngClass"+n,["$animate",function(i){function f(n,t){var f=[],i,u,r;n:for(i=0;i<n.length;i++){for(u=n[i],r=0;r<t.length;r++)if(u==t[r])continue n;f.push(u)}return f}function u(n){var t=[];return a(n)?(r(n,function(n){t=t.concat(u(n))}),t):h(n)?n.split(" "):c(n)?(r(n,function(n,i){n&&(t=t.concat(i.split(" ")))}),t):n}return{restrict:"AC",link:function(e,o,s){function l(n){var t=c(n,1);s.$addClass(t)}function v(n){var t=c(n,-1);s.$removeClass(t)}function c(n,t){var i=o.data("$classCounts")||d(),u=[];return r(n,function(n){(t>0||i[n])&&(i[n]=(i[n]||0)+t,i[n]===+(t>0)&&u.push(n))}),o.data("$classCounts",i),u.join(" ")}function y(n,t){var r=f(t,n),u=f(n,t);r=c(r,1);u=c(u,-1);r&&r.length&&i.addClass(o,r);u&&u.length&&i.removeClass(o,u)}function a(n){var i,r;(t===!0||e.$index%2===t)&&(i=u(n||[]),h?ot(n,h)||(r=u(h),y(r,i)):l(i));h=ct(n)}var h;e.$watch(s[n],a,!0);s.$observe("class",function(){a(e.$eval(s[n]))});n!=="ngClass"&&e.$watch("$index",function(i,r){var o=i&1,f;o!==(r&1)&&(f=u(e.$eval(s[n])),o===t?l(f):v(f))})}}}]}function al(n){function l(n,r,o){f(r)?a("$pending",n,o):v("$pending",n,o);or(r)?r?(u(t.$error,n,o),s(t.$$success,n,o)):(s(t.$error,n,o),u(t.$$success,n,o)):(u(t.$error,n,o),u(t.$$success,n,o));t.$pending?(e(ll,!0),t.$valid=t.$invalid=i,h("",null)):(e(ll,!1),t.$valid=vl(t.$error),t.$invalid=!t.$valid,h("",t.$valid));var c;c=t.$pending&&t.$pending[n]?i:t.$error[n]?!1:t.$$success[n]?!0:null;h(n,c);t.$$parentForm.$setValidity(n,c,t)}function a(n,i,r){t[n]||(t[n]={});s(t[n],i,r)}function v(n,r,f){t[n]&&u(t[n],r,f);vl(t[n])&&(t[n]=i)}function e(n,t){t&&!r[n]?(c.addClass(o,n),r[n]=!0):!t&&r[n]&&(c.removeClass(o,n),r[n]=!1)}function h(n,t){n=n?"-"+is(n,"-"):"";e(fu+n,t===!0);e(hl+n,t===!1)}var t=n.ctrl,o=n.$element,r={},s=n.set,u=n.unset,c=n.$animate;r[hl]=!(r[fu]=o.hasClass(fu));t.$setValidity=l}function vl(n){if(n)for(var t in n)if(n.hasOwnProperty(t))return!1;return!0}function vd(n){n[0].hasAttribute("selected")&&(n[0].selected=!0)}var gl=/^\/(.+)\/([a-z]*)$/,na="validity",v=function(n){return h(n)?n.toLowerCase():n},pt=Object.prototype.hasOwnProperty,ir=function(n){return h(n)?n.toUpperCase():n},ta=function(n){return h(n)?n.replace(/[A-Z]/g,function(n){return String.fromCharCode(n.charCodeAt(0)|32)}):n},ia=function(n){return h(n)?n.replace(/[a-z]/g,function(n){return String.fromCharCode(n.charCodeAt(0)&-33)}):n},a,ao,w,pf,ti,cr,si,ts,df,gf,es,hs,hi,br,oe,se,he,nh,ce,ii,hh,it,nu,yh,uf,u,ff,dp,gp,rc,ni,st,tt,nt,de,of,pc,wc,kc,tu,iu,to;"i"!=="I".toLowerCase()&&(v=ta,ir=ia);var fi,o,ht,rr=[].slice,ra=[].splice,ua=[].push,wt=Object.prototype.toString,eo=Object.getPrototypeOf,ei=y("ng"),ft=n.angular||(n.angular={}),af,fa=0;fi=t.documentMode;s.$inject=[];ur.$inject=[];a=Array.isArray;ao=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/;w=function(n){return h(n)?n.trim():n};pf=function(n){return n.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};ti=function(){function r(){try{return new Function(""),!1}catch(n){return!0}}var i,n;return e(ti.rules)||(i=t.querySelector("[ng-csp]")||t.querySelector("[data-ng-csp]"),i?(n=i.getAttribute("ng-csp")||i.getAttribute("data-ng-csp"),ti.rules={noUnsafeEval:!n||n.indexOf("no-unsafe-eval")!==-1,noInlineStyle:!n||n.indexOf("no-inline-style")!==-1}):ti.rules={noUnsafeEval:r(),noInlineStyle:!1}),ti.rules};cr=function(){if(e(cr.name_))return cr.name_;for(var r,f=si.length,i,u,n=0;n<f;++n)if(i=si[n],r=t.querySelector("["+i.replace(":","\\:")+"jq]")){u=r.getAttribute(i+"jq");break}return cr.name_=u};si=["ng-","data-ng-","ng:","x-ng-"];ts=/[A-Z]/g;df=!1;var dt=1,ba=2,di=3,au=8,us=9,ne=11;es={full:"1.4.8",major:1,minor:4,dot:8,codeName:"ice-manipulation"};b.expando="ng339";var yr=b.cache={},nv=1,vu=function(n,t,i){n.addEventListener(t,i,!1)},pr=function(n,t,i){n.removeEventListener(t,i,!1)};b._data=function(n){return this.cache[n[this.expando]]||{}};var iv=/([\:\-\_]+(.))/g,rv=/^moz([A-Z])/,yu={mouseleave:"mouseout",mouseenter:"mouseover"},te=y("jqLite");var uv=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,fv=/<|&#?\w+;/,ev=/<([\w:-]+)/,ov=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,at={option:[1,'<select multiple="multiple">',"<\/select>"],thead:[1,"<table>","<\/table>"],col:[2,"<table><colgroup>","<\/colgroup><\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:[0,"",""]};at.optgroup=at.option;at.tbody=at.tfoot=at.colgroup=at.caption=at.thead;at.th=at.td;hs=Node.prototype.contains||function(n){return!!(this.compareDocumentPosition(n)&16)};hi=b.prototype={ready:function(i){function r(){u||(u=!0,i())}var u=!1;if(t.readyState==="complete")setTimeout(r);else{this.on("DOMContentLoaded",r);b(n).on("load",r)}},toString:function(){var n=[];return r(this,function(t){n.push(""+t)}),"["+n.join(", ")+"]"},eq:function(n){return n>=0?o(this[n]):o(this[this.length+n])},length:0,push:ua,sort:[].sort,splice:[].splice};br={};r("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(n){br[v(n)]=n});oe={};r("input,select,option,textarea,button,form,details".split(","),function(n){oe[n]=!0});se={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};r({data:ue,removeData:wu,hasData:sv},function(n,t){b[t]=n});r({data:ue,inheritedData:nf,scope:function(n){return o.data(n,"$scope")||nf(n.parentNode||n,["$isolateScope","$scope"])},isolateScope:function(n){return o.data(n,"$isolateScope")||o.data(n,"$isolateScopeNoTemplate")},controller:ls,injector:function(n){return nf(n,"$injector")},removeAttr:function(n,t){n.removeAttribute(t)},hasClass:ku,css:function(n,t,i){if(t=wr(t),e(i))n.style[t]=i;else return n.style[t]},attr:function(n,t,r){var f=n.nodeType,u,o;if(f!==di&&f!==ba&&f!==au)if(u=v(t),br[u])if(e(r))r?(n[t]=!0,n.setAttribute(t,u)):(n[t]=!1,n.removeAttribute(u));else return n[t]||(n.attributes.getNamedItem(t)||s).specified?u:i;else if(e(r))n.setAttribute(t,r);else if(n.getAttribute)return o=n.getAttribute(t,2),o===null?i:o},prop:function(n,t,i){if(e(i))n[t]=i;else return n[t]},text:function(){function n(n,t){if(f(t)){var i=n.nodeType;return i===dt||i===di?n.textContent:""}n.textContent=t}return n.$dv="",n}(),val:function(n,t){if(f(t)){if(n.multiple&&bt(n)==="select"){var i=[];return r(n.options,function(n){n.selected&&i.push(n.value||n.text)}),i.length===0?null:i}return n.value}n.value=t},html:function(n,t){if(f(t))return n.innerHTML;pu(n,!0);n.innerHTML=t},empty:as},function(n,t){b.prototype[t]=function(t,i){var r,s,e=this.length,u,l,o,h;if(n!==as&&f(n.length==2&&n!==ku&&n!==ls?t:i)){if(c(t)){for(r=0;r<e;r++)if(n===ue)n(this[r],t);else for(s in t)n(this[r],s,t[s]);return this}for(u=n.$dv,l=f(u)?Math.min(e,1):e,o=0;o<l;o++)h=n(this[o],t,i),u=u?u+h:h;return u}for(r=0;r<e;r++)n(this[r],t,i);return this}});r({removeData:wu,on:function(n,t,r,u){if(e(u))throw te("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(os(n)){var f=bu(n,!0),o=f.events,s=f.handle;s||(s=f.handle=av(n,o));for(var c=t.indexOf(" ")>=0?t.split(" "):[t],l=c.length,h=function(t,i,u){var f=o[t];f||(f=o[t]=[],f.specialHandlerWrapper=i,t==="$destroy"||u||vu(n,t,s));f.push(r)};l--;)t=c[l],yu[t]?(h(yu[t],yv),h(t,i,!0)):h(t)}},off:cs,one:function(n,t,i){n=o(n);n.on(t,function r(){n.off(t,i);n.off(t,r)});n.on(t,i)},replaceWith:function(n,t){var i,u=n.parentNode;pu(n);r(new b(t),function(t){i?u.insertBefore(t,i.nextSibling):u.replaceChild(t,n);i=t})},children:function(n){var t=[];return r(n.childNodes,function(n){n.nodeType===dt&&t.push(n)}),t},contents:function(n){return n.contentDocument||n.childNodes||[]},append:function(n,t){var r=n.nodeType,i,u,f;if(r===dt||r===ne)for(t=new b(t),i=0,u=t.length;i<u;i++)f=t[i],n.appendChild(f)},prepend:function(n,t){if(n.nodeType===dt){var i=n.firstChild;r(new b(t),function(t){n.insertBefore(t,i)})}},wrap:function(n,t){t=o(t).eq(0).clone()[0];var i=n.parentNode;i&&i.replaceChild(t,n);t.appendChild(n)},remove:ee,detach:function(n){ee(n,!0)},after:function(n,t){var u=n,e=n.parentNode,i,f,r;for(t=new b(t),i=0,f=t.length;i<f;i++)r=t[i],e.insertBefore(r,u.nextSibling),u=r},addClass:gu,removeClass:du,toggleClass:function(n,t,i){t&&r(t.split(" "),function(t){var r=i;f(r)&&(r=!ku(n,t));(r?gu:du)(n,t)})},parent:function(n){var t=n.parentNode;return t&&t.nodeType!==ne?t:null},next:function(n){return n.nextElementSibling},find:function(n,t){return n.getElementsByTagName?n.getElementsByTagName(t):[]},clone:re,triggerHandler:function(n,t,i){var u,f,e,o=t.type||t,h=bu(n),c=h&&h.events,l=c&&c[o];l&&(u={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented===!0},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return this.immediatePropagationStopped===!0},stopPropagation:s,type:o,target:n},t.type&&(u=p(u,t)),f=ct(l),e=i?[u].concat(i):[u],r(f,function(t){u.isImmediatePropagationStopped()||t.apply(n,e)}))}},function(n,t){b.prototype[t]=function(t,i,r){for(var u,s=0,h=this.length;s<h;s++)f(u)?(u=n(this[s],t,i,r),e(u)&&(u=o(u))):fe(u,n(this[s],t,i,r));return e(u)?u:this};b.prototype.bind=b.prototype.on;b.prototype.unbind=b.prototype.off});gi.prototype={put:function(n,t){this[ci(n,this.nextUid)]=t},get:function(n){return this[ci(n,this.nextUid)]},remove:function(n){var t=this[n=ci(n,this.nextUid)];return delete this[n],t}};var wv=[function(){this.$get=[function(){return gi}]}],ys=/^[^\(]*\(\s*([^\)]*)\)/m,bv=/,/,kv=/^\s*(_?)(\S+?)\1\s*$/,ps=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,li=y("$injector");kr.$$annotate=gv;var ws=y("$animate"),ty=1,bs="ng-animate";var uy=function(){this.$get=["$q","$$rAF",function(n,t){function i(){}return i.all=s,i.chain=s,i.prototype={end:s,cancel:s,resume:s,pause:s,complete:s,then:function(i,r){return n(function(n){t(function(){n()})}).then(i,r)}},i}]},fy=function(){var n=new gi,t=[];this.$get=["$$AnimateRunner","$rootScope",function(i,u){function f(n,t,i){var u=!1;return t&&(t=h(t)?t.split(" "):a(t)?t:[],r(t,function(t){t&&(u=!0,n[t]=i)})),u}function e(){r(t,function(t){var f=n.get(t);if(f){var e=ry(t.attr("class")),i="",u="";r(f,function(n,t){var r=!!e[t];n!==r&&(n?i+=(i.length?" ":"")+t:u+=(u.length?" ":"")+t)});r(t,function(n){i&&gu(n,i);u&&du(n,u)});n.remove(t)}});t.length=0}function o(i,r,o){var s=n.get(i)||{},h=f(s,r,!0),c=f(s,o,!1);(h||c)&&(n.put(i,s),t.push(i),t.length===1&&u.$$postDigest(e))}return{enabled:s,on:s,off:s,pin:s,push:function(n,t,r,u){return u&&u(),r=r||{},r.from&&n.css(r.from),r.to&&n.css(r.to),(r.addClass||r.removeClass)&&o(n,r.addClass,r.removeClass),new i}}}]},ey=["$provide",function(n){var t=this;this.$$registeredAnimations=Object.create(null);this.register=function(i,r){if(i&&i.charAt(0)!==".")throw ws("notcsel","Expecting class selector starting with '.' got '{0}'.",i);var u=i+"-animation";t.$$registeredAnimations[i.substr(1)]=u;n.factory(u,r)};this.classNameFilter=function(n){if(arguments.length===1&&(this.$$classNameFilter=n instanceof RegExp?n:null,this.$$classNameFilter)){var t=new RegExp("(\\s+|\\/)"+bs+"(\\s+|\\/)");if(t.test(this.$$classNameFilter.toString()))throw ws("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',bs);}return this.$$classNameFilter};this.$get=["$$animateQueue",function(n){function t(n,t,i){if(i){var r=iy(i);!r||r.parentNode||r.previousElementSibling||(i=null)}i?i.after(n):t.prepend(n)}return{on:n.on,off:n.off,pin:n.pin,enabled:n.enabled,cancel:function(n){n.end&&n.end()},enter:function(i,r,u,f){return r=r&&o(r),u=u&&o(u),r=r||u.parent(),t(i,r,u),n.push(i,"enter",ai(f))},move:function(i,r,u,f){return r=r&&o(r),u=u&&o(u),r=r||u.parent(),t(i,r,u),n.push(i,"move",ai(f))},leave:function(t,i){return n.push(t,"leave",ai(i),function(){t.remove()})},addClass:function(t,i,r){return r=ai(r),r.addClass=dr(r.addclass,i),n.push(t,"addClass",r)},removeClass:function(t,i,r){return r=ai(r),r.removeClass=dr(r.removeClass,i),n.push(t,"removeClass",r)},setClass:function(t,i,r,u){return u=ai(u),u.addClass=dr(u.addClass,i),u.removeClass=dr(u.removeClass,r),n.push(t,"setClass",u)},animate:function(t,i,r,u,f){return f=ai(f),f.from=f.from?p(f.from,i):i,f.to=f.to?p(f.to,r):r,u=u||"ng-inline-animate",f.tempClasses=dr(f.tempClasses,u),n.push(t,"animate",f)}}}]}],oy=function(){this.$get=["$$rAF","$q",function(n,t){var i=function(){};return i.prototype={done:function(n){this.defer&&this.defer[n===!0?"reject":"resolve"]()},end:function(){this.done()},cancel:function(){this.done(!0)},getPromise:function(){return this.defer||(this.defer=t.defer()),this.defer.promise},then:function(n,t){return this.getPromise().then(n,t)},"catch":function(n){return this.getPromise()["catch"](n)},"finally":function(n){return this.getPromise()["finally"](n)}},function(t,r){function e(){return n(function(){o();u||f.done();u=!0}),f}function o(){r.addClass&&(t.addClass(r.addClass),r.addClass=null);r.removeClass&&(t.removeClass(r.removeClass),r.removeClass=null);r.to&&(t.css(r.to),r.to=null)}r.cleanupStyles&&(r.from=r.to=null);r.from&&(t.css(r.from),r.from=null);var u,f=new i;return{start:e,end:e}}}]};tt=y("$compile");ks.$inject=["$provide","$$sanitizeUriProvider"];he=/^((?:x|data)[\:\-_])/i;nh=y("$controller");ce=/^(\S+)(\s+as\s+(\w+))?$/;var wy=function(){this.$get=["$document",function(n){return function(t){return t?!t.nodeType&&t instanceof o&&(t=t[0]):t=n[0].body,t.offsetWidth+1}}]},th="application/json",le={"Content-Type":th+";charset=utf-8"},by=/^\[|^\{(?!\{)/,ky={"[":/]$/,"{":/}$/},dy=/^\)\]\}',?\n/,gy=y("$http"),ih=function(n){return function(){throw gy("legacy","The method `{0}` on the promise returned from `$http` has been disabled.",n);}};ii=ft.$interpolateMinErr=y("$interpolate");ii.throwNoconcat=function(n){throw ii("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required.  See http://docs.angularjs.org/api/ng.$sce",n);};ii.interr=function(n,t){return ii("interr","Can't interpolate: {0}\n{1}",n,t.toString())};var hp=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,cp={http:80,https:443,ftp:21},tf=y("$location");hh={$$html5:!1,$$replace:!1,absUrl:rf("$$absUrl"),url:function(n){if(f(n))return this.$$url;var t=hp.exec(n);return(t[1]||n==="")&&this.path(decodeURIComponent(t[1])),(t[2]||t[1]||n==="")&&this.search(t[3]||""),this.hash(t[5]||""),this},protocol:rf("$$protocol"),host:rf("$$host"),port:rf("$$port"),path:ch("$$path",function(n){return n=n!==null?n.toString():"",n.charAt(0)=="/"?n:"/"+n}),search:function(n,t){switch(arguments.length){case 0:return this.$$search;case 1:if(h(n)||k(n))n=n.toString(),this.$$search=go(n);else if(c(n))n=hr(n,{}),r(n,function(t,i){t==null&&delete n[i]}),this.$$search=n;else throw tf("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");break;default:f(t)||t===null?delete this.$$search[n]:this.$$search[n]=t}return this.$$compose(),this},hash:ch("$$hash",function(n){return n!==null?n.toString():""}),replace:function(){return this.$$replace=!0,this}};r([sh,be,we],function(n){n.prototype=Object.create(hh);n.prototype.state=function(t){if(!arguments.length)return this.$$state;if(n!==we||!this.$$html5)throw tf("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=f(t)?null:t,this}});it=y("$parse");var pp=Function.prototype.call,wp=Function.prototype.apply,bp=Function.prototype.bind;nu=d();r("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(n){nu[n]=!0});yh={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'};uf=function(n){this.options=n};uf.prototype={constructor:uf,lex:function(n){var t,r;for(this.text=n,this.index=0,this.tokens=[];this.index<this.text.length;)if(t=this.text.charAt(this.index),t==='"'||t==="'")this.readString(t);else if(this.isNumber(t)||t==="."&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(t))this.readIdent();else if(this.is(t,"(){}[].,;:?"))this.tokens.push({index:this.index,text:t}),this.index++;else if(this.isWhitespace(t))this.index++;else{var i=t+this.peek(),u=i+this.peek(2),o=nu[t],f=nu[i],e=nu[u];o||f||e?(r=e?u:f?i:t,this.tokens.push({index:this.index,text:r,operator:!0}),this.index+=r.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(n,t){return t.indexOf(n)!==-1},peek:function(n){var t=n||1;return this.index+t<this.text.length?this.text.charAt(this.index+t):!1},isNumber:function(n){return"0"<=n&&n<="9"&&typeof n=="string"},isWhitespace:function(n){return n===" "||n==="\r"||n==="\t"||n==="\n"||n==='\v'||n===" "},isIdent:function(n){return"a"<=n&&n<="z"||"A"<=n&&n<="Z"||"_"===n||n==="$"},isExpOperator:function(n){return n==="-"||n==="+"||this.isNumber(n)},throwError:function(n,t,i){i=i||this.index;var r=e(t)?"s "+t+"-"+this.index+" ["+this.text.substring(t,i)+"]":" "+i;throw it("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",n,r,this.text);},readNumber:function(){for(var n="",r=this.index,t,i;this.index<this.text.length;){if(t=v(this.text.charAt(this.index)),t=="."||this.isNumber(t))n+=t;else if(i=this.peek(),t=="e"&&this.isExpOperator(i))n+=t;else if(this.isExpOperator(t)&&i&&this.isNumber(i)&&n.charAt(n.length-1)=="e")n+=t;else if(!this.isExpOperator(t)||i&&this.isNumber(i)||n.charAt(n.length-1)!="e")break;else this.throwError("Invalid exponent");this.index++}this.tokens.push({index:r,text:n,constant:!0,value:Number(n)})},readIdent:function(){for(var t=this.index,n;this.index<this.text.length;){if(n=this.text.charAt(this.index),!(this.isIdent(n)||this.isNumber(n)))break;this.index++}this.tokens.push({index:t,text:this.text.slice(t,this.index),identifier:!0})},readString:function(n){var f=this.index,t,r,o;this.index++;for(var i="",e=n,u=!1;this.index<this.text.length;){if(t=this.text.charAt(this.index),e+=t,u)t==="u"?(r=this.text.substring(this.index+1,this.index+5),r.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+r+"]"),this.index+=4,i+=String.fromCharCode(parseInt(r,16))):(o=yh[t],i=i+(o||t)),u=!1;else if(t==="\\")u=!0;else{if(t===n){this.index++;this.tokens.push({index:f,text:e,constant:!0,value:i});return}i+=t}this.index++}this.throwError("Unterminated quote",f)}};u=function(n,t){this.lexer=n;this.options=t};u.Program="Program";u.ExpressionStatement="ExpressionStatement";u.AssignmentExpression="AssignmentExpression";u.ConditionalExpression="ConditionalExpression";u.LogicalExpression="LogicalExpression";u.BinaryExpression="BinaryExpression";u.UnaryExpression="UnaryExpression";u.CallExpression="CallExpression";u.MemberExpression="MemberExpression";u.Identifier="Identifier";u.Literal="Literal";u.ArrayExpression="ArrayExpression";u.Property="Property";u.ObjectExpression="ObjectExpression";u.ThisExpression="ThisExpression";u.NGValueParameter="NGValueParameter";u.prototype={ast:function(n){this.text=n;this.tokens=this.lexer.lex(n);var t=this.program();return this.tokens.length!==0&&this.throwError("is an unexpected token",this.tokens[0]),t},program:function(){for(var n=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&n.push(this.expressionStatement()),!this.expect(";"))return{type:u.Program,body:n}},expressionStatement:function(){return{type:u.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var n=this.expression(),t;t=this.expect("|");)n=this.filter(n);return n},expression:function(){return this.assignment()},assignment:function(){var n=this.ternary();return this.expect("=")&&(n={type:u.AssignmentExpression,left:n,right:this.assignment(),operator:"="}),n},ternary:function(){var n=this.logicalOR(),t,i;return this.expect("?")&&(t=this.expression(),this.consume(":"))?(i=this.expression(),{type:u.ConditionalExpression,test:n,alternate:t,consequent:i}):n},logicalOR:function(){for(var n=this.logicalAND();this.expect("||");)n={type:u.LogicalExpression,operator:"||",left:n,right:this.logicalAND()};return n},logicalAND:function(){for(var n=this.equality();this.expect("&&");)n={type:u.LogicalExpression,operator:"&&",left:n,right:this.equality()};return n},equality:function(){for(var n=this.relational(),t;t=this.expect("==","!=","===","!==");)n={type:u.BinaryExpression,operator:t.text,left:n,right:this.relational()};return n},relational:function(){for(var n=this.additive(),t;t=this.expect("<",">","<=",">=");)n={type:u.BinaryExpression,operator:t.text,left:n,right:this.additive()};return n},additive:function(){for(var n=this.multiplicative(),t;t=this.expect("+","-");)n={type:u.BinaryExpression,operator:t.text,left:n,right:this.multiplicative()};return n},multiplicative:function(){for(var n=this.unary(),t;t=this.expect("*","/","%");)n={type:u.BinaryExpression,operator:t.text,left:n,right:this.unary()};return n},unary:function(){var n;return(n=this.expect("+","-","!"))?{type:u.UnaryExpression,operator:n.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var n,t;for(this.expect("(")?(n=this.filterChain(),this.consume(")")):this.expect("[")?n=this.arrayDeclaration():this.expect("{")?n=this.object():this.constants.hasOwnProperty(this.peek().text)?n=hr(this.constants[this.consume().text]):this.peek().identifier?n=this.identifier():this.peek().constant?n=this.constant():this.throwError("not a primary expression",this.peek());t=this.expect("(","[",".");)t.text==="("?(n={type:u.CallExpression,callee:n,arguments:this.parseArguments()},this.consume(")")):t.text==="["?(n={type:u.MemberExpression,object:n,property:this.expression(),computed:!0},this.consume("]")):t.text==="."?n={type:u.MemberExpression,object:n,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return n},filter:function(n){for(var t=[n],i={type:u.CallExpression,callee:this.identifier(),arguments:t,filter:!0};this.expect(":");)t.push(this.expression());return i},parseArguments:function(){var n=[];if(this.peekToken().text!==")")do n.push(this.expression());while(this.expect(","));return n},identifier:function(){var n=this.consume();return n.identifier||this.throwError("is not a valid identifier",n),{type:u.Identifier,name:n.text}},constant:function(){return{type:u.Literal,value:this.consume().value}},arrayDeclaration:function(){var n=[];if(this.peekToken().text!=="]")do{if(this.peek("]"))break;n.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:u.ArrayExpression,elements:n}},object:function(){var t=[],n;if(this.peekToken().text!=="}")do{if(this.peek("}"))break;n={type:u.Property,kind:"init"};this.peek().constant?n.key=this.constant():this.peek().identifier?n.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");n.value=this.expression();t.push(n)}while(this.expect(","));return this.consume("}"),{type:u.ObjectExpression,properties:t}},throwError:function(n,t){throw it("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",t.text,n,t.index+1,this.text,this.text.substring(t.index));},consume:function(n){if(this.tokens.length===0)throw it("ueoe","Unexpected end of expression: {0}",this.text);var t=this.expect(n);return t||this.throwError("is unexpected, expecting ["+n+"]",this.peek()),t},peekToken:function(){if(this.tokens.length===0)throw it("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(n,t,i,r){return this.peekAhead(0,n,t,i,r)},peekAhead:function(n,t,i,r,u){if(this.tokens.length>n){var e=this.tokens[n],f=e.text;if(f===t||f===i||f===r||f===u||!t&&!i&&!r&&!u)return e}return!1},expect:function(n,t,i,r){var u=this.peek(n,t,i,r);return u?(this.tokens.shift(),u):!1},constants:{"true":{type:u.Literal,value:!0},"false":{type:u.Literal,value:!1},"null":{type:u.Literal,value:null},undefined:{type:u.Literal,value:i},"this":{type:u.ThisExpression}}};tc.prototype={compile:function(n,t){var u=this,f=this.astBuilder.ast(n),o,h,s,c,l,e;return this.state={nextId:0,filters:{},expensiveChecks:t,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},g(f,u.$filter),o="",this.stage="assign",(h=dh(f))&&(this.state.computing="assign",s=this.nextId(),this.recurse(h,s),this.return_(s),o="fn.assign="+this.generateFunction("assign","s,v,l")),c=bh(f.body),u.stage="inputs",r(c,function(n,t){var i="fn"+t,r;u.state[i]={vars:[],body:[],own:{}};u.state.computing=i;r=u.nextId();u.recurse(n,r);u.return_(r);u.state.inputs.push(i);n.watchId=t}),this.state.computing="fn",this.stage="main",this.recurse(f),l='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+o+this.watchFns()+"return fn;",e=new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",l)(this.$filter,nr,ri,ah,lh,vh,kp,ph,n),this.state=this.stage=i,e.literal=gh(f),e.constant=nc(f),e},USE:"use",STRICT:"strict",watchFns:function(){var n=[],t=this.state.inputs,i=this;return r(t,function(t){n.push("var "+t+"="+i.generateFunction(t,"s"))}),t.length&&n.push("fn.inputs=["+t.join(",")+"];"),n.join("")},generateFunction:function(n,t){return"function("+t+"){"+this.varsPrefix(n)+this.body(n)+"};"},filterPrefix:function(){var n=[],t=this;return(r(this.state.filters,function(i,r){n.push(i+"=$filter("+t.escape(r)+")")}),n.length)?"var "+n.join(",")+";":""},varsPrefix:function(n){return this.state[n].vars.length?"var "+this.state[n].vars.join(",")+";":""},body:function(n){return this.state[n].body.join("")},recurse:function(n,t,f,o,h,c){var v,y,l=this,p,a;if(o=o||s,!c&&e(n.watchId)){t=t||this.nextId();this.if_("i",this.lazyAssign(t,this.computedMember("i",n.watchId)),this.lazyRecurse(n,t,f,o,h,!0));return}switch(n.type){case u.Program:r(n.body,function(t,r){l.recurse(t.expression,i,i,function(n){y=n});r!==n.body.length-1?l.current().body.push(y,";"):l.return_(y)});break;case u.Literal:a=this.escape(n.value);this.assign(t,a);o(a);break;case u.UnaryExpression:this.recurse(n.argument,i,i,function(n){y=n});a=n.operator+"("+this.ifDefined(y,0)+")";this.assign(t,a);o(a);break;case u.BinaryExpression:this.recurse(n.left,i,i,function(n){v=n});this.recurse(n.right,i,i,function(n){y=n});a=n.operator==="+"?this.plus(v,y):n.operator==="-"?this.ifDefined(v,0)+n.operator+this.ifDefined(y,0):"("+v+")"+n.operator+"("+y+")";this.assign(t,a);o(a);break;case u.LogicalExpression:t=t||this.nextId();l.recurse(n.left,t);l.if_(n.operator==="&&"?t:l.not(t),l.lazyRecurse(n.right,t));o(t);break;case u.ConditionalExpression:t=t||this.nextId();l.recurse(n.test,t);l.if_(t,l.lazyRecurse(n.alternate,t),l.lazyRecurse(n.consequent,t));o(t);break;case u.Identifier:t=t||this.nextId();f&&(f.context=l.stage==="inputs"?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",n.name)+"?l:s"),f.computed=!1,f.name=n.name);nr(n.name);l.if_(l.stage==="inputs"||l.not(l.getHasOwnProperty("l",n.name)),function(){l.if_(l.stage==="inputs"||"s",function(){h&&h!==1&&l.if_(l.not(l.nonComputedMember("s",n.name)),l.lazyAssign(l.nonComputedMember("s",n.name),"{}"));l.assign(t,l.nonComputedMember("s",n.name))})},t&&l.lazyAssign(t,l.nonComputedMember("l",n.name)));(l.state.expensiveChecks||ef(n.name))&&l.addEnsureSafeObject(t);o(t);break;case u.MemberExpression:v=f&&(f.context=this.nextId())||this.nextId();t=t||this.nextId();l.recurse(n.object,v,i,function(){l.if_(l.notNull(v),function(){n.computed?(y=l.nextId(),l.recurse(n.property,y),l.getStringValue(y),l.addEnsureSafeMemberName(y),h&&h!==1&&l.if_(l.not(l.computedMember(v,y)),l.lazyAssign(l.computedMember(v,y),"{}")),a=l.ensureSafeObject(l.computedMember(v,y)),l.assign(t,a),f&&(f.computed=!0,f.name=y)):(nr(n.property.name),h&&h!==1&&l.if_(l.not(l.nonComputedMember(v,n.property.name)),l.lazyAssign(l.nonComputedMember(v,n.property.name),"{}")),a=l.nonComputedMember(v,n.property.name),(l.state.expensiveChecks||ef(n.property.name))&&(a=l.ensureSafeObject(a)),l.assign(t,a),f&&(f.computed=!1,f.name=n.property.name))},function(){l.assign(t,"undefined")});o(t)},!!h);break;case u.CallExpression:t=t||this.nextId();n.filter?(y=l.filter(n.callee.name),p=[],r(n.arguments,function(n){var t=l.nextId();l.recurse(n,t);p.push(t)}),a=y+"("+p.join(",")+")",l.assign(t,a),o(t)):(y=l.nextId(),v={},p=[],l.recurse(n.callee,y,v,function(){l.if_(l.notNull(y),function(){l.addEnsureSafeFunction(y);r(n.arguments,function(n){l.recurse(n,l.nextId(),i,function(n){p.push(l.ensureSafeObject(n))})});v.name?(l.state.expensiveChecks||l.addEnsureSafeObject(v.context),a=l.member(v.context,v.name,v.computed)+"("+p.join(",")+")"):a=y+"("+p.join(",")+")";a=l.ensureSafeObject(a);l.assign(t,a)},function(){l.assign(t,"undefined")});o(t)}));break;case u.AssignmentExpression:if(y=this.nextId(),v={},!kh(n.left))throw it("lval","Trying to assing a value to a non l-value");this.recurse(n.left,i,v,function(){l.if_(l.notNull(v.context),function(){l.recurse(n.right,y);l.addEnsureSafeObject(l.member(v.context,v.name,v.computed));l.addEnsureSafeAssignContext(v.context);a=l.member(v.context,v.name,v.computed)+n.operator+y;l.assign(t,a);o(t||a)})},1);break;case u.ArrayExpression:p=[];r(n.elements,function(n){l.recurse(n,l.nextId(),i,function(n){p.push(n)})});a="["+p.join(",")+"]";this.assign(t,a);o(a);break;case u.ObjectExpression:p=[];r(n.properties,function(n){l.recurse(n.value,l.nextId(),i,function(t){p.push(l.escape(n.key.type===u.Identifier?n.key.name:""+n.key.value)+":"+t)})});a="{"+p.join(",")+"}";this.assign(t,a);o(a);break;case u.ThisExpression:this.assign(t,"s");o("s");break;case u.NGValueParameter:this.assign(t,"v");o("v")}},getHasOwnProperty:function(n,t){var i=n+"."+t,r=this.current().own;return r.hasOwnProperty(i)||(r[i]=this.nextId(!1,n+"&&("+this.escape(t)+" in "+n+")")),r[i]},assign:function(n,t){if(n)return this.current().body.push(n,"=",t,";"),n},filter:function(n){return this.state.filters.hasOwnProperty(n)||(this.state.filters[n]=this.nextId(!0)),this.state.filters[n]},ifDefined:function(n,t){return"ifDefined("+n+","+this.escape(t)+")"},plus:function(n,t){return"plus("+n+","+t+")"},return_:function(n){this.current().body.push("return ",n,";")},if_:function(n,t,i){if(n===!0)t();else{var r=this.current().body;r.push("if(",n,"){");t();r.push("}");i&&(r.push("else{"),i(),r.push("}"))}},not:function(n){return"!("+n+")"},notNull:function(n){return n+"!=null"},nonComputedMember:function(n,t){return n+"."+t},computedMember:function(n,t){return n+"["+t+"]"},member:function(n,t,i){return i?this.computedMember(n,t):this.nonComputedMember(n,t)},addEnsureSafeObject:function(n){this.current().body.push(this.ensureSafeObject(n),";")},addEnsureSafeMemberName:function(n){this.current().body.push(this.ensureSafeMemberName(n),";")},addEnsureSafeFunction:function(n){this.current().body.push(this.ensureSafeFunction(n),";")},addEnsureSafeAssignContext:function(n){this.current().body.push(this.ensureSafeAssignContext(n),";")},ensureSafeObject:function(n){return"ensureSafeObject("+n+",text)"},ensureSafeMemberName:function(n){return"ensureSafeMemberName("+n+",text)"},ensureSafeFunction:function(n){return"ensureSafeFunction("+n+",text)"},getStringValue:function(n){this.assign(n,"getStringValue("+n+",text)")},ensureSafeAssignContext:function(n){return"ensureSafeAssignContext("+n+",text)"},lazyRecurse:function(n,t,i,r,u,f){var e=this;return function(){e.recurse(n,t,i,r,u,f)}},lazyAssign:function(n,t){var i=this;return function(){i.assign(n,t)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)},escape:function(n){if(h(n))return"'"+n.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(k(n))return n.toString();if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(typeof n=="undefined")return"undefined";throw it("esc","IMPOSSIBLE");},nextId:function(n,t){var i="v"+this.state.nextId++;return n||this.current().vars.push(i+(t?"="+t:"")),i},current:function(){return this.state[this.state.computing]}};ic.prototype={compile:function(n,t){var o=this,i=this.astBuilder.ast(n),c,s,h,f,e,u;return this.expression=n,this.expensiveChecks=t,g(i,o.$filter),(c=dh(i))&&(s=this.recurse(c)),h=bh(i.body),h&&(f=[],r(h,function(n,t){var i=o.recurse(n);n.input=i;f.push(i);n.watchId=t})),e=[],r(i.body,function(n){e.push(o.recurse(n.expression))}),u=i.body.length===0?function(){}:i.body.length===1?e[0]:function(n,t){var i;return r(e,function(r){i=r(n,t)}),i},s&&(u.assign=function(n,t,i){return s(n,i,t)}),f&&(u.inputs=f),u.literal=gh(i),u.constant=nc(i),u},recurse:function(n,t,f){var h,e,o=this,s;if(n.input)return this.inputs(n.input,n.watchId);switch(n.type){case u.Literal:return this.value(n.value,t);case u.UnaryExpression:return e=this.recurse(n.argument),this["unary"+n.operator](e,t);case u.BinaryExpression:return h=this.recurse(n.left),e=this.recurse(n.right),this["binary"+n.operator](h,e,t);case u.LogicalExpression:return h=this.recurse(n.left),e=this.recurse(n.right),this["binary"+n.operator](h,e,t);case u.ConditionalExpression:return this["ternary?:"](this.recurse(n.test),this.recurse(n.alternate),this.recurse(n.consequent),t);case u.Identifier:return nr(n.name,o.expression),o.identifier(n.name,o.expensiveChecks||ef(n.name),t,f,o.expression);case u.MemberExpression:return h=this.recurse(n.object,!1,!!f),n.computed||(nr(n.property.name,o.expression),e=n.property.name),n.computed&&(e=this.recurse(n.property)),n.computed?this.computedMember(h,e,t,f,o.expression):this.nonComputedMember(h,e,o.expensiveChecks,t,f,o.expression);case u.CallExpression:return s=[],r(n.arguments,function(n){s.push(o.recurse(n))}),n.filter&&(e=this.$filter(n.callee.name)),n.filter||(e=this.recurse(n.callee,!0)),n.filter?function(n,r,u,f){for(var h,c=[],o=0;o<s.length;++o)c.push(s[o](n,r,u,f));return h=e.apply(i,c,f),t?{context:i,name:i,value:h}:h}:function(n,i,r,u){var f=e(n,i,r,u),c,l,h;if(f.value!=null){for(ri(f.context,o.expression),ah(f.value,o.expression),l=[],h=0;h<s.length;++h)l.push(ri(s[h](n,i,r,u),o.expression));c=ri(f.value.apply(f.context,l),o.expression)}return t?{value:c}:c};case u.AssignmentExpression:return h=this.recurse(n.left,!0,1),e=this.recurse(n.right),function(n,i,r,u){var f=h(n,i,r,u),s=e(n,i,r,u);return ri(f.value,o.expression),vh(f.context),f.context[f.name]=s,t?{value:s}:s};case u.ArrayExpression:return s=[],r(n.elements,function(n){s.push(o.recurse(n))}),function(n,i,r,u){for(var f=[],e=0;e<s.length;++e)f.push(s[e](n,i,r,u));return t?{value:f}:f};case u.ObjectExpression:return s=[],r(n.properties,function(n){s.push({key:n.key.type===u.Identifier?n.key.name:""+n.key.value,value:o.recurse(n.value)})}),function(n,i,r,u){for(var e={},f=0;f<s.length;++f)e[s[f].key]=s[f].value(n,i,r,u);return t?{value:e}:e};case u.ThisExpression:return function(n){return t?{value:n}:n};case u.NGValueParameter:return function(n,i,r){return t?{value:r}:r}}},"unary+":function(n,t){return function(i,r,u,f){var o=n(i,r,u,f);return o=e(o)?+o:0,t?{value:o}:o}},"unary-":function(n,t){return function(i,r,u,f){var o=n(i,r,u,f);return o=e(o)?-o:0,t?{value:o}:o}},"unary!":function(n,t){return function(i,r,u,f){var e=!n(i,r,u,f);return t?{value:e}:e}},"binary+":function(n,t,i){return function(r,u,f,e){var s=n(r,u,f,e),h=t(r,u,f,e),o=ph(s,h);return i?{value:o}:o}},"binary-":function(n,t,i){return function(r,u,f,o){var s=n(r,u,f,o),h=t(r,u,f,o),c=(e(s)?s:0)-(e(h)?h:0);return i?{value:c}:c}},"binary*":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)*t(r,u,f,e);return i?{value:o}:o}},"binary/":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)/t(r,u,f,e);return i?{value:o}:o}},"binary%":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)%t(r,u,f,e);return i?{value:o}:o}},"binary===":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)===t(r,u,f,e);return i?{value:o}:o}},"binary!==":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)!==t(r,u,f,e);return i?{value:o}:o}},"binary==":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)==t(r,u,f,e);return i?{value:o}:o}},"binary!=":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)!=t(r,u,f,e);return i?{value:o}:o}},"binary<":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)<t(r,u,f,e);return i?{value:o}:o}},"binary>":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)>t(r,u,f,e);return i?{value:o}:o}},"binary<=":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)<=t(r,u,f,e);return i?{value:o}:o}},"binary>=":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)>=t(r,u,f,e);return i?{value:o}:o}},"binary&&":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)&&t(r,u,f,e);return i?{value:o}:o}},"binary||":function(n,t,i){return function(r,u,f,e){var o=n(r,u,f,e)||t(r,u,f,e);return i?{value:o}:o}},"ternary?:":function(n,t,i,r){return function(u,f,e,o){var s=n(u,f,e,o)?t(u,f,e,o):i(u,f,e,o);return r?{value:s}:s}},value:function(n,t){return function(){return t?{context:i,name:i,value:n}:n}},identifier:function(n,t,r,u,f){return function(e,o){var s=o&&n in o?o:e,h;return u&&u!==1&&s&&!s[n]&&(s[n]={}),h=s?s[n]:i,t&&ri(h,f),r?{context:s,name:n,value:h}:h}},computedMember:function(n,t,i,r,u){return function(f,e,o,s){var c=n(f,e,o,s),h,l;return c!=null&&(h=t(f,e,o,s),h=lh(h),nr(h,u),r&&r!==1&&c&&!c[h]&&(c[h]={}),l=c[h],ri(l,u)),i?{context:c,name:h,value:l}:l}},nonComputedMember:function(n,t,r,u,f,e){return function(o,s,h,c){var l=n(o,s,h,c),a;return f&&f!==1&&l&&!l[t]&&(l[t]={}),a=l!=null?l[t]:i,(r||ef(t))&&ri(a,e),u?{context:l,name:t,value:a}:a}},inputs:function(n,t){return function(i,r,u,f){return f?f[t]:n(i,r,u)}}};ff=function(n,t,i){this.lexer=n;this.$filter=t;this.options=i;this.ast=new u(this.lexer);this.astCompiler=i.csp?new ic(this.ast,t):new tc(this.ast,t)};ff.prototype={constructor:ff,parse:function(n){return this.astCompiler.compile(n,this.options.expensiveChecks)}};dp=d();gp=d();rc=Object.prototype.valueOf;ni=y("$sce");st={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"};tt=y("$compile");nt=t.createElement("a");de=ui(n.location.href);oc.$inject=["$document"];sc.$inject=["$provide"];hc.$inject=["$locale"];cc.$inject=["$locale"];of=".";var nb={yyyy:rt("FullYear",4),yy:rt("FullYear",2,0,!0),y:rt("FullYear",1),MMMM:hf("Month"),MMM:hf("Month",!0),MM:rt("Month",2,1),M:rt("Month",1,1),dd:rt("Date",2),d:rt("Date",1),HH:rt("Hours",2),H:rt("Hours",1),hh:rt("Hours",2,-12),h:rt("Hours",1,-12),mm:rt("Minutes",2),m:rt("Minutes",1),ss:rt("Seconds",2),s:rt("Seconds",1),sss:rt("Milliseconds",3),EEEE:hf("Day"),EEE:hf("Day",!0),a:dw,Z:bw,ww:vc(2),w:vc(1),G:no,GG:no,GGG:no,GGGG:gw},tb=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,ib=/^\-?\d+$/;yc.$inject=["$locale"];pc=vt(v);wc=vt(ir);bc.$inject=["$parse"];kc=vt({restrict:"E",compile:function(n,t){if(!t.href&&!t.xlinkHref)return function(n,t){if(t[0].nodeName.toLowerCase()==="a"){var i=wt.call(t.prop("href"))==="[object SVGAnimatedString]"?"xlink:href":"href";t.on("click",function(n){t.attr(i)||n.preventDefault()})}}}});tu={};r(br,function(n,t){function r(n,r,u){n.$watch(u[i],function(n){u.$set(t,!!n)})}if(n!="multiple"){var i=gt("ng-"+t),u=r;n==="checked"&&(u=function(n,t,u){u.ngModel!==u[i]&&r(n,t,u)});tu[i]=function(){return{restrict:"A",priority:100,link:u}}}});r(se,function(n,t){tu[t]=function(){return{priority:100,link:function(n,i,r){if(t==="ngPattern"&&r.ngPattern.charAt(0)=="/"){var u=r.ngPattern.match(gl);if(u){r.$set("ngPattern",new RegExp(u[1],u[2]));return}}n.$watch(r[t],function(n){r.$set(t,n)})}}}});r(["src","srcset","href"],function(n){var t=gt("ng-"+n);tu[t]=function(){return{priority:99,link:function(i,r,u){var e=n,f=n;n==="href"&&wt.call(r.prop("href"))==="[object SVGAnimatedString]"&&(f="xlinkHref",u.$attr[f]="xlink:href",e=null);u.$observe(t,function(t){if(!t){n==="href"&&u.$set(f,null);return}u.$set(f,t);fi&&e&&r.prop(e,u[f])})}}}});iu={$addControl:s,$$renameControl:fb,$removeControl:s,$setValidity:s,$setDirty:s,$setPristine:s,$setSubmitted:s};to="ng-submitted";dc.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var gc=function(n){return["$timeout","$parse",function(t,r){function u(n){return n===""?r('this[""]').assign:r(n).assign||s}return{name:"form",restrict:n?"EAC":"E",require:["form","^^?form"],controller:dc,compile:function(r,f){r.addClass(tr).addClass(fu);var e=f.name?"name":n&&f.ngForm?"ngForm":!1;return{pre:function(n,r,f,o){var h=o[0],l,a,c;if(!("action"in f)){l=function(t){n.$apply(function(){h.$commitViewValue();h.$setSubmitted()});t.preventDefault()};vu(r[0],"submit",l);r.on("$destroy",function(){t(function(){pr(r[0],"submit",l)},0,!1)})}a=o[1]||h.$$parentForm;a.$addControl(h);c=e?u(h.$name):s;e&&(c(n,h),f.$observe(e,function(t){h.$name!==t&&(c(n,i),h.$$parentForm.$$renameControl(h,t),c=u(h.$name),c(n,h))}));r.on("$destroy",function(){h.$$parentForm.$removeControl(h);c(n,i);p(h,iu)})}}}}}]},eb=gc(),ob=gc(!0),sb=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,hb=/^[A-Za-z][A-Za-z\d.+-]*:\/*(?:\w+(?::\w+)?@)?[^\s/]+(?::\d+)?(?:\/[\w#!:.?+=&%@\-/]*)?$/,cb=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,lb=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,nl=/^(\d{4})-(\d{2})-(\d{2})$/,tl=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,io=/^(\d{4})-W(\d\d)$/,il=/^(\d{4})-(\d\d)$/,rl=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ul={text:ab,date:uu("date",nl,cf(nl,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":uu("datetimelocal",tl,cf(tl,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:uu("time",rl,cf(rl,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:uu("week",io,vb,"yyyy-Www"),month:uu("month",il,cf(il,["yyyy","MM"]),"yyyy-MM"),number:yb,url:pb,email:wb,radio:bb,checkbox:kb,hidden:s,button:s,submit:s,reset:s,file:s};var ol=["$browser","$sniffer","$filter","$parse",function(n,t,i,r){return{restrict:"E",require:["?ngModel"],link:{pre:function(u,f,e,o){o[0]&&(ul[v(e.type)]||ul.text)(u,f,e,o[0],t,n,i,r)}}}}],db=/^(true|false|\d+)$/,gb=function(){return{restrict:"A",priority:100,compile:function(n,t){return db.test(t.ngValue)?function(n,t,i){i.$set("value",n.$eval(i.ngValue))}:function(n,t,i){n.$watch(i.ngValue,function(n){i.$set("value",n)})}}}},nk=["$compile",function(n){return{restrict:"AC",compile:function(t){return n.$$addBindingClass(t),function(t,i,r){n.$$addBindingInfo(i,r.ngBind);i=i[0];t.$watch(r.ngBind,function(n){i.textContent=f(n)?"":n})}}}}],tk=["$interpolate","$compile",function(n,t){return{compile:function(i){return t.$$addBindingClass(i),function(i,r,u){var e=n(r.attr(u.$attr.ngBindTemplate));t.$$addBindingInfo(r,e.expressions);r=r[0];u.$observe("ngBindTemplate",function(n){r.textContent=f(n)?"":n})}}}}],ik=["$sce","$parse","$compile",function(n,t,i){return{restrict:"A",compile:function(r,u){var f=t(u.ngBindHtml),e=t(u.ngBindHtml,function(n){return(n||"").toString()});return i.$$addBindingClass(r),function(t,r,u){i.$$addBindingInfo(r,u.ngBindHtml);t.$watch(e,function(){r.html(n.getTrustedHtml(f(t))||"")})}}}}],rk=vt({restrict:"A",require:"ngModel",link:function(n,t,i,r){r.$viewChangeListeners.push(function(){n.$eval(i.ngChange)})}});var uk=uo("",!0),fk=uo("Odd",0),ek=uo("Even",1),ok=pi({compile:function(n,t){t.$set("ngCloak",i);n.removeClass("ng-cloak")}}),sk=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],sl={},hk={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(n){var t=gt("ng-"+n);sl[t]=["$parse","$rootScope",function(i,r){return{restrict:"A",compile:function(u,f){var e=i(f[t],null,!0);return function(t,i){i.on(n,function(i){var u=function(){e(t,{$event:i})};hk[n]&&r.$$phase?t.$evalAsync(u):t.$apply(u)})}}}}]});var ck=["$animate",function(n){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(i,r,u,f,e){var h,s,o;i.$watch(u.ngIf,function(i){i?s||e(function(i,f){s=f;i[i.length++]=t.createComment(" end ngIf: "+u.ngIf+" ");h={clone:i};n.enter(i,r.parent(),r)}):(o&&(o.remove(),o=null),s&&(s.$destroy(),s=null),h&&(o=lu(h.clone),n.leave(o).then(function(){o=null}),h=null))})}}}],lk=["$templateRequest","$anchorScroll","$animate",function(n,t,i){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ft.noop,compile:function(r,u){var o=u.ngInclude||u.src,s=u.onload||"",f=u.autoscroll;return function(r,u,h,c,l){var p=0,a,v,y,w=function(){v&&(v.remove(),v=null);a&&(a.$destroy(),a=null);y&&(i.leave(y).then(function(){v=null}),v=y,y=null)};r.$watch(o,function(o){var v=function(){e(f)&&(!f||r.$eval(f))&&t()},h=++p;o?(n(o,!0).then(function(n){var t,f;h===p&&(t=r.$new(),c.template=n,f=l(t,function(n){w();i.enter(n,null,u).then(v)}),a=t,y=f,a.$emit("$includeContentLoaded",o),r.$eval(s))},function(){h===p&&(w(),r.$emit("$includeContentError",o))}),r.$emit("$includeContentRequested",o)):(w(),c.template=null)})}}}}],ak=["$compile",function(n){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(i,r,u,f){if(/SVG/.test(r[0].toString())){r.empty();n(ss(f.template,t).childNodes)(i,function(n){r.append(n)},{futureParentElement:r});return}r.html(f.template);n(r.contents())(i)}}}],vk=pi({priority:450,compile:function(){return{pre:function(n,t,i){n.$eval(i.ngInit)}}}}),yk=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(n,t,u,e){var o=t.attr(u.$attr.ngList)||", ",s=u.ngTrim!=="false",h=s?w(o):o,c=function(n){if(!f(n)){var t=[];return n&&r(n.split(h),function(n){n&&t.push(s?w(n):n)}),t}};e.$parsers.push(c);e.$formatters.push(function(n){return a(n)?n.join(o):i});e.$isEmpty=function(n){return!n||!n.length}}}},fu="ng-valid",hl="ng-invalid",tr="ng-pristine",lf="ng-dirty",fo="ng-untouched",cl="ng-touched",ll="ng-pending",eu=y("ngModel"),pk=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(n,t,u,o,h,c,a,v,y,p){var g;this.$viewValue=Number.NaN;this.$modelValue=Number.NaN;this.$$rawModelValue=i;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=i;this.$name=p(u.name||"",!1)(n);this.$$parentForm=iu;var d=h(u.ngModel),it=d.assign,tt=d,rt=it,nt=null,b,w=this;this.$$setOptions=function(n){if(w.$options=n,n&&n.getterSetter){var t=h(u.ngModel+"()"),i=h(u.ngModel+"($$$p)");tt=function(n){var i=d(n);return l(i)&&(i=t(n)),i};rt=function(n){l(d(n))?i(n,{$$$p:w.$modelValue}):it(n,w.$modelValue)}}else if(!d.assign)throw eu("nonassign","Expression '{0}' is non-assignable. Element: {1}",u.ngModel,kt(o));};this.$render=s;this.$isEmpty=function(n){return f(n)||n===""||n===null||n!==n};g=0;al({ctrl:this,$element:o,set:function(n,t){n[t]=!0},unset:function(n,t){delete n[t]},$animate:c});this.$setPristine=function(){w.$dirty=!1;w.$pristine=!0;c.removeClass(o,lf);c.addClass(o,tr)};this.$setDirty=function(){w.$dirty=!0;w.$pristine=!1;c.removeClass(o,tr);c.addClass(o,lf);w.$$parentForm.$setDirty()};this.$setUntouched=function(){w.$touched=!1;w.$untouched=!0;c.setClass(o,fo,cl)};this.$setTouched=function(){w.$touched=!0;w.$untouched=!1;c.setClass(o,cl,fo)};this.$rollbackViewValue=function(){a.cancel(nt);w.$viewValue=w.$$lastCommittedViewValue;w.$render()};this.$validate=function(){if(!k(w.$modelValue)||!isNaN(w.$modelValue)){var t=w.$$lastCommittedViewValue,n=w.$$rawModelValue,r=w.$valid,u=w.$modelValue,f=w.$options&&w.$options.allowInvalid;w.$$runValidators(n,t,function(t){f||r===t||(w.$modelValue=t?n:i,w.$modelValue!==u&&w.$$writeModelToScope())})}};this.$$runValidators=function(n,t,u){function c(){var n=w.$$parserName||"parse";if(f(b))e(n,null);else return b||(r(w.$validators,function(n,t){e(t,null)}),r(w.$asyncValidators,function(n,t){e(t,null)})),e(n,b),b;return!0}function l(){var i=!0;return(r(w.$validators,function(r,u){var f=r(n,t);i=i&&f;e(u,f)}),!i)?(r(w.$asyncValidators,function(n,t){e(t,null)}),!1):!0}function a(){var u=[],f=!0;r(w.$asyncValidators,function(r,o){var s=r(n,t);if(!su(s))throw eu("$asyncValidators","Expected asynchronous validator to return a promise but got '{0}' instead.",s);e(o,i);u.push(s.then(function(){e(o,!0)},function(){f=!1;e(o,!1)}))});u.length?y.all(u).then(function(){o(f)},s):o(!0)}function e(n,t){h===g&&w.$setValidity(n,t)}function o(n){h===g&&u(n)}g++;var h=g;if(!c()){o(!1);return}if(!l()){o(!1);return}a()};this.$commitViewValue=function(){var n=w.$viewValue;(a.cancel(nt),w.$$lastCommittedViewValue!==n||n===""&&w.$$hasNativeValidators)&&(w.$$lastCommittedViewValue=n,w.$pristine&&this.$setDirty(),this.$$parseAndValidate())};this.$$parseAndValidate=function(){function o(){w.$modelValue!==e&&w.$$writeModelToScope()}var s=w.$$lastCommittedViewValue,t=s,r,e,u;if(b=f(t)?i:!0,b)for(r=0;r<w.$parsers.length;r++)if(t=w.$parsers[r](t),f(t)){b=!1;break}k(w.$modelValue)&&isNaN(w.$modelValue)&&(w.$modelValue=tt(n));e=w.$modelValue;u=w.$options&&w.$options.allowInvalid;w.$$rawModelValue=t;u&&(w.$modelValue=t,o());w.$$runValidators(t,w.$$lastCommittedViewValue,function(n){u||(w.$modelValue=n?t:i,o())})};this.$$writeModelToScope=function(){rt(n,w.$modelValue);r(w.$viewChangeListeners,function(n){try{n()}catch(i){t(i)}})};this.$setViewValue=function(n,t){w.$viewValue=n;(!w.$options||w.$options.updateOnDefault)&&w.$$debounceViewValueCommit(t)};this.$$debounceViewValueCommit=function(t){var r=0,u=w.$options,i;u&&e(u.debounce)&&(i=u.debounce,k(i)?r=i:k(i[t])?r=i[t]:k(i["default"])&&(r=i["default"]));a.cancel(nt);r?nt=a(function(){w.$commitViewValue()},r):v.$$phase?w.$commitViewValue():n.$apply(function(){w.$commitViewValue()})};n.$watch(function(){var t=tt(n);if(t!==w.$modelValue&&(w.$modelValue===w.$modelValue||t===t)){w.$modelValue=w.$$rawModelValue=t;b=i;for(var u=w.$formatters,f=u.length,r=t;f--;)r=u[f](r);w.$viewValue!==r&&(w.$viewValue=w.$$lastCommittedViewValue=r,w.$render(),w.$$runValidators(t,r,s))}return t})}],wk=["$rootScope",function(n){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:pk,priority:1,compile:function(t){return t.addClass(tr).addClass(fo).addClass(fu),{pre:function(n,t,i,r){var u=r[0],f=r[1]||u.$$parentForm;u.$$setOptions(r[2]&&r[2].$options);f.$addControl(u);i.$observe("name",function(n){u.$name!==n&&u.$$parentForm.$$renameControl(u,n)});n.$on("$destroy",function(){u.$$parentForm.$removeControl(u)})},post:function(t,i,r,u){var f=u[0];if(f.$options&&f.$options.updateOn)i.on(f.$options.updateOn,function(n){f.$$debounceViewValueCommit(n&&n.type)});i.on("blur",function(){f.$touched||(n.$$phase?t.$evalAsync(f.$setTouched):t.$apply(f.$setTouched))})}}}}}],bk=/(\s+|^)default(\s+|$)/,kk=function(){return{restrict:"A",controller:["$scope","$attrs",function(n,t){var i=this;this.$options=hr(n.$eval(t.ngModelOptions));e(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=w(this.$options.updateOn.replace(bk,function(){return i.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}};var dk=pi({terminal:!0,priority:1e3}),gk=y("ngOptions"),nd=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,td=["$compile","$parse",function(n,i){function f(n,t,r){function tt(n,t,i,r,u){this.selectValue=n;this.viewValue=t;this.label=i;this.group=r;this.disabled=u}function w(n){var t,i;if(!s&&oi(n))t=n;else{t=[];for(i in n)n.hasOwnProperty(i)&&i.charAt(0)!=="$"&&t.push(i)}return t}var u=n.match(nd);if(!u)throw gk("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",n,kt(t));var o=u[5]||u[7],s=u[6],l=/ as /.test(u[0])&&u[1],f=u[9],b=i(u[2]?u[1]:o),k=l&&i(l),d=k||b,g=f&&i(f),h=f?function(n,t){return g(r,t)}:function(n){return ci(n)},a=function(n,t){return h(n,c(n,t))},v=i(u[2]||u[1]),nt=i(u[3]||""),y=i(u[4]||""),p=i(u[8]),e={},c=s?function(n,t){return e[s]=t,e[o]=n,e}:function(n){return e[o]=n,e};return{trackBy:f,getTrackByValue:a,getWatchables:i(p,function(n){var i=[],f,s,t,l,a;for(n=n||[],f=w(n),s=f.length,t=0;t<s;t++){var e=n===f?t:f[t],b=n[e],o=c(n[e],e),p=h(n[e],o);i.push(p);(u[2]||u[1])&&(l=v(r,o),i.push(l));u[4]&&(a=y(r,o),i.push(a))}return i}),getOptions:function(){for(var o=[],i={},u=p(r)||[],e=w(u),g=e.length,t=0;t<g;t++){var s=u===e?t:e[t],it=u[s],n=c(it,s),l=d(r,n),b=h(l,n),rt=v(r,n),ut=nt(r,n),et=y(r,n),k=new tt(b,l,rt,ut,et);o.push(k);i[b]=k}return{items:o,selectValueMap:i,getOptionFromViewValue:function(n){return i[a(n)]},getViewValueFromOption:function(n){return f?ft.copy(n.viewValue):n.viewValue}}}}}function h(t,i,s,h){function ut(n,t){n.element=t;t.disabled=n.disabled;n.label!==t.label&&(t.label=n.label,t.textContent=n.label);n.value!==t.value&&(t.value=n.selectValue)}function it(n,t,i,r){var u;return t&&v(t.nodeName)===i?u=t:(u=r.cloneNode(!1),t?n.insertBefore(u,t):n.appendChild(u)),u}function ft(n){for(var t;n;)t=n.nextSibling,ee(n),n=t}function lt(n){var t=c&&c[0],i=p&&p[0];if(t||i)while(n&&(n===t||n===i||n.nodeType===au||n.value===""))n=n.nextSibling;return n}function et(){var f=y&&w.readValue(),t,n,r;y=b.getOptions();t={};n=i[0].firstChild;k&&i.prepend(c);n=lt(n);y.items.forEach(function(r){var f,s,o;r.group?(f=t[r.group],f||(s=it(i[0],n,"optgroup",e),n=s.nextSibling,s.label=r.group,f=t[r.group]={groupElement:s,currentOptionElement:s.firstChild}),o=it(f.groupElement,f.currentOptionElement,"option",u),ut(r,o),f.currentOptionElement=o.nextSibling):(o=it(i[0],n,"option",u),ut(r,o),n=o.nextSibling)});Object.keys(t).forEach(function(n){ft(t[n].currentOptionElement)});ft(n);l.$render();l.$isEmpty(f)||(r=w.readValue(),(b.trackBy?ot(f,r):f===r)||(l.$setViewValue(r),l.$render()))}var l=h[1],w,rt,c,k,p;if(l){w=h[0];rt=s.multiple;for(var d=0,g=i.children(),st=g.length;d<st;d++)if(g[d].value===""){c=g.eq(d);break}k=!!c;p=o(u.cloneNode(!1));p.val("?");var y,b=f(s.ngOptions,i,t),ht=function(){k||i.prepend(c);i.val("");c.prop("selected",!0);c.attr("selected",!0)},nt=function(){k||c.remove()},ct=function(){i.prepend(p);i.val("?");p.prop("selected",!0);p.attr("selected",!0)},tt=function(){p.remove()};rt?(l.$isEmpty=function(n){return!n||n.length===0},w.writeValue=function(n){y.items.forEach(function(n){n.element.selected=!1});n&&n.forEach(function(n){var t=y.getOptionFromViewValue(n);t&&!t.disabled&&(t.element.selected=!0)})},w.readValue=function(){var t=i.val()||[],n=[];return r(t,function(t){var i=y.selectValueMap[t];i&&!i.disabled&&n.push(y.getViewValueFromOption(i))}),n},b.trackBy&&t.$watchCollection(function(){if(a(l.$viewValue))return l.$viewValue.map(function(n){return b.getTrackByValue(n)})},function(){l.$render()})):(w.writeValue=function(n){var t=y.getOptionFromViewValue(n);t&&!t.disabled?i[0].value!==t.selectValue&&(tt(),nt(),i[0].value=t.selectValue,t.element.selected=!0,t.element.setAttribute("selected","selected")):n===null||k?(tt(),ht()):(nt(),ct())},w.readValue=function(){var n=y.selectValueMap[i.val()];return n&&!n.disabled?(nt(),tt(),y.getViewValueFromOption(n)):null},b.trackBy&&t.$watch(function(){return b.getTrackByValue(l.$viewValue)},function(){l.$render()}));k?(c.remove(),n(c)(t),c.removeClass("ng-scope")):c=o(u.cloneNode(!1));et();t.$watchCollection(b.getWatchables,et)}}var u=t.createElement("option"),e=t.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","?ngModel"],link:{pre:function(n,t,i,r){r[0].registerOption=s},post:h}}}],id=["$locale","$interpolate","$log",function(n,t,i){var u=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(o,h,c){function g(n){h.text(n||"")}var p=c.count,w=c.$attr.when&&h.attr(c.$attr.when),b=c.offset||0,a=o.$eval(w)||{},d={},nt=t.startSymbol(),tt=t.endSymbol(),it=nt+p+"-"+b+tt,y=ft.noop,l;r(c,function(n,t){var i=e.exec(t),r;i&&(r=(i[1]?"-":"")+v(i[2]),a[r]=h.attr(c.$attr[t]))});r(a,function(n,i){d[i]=t(n.replace(u,it))});o.$watch(p,function(t){var r=parseFloat(t),e=isNaN(r),u;e||r in a||(r=n.pluralCat(r-b));r===l||e&&k(l)&&isNaN(l)||(y(),u=d[r],f(u)?(t!=null&&i.debug("ngPluralize: no rule defined for '"+r+"' in "+w),y=s,g()):y=o.$watch(u,g),l=r)})}}}],rd=["$parse","$animate",function(n,u){var e="$$NG_REMOVED",f=y("ngRepeat"),s=function(n,t,i,r,u,f,e){n[i]=r;u&&(n[u]=f);n.$index=t;n.$first=t===0;n.$last=t===e-1;n.$middle=!(n.$first||n.$last);n.$odd=!(n.$even=(t&1)==0)},h=function(n){return n.clone[0]},c=function(n){return n.clone[n.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(l,a){var b=a.ngRepeat,ft=t.createComment(" end ngRepeat: "+b+" "),v=b.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),k,p,g,nt,rt,ut,w;if(!v)throw f("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",b);var tt=v[1],et=v[2],y=v[3],it=v[4];if(v=tt.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/),!v)throw f("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",tt);if(k=v[3]||v[1],p=v[2],y&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(y)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(y)))throw f("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",y);return w={$id:ci},it?g=n(it):(rt=function(n,t){return ci(t)},ut=function(n){return n}),function(n,t,l,a,v){g&&(nt=function(t,i,r){return p&&(w[p]=t),w[k]=i,w.$index=r,g(n,w)});var tt=d();n.$watchCollection(et,function(l){var a,bt,ct=t[0],ot,lt=d(),st,et,ht,g,wt,it,w,at,vt,yt,kt;if(y&&(n[y]=l),oi(l))it=l,wt=nt||rt;else{wt=nt||ut;it=[];for(yt in l)pt.call(l,yt)&&yt.charAt(0)!=="$"&&it.push(yt)}for(st=it.length,at=new Array(st),a=0;a<st;a++)if(et=l===it?a:it[a],ht=l[et],g=wt(et,ht,a),tt[g])w=tt[g],delete tt[g],lt[g]=w,at[a]=w;else if(lt[g]){r(at,function(n){n&&n.scope&&(tt[n.id]=n)});throw f("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",b,g,ht);}else at[a]={id:g,scope:i,clone:i},lt[g]=!0;for(kt in tt){if(w=tt[kt],vt=lu(w.clone),u.leave(vt),vt[0].parentNode)for(a=0,bt=vt.length;a<bt;a++)vt[a][e]=!0;w.scope.$destroy()}for(a=0;a<st;a++)if(et=l===it?a:it[a],ht=l[et],w=at[a],w.scope){ot=ct;do ot=ot.nextSibling;while(ot&&ot[e]);h(w)!=ot&&u.move(lu(w.clone),null,o(ct));ct=c(w);s(w.scope,a,k,ht,p,et,st)}else v(function(n,t){w.scope=t;var i=ft.cloneNode(!1);n[n.length++]=i;u.enter(n,null,o(ct));ct=i;w.clone=n;lt[w.id]=w;s(w.scope,a,k,ht,p,et,st)});tt=lt})}}}}],yl="ng-hide",pl="ng-hide-animate",ud=["$animate",function(n){return{restrict:"A",multiElement:!0,link:function(t,i,r){t.$watch(r.ngShow,function(t){n[t?"removeClass":"addClass"](i,yl,{tempClasses:pl})})}}}],fd=["$animate",function(n){return{restrict:"A",multiElement:!0,link:function(t,i,r){t.$watch(r.ngHide,function(t){n[t?"addClass":"removeClass"](i,yl,{tempClasses:pl})})}}}],ed=pi(function(n,t,i){n.$watch(i.ngStyle,function(n,i){i&&n!==i&&r(i,function(n,i){t.css(i,"")});n&&t.css(n)},!0)}),od=["$animate",function(n){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(i,u,f,e){var l=f.ngSwitch||f.on,c=[],h=[],o=[],s=[],a=function(n,t){return function(){n.splice(t,1)}};i.$watch(l,function(i){for(var l,v,u=0,f=o.length;u<f;++u)n.cancel(o[u]);for(o.length=0,u=0,f=s.length;u<f;++u)l=lu(h[u].clone),s[u].$destroy(),v=o[u]=n.leave(l),v.then(a(o,u));h.length=0;s.length=0;(c=e.cases["!"+i]||e.cases["?"])&&r(c,function(i){i.transclude(function(r,u){var f,e;s.push(u);f=i.element;r[r.length++]=t.createComment(" end ngSwitchWhen: ");e={clone:r};h.push(e);n.enter(r,f.parent(),f)})})})}}}],sd=pi({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(n,t,i,r,u){r.cases["!"+i.ngSwitchWhen]=r.cases["!"+i.ngSwitchWhen]||[];r.cases["!"+i.ngSwitchWhen].push({transclude:u,element:t})}}),hd=pi({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(n,t,i,r,u){r.cases["?"]=r.cases["?"]||[];r.cases["?"].push({transclude:u,element:t})}}),cd=pi({restrict:"EAC",link:function(n,t,i,r,u){if(!u)throw y("ngTransclude")("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",kt(t));u(function(n){t.empty();t.append(n)})}}),ld=["$templateCache",function(n){return{restrict:"E",terminal:!0,compile:function(t,i){if(i.type=="text/ng-template"){var r=i.id,u=t[0].text;n.put(r,u)}}}}],ad={$setViewValue:s,$render:s};var yd=["$element","$scope","$attrs",function(n,r){var u=this,f=new gi;u.ngModelCtrl=ad;u.unknownOption=o(t.createElement("option"));u.renderUnknownOption=function(t){var i="? "+ci(t)+" ?";u.unknownOption.val(i);n.prepend(u.unknownOption);n.val(i)};r.$on("$destroy",function(){u.renderUnknownOption=s});u.removeUnknownOption=function(){u.unknownOption.parent()&&u.unknownOption.remove()};u.readValue=function(){return u.removeUnknownOption(),n.val()};u.writeValue=function(t){u.hasOption(t)?(u.removeUnknownOption(),n.val(t),t===""&&u.emptyOption.prop("selected",!0)):t==null&&u.emptyOption?(u.removeUnknownOption(),n.val("")):u.renderUnknownOption(t)};u.addOption=function(n,t){ki(n,'"option value"');n===""&&(u.emptyOption=t);var i=f.get(n)||0;f.put(n,i+1);u.ngModelCtrl.$render();vd(t)};u.removeOption=function(n){var t=f.get(n);t&&(t===1?(f.remove(n),n===""&&(u.emptyOption=i)):f.put(n,t-1))};u.hasOption=function(n){return!!f.get(n)};u.registerOption=function(n,t,i,r,f){if(r){var o;i.$observe("value",function(n){e(o)&&u.removeOption(o);o=n;u.addOption(n,t)})}else f?n.$watch(f,function(n,r){i.$set("value",n);r!==n&&u.removeOption(r);u.addOption(n,t)}):u.addOption(i.value,t);t.on("$destroy",function(){u.removeOption(i.value);u.ngModelCtrl.$render()})}}],pd=function(){function n(n,t,i,u){var f=u[1],o,h,s;if(f){o=u[0];o.ngModelCtrl=f;f.$render=function(){o.writeValue(f.$viewValue)};t.on("change",function(){n.$apply(function(){f.$setViewValue(o.readValue())})});i.multiple&&(o.readValue=function(){var n=[];return r(t.find("option"),function(t){t.selected&&n.push(t.value)}),n},o.writeValue=function(n){var i=new gi(n);r(t.find("option"),function(n){n.selected=e(i.get(n.value))})},s=NaN,n.$watch(function(){s!==f.$viewValue||ot(h,f.$viewValue)||(h=ct(f.$viewValue),f.$render());s=f.$viewValue}),f.$isEmpty=function(n){return!n||n.length===0})}}return{restrict:"E",require:["select","?ngModel"],controller:yd,priority:1,link:{pre:n}}},wd=["$interpolate",function(n){return{restrict:"E",priority:100,compile:function(t,i){var u,r;return e(i.value)?u=n(i.value,!0):(r=n(t.text(),!0),r||i.$set("value",t.text())),function(n,t,i){var f="$selectController",e=t.parent(),o=e.data(f)||e.parent().data(f);o&&o.registerOption(n,t,i,u,r)}}}}],bd=vt({restrict:"E",terminal:!1}),wl=function(){return{restrict:"A",require:"?ngModel",link:function(n,t,i,r){r&&(i.required=!0,r.$validators.required=function(n,t){return!i.required||!r.$isEmpty(t)},i.$observe("required",function(){r.$validate()}))}}},bl=function(){return{restrict:"A",require:"?ngModel",link:function(n,t,r,u){if(u){var e,o=r.ngPattern||r.pattern;r.$observe("pattern",function(n){if(h(n)&&n.length>0&&(n=new RegExp("^"+n+"$")),n&&!n.test)throw y("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",o,n,kt(t));e=n||i;u.$validate()});u.$validators.pattern=function(n,t){return u.$isEmpty(t)||f(e)||e.test(t)}}}}},kl=function(){return{restrict:"A",require:"?ngModel",link:function(n,t,i,r){if(r){var u=-1;i.$observe("maxlength",function(n){var t=ut(n);u=isNaN(t)?-1:t;r.$validate()});r.$validators.maxlength=function(n,t){return u<0||r.$isEmpty(t)||t.length<=u}}}}},dl=function(){return{restrict:"A",require:"?ngModel",link:function(n,t,i,r){if(r){var u=0;i.$observe("minlength",function(n){u=ut(n)||0;r.$validate()});r.$validators.minlength=function(n,t){return r.$isEmpty(t)||t.length>=u}}}}};if(n.angular.bootstrap){console.log("WARNING: Tried to load angular more than once.");return}wa();ga(ft);ft.module("ngLocale",[],["$provide",function(n){function r(n){n=n+"";var t=n.indexOf(".");return t==-1?0:n.length-t-1}function u(n,t){var u=t,f,e;return i===u&&(u=Math.min(r(n),3)),f=Math.pow(10,u),e=(n*f|0)%f,{v:u,f:e}}var t={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};n.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",short:"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",pluralCat:function(n,i){var r=n|0,f=u(n,i);return r==1&&f.v==0?t.ONE:t.OTHER}})}]);o(t).ready(function(){va(t,ns)})})(window,document);window.angular.$$csp().noInlineStyle||window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}<\/style>');
//# sourceMappingURL=angular.min.js.map
;
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
  n = n + '';
  var i = n.indexOf('.');
  return (i == -1) ? 0 : n.length - i - 1;
}

function getVF(n, opt_precision) {
  var v = opt_precision;

  if (undefined === v) {
    v = Math.min(getDecimals(n), 3);
  }

  var base = Math.pow(10, v);
  var f = ((n * base) | 0) % base;
  return {v: v, f: f};
}

$provide.value("$locale", {
  "DATETIME_FORMATS": {
    "AMPMS": [
      "AM",
      "PM"
    ],
    "DAY": [
      "\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435",
      "\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a",
      "\u0432\u0442\u043e\u0440\u043d\u0438\u043a",
      "\u0441\u0440\u0435\u0434\u0430",
      "\u0447\u0435\u0442\u0432\u0435\u0440\u0433",
      "\u043f\u044f\u0442\u043d\u0438\u0446\u0430",
      "\u0441\u0443\u0431\u0431\u043e\u0442\u0430"
    ],
    "ERANAMES": [
      "\u0434\u043e \u043d. \u044d.",
      "\u043d. \u044d."
    ],
    "ERAS": [
      "\u0434\u043e \u043d. \u044d.",
      "\u043d. \u044d."
    ],
    "FIRSTDAYOFWEEK": 0,
    "MONTH": [
      "\u044f\u043d\u0432\u0430\u0440\u044f",
      "\u0444\u0435\u0432\u0440\u0430\u043b\u044f",
      "\u043c\u0430\u0440\u0442\u0430",
      "\u0430\u043f\u0440\u0435\u043b\u044f",
      "\u043c\u0430\u044f",
      "\u0438\u044e\u043d\u044f",
      "\u0438\u044e\u043b\u044f",
      "\u0430\u0432\u0433\u0443\u0441\u0442\u0430",
      "\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",
      "\u043e\u043a\u0442\u044f\u0431\u0440\u044f",
      "\u043d\u043e\u044f\u0431\u0440\u044f",
      "\u0434\u0435\u043a\u0430\u0431\u0440\u044f"
    ],
    "SHORTDAY": [
      "\u0432\u0441",
      "\u043f\u043d",
      "\u0432\u0442",
      "\u0441\u0440",
      "\u0447\u0442",
      "\u043f\u0442",
      "\u0441\u0431"
    ],
    "SHORTMONTH": [
      "\u044f\u043d\u0432.",
      "\u0444\u0435\u0432\u0440.",
      "\u043c\u0430\u0440\u0442\u0430",
      "\u0430\u043f\u0440.",
      "\u043c\u0430\u044f",
      "\u0438\u044e\u043d\u044f",
      "\u0438\u044e\u043b\u044f",
      "\u0430\u0432\u0433.",
      "\u0441\u0435\u043d\u0442.",
      "\u043e\u043a\u0442.",
      "\u043d\u043e\u044f\u0431.",
      "\u0434\u0435\u043a."
    ],
    "WEEKENDRANGE": [
      5,
      6
    ],
    "fullDate": "EEEE, d MMMM y '\u0433'.",
    "longDate": "d MMMM y '\u0433'.",
    "medium": "d MMM y '\u0433'. H:mm:ss",
    "mediumDate": "d MMM y '\u0433'.",
    "mediumTime": "H:mm:ss",
    "short": "dd.MM.yy H:mm",
    "shortDate": "dd.MM.yy",
    "shortTime": "H:mm"
  },
  "NUMBER_FORMATS": {
    "CURRENCY_SYM": "\u0440\u0443\u0431.",
    "DECIMAL_SEP": ",",
    "GROUP_SEP": "\u00a0",
    "PATTERNS": [
      {
        "gSize": 3,
        "lgSize": 3,
        "maxFrac": 3,
        "minFrac": 0,
        "minInt": 1,
        "negPre": "-",
        "negSuf": "",
        "posPre": "",
        "posSuf": ""
      },
      {
        "gSize": 3,
        "lgSize": 3,
        "maxFrac": 2,
        "minFrac": 2,
        "minInt": 1,
        "negPre": "-",
        "negSuf": "\u00a0\u00a4",
        "posPre": "",
        "posSuf": "\u00a0\u00a4"
      }
    ]
  },
  "id": "ru-ru",
  "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (vf.v == 0 && i % 10 == 1 && i % 100 != 11) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i % 10 == 0 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 11 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
});
}]);
;
/**
 * State-based routing for AngularJS
 * @version v0.4.2
 * @link http://angular-ui.github.com/
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return T(new(T(function(){},{prototype:a})),b)}function e(a){return S(arguments,function(b){b!==a&&S(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return S(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d<c;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l]&&i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return T({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e<c.length;e++){var f=c[e];if(a[f]!=b[f])return!1}return!0}function k(a,b){var c={};return S(a,function(a){c[a]=b[a]}),c}function l(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return S(c,function(c){c in a&&(b[c]=a[c])}),b}function m(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var d in a)h(c,d)==-1&&(b[d]=a[d]);return b}function n(a,b){var c=R(a),d=c?[]:{};return S(a,function(a,e){b(a,e)&&(d[c?d.length:e]=a)}),d}function o(a,b){var c=R(a)?[]:{};return S(a,function(a,d){c[d]=b(a,d)}),c}function p(a){return a.then(c,function(){})&&a}function q(a,b){var d=1,f=2,i={},j=[],k=i,l=T(a.when(i),{$$promises:i,$$values:i});this.study=function(i){function n(a,c){if(t[c]!==f){if(s.push(c),t[c]===d)throw s.splice(0,h(s,c)),new Error("Cyclic dependency: "+s.join(" -> "));if(t[c]=d,P(a))r.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);S(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),r.push(c,a,e)}s.pop(),t[c]=f}}function o(a){return Q(a)&&a.then&&a.$$promises}if(!Q(i))throw new Error("'invocables' must be an object");var q=g(i||{}),r=[],s=[],t={};return S(i,n),i=s=t=null,function(d,f,g){function h(){--v||(w||e(u,f.$$values),s.$$values=u,s.$$promises=s.$$promises||!0,delete s.$$inheritedValues,n.resolve(u))}function i(a){s.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!N(s.$$failure))try{l.resolve(b.invoke(e,g,u)),l.promise.then(function(a){u[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;S(f,function(a){t.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,t[a].then(function(b){u[a]=b,--m||k()},j))}),m||k(),t[c]=p(l.promise)}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!Q(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),s=p(n.promise),t=s.$$promises={},u=T({},d),v=1+r.length/3,w=!1;if(p(s),N(f.$$failure))return i(f.$$failure),s;f.$$inheritedValues&&e(u,m(f.$$inheritedValues,q)),T(t,f.$$promises),f.$$values?(w=e(u,m(f.$$values,q)),s.$$inheritedValues=m(f.$$values,q),h()):(f.$$inheritedValues&&(s.$$inheritedValues=m(f.$$inheritedValues,q)),f.then(h,i));for(var x=0,y=r.length;x<y;x+=3)d.hasOwnProperty(r[x])?h():j(r[x],r[x+1],r[x+2]);return s}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function r(){var a=b.version.minor<3;this.shouldUnsafelyUseHttp=function(b){a=!!b},this.$get=["$http","$templateCache","$injector",function(b,c,d){return new s(b,c,d,a)}]}function s(a,b,c,d){this.fromConfig=function(a,b,c){return N(a.template)?this.fromString(a.template,b):N(a.templateUrl)?this.fromUrl(a.templateUrl,b):N(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return O(a)?a(b):a},this.fromUrl=function(e,f){return O(e)&&(e=e(f)),null==e?null:d?a.get(e,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data}):c.get("$templateRequest")(e)},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function t(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new W.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:f=f.replace(/\/$/,""),e=["(?:/(",")|/)?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),h&&(j=W.type(h)||d(W.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)})),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=T({params:{}},Q(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new W.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function u(a){T(this,a)}function v(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return O(a)||R(a)&&O(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){T(this,a||{})}W=this;var l,m=!1,p=!0,q=!1,r={},s=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!N(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return a!==c&&null!==a&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};v.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return N(a)&&(m=a),m},this.strictMode=function(a){return N(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!N(a))return q;if(a!==!0&&a!==!1&&!P(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new t(a,T(f(),b))},this.isMatcher=function(a){if(!Q(a))return!1;var b=!0;return S(t.prototype,function(c,d){O(c)&&(b=b&&N(a[d])&&O(a[d]))}),b},this.type=function(a,b,c){if(!N(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new u(T({name:a},b)),c&&(w.push({name:a,def:c}),s||j()),this},S(x,function(a,b){r[b]=new u(T({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,s=!1,j(),S(x,function(a,b){r[b]||(r[b]=new u(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=Q(a)?g(a):[],c=h(b,"value")===-1&&h(b,"type")===-1&&h(b,"squash")===-1&&h(b,"array")===-1;return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?r[c.type]:c.type instanceof u?c.type:new u(c.type):"config"===e?r.any:r.string}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return T(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!N(c)||null==c)return q;if(c===!0||P(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=R(a.replace)?a.replace:[],P(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return h(g,a.from)===-1}).concat(f)}function t(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),N(a)?x.type.$normalize(a):t()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);T(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,T(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),S(b,function(b){S(g(b),function(b){h(a,b)===-1&&h(d,b)===-1&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return S(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return S(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d<i.length&&(e=this[i[d]],f=a[i[d]],f!==c&&null!==f||!e.isOptional);d++){if(g=e.type.$normalize(f),!e.type.is(g))return!1;if(h=e.type.encode(g),b.isString(h)&&!e.type.pattern.exec(h))return!1}return!0},$$parent:c},this.ParamSet=k}function w(a,d){function e(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function f(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function g(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return!N(d)||d}function h(d,e,f,g,h){function m(a,b,c){return"/"===q?a:b?q.slice(0,-1)+a:c?q.slice(1)+a:a}function n(a){function b(a){var b=a(f,d);return!!b&&(P(b)&&d.replace().url(b),!0)}if(!a||!a.defaultPrevented){p&&d.url()===p;p=c;var e,g=j.length;for(e=0;e<g;e++)if(b(j[e]))return;k&&b(k)}}function o(){return i=i||e.$on("$locationChangeSuccess",n)}var p,q=g.baseHref(),r=d.url();return l||o(),{sync:function(){n()},listen:function(){return o()},update:function(a){return a?void(r=d.url()):void(d.url()!==r&&(d.url(r),d.replace()))},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),p=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled),g=g&&h.history;var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=m(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!O(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(P(a)){var b=a;a=function(){return b}}else if(!O(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=P(b);if(P(a)&&(a=d.compile(a)),!h&&!O(b)&&!R(b))throw new Error("invalid 'handler' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),T(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:P(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),T(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}function x(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=P(a),e=d?a:a.name,g=f(e);if(g){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var h=e.split("."),i=0,j=h.length,k=b;i<j;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=A[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function n(a,b){B[a]||(B[a]=[]),B[a].push(b)}function q(a){for(var b=B[a]||[];b.length;)r(b.shift())}function r(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!P(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=c.indexOf(".")!==-1?c.substring(0,c.lastIndexOf(".")):P(b.parent)?b.parent:Q(b.parent)&&P(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)O(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d<e;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length==c.length&&c.join("")===b.join("")}function u(a,b){return P(a)&&!N(b)?D[a]:O(b)&&P(a)?(D[a]&&!D.$delegates[a]&&(D.$delegates[a]=D[a]),D[a]=b,this):this}function v(a,b){return Q(a)?b=a:b.name=a,r(b),this}function w(a,e,f,h,j,l,n,q,r){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return n.update(),E;if(!g.retry)return null;if(f.$retry)return n.update(),F;var h=z.transition=e.when(g.retry);return h.then(function(){return h!==z.transition?(a.$broadcast("$stateChangeCancel",b.to,b.toParams,c,d),B):(b.options.$retry=!0,z.transitionTo(b.to,b.toParams,b.options))},function(){return E}),n.update(),h}function v(a,c,d,g,i,l){function m(){var c=[];return S(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:l.notify})||""}],c.push(j.resolve(g,i.globals,i.resolve,a).then(function(c){if(O(d.controllerProvider)||R(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,c.$$resolveAs=d.resolveAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=j.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var w=new Error("transition superseded"),B=p(e.reject(w)),D=p(e.reject(new Error("transition prevented"))),E=p(e.reject(new Error("transition aborted"))),F=p(e.reject(new Error("transition failed")));return y.locals={resolve:null,globals:{$stateParams:{}}},z={params:{},current:y.self,$current:y,transition:null},z.reload=function(a){return z.transitionTo(z.current,l,{reload:a||!0,inherit:!1,notify:!0})},z.go=function(a,b,c){return z.transitionTo(a,b,T({inherit:!0,relative:z.$current},c))},z.transitionTo=function(b,c,f){c=c||{},f=T({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=z.$current,o=z.params,q=j.path,r=m(b,f.relative),s=c["#"];if(!N(r)){var t={to:b,toParams:c,options:f},A=u(t,j.self,o,f);if(A)return A;if(b=t.to,c=t.toParams,f=t.options,r=m(b,f.relative),!N(r)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(r[C])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(l,c||{},z.$current,r)),!r.params.$$validates(c))return F;c=r.params.$$values(c),b=r;var E=b.path,G=0,H=E[G],I=y.locals,J=[];if(f.reload){if(P(f.reload)||Q(f.reload)){if(Q(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var K=f.reload===!0?q[0]:m(f.reload);if(f.reload&&!K)throw new Error("No such reload state '"+(P(f.reload)?f.reload:f.reload.name)+"'");for(;H&&H===q[G]&&H!==K;)I=J[G]=H.locals,G++,H=E[G]}}else for(;H&&H===q[G]&&H.ownParams.$$equals(c,o);)I=J[G]=H.locals,G++,H=E[G];if(x(b,c,j,o,I,f))return s&&(c["#"]=s),z.params=c,U(z.params,l),U(k(b.params.$$keys(),l),b.locals.globals.$stateParams),f.location&&b.navigable&&b.navigable.url&&(n.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),n.update(!0)),z.transition=null,e.when(z.current);if(c=k(b.params.$$keys(),c||{}),s&&(c["#"]=s),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,o,f).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),null==z.transition&&n.update(),D;for(var L=e.when(I),M=G;M<E.length;M++,H=E[M])I=J[M]=d(I),L=v(H,c,H===b,L,I,f);var O=z.transition=L.then(function(){var d,e,g;if(z.transition!==O)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B;for(d=q.length-1;d>=G;d--)g=q[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=G;d<E.length;d++)e=E[d],e.locals=J[d],e.self.onEnter&&h.invoke(e.self.onEnter,e.self,e.locals.globals);return z.transition!==O?(a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B):(z.$current=b,z.current=b.self,z.params=c,U(z.params,l),z.transition=null,f.location&&b.navigable&&n.push(b.navigable.url,b.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===f.location}),f.notify&&a.$broadcast("$stateChangeSuccess",b.self,c,j.self,o),n.update(!0),z.current)}).then(null,function(d){return d===w?B:z.transition!==O?(a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B):(z.transition=null,g=a.$broadcast("$stateChangeError",b.self,c,j.self,o,d),g.defaultPrevented||n.update(),e.reject(d))});return p(O),O},z.is=function(a,b,d){d=T({relative:z.$current},d||{});var e=m(a,d.relative);return N(e)?z.$current===e&&(!b||g(b).reduce(function(a,c){var d=e.params[c];return a&&!d||d.type.equals(l[c],b[c])},!0)):c},z.includes=function(a,b,d){if(d=T({relative:z.$current},d||{}),P(a)&&s(a)){if(!t(a))return!1;a=z.$current.name}var e=m(a,d.relative);if(!N(e))return c;if(!N(z.$current.includes[e.name]))return!1;if(!b)return!0;for(var f=g(b),h=0;h<f.length;h++){var i=f[h],j=e.params[i];if(j&&!j.type.equals(l[i],b[i]))return!1}return g(b).reduce(function(a,c){var d=e.params[c];return a&&!d||d.type.equals(l[c],b[c])},!0)},z.href=function(a,b,d){d=T({lossy:!0,inherit:!0,absolute:!1,relative:z.$current},d||{});var e=m(a,d.relative);if(!N(e))return null;d.inherit&&(b=i(l,b||{},z.$current,e));var f=e&&d.lossy?e.navigable:e;return f&&f.url!==c&&null!==f.url?n.href(f.url,k(e.params.$$keys().concat("#"),b||{}),{absolute:d.absolute}):null},z.get=function(a,b){if(0===arguments.length)return o(g(A),function(a){return A[a].self});var c=m(a,b||z.$current);return c&&c.self?c.self:null},z}function x(a,b,c,d,e,f){function g(a,b,c){function d(b){return"search"!=a.params[b].location}var e=a.params.$$keys().filter(d),f=l.apply({},[a.params].concat(e)),g=new W.ParamSet(f);return g.$$equals(b,c)}if(!f.reload&&a===c&&(e===c.locals||a.self.reloadOnSearch===!1&&g(c,d,b)))return!0}var y,z,A={},B={},C="abstract",D={parent:function(a){if(N(a.parent)&&a.parent)return m(a.parent);var b=/^(.+)\.[^.]+$/.exec(a.name);return b?m(b[1]):y},data:function(a){return a.parent&&a.parent.data&&(a.data=a.self.data=d(a.parent.data,a.data)),a.data},url:function(a){var b=a.url,c={params:a.params||{}};if(P(b))return"^"==b.charAt(0)?e.compile(b.substring(1),c):(a.parent.navigable||y).url.concat(b,c);if(!b||e.isMatcher(b))return b;throw new Error("Invalid url '"+b+"' in state '"+a+"'")},navigable:function(a){return a.url?a:a.parent?a.parent.navigable:null},ownParams:function(a){var b=a.url&&a.url.params||new W.ParamSet;return S(a.params||{},function(a,c){b[c]||(b[c]=new W.Param(c,null,a,"config"))}),b},params:function(a){var b=l(a.ownParams,a.ownParams.$$keys());return a.parent&&a.parent.params?T(a.parent.params.$$new(),b):new W.ParamSet},views:function(a){var b={};return S(N(a.views)?a.views:{"":a},function(c,d){d.indexOf("@")<0&&(d+="@"+a.parent.name),c.resolveAs=c.resolveAs||a.resolveAs||"$resolve",b[d]=c}),b},path:function(a){return a.parent?a.parent.path.concat(a):[]},includes:function(a){var b=a.parent?T({},a.parent.includes):{};return b[a.name]=!0,b},$delegates:{}};y=r({name:"",url:"^",views:null,abstract:!0}),y.navigable=null,this.decorator=u,this.state=v,this.$get=w,w.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function y(){function a(a,b){return{load:function(a,c){var d,e={template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}};return c=T(e,c),c.view&&(d=b.fromConfig(c.view,c.params,c.locals)),d}}}this.$get=a,a.$inject=["$rootScope","$templateFactory"]}function z(){var a=!1;this.useAnchorScroll=function(){a=!0},this.$get=["$anchorScroll","$timeout",function(b,c){return a?b:function(a){return c(function(){a[0].scrollIntoView()},0,!1)}}]}function A(a,c,d,e,f){function g(){return c.has?function(a){return c.has(a)?c.get(a):null}:function(a){try{return c.get(a)}catch(a){return null}}}function h(a,c){var d=function(){return{enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}}};if(k)return{enter:function(a,c,d){b.version.minor>2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate"),l={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=C(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}};return l}function B(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return f.empty?f.empty():f[0].innerHTML=null,function(f,h,i){var j=d.$current,k=C(f,i,h,e),l=j&&j.locals[k];if(!l)return h.html(g),void a(h.contents())(f);h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),O(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}function C(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function D(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function E(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function F(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function G(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function H(a,b){return{relative:E(a)||b.$current,inherit:!0}}function I(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=D(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=F(e),l=g[1]||g[0],m=null;j.options=T(H(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=G(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function J(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=F(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=G(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function K(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,E(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);a!==-1&&p.splice(a,1)}}function h(a,c){if(!P(a))throw new Error("state should be a string");return Q(c)?a+V(c):(c=b.$eval(c),Q(c)?a+V(c):a)}function i(){for(var a=0;a<p.length;a++)l(p[a].state,p[a].params)?j(d,q[p[a].hash]):k(d,q[p[a].hash]),m(p[a].state,p[a].params)?j(d,n):k(d,n)}function j(a,b){f(function(){a.addClass(b)})}function k(a,b){a.removeClass(b)}function l(b,c){return a.includes(b.name,c)}function m(b,c){return a.is(b.name,c)}var n,o,p=[],q={};n=c(e.uiSrefActiveEq||"",!1)(b);try{o=b.$eval(e.uiSrefActive)}catch(a){}o=o||c(e.uiSrefActive||"",!1)(b),Q(o)&&S(o,function(c,d){if(P(c)){var e=D(c,a.current.name);g(e.state,b.$eval(e.paramExpr),d)}}),this.$$addStateInfo=function(a,b){if(!(Q(o)&&p.length>0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function L(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function M(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var N=b.isDefined,O=b.isFunction,P=b.isString,Q=b.isObject,R=b.isArray,S=b.forEach,T=b.extend,U=b.copy,V=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),b.module("ui.router.util").provider("$templateFactory",r);var W;t.prototype.concat=function(a,b){var c={caseInsensitive:W.caseInsensitive(),strict:W.strictMode(),squash:W.defaultSquashPolicy()};return new t(this.sourcePath+a+this.sourceSearch,T(c,b),this)},t.prototype.toString=function(){return this.source},t.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e<j;e++){for(g=h[e],l=this.params[g],m=d[e+1],f=0;f<l.replace.length;f++)l.replace[f].from===m&&(m=l.replace[f].to);m&&l.array===!0&&(m=c(m)),N(m)&&(m=l.type.decode(m)),k[g]=l.value(m)}for(;e<i;e++){for(g=h[e],k[g]=this.params[g].value(b[g]),l=this.params[g],m=b[g],f=0;f<l.replace.length;f++)l.replace[f].from===m&&(m=l.replace[f].to);N(m)&&(m=l.type.decode(m)),k[g]=l.value(m)}return k},t.prototype.parameters=function(a){return N(a)?this.params[a]||null:this.$$paramNames},t.prototype.validates=function(a){return this.params.$$validates(a)},t.prototype.format=function(a){function b(a){return encodeURIComponent(a).replace(/-/g,function(a){return"%5C%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a||{};var c=this.segments,d=this.parameters(),e=this.params;if(!this.validates(a))return null;var f,g=!1,h=c.length-1,i=d.length,j=c[0];for(f=0;f<i;f++){var k=f<h,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=!!p&&m.squash,r=m.type.encode(n);if(k){var s=c[f+1],t=f+1===h;if(q===!1)null!=r&&(j+=R(r)?o(r,b).join("-"):encodeURIComponent(r)),j+=s;else if(q===!0){var u=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(u)[1]}else P(q)&&(j+=q+s);t&&m.squash===!0&&"/"===j.slice(-1)&&(j=j.slice(0,-1))}else{if(null==r||p&&q!==!1)continue;if(R(r)||(r=[r]),0===r.length)continue;r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+(l+"="+r),g=!0}}return j},u.prototype.is=function(a,b){return!0},u.prototype.encode=function(a,b){return a},u.prototype.decode=function(a,b){return a},u.prototype.equals=function(a,b){return a==b},u.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},u.prototype.pattern=/.*/,u.prototype.toString=function(){return"{Type:"+this.name+"}"},u.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},u.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return R(a)?a:N(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){if(R(c)&&0===c.length)return c;c=e(c);var d=o(c,a);return b===!0?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;
for(var g=0;g<d.length;g++)if(!a(d[g],f[g]))return!1;return!0}}this.encode=h(d(a,"encode")),this.decode=h(d(a,"decode")),this.is=h(d(a,"is"),!0),this.equals=i(d(a,"equals")),this.pattern=a.pattern,this.$normalize=h(d(a,"$normalize")),this.name=a.name,this.$arrayMode=b}if(!a)return this;if("auto"===a&&!b)throw new Error("'auto' array mode is for query parameters only");return new d(this,a)},b.module("ui.router.util").provider("$urlMatcherFactory",v),b.module("ui.router.util").run(["$urlMatcherFactory",function(a){}]),w.$inject=["$locationProvider","$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",w),x.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],b.module("ui.router.state").factory("$stateParams",function(){return{}}).constant("$state.runtime",{autoinject:!0}).provider("$state",x).run(["$injector",function(a){a.get("$state.runtime").autoinject&&a.get("$state")}]),y.$inject=[],b.module("ui.router.state").provider("$view",y),b.module("ui.router.state").provider("$uiViewScroll",z),A.$inject=["$state","$injector","$uiViewScroll","$interpolate","$q"],B.$inject=["$compile","$controller","$state","$interpolate"],b.module("ui.router.state").directive("uiView",A),b.module("ui.router.state").directive("uiView",B),I.$inject=["$state","$timeout"],J.$inject=["$state","$timeout"],K.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",I).directive("uiSrefActive",K).directive("uiSrefActiveEq",K).directive("uiState",J),L.$inject=["$state"],M.$inject=["$state"],b.module("ui.router.state").filter("isState",L).filter("includedByState",M)}(window,window.angular);;
/*
 AngularJS v1.5.9-build.5006+sha.e3a378e
 (c) 2010-2016 Google, Inc. http://angularjs.org
 License: MIT
*/
(function (x, n) {
    'use strict'; function s(f, k) { var e = !1, a = !1; this.ngClickOverrideEnabled = function (b) { return n.isDefined(b) ? (b && !a && (a = !0, t.$$moduleName = "ngTouch", k.directive("ngClick", t), f.decorator("ngClickDirective", ["$delegate", function (a) { if (e) a.shift(); else for (var b = a.length - 1; 0 <= b;) { if ("ngTouch" === a[b].$$moduleName) { a.splice(b, 1); break } b-- } return a }])), e = b, this) : e }; this.$get = function () { return { ngClickOverrideEnabled: function () { return e } } } } function v(f, k, e) {
        p.directive(f, ["$parse", "$swipe", function (a,
        b) { return function (l, u, g) { function h(c) { if (!d) return !1; var a = Math.abs(c.y - d.y); c = (c.x - d.x) * k; return r && 75 > a && 0 < c && 30 < c && .3 > a / c } var m = a(g[f]), d, r, c = ["touch"]; n.isDefined(g.ngSwipeDisableMouse) || c.push("mouse"); b.bind(u, { start: function (c, a) { d = c; r = !0 }, cancel: function (c) { r = !1 }, end: function (c, d) { h(c) && l.$apply(function () { u.triggerHandler(e); m(l, { $event: d }) }) } }, c) } }])
    } var p = n.module("ngTouch", []); p.provider("$touch", s); s.$inject = ["$provide", "$compileProvider"]; p.factory("$swipe", [function () {
        function f(a) {
            a =
            a.originalEvent || a; var b = a.touches && a.touches.length ? a.touches : [a]; a = a.changedTouches && a.changedTouches[0] || b[0]; return { x: a.clientX, y: a.clientY }
        } function k(a, b) { var l = []; n.forEach(a, function (a) { (a = e[a][b]) && l.push(a) }); return l.join(" ") } var e = { mouse: { start: "mousedown", move: "mousemove", end: "mouseup" }, touch: { start: "touchstart", move: "touchmove", end: "touchend", cancel: "touchcancel" }, pointer: { start: "pointerdown", move: "pointermove", end: "pointerup", cancel: "pointercancel" } }; return {
            bind: function (a, b, l) {
                var e,
                g, h, m, d = !1; l = l || ["mouse", "touch", "pointer"]; a.on(k(l, "start"), function (c) { h = f(c); d = !0; g = e = 0; m = h; b.start && b.start(h, c) }); var r = k(l, "cancel"); if (r) a.on(r, function (c) { d = !1; b.cancel && b.cancel(c) }); a.on(k(l, "move"), function (c) { if (d && h) { var a = f(c); e += Math.abs(a.x - m.x); g += Math.abs(a.y - m.y); m = a; 10 > e && 10 > g || (g > e ? (d = !1, b.cancel && b.cancel(c)) : (c.preventDefault(), b.move && b.move(a, c))) } }); a.on(k(l, "end"), function (c) { d && (d = !1, b.end && b.end(f(c), c)) })
            }
        }
    }]); var t = ["$parse", "$timeout", "$rootElement", function (f, k, e) {
        function a(a,
        d, b) { for (var c = 0; c < a.length; c += 2) { var g = a[c + 1], e = b; if (25 > Math.abs(a[c] - d) && 25 > Math.abs(g - e)) return a.splice(c, c + 2), !0 } return !1 } function b(b) { if (!(2500 < Date.now() - u)) { var d = b.touches && b.touches.length ? b.touches : [b], e = d[0].clientX, d = d[0].clientY; if (!(1 > e && 1 > d || h && h[0] === e && h[1] === d)) { h && (h = null); var c = b.target; "label" === n.lowercase(c.nodeName || c[0] && c[0].nodeName) && (h = [e, d]); a(g, e, d) || (b.stopPropagation(), b.preventDefault(), b.target && b.target.blur && b.target.blur()) } } } function l(a) {
            a = a.touches && a.touches.length ?
            a.touches : [a]; var b = a[0].clientX, e = a[0].clientY; g.push(b, e); k(function () { for (var a = 0; a < g.length; a += 2) if (g[a] === b && g[a + 1] === e) { g.splice(a, a + 2); break } }, 2500, !1)
        } var u, g, h; return function (h, d, k) {
            var c = f(k.ngClick), w = !1, q, p, s, t; d.on("touchstart", function (a) { w = !0; q = a.target ? a.target : a.srcElement; 3 === q.nodeType && (q = q.parentNode); d.addClass("ng-click-active"); p = Date.now(); a = a.originalEvent || a; a = (a.touches && a.touches.length ? a.touches : [a])[0]; s = a.clientX; t = a.clientY }); d.on("touchcancel", function (a) { w = !1; d.removeClass("ng-click-active") });
            d.on("touchend", function (c) { var h = Date.now() - p, f = c.originalEvent || c, m = (f.changedTouches && f.changedTouches.length ? f.changedTouches : f.touches && f.touches.length ? f.touches : [f])[0], f = m.clientX, m = m.clientY, v = Math.sqrt(Math.pow(f - s, 2) + Math.pow(m - t, 2)); w && 750 > h && 12 > v && (g || (e[0].addEventListener("click", b, !0), e[0].addEventListener("touchstart", l, !0), g = []), u = Date.now(), a(g, f, m), q && q.blur(), n.isDefined(k.disabled) && !1 !== k.disabled || d.triggerHandler("click", [c])); w = !1; d.removeClass("ng-click-active") }); d.onclick =
            function (a) { }; d.on("click", function (a, b) { h.$apply(function () { c(h, { $event: b || a }) }) }); d.on("mousedown", function (a) { d.addClass("ng-click-active") }); d.on("mousemove mouseup", function (a) { d.removeClass("ng-click-active") })
        }
    }]; v("ngSwipeLeft", -1, "swipeleft"); v("ngSwipeRight", 1, "swiperight")
})(window, window.angular);
//# sourceMappingURL=angular-touch.min.js.map;
/*
 AngularJS v1.4.8
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(n,h,p){'use strict';function E(a){var f=[];r(f,h.noop).chars(a);return f.join("")}function g(a,f){var d={},c=a.split(","),b;for(b=0;b<c.length;b++)d[f?h.lowercase(c[b]):c[b]]=!0;return d}function F(a,f){function d(a,b,d,l){b=h.lowercase(b);if(s[b])for(;e.last()&&t[e.last()];)c("",e.last());u[b]&&e.last()==b&&c("",b);(l=v[b]||!!l)||e.push(b);var m={};d.replace(G,function(b,a,f,c,d){m[a]=q(f||c||d||"")});f.start&&f.start(b,m,l)}function c(b,a){var c=0,d;if(a=h.lowercase(a))for(c=e.length-
1;0<=c&&e[c]!=a;c--);if(0<=c){for(d=e.length-1;d>=c;d--)f.end&&f.end(e[d]);e.length=c}}"string"!==typeof a&&(a=null===a||"undefined"===typeof a?"":""+a);var b,k,e=[],m=a,l;for(e.last=function(){return e[e.length-1]};a;){l="";k=!0;if(e.last()&&w[e.last()])a=a.replace(new RegExp("([\\W\\w]*)<\\s*\\/\\s*"+e.last()+"[^>]*>","i"),function(a,b){b=b.replace(H,"$1").replace(I,"$1");f.chars&&f.chars(q(b));return""}),c("",e.last());else{if(0===a.indexOf("\x3c!--"))b=a.indexOf("--",4),0<=b&&a.lastIndexOf("--\x3e",
b)===b&&(f.comment&&f.comment(a.substring(4,b)),a=a.substring(b+3),k=!1);else if(x.test(a)){if(b=a.match(x))a=a.replace(b[0],""),k=!1}else if(J.test(a)){if(b=a.match(y))a=a.substring(b[0].length),b[0].replace(y,c),k=!1}else K.test(a)&&((b=a.match(z))?(b[4]&&(a=a.substring(b[0].length),b[0].replace(z,d)),k=!1):(l+="<",a=a.substring(1)));k&&(b=a.indexOf("<"),l+=0>b?a:a.substring(0,b),a=0>b?"":a.substring(b),f.chars&&f.chars(q(l)))}if(a==m)throw L("badparse",a);m=a}c()}function q(a){if(!a)return"";A.innerHTML=
a.replace(/</g,"&lt;");return A.textContent}function B(a){return a.replace(/&/g,"&amp;").replace(M,function(a){var d=a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(d-55296)+(a-56320)+65536)+";"}).replace(N,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function r(a,f){var d=!1,c=h.bind(a,a.push);return{start:function(a,k,e){a=h.lowercase(a);!d&&w[a]&&(d=a);d||!0!==C[a]||(c("<"),c(a),h.forEach(k,function(d,e){var k=h.lowercase(e),g="img"===a&&"src"===k||
"background"===k;!0!==O[k]||!0===D[k]&&!f(d,g)||(c(" "),c(e),c('="'),c(B(d)),c('"'))}),c(e?"/>":">"))},end:function(a){a=h.lowercase(a);d||!0!==C[a]||(c("</"),c(a),c(">"));a==d&&(d=!1)},chars:function(a){d||c(B(a))}}}var L=h.$$minErr("$sanitize"),z=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,y=/^<\/\s*([\w:-]+)[^>]*>/,G=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,K=/^</,J=/^<\//,H=/\x3c!--(.*?)--\x3e/g,x=/<!DOCTYPE([^>]*?)>/i,
I=/<!\[CDATA\[(.*?)]]\x3e/g,M=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,N=/([^\#-~| |!])/g,v=g("area,br,col,hr,img,wbr");n=g("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr");p=g("rp,rt");var u=h.extend({},p,n),s=h.extend({},n,g("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),t=h.extend({},p,g("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var"));
n=g("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan,use");var w=g("script,style"),C=h.extend({},v,s,t,u,n),D=g("background,cite,href,longdesc,src,usemap,xlink:href");n=g("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width");
p=g("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",
!0);var O=h.extend({},D,p,n),A=document.createElement("pre");h.module("ngSanitize",[]).provider("$sanitize",function(){this.$get=["$$sanitizeUri",function(a){return function(f){var d=[];F(f,r(d,function(c,b){return!/^unsafe/.test(a(c,b))}));return d.join("")}}]});h.module("ngSanitize").filter("linky",["$sanitize",function(a){var f=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,d=/^mailto:/i;return function(c,b){function k(a){a&&g.push(E(a))}function e(a,
c){g.push("<a ");h.isDefined(b)&&g.push('target="',b,'" ');g.push('href="',a.replace(/"/g,"&quot;"),'">');k(c);g.push("</a>")}if(!c)return c;for(var m,l=c,g=[],n,p;m=l.match(f);)n=m[0],m[2]||m[4]||(n=(m[3]?"http://":"mailto:")+n),p=m.index,k(l.substr(0,p)),e(n,m[0].replace(d,"")),l=l.substring(p+m[0].length);k(l);return a(g.join(""))}}])})(window,window.angular);
//# sourceMappingURL=angular-sanitize.min.js.map
;
/*! angular-breadcrumb - v0.4.1
* http://ncuillery.github.io/angular-breadcrumb
* Copyright (c) 2015 Nicolas Cuillery; Licensed MIT */
(function(n,t,i){"use strict";function c(n,i){return t.equals(n.length,i.length)?n>i:n.length>i.length}function u(n){var t=n.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/);if(!t||t.length!==4)throw new Error("Invalid state ref '"+n+"'");return{state:t[1],paramExpr:t[3]||null}}function l(){var n={prefixStateName:null,template:"bootstrap3",templateUrl:null,includeAbstract:!1};this.setOptions=function(i){t.extend(n,i)};this.$get=["$state","$stateParams","$rootScope",function(t,r,f){var e=f;f.$on("$viewContentLoaded",function(n){!n.targetScope.ncyBreadcrumbIgnore&&c(n.targetScope.$id,e.$id)&&(e=n.targetScope)});var s=function(n){var t=n.parent||(/^(.+)\.[^.]+$/.exec(n.name)||[])[1],i=typeof t=="object";return i?t.name:t},o=function(i,f){for(var o,c,s=u(f),l=!1,a=!1,h=0,v=i.length;h<v;h+=1)if(i[h].name===s.state)return;o=t.get(s.state);o.ncyBreadcrumb&&(o.ncyBreadcrumb.force&&(l=!0),o.ncyBreadcrumb.skip&&(a=!0));(!o.abstract||n.includeAbstract||l)&&!a&&(s.paramExpr&&(c=e.$eval(s.paramExpr)),o.ncyBreadcrumbLink=t.href(s.state,c||r||{}),i.unshift(o))},h=function(n){var o=u(n),i=t.get(o.state),f,r;return i.ncyBreadcrumb&&i.ncyBreadcrumb.parent&&(f=typeof i.ncyBreadcrumb.parent=="function",r=f?i.ncyBreadcrumb.parent(e):i.ncyBreadcrumb.parent,r)?r:s(i)};return{getTemplate:function(t){return n.templateUrl?null:t[n.template]?t[n.template]:n.template},getTemplateUrl:function(){return n.templateUrl},getStatesChain:function(i){for(var r=[],u=t.$current.self.name;u;u=h(u))if(o(r,u),i&&r.length)return r;return n.prefixStateName&&o(r,n.prefixStateName),r},getLastStep:function(){var n=this.getStatesChain(!0);return n.length?n[0]:i},$getLastViewScope:function(){return e}}}]}function o(n,i,u){return{restrict:"AE",replace:!0,scope:{},template:i.getTemplate({bootstrap2:'<ul class="breadcrumb"><li ng-repeat="step in steps" ng-switch="$last || !!step.abstract" ng-class="{active: $last}"><a ng-switch-when="false" href="{{step.ncyBreadcrumbLink}}">{{step.ncyBreadcrumbLabel}}<\/a><span ng-switch-when="true">{{step.ncyBreadcrumbLabel}}<\/span><span class="divider" ng-hide="$last">/<\/span><\/li><\/ul>',bootstrap3:'<ol class="breadcrumb"><li ng-repeat="step in steps" ng-class="{active: $last}" ng-switch="$last || !!step.abstract"><a ng-switch-when="false" href="{{step.ncyBreadcrumbLink}}">{{step.ncyBreadcrumbLabel}}<\/a><span ng-switch-when="true">{{step.ncyBreadcrumbLabel}}<\/span><\/li><\/ol>'}),templateUrl:i.getTemplateUrl(),link:{post:function(f){var o=[],s=function(){r(o);o=[];var u=i.$getLastViewScope();f.steps=i.getStatesChain();t.forEach(f.steps,function(t){if(t.ncyBreadcrumb&&t.ncyBreadcrumb.label){var i=n(t.ncyBreadcrumb.label);t.ncyBreadcrumbLabel=i(u);e(o,i,u,t)}else t.ncyBreadcrumbLabel=t.name})};u.$on("$viewContentLoaded",function(n){n.targetScope.ncyBreadcrumbIgnore||s()});s()}}}}function s(n,t,i){return{restrict:"A",scope:{},template:"{{ncyBreadcrumbLabel}}",compile:function(u,f){var o=u.attr(f.$attr.ncyBreadcrumbLast);return o&&u.html(o),{post:function(u){var f=[],o=function(){var o,i,s;r(f);f=[];o=t.$getLastViewScope();i=t.getLastStep();i&&(u.ncyBreadcrumbLink=i.ncyBreadcrumbLink,i.ncyBreadcrumb&&i.ncyBreadcrumb.label?(s=n(i.ncyBreadcrumb.label),u.ncyBreadcrumbLabel=s(o),e(f,s,o,u)):u.ncyBreadcrumbLabel=i.name)};i.$on("$viewContentLoaded",function(n){n.targetScope.ncyBreadcrumbIgnore||o()});o()}}}}}function h(n,i,u){return{restrict:"A",scope:{},template:"{{ncyBreadcrumbChain}}",compile:function(e,o){var s=e.attr(o.$attr.ncyBreadcrumbText),h;return s&&e.html(s),h=e.attr(o.$attr.ncyBreadcrumbTextSeparator)||" / ",{post:function(e){var o=[],c=function(n,i,r){t.forEach(f(i),function(t){var i=r.$watch(t,function(n,t){n!==t&&s()});n.push(i)})},s=function(){r(o);o=[];var f=i.$getLastViewScope(),s=i.getStatesChain(),u=[];t.forEach(s,function(t){if(t.ncyBreadcrumb&&t.ncyBreadcrumb.label){var i=n(t.ncyBreadcrumb.label);u.push(i(f));c(o,i,f)}else u.push(t.name)});e.ncyBreadcrumbChain=u.join(h)};u.$on("$viewContentLoaded",function(n){n.targetScope.ncyBreadcrumbIgnore||s()});s()}}}}}var f=function(n){if(n.expressions)return n.expressions;var i=[];return t.forEach(n.parts,function(n){t.isFunction(n)&&i.push(n.exp)}),i},e=function(n,i,r,u){t.forEach(f(i),function(t){var f=r.$watch(t,function(){u.ncyBreadcrumbLabel=i(r)});n.push(f)})},r=function(n){t.forEach(n,function(n){n()})};o.$inject=["$interpolate","$breadcrumb","$rootScope"];s.$inject=["$interpolate","$breadcrumb","$rootScope"];h.$inject=["$interpolate","$breadcrumb","$rootScope"];t.module("ncy-angular-breadcrumb",["ui.router.state"]).provider("$breadcrumb",l).directive("ncyBreadcrumb",o).directive("ncyBreadcrumbLast",s).directive("ncyBreadcrumbText",h)})(window,window.angular);
//# sourceMappingURL=angular-breadcrumb.min.js.map
;
/*
 AngularJS v1.4.8
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(H,u,Sa){'use strict';function wa(a,b,c){if(!a)throw ngMinErr("areq",b||"?",c||"required");return a}function xa(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;X(a)&&(a=a.join(" "));X(b)&&(b=b.join(" "));return a+" "+b}function Ia(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function T(a,b,c){var d="";a=X(a)?a:a&&I(a)&&a.length?a.split(/\s+/):[];q(a,function(a,s){a&&0<a.length&&(d+=0<s?" ":"",d+=c?b+a:a+b)});return d}function Ja(a){if(a instanceof L)switch(a.length){case 0:return[];
case 1:if(1===a[0].nodeType)return a;break;default:return L(ma(a))}if(1===a.nodeType)return L(a)}function ma(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(1==c.nodeType)return c}}function Ka(a,b,c){q(b,function(b){a.addClass(b,c)})}function La(a,b,c){q(b,function(b){a.removeClass(b,c)})}function N(a){return function(b,c){c.addClass&&(Ka(a,b,c.addClass),c.addClass=null);c.removeClass&&(La(a,b,c.removeClass),c.removeClass=null)}}function ia(a){a=a||{};if(!a.$$prepared){var b=a.domOperation||
M;a.domOperation=function(){a.$$domOperationFired=!0;b();b=M};a.$$prepared=!0}return a}function da(a,b){ya(a,b);za(a,b)}function ya(a,b){b.from&&(a.css(b.from),b.from=null)}function za(a,b){b.to&&(a.css(b.to),b.to=null)}function Q(a,b,c){var d=(b.addClass||"")+" "+(c.addClass||""),e=(b.removeClass||"")+" "+(c.removeClass||"");a=Ma(a.attr("class"),d,e);c.preparationClasses&&(b.preparationClasses=Y(c.preparationClasses,b.preparationClasses),delete c.preparationClasses);d=b.domOperation!==M?b.domOperation:
null;Aa(b,c);d&&(b.domOperation=d);b.addClass=a.addClass?a.addClass:null;b.removeClass=a.removeClass?a.removeClass:null;return b}function Ma(a,b,c){function d(a){I(a)&&(a=a.split(" "));var b={};q(a,function(a){a.length&&(b[a]=!0)});return b}var e={};a=d(a);b=d(b);q(b,function(a,b){e[b]=1});c=d(c);q(c,function(a,b){e[b]=1===e[b]?null:-1});var s={addClass:"",removeClass:""};q(e,function(b,c){var e,d;1===b?(e="addClass",d=!a[c]):-1===b&&(e="removeClass",d=a[c]);d&&(s[e].length&&(s[e]+=" "),s[e]+=c)});
return s}function B(a){return a instanceof u.element?a[0]:a}function Na(a,b,c){var d="";b&&(d=T(b,"ng-",!0));c.addClass&&(d=Y(d,T(c.addClass,"-add")));c.removeClass&&(d=Y(d,T(c.removeClass,"-remove")));d.length&&(c.preparationClasses=d,a.addClass(d))}function ja(a,b){var c=b?"-"+b+"s":"";ea(a,[fa,c]);return[fa,c]}function na(a,b){var c=b?"paused":"",d=U+"PlayState";ea(a,[d,c]);return[d,c]}function ea(a,b){a.style[b[0]]=b[1]}function Y(a,b){return a?b?a+" "+b:a:b}function Ba(a,b,c){var d=Object.create(null),
e=a.getComputedStyle(b)||{};q(c,function(a,b){var c=e[a];if(c){var v=c.charAt(0);if("-"===v||"+"===v||0<=v)c=Oa(c);0===c&&(c=null);d[b]=c}});return d}function Oa(a){var b=0;a=a.split(/\s*,\s*/);q(a,function(a){"s"==a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));a=parseFloat(a)||0;b=b?Math.max(a,b):a});return b}function oa(a){return 0===a||null!=a}function Ca(a,b){var c=O,d=a+"s";b?c+="Duration":d+=" linear all";return[c,d]}function Da(){var a=Object.create(null);return{flush:function(){a=Object.create(null)},
count:function(b){return(b=a[b])?b.total:0},get:function(b){return(b=a[b])&&b.value},put:function(b,c){a[b]?a[b].total++:a[b]={total:1,value:c}}}}function Ea(a,b,c){q(c,function(c){a[c]=V(a[c])?a[c]:b.style.getPropertyValue(c)})}var M=u.noop,Aa=u.extend,L=u.element,q=u.forEach,X=u.isArray,I=u.isString,pa=u.isObject,qa=u.isUndefined,V=u.isDefined,Fa=u.isFunction,ra=u.isElement,O,sa,U,ta;qa(H.ontransitionend)&&V(H.onwebkittransitionend)?(O="WebkitTransition",sa="webkitTransitionEnd transitionend"):
(O="transition",sa="transitionend");qa(H.onanimationend)&&V(H.onwebkitanimationend)?(U="WebkitAnimation",ta="webkitAnimationEnd animationend"):(U="animation",ta="animationend");var ka=U+"Delay",ua=U+"Duration",fa=O+"Delay";H=O+"Duration";var Pa={transitionDuration:H,transitionDelay:fa,transitionProperty:O+"Property",animationDuration:ua,animationDelay:ka,animationIterationCount:U+"IterationCount"},Qa={transitionDuration:H,transitionDelay:fa,animationDuration:ua,animationDelay:ka};u.module("ngAnimate",
[]).directive("ngAnimateChildren",[function(){return function(a,b,c){a=c.ngAnimateChildren;u.isString(a)&&0===a.length?b.data("$$ngAnimateChildren",!0):c.$observe("ngAnimateChildren",function(a){b.data("$$ngAnimateChildren","on"===a||"true"===a)})}}]).factory("$$rAFScheduler",["$$rAF",function(a){function b(a){d=d.concat(a);c()}function c(){if(d.length){for(var b=d.shift(),h=0;h<b.length;h++)b[h]();e||a(function(){e||c()})}}var d,e;d=b.queue=[];b.waitUntilQuiet=function(b){e&&e();e=a(function(){e=
null;b();c()})};return b}]).factory("$$AnimateRunner",["$q","$sniffer","$$animateAsyncRun",function(a,b,c){function d(a){this.setHost(a);this._doneCallbacks=[];this._runInAnimationFrame=c();this._state=0}d.chain=function(a,b){function c(){if(d===a.length)b(!0);else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};d.all=function(a,b){function c(h){v=v&&h;++d===a.length&&b(v)}var d=0,v=!0;q(a,function(a){a.done(c)})};d.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?
a():this._doneCallbacks.push(a)},progress:M,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();
this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._runInAnimationFrame(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(q(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}};return d}]).factory("$$animateAsyncRun",["$$rAF",function(a){function b(b){c.push(b);1<c.length||a(function(){for(var a=0;a<c.length;a++)c[a]();c=[]})}var c=[];return function(){var a=
!1;b(function(){a=!0});return function(c){a?c():b(c)}}}]).provider("$$animateQueue",["$animateProvider",function(a){function b(a,b,c,q){return d[a].some(function(a){return a(b,c,q)})}function c(a,b){a=a||{};var c=0<(a.addClass||"").length,d=0<(a.removeClass||"").length;return b?c&&d:c||d}var d=this.rules={skip:[],cancel:[],join:[]};d.join.push(function(a,b,d){return!b.structural&&c(b.options)});d.skip.push(function(a,b,d){return!b.structural&&!c(b.options)});d.skip.push(function(a,b,c){return"leave"==
c.event&&b.structural});d.skip.push(function(a,b,c){return c.structural&&2===c.state&&!b.structural});d.cancel.push(function(a,b,c){return c.structural&&b.structural});d.cancel.push(function(a,b,c){return 2===c.state&&b.structural});d.cancel.push(function(a,b,c){a=b.options;c=c.options;return a.addClass&&a.addClass===c.removeClass||a.removeClass&&a.removeClass===c.addClass});this.$get=["$$rAF","$rootScope","$rootElement","$document","$$HashMap","$$animation","$$AnimateRunner","$templateRequest","$$jqLite",
"$$forceReflow",function(d,s,h,g,v,r,$,u,R,C){function D(){var a=!1;return function(b){a?b():s.$$postDigest(function(){a=!0;b()})}}function K(a,b,c){var f=B(b),d=B(a),n=[];(a=t[c])&&q(a,function(a){a.node.contains(f)?n.push(a.callback):"leave"===c&&a.node.contains(d)&&n.push(a.callback)});return n}function l(a,f,k){function n(b,c,f,t){R(function(){var b=K(v,a,c);b.length&&d(function(){q(b,function(b){b(a,f,t)})})});b.progress(c,f,t)}function t(b){var c=a,f=k;f.preparationClasses&&(c.removeClass(f.preparationClasses),
f.preparationClasses=null);f.activeClasses&&(c.removeClass(f.activeClasses),f.activeClasses=null);Ha(a,k);da(a,k);k.domOperation();h.complete(!b)}var A,v;if(a=Ja(a))A=B(a),v=a.parent();k=ia(k);var h=new $,R=D();X(k.addClass)&&(k.addClass=k.addClass.join(" "));k.addClass&&!I(k.addClass)&&(k.addClass=null);X(k.removeClass)&&(k.removeClass=k.removeClass.join(" "));k.removeClass&&!I(k.removeClass)&&(k.removeClass=null);k.from&&!pa(k.from)&&(k.from=null);k.to&&!pa(k.to)&&(k.to=null);if(!A)return t(),h;
var z=[A.className,k.addClass,k.removeClass].join(" ");if(!Ra(z))return t(),h;var l=0<=["enter","move","leave"].indexOf(f),g=!G||F.get(A),z=!g&&m.get(A)||{},C=!!z.state;g||C&&1==z.state||(g=!la(a,v,f));if(g)return t(),h;l&&y(a);g={structural:l,element:a,event:f,close:t,options:k,runner:h};if(C){if(b("skip",a,g,z)){if(2===z.state)return t(),h;Q(a,z.options,k);return z.runner}if(b("cancel",a,g,z))if(2===z.state)z.runner.end();else if(z.structural)z.close();else return Q(a,z.options,g.options),z.runner;
else if(b("join",a,g,z))if(2===z.state)Q(a,k,{});else return Na(a,l?f:null,k),f=g.event=z.event,k=Q(a,z.options,g.options),z.runner}else Q(a,k,{});(C=g.structural)||(C="animate"===g.event&&0<Object.keys(g.options.to||{}).length||c(g.options));if(!C)return t(),w(a),h;var u=(z.counter||0)+1;g.counter=u;x(a,1,g);s.$$postDigest(function(){var b=m.get(A),d=!b,b=b||{},K=0<(a.parent()||[]).length&&("animate"===b.event||b.structural||c(b.options));if(d||b.counter!==u||!K){d&&(Ha(a,k),da(a,k));if(d||l&&b.event!==
f)k.domOperation(),h.end();K||w(a)}else f=!b.structural&&c(b.options,!0)?"setClass":b.event,x(a,2),b=r(a,f,b.options),b.done(function(b){t(!b);(b=m.get(A))&&b.counter===u&&w(B(a));n(h,f,"close",{})}),h.setHost(b),n(h,f,"start",{})});return h}function y(a){a=B(a).querySelectorAll("[data-ng-animate]");q(a,function(a){var b=parseInt(a.getAttribute("data-ng-animate")),c=m.get(a);switch(b){case 2:c.runner.end();case 1:c&&m.remove(a)}})}function w(a){a=B(a);a.removeAttribute("data-ng-animate");m.remove(a)}
function f(a,b){return B(a)===B(b)}function la(a,b,c){c=L(g[0].body);var d=f(a,c)||"HTML"===a[0].nodeName,t=f(a,h),n=!1,w;for((a=a.data("$ngAnimatePin"))&&(b=a);b&&b.length;){t||(t=f(b,h));a=b[0];if(1!==a.nodeType)break;var x=m.get(a)||{};n||(n=x.structural||F.get(a));if(qa(w)||!0===w)a=b.data("$$ngAnimateChildren"),V(a)&&(w=a);if(n&&!1===w)break;t||(t=f(b,h),t||(a=b.data("$ngAnimatePin"))&&(b=a));d||(d=f(b,c));b=b.parent()}return(!n||w)&&t&&d}function x(a,b,c){c=c||{};c.state=b;a=B(a);a.setAttribute("data-ng-animate",
b);c=(b=m.get(a))?Aa(b,c):c;m.put(a,c)}var m=new v,F=new v,G=null,A=s.$watch(function(){return 0===u.totalPendingRequests},function(a){a&&(A(),s.$$postDigest(function(){s.$$postDigest(function(){null===G&&(G=!0)})}))}),t={},n=a.classNameFilter(),Ra=n?function(a){return n.test(a)}:function(){return!0},Ha=N(R);return{on:function(a,b,c){b=ma(b);t[a]=t[a]||[];t[a].push({node:b,callback:c})},off:function(a,b,c){function f(a,b,c){var d=ma(b);return a.filter(function(a){return!(a.node===d&&(!c||a.callback===
c))})}var d=t[a];d&&(t[a]=1===arguments.length?null:f(d,b,c))},pin:function(a,b){wa(ra(a),"element","not an element");wa(ra(b),"parentElement","not an element");a.data("$ngAnimatePin",b)},push:function(a,b,c,f){c=c||{};c.domOperation=f;return l(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!G;else if(ra(a)){var f=B(a),d=F.get(f);1===c?b=!d:(b=!!b)?d&&F.remove(f):F.put(f,!0)}else b=G=!!a;return b}}}]}]).provider("$$animation",["$animateProvider",function(a){function b(a){return a.data("$$animationRunner")}
var c=this.drivers=[];this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$HashMap","$$rAFScheduler",function(a,e,s,h,g,v){function r(a){function b(a){if(a.processed)return a;a.processed=!0;var f=a.domNode,d=f.parentNode;e.put(f,a);for(var x;d;){if(x=e.get(d)){x.processed||(x=b(x));break}d=d.parentNode}(x||c).children.push(a);return a}var c={children:[]},d,e=new g;for(d=0;d<a.length;d++){var h=a[d];e.put(h.domNode,a[d]={domNode:h.domNode,fn:h.fn,children:[]})}for(d=0;d<a.length;d++)b(a[d]);
return function(a){var b=[],c=[],d;for(d=0;d<a.children.length;d++)c.push(a.children[d]);a=c.length;var m=0,e=[];for(d=0;d<c.length;d++){var h=c[d];0>=a&&(a=m,m=0,b.push(e),e=[]);e.push(h.fn);h.children.forEach(function(a){m++;c.push(a)});a--}e.length&&b.push(e);return b}(c)}var $=[],u=N(a);return function(g,C,D){function K(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];q(a,function(a){var c=a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}
function l(a){var b=[],c={};q(a,function(a,f){var d=B(a.element),t=0<=["enter","move"].indexOf(a.event),d=a.structural?K(d):[];if(d.length){var m=t?"to":"from";q(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{};c[b][m]={animationID:f,element:L(a)}})}else b.push(a)});var f={},d={};q(c,function(c,m){var w=c.from,e=c.to;if(w&&e){var h=a[w.animationID],g=a[e.animationID],x=w.animationID.toString();if(!d[x]){var A=d[x]={structural:!0,beforeStart:function(){h.beforeStart();g.beforeStart()},
close:function(){h.close();g.close()},classes:y(h.classes,g.classes),from:h,to:g,anchors:[]};A.classes.length?b.push(A):(b.push(h),b.push(g))}d[x].anchors.push({out:w.element,"in":e.element})}else w=w?w.animationID:e.animationID,e=w.toString(),f[e]||(f[e]=!0,b.push(a[w]))});return b}function y(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],f=0;f<a.length;f++){var d=a[f];if("ng-"!==d.substring(0,3))for(var m=0;m<b.length;m++)if(d===b[m]){c.push(d);break}}return c.join(" ")}function w(a){for(var b=
c.length-1;0<=b;b--){var f=c[b];if(s.has(f)&&(f=s.get(f)(a)))return f}}function f(a,c){a.from&&a.to?(b(a.from.element).setHost(c),b(a.to.element).setHost(c)):b(a.element).setHost(c)}function la(){var a=b(g);!a||"leave"===C&&D.$$domOperationFired||a.end()}function x(b){g.off("$destroy",la);g.removeData("$$animationRunner");u(g,D);da(g,D);D.domOperation();A&&a.removeClass(g,A);g.removeClass("ng-animate");F.complete(!b)}D=ia(D);var m=0<=["enter","move","leave"].indexOf(C),F=new h({end:function(){x()},
cancel:function(){x(!0)}});if(!c.length)return x(),F;g.data("$$animationRunner",F);var G=xa(g.attr("class"),xa(D.addClass,D.removeClass)),A=D.tempClasses;A&&(G+=" "+A,D.tempClasses=null);$.push({element:g,classes:G,event:C,structural:m,options:D,beforeStart:function(){g.addClass("ng-animate");A&&a.addClass(g,A)},close:x});g.on("$destroy",la);if(1<$.length)return F;e.$$postDigest(function(){var a=[];q($,function(c){b(c.element)?a.push(c):c.close()});$.length=0;var c=l(a),d=[];q(c,function(a){d.push({domNode:B(a.from?
a.from.element:a.element),fn:function(){a.beforeStart();var c,d=a.close;if(b(a.anchors?a.from.element||a.to.element:a.element)){var m=w(a);m&&(c=m.start)}c?(c=c(),c.done(function(a){d(!a)}),f(a,c)):d()}})});v(r(d))});return F}}]}]).provider("$animateCss",["$animateProvider",function(a){var b=Da(),c=Da();this.$get=["$window","$$jqLite","$$AnimateRunner","$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$animate",function(a,e,s,h,g,v,r,u){function Ga(a,b){var c=a.parentNode;return(c.$$ngAnimateParentKey||
(c.$$ngAnimateParentKey=++l))+"-"+a.getAttribute("class")+"-"+b}function R(w,f,h,g){var m;0<b.count(h)&&(m=c.get(h),m||(f=T(f,"-stagger"),e.addClass(w,f),m=Ba(a,w,g),m.animationDuration=Math.max(m.animationDuration,0),m.transitionDuration=Math.max(m.transitionDuration,0),e.removeClass(w,f),c.put(h,m)));return m||{}}function C(a){y.push(a);r.waitUntilQuiet(function(){b.flush();c.flush();for(var a=g(),d=0;d<y.length;d++)y[d](a);y.length=0})}function D(c,f,e){f=b.get(e);f||(f=Ba(a,c,Pa),"infinite"===
f.animationIterationCount&&(f.animationIterationCount=1));b.put(e,f);c=f;e=c.animationDelay;f=c.transitionDelay;c.maxDelay=e&&f?Math.max(e,f):e||f;c.maxDuration=Math.max(c.animationDuration*c.animationIterationCount,c.transitionDuration);return c}var K=N(e),l=0,y=[];return function(a,c){function d(){m()}function g(){m(!0)}function m(b){if(!(ga||va&&k)){ga=!0;k=!1;c.$$skipPreparationClasses||e.removeClass(a,Z);e.removeClass(a,Y);na(n,!1);ja(n,!1);q(y,function(a){n.style[a[0]]=""});K(a,c);da(a,c);Object.keys(t).length&&
q(t,function(a,b){a?n.style.setProperty(b,a):n.style.removeProperty(b)});if(c.onDone)c.onDone();H&&H.complete(!b)}}function F(a){p.blockTransition&&ja(n,a);p.blockKeyframeAnimation&&na(n,!!a)}function G(){H=new s({end:d,cancel:g});C(M);m();return{$$willAnimate:!1,start:function(){return H},end:d}}function A(){function b(){if(!ga){F(!1);q(y,function(a){n.style[a[0]]=a[1]});K(a,c);e.addClass(a,Y);if(p.recalculateTimingStyles){ha=n.className+" "+Z;aa=Ga(n,ha);E=D(n,ha,aa);W=E.maxDelay;I=Math.max(W,0);
J=E.maxDuration;if(0===J){m();return}p.hasTransitions=0<E.transitionDuration;p.hasAnimations=0<E.animationDuration}p.applyAnimationDelay&&(W="boolean"!==typeof c.delay&&oa(c.delay)?parseFloat(c.delay):W,I=Math.max(W,0),E.animationDelay=W,ca=[ka,W+"s"],y.push(ca),n.style[ca[0]]=ca[1]);N=1E3*I;z=1E3*J;if(c.easing){var k,l=c.easing;p.hasTransitions&&(k=O+"TimingFunction",y.push([k,l]),n.style[k]=l);p.hasAnimations&&(k=U+"TimingFunction",y.push([k,l]),n.style[k]=l)}E.transitionDuration&&x.push(sa);E.animationDuration&&
x.push(ta);A=Date.now();var v=N+1.5*z;k=A+v;var l=a.data("$$animateCss")||[],r=!0;if(l.length){var G=l[0];(r=k>G.expectedEndTime)?h.cancel(G.timer):l.push(m)}r&&(v=h(d,v,!1),l[0]={timer:v,expectedEndTime:k},l.push(m),a.data("$$animateCss",l));a.on(x.join(" "),g);c.to&&(c.cleanupStyles&&Ea(t,n,Object.keys(c.to)),za(a,c))}}function d(){var b=a.data("$$animateCss");if(b){for(var c=1;c<b.length;c++)b[c]();a.removeData("$$animateCss")}}function g(a){a.stopPropagation();var b=a.originalEvent||a;a=b.$manualTimeStamp||
b.timeStamp||Date.now();b=parseFloat(b.elapsedTime.toFixed(3));Math.max(a-A,0)>=N&&b>=J&&(va=!0,m())}if(!ga)if(n.parentNode){var A,x=[],l=function(a){if(va)k&&a&&(k=!1,m());else if(k=!a,E.animationDuration)if(a=na(n,k),k)y.push(a);else{var b=y,c=b.indexOf(a);0<=a&&b.splice(c,1)}},v=0<V&&(E.transitionDuration&&0===S.transitionDuration||E.animationDuration&&0===S.animationDuration)&&Math.max(S.animationDelay,S.transitionDelay);v?h(b,Math.floor(v*V*1E3),!1):b();L.resume=function(){l(!0)};L.pause=function(){l(!1)}}else m()}
var t={},n=B(a);if(!n||!n.parentNode||!u.enabled())return G();c=ia(c);var y=[],r=a.attr("class"),l=Ia(c),ga,k,va,H,L,I,N,J,z;if(0===c.duration||!v.animations&&!v.transitions)return G();var ba=c.event&&X(c.event)?c.event.join(" "):c.event,Q="",P="";ba&&c.structural?Q=T(ba,"ng-",!0):ba&&(Q=ba);c.addClass&&(P+=T(c.addClass,"-add"));c.removeClass&&(P.length&&(P+=" "),P+=T(c.removeClass,"-remove"));c.applyClassesEarly&&P.length&&K(a,c);var Z=[Q,P].join(" ").trim(),ha=r+" "+Z,Y=T(Z,"-active"),r=l.to&&0<
Object.keys(l.to).length;if(!(0<(c.keyframeStyle||"").length||r||Z))return G();var aa,S;0<c.stagger?(l=parseFloat(c.stagger),S={transitionDelay:l,animationDelay:l,transitionDuration:0,animationDuration:0}):(aa=Ga(n,ha),S=R(n,Z,aa,Qa));c.$$skipPreparationClasses||e.addClass(a,Z);c.transitionStyle&&(l=[O,c.transitionStyle],ea(n,l),y.push(l));0<=c.duration&&(l=0<n.style[O].length,l=Ca(c.duration,l),ea(n,l),y.push(l));c.keyframeStyle&&(l=[U,c.keyframeStyle],ea(n,l),y.push(l));var V=S?0<=c.staggerIndex?
c.staggerIndex:b.count(aa):0;(ba=0===V)&&!c.skipBlocking&&ja(n,9999);var E=D(n,ha,aa),W=E.maxDelay;I=Math.max(W,0);J=E.maxDuration;var p={};p.hasTransitions=0<E.transitionDuration;p.hasAnimations=0<E.animationDuration;p.hasTransitionAll=p.hasTransitions&&"all"==E.transitionProperty;p.applyTransitionDuration=r&&(p.hasTransitions&&!p.hasTransitionAll||p.hasAnimations&&!p.hasTransitions);p.applyAnimationDuration=c.duration&&p.hasAnimations;p.applyTransitionDelay=oa(c.delay)&&(p.applyTransitionDuration||
p.hasTransitions);p.applyAnimationDelay=oa(c.delay)&&p.hasAnimations;p.recalculateTimingStyles=0<P.length;if(p.applyTransitionDuration||p.applyAnimationDuration)J=c.duration?parseFloat(c.duration):J,p.applyTransitionDuration&&(p.hasTransitions=!0,E.transitionDuration=J,l=0<n.style[O+"Property"].length,y.push(Ca(J,l))),p.applyAnimationDuration&&(p.hasAnimations=!0,E.animationDuration=J,y.push([ua,J+"s"]));if(0===J&&!p.recalculateTimingStyles)return G();if(null!=c.delay){var ca=parseFloat(c.delay);
p.applyTransitionDelay&&y.push([fa,ca+"s"]);p.applyAnimationDelay&&y.push([ka,ca+"s"])}null==c.duration&&0<E.transitionDuration&&(p.recalculateTimingStyles=p.recalculateTimingStyles||ba);N=1E3*I;z=1E3*J;c.skipBlocking||(p.blockTransition=0<E.transitionDuration,p.blockKeyframeAnimation=0<E.animationDuration&&0<S.animationDelay&&0===S.animationDuration);c.from&&(c.cleanupStyles&&Ea(t,n,Object.keys(c.from)),ya(a,c));p.blockTransition||p.blockKeyframeAnimation?F(J):c.skipBlocking||ja(n,!1);return{$$willAnimate:!0,
end:d,start:function(){if(!ga)return L={end:d,cancel:g,resume:null,pause:null},H=new s(L),C(A),H}}}}]}]).provider("$$animateCssDriver",["$$animationProvider",function(a){a.drivers.push("$$animateCssDriver");this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,c,d,e,s,h,g){function v(a){return a.replace(/\bng-\S+\b/g,"")}function r(a,b){I(a)&&(a=a.split(" "));I(b)&&(b=b.split(" "));return a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}
function u(c,e,g){function h(a){var b={},c=B(a).getBoundingClientRect();q(["width","height","top","left"],function(a){var d=c[a];switch(a){case "top":d+=C.scrollTop;break;case "left":d+=C.scrollLeft}b[a]=Math.floor(d)+"px"});return b}function f(){var c=v(g.attr("class")||""),d=r(c,m),c=r(m,c),d=a(x,{to:h(g),addClass:"ng-anchor-in "+d,removeClass:"ng-anchor-out "+c,delay:!0});return d.$$willAnimate?d:null}function s(){x.remove();e.removeClass("ng-animate-shim");g.removeClass("ng-animate-shim")}var x=
L(B(e).cloneNode(!0)),m=v(x.attr("class")||"");e.addClass("ng-animate-shim");g.addClass("ng-animate-shim");x.addClass("ng-anchor");D.append(x);var F;c=function(){var c=a(x,{addClass:"ng-anchor-out",delay:!0,from:h(e)});return c.$$willAnimate?c:null}();if(!c&&(F=f(),!F))return s();var G=c||F;return{start:function(){function a(){c&&c.end()}var b,c=G.start();c.done(function(){c=null;if(!F&&(F=f()))return c=F.start(),c.done(function(){c=null;s();b.complete()}),c;s();b.complete()});return b=new d({end:a,
cancel:a})}}}function H(a,b,c,e){var f=R(a,M),g=R(b,M),h=[];q(e,function(a){(a=u(c,a.out,a["in"]))&&h.push(a)});if(f||g||0!==h.length)return{start:function(){function a(){q(b,function(a){a.end()})}var b=[];f&&b.push(f.start());g&&b.push(g.start());q(h,function(a){b.push(a.start())});var c=new d({end:a,cancel:a});d.all(b,function(a){c.complete(a)});return c}}}function R(c){var d=c.element,e=c.options||{};c.structural&&(e.event=c.event,e.structural=!0,e.applyClassesEarly=!0,"leave"===c.event&&(e.onDone=
e.domOperation));e.preparationClasses&&(e.event=Y(e.event,e.preparationClasses));c=a(d,e);return c.$$willAnimate?c:null}if(!s.animations&&!s.transitions)return M;var C=g[0].body;c=B(e);var D=L(c.parentNode&&11===c.parentNode.nodeType||C.contains(c)?c:C);N(h);return function(a){return a.from&&a.to?H(a.from,a.to,a.classes,a.anchors):R(a)}}]}]).provider("$$animateJs",["$animateProvider",function(a){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function e(c){c=X(c)?c:c.split(" ");
for(var d=[],e={},r=0;r<c.length;r++){var q=c[r],s=a.$$registeredAnimations[q];s&&!e[q]&&(d.push(b.get(s)),e[q]=!0)}return d}var s=N(d);return function(a,b,d,r){function u(){r.domOperation();s(a,r)}function H(a,b,d,e,f){switch(d){case "animate":b=[b,e.from,e.to,f];break;case "setClass":b=[b,D,K,f];break;case "addClass":b=[b,D,f];break;case "removeClass":b=[b,K,f];break;default:b=[b,f]}b.push(e);if(a=a.apply(a,b))if(Fa(a.start)&&(a=a.start()),a instanceof c)a.done(f);else if(Fa(a))return a;return M}
function B(a,b,d,e,f){var g=[];q(e,function(e){var h=e[f];h&&g.push(function(){var e,f,g=!1,k=function(a){g||(g=!0,(f||M)(a),e.complete(!a))};e=new c({end:function(){k()},cancel:function(){k(!0)}});f=H(h,a,b,d,function(a){k(!1===a)});return e})});return g}function C(a,b,d,e,f){var g=B(a,b,d,e,f);if(0===g.length){var h,l;"beforeSetClass"===f?(h=B(a,"removeClass",d,e,"beforeRemoveClass"),l=B(a,"addClass",d,e,"beforeAddClass")):"setClass"===f&&(h=B(a,"removeClass",d,e,"removeClass"),l=B(a,"addClass",
d,e,"addClass"));h&&(g=g.concat(h));l&&(g=g.concat(l))}if(0!==g.length)return function(a){var b=[];g.length&&q(g,function(a){b.push(a())});b.length?c.all(b,a):a();return function(a){q(b,function(b){a?b.cancel():b.end()})}}}3===arguments.length&&pa(d)&&(r=d,d=null);r=ia(r);d||(d=a.attr("class")||"",r.addClass&&(d+=" "+r.addClass),r.removeClass&&(d+=" "+r.removeClass));var D=r.addClass,K=r.removeClass,l=e(d),y,w;if(l.length){var f,I;"leave"==b?(I="leave",f="afterLeave"):(I="before"+b.charAt(0).toUpperCase()+
b.substr(1),f=b);"enter"!==b&&"move"!==b&&(y=C(a,b,r,l,I));w=C(a,b,r,l,f)}if(y||w)return{start:function(){function b(c){f=!0;u();da(a,r);g.complete(c)}var d,e=[];y&&e.push(function(a){d=y(a)});e.length?e.push(function(a){u();a(!0)}):u();w&&e.push(function(a){d=w(a)});var f=!1,g=new c({end:function(){f||((d||M)(void 0),b(void 0))},cancel:function(){f||((d||M)(!0),b(!0))}});c.chain(e,b);return g}}}}]}]).provider("$$animateJsDriver",["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver");
this.$get=["$$animateJs","$$AnimateRunner",function(a,c){function d(c){return a(c.element,c.event,c.classes,c.options)}return function(a){if(a.from&&a.to){var b=d(a.from),h=d(a.to);if(b||h)return{start:function(){function a(){return function(){q(d,function(a){a.end()})}}var d=[];b&&d.push(b.start());h&&d.push(h.start());c.all(d,function(a){e.complete(a)});var e=new c({end:a(),cancel:a()});return e}}}else return d(a)}}]}])})(window,window.angular);
//# sourceMappingURL=angular-animate.min.js.map
;
/**
 * Bunch of useful filters for angularJS(with no external dependencies!)
 * @version v0.5.1 - 2014-11-12 * @link https://github.com/a8m/angular-filter
 * @author Ariel Mashraki <ariel@mashraki.co.il>
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */
(function ( window, angular, undefined ) {
/*jshint globalstrict:true*/
'use strict';

var isDefined = angular.isDefined,
    isUndefined = angular.isUndefined,
    isFunction = angular.isFunction,
    isString = angular.isString,
    isNumber = angular.isNumber,
    isObject = angular.isObject,
    isArray = angular.isArray,
    forEach = angular.forEach,
    extend = angular.extend,
    copy = angular.copy,
    equals = angular.equals;


/**
 * @description
 * get an object and return array of values
 * @param object
 * @returns {Array}
 */
function toArray(object) {
  return isArray(object) ? object :
    Object.keys(object).map(function(key) {
      return object[key];
    });
}

/**
 * @param value
 * @returns {boolean}
 */
function isNull(value) {
    return value === null;
}

/**
 * @description
 * return if object contains partial object
 * @param partial{object}
 * @param object{object}
 * @returns {boolean}
 */
function objectContains(partial, object) {
  var keys = Object.keys(partial);

  return keys.map(function(el) {
    return !(!object[el] || (object[el] != partial[el]));
  }).indexOf(false) == -1;

}

/**
 * @description
 * search for approximate pattern in string
 * @param word
 * @param pattern
 * @returns {*}
 */
function hasApproxPattern(word, pattern) {
  if(pattern === '')
    return word;

  var index = word.indexOf(pattern.charAt(0));

  if(index === -1)
    return false;

  return hasApproxPattern(word.substr(index+1), pattern.substr(1))
}

/**
 * @description
 * return the first n element of an array,
 * if expression provided, is returns as long the expression return truthy
 * @param array
 * @param n {number}
 * @param expression {$parse}
 * @return array or single object
 */
function getFirstMatches(array, n, expression) {
  var count = 0;

  return array.filter(function(elm) {
    var rest = isDefined(expression) ? (count < n && expression(elm)) : count < n;
    count = rest ? count+1 : count;

    return rest;
  });
}
/**
 * Polyfill to ECMA6 String.prototype.contains
 */
if (!String.prototype.contains) {
  String.prototype.contains = function() {
    return String.prototype.indexOf.apply(this, arguments) !== -1;
  };
}

/**
 * @param num {Number}
 * @param decimal {Number}
 * @param $math
 * @returns {Number}
 */
function convertToDecimal(num, decimal, $math){
  return $math.round(num * $math.pow(10,decimal)) / ($math.pow(10,decimal));
}

/**
 * @description
 * Get an object, and return an array composed of it's properties names(nested too).
 * @param obj {Object}
 * @param stack {Array}
 * @param parent {String}
 * @returns {Array}
 * @example
 * parseKeys({ a:1, b: { c:2, d: { e: 3 } } }) ==> ["a", "b.c", "b.d.e"]
 */
function deepKeys(obj, stack, parent) {
  stack = stack || [];
  var keys = Object.keys(obj);

  keys.forEach(function(el) {
    //if it's a nested object
    if(isObject(obj[el]) && !isArray(obj[el])) {
      //concatenate the new parent if exist
      var p = parent ? parent + '.' + el : parent;
      deepKeys(obj[el], stack, p || el);
    } else {
      //create and save the key
      var key = parent ? parent + '.' + el : el;
      stack.push(key)
    }
  });
  return stack
}

/**
 * @description
 * Test if given object is a Scope instance
 * @param obj
 * @returns {Boolean}
 */
function isScope(obj) {
  return obj && obj.$evalAsync && obj.$watch;
}
/**
 * @ngdoc filter
 * @name a8m.angular
 * @kind function
 *
 * @description
 * reference to angular function
 */

angular.module('a8m.angular', [])

    .filter('isUndefined', function () {
      return function (input) {
        return angular.isUndefined(input);
      }
    })
    .filter('isDefined', function() {
      return function (input) {
        return angular.isDefined(input);
      }
    })
    .filter('isFunction', function() {
      return function (input) {
        return angular.isFunction(input);
      }
    })
    .filter('isString', function() {
      return function (input) {
        return angular.isString(input)
      }
    })
    .filter('isNumber', function() {
      return function (input) {
        return angular.isNumber(input);
      }
    })
    .filter('isArray', function() {
      return function (input) {
        return angular.isArray(input);
      }
    })
    .filter('isObject', function() {
      return function (input) {
        return angular.isObject(input);
      }
    })
    .filter('isEqual', function() {
      return function (o1, o2) {
        return angular.equals(o1, o2);
      }
    });

/**
 * @ngdoc filter
 * @name a8m.conditions
 * @kind function
 *
 * @description
 * reference to math conditions
 */
 angular.module('a8m.conditions', [])

  .filter({
    isGreaterThan  : isGreaterThanFilter,
    '>'            : isGreaterThanFilter,

    isGreaterThanOrEqualTo  : isGreaterThanOrEqualToFilter,
    '>='                    : isGreaterThanOrEqualToFilter,

    isLessThan  : isLessThanFilter,
    '<'         : isLessThanFilter,

    isLessThanOrEqualTo  : isLessThanOrEqualToFilter,
    '<='                 : isLessThanOrEqualToFilter,

    isEqualTo  : isEqualToFilter,
    '=='       : isEqualToFilter,

    isNotEqualTo  : isNotEqualToFilter,
    '!='          : isNotEqualToFilter,

    isIdenticalTo  : isIdenticalToFilter,
    '==='          : isIdenticalToFilter,

    isNotIdenticalTo  : isNotIdenticalToFilter,
    '!=='             : isNotIdenticalToFilter
  });

  function isGreaterThanFilter() {
    return function (input, check) {
      return input > check;
    };
  }

  function isGreaterThanOrEqualToFilter() {
    return function (input, check) {
      return input >= check;
    };
  }

  function isLessThanFilter() {
    return function (input, check) {
      return input < check;
    };
  }

  function isLessThanOrEqualToFilter() {
    return function (input, check) {
      return input <= check;
    };
  }

  function isEqualToFilter() {
    return function (input, check) {
      return input == check;
    };
  }

  function isNotEqualToFilter() {
    return function (input, check) {
      return input != check;
    };
  }

  function isIdenticalToFilter() {
    return function (input, check) {
      return input === check;
    };
  }

  function isNotIdenticalToFilter() {
    return function (input, check) {
      return input !== check;
    };
  }
/**
 * @ngdoc filter
 * @name isNull
 * @kind function
 *
 * @description
 * checks if value is null or not
 * @return Boolean
 */

angular.module('a8m.is-null', [])

    .filter('isNull', function () {
      return function(input) {
        return isNull(input);
      }
    });

/**
 * @ngdoc filter
 * @name after-where
 * @kind function
 *
 * @description
 * get a collection and properties object, and returns all of the items
 * in the collection after the first that found with the given properties.
 *
 */

angular.module('a8m.after-where', [])
    .filter('afterWhere', function() {
      return function (collection, object) {

        collection = (isObject(collection)) ?
            toArray(collection) :
            collection;

        if(!isArray(collection) || isUndefined(object))
          return collection;

        var index = collection.map( function( elm ) {
          return objectContains(object, elm);
        }).indexOf( true );

        return collection.slice((index === -1) ? 0 : index);
      }
    });

/**
 * @ngdoc filter
 * @name after
 * @kind function
 *
 * @description
 * get a collection and specified count, and returns all of the items
 * in the collection after the specified count.
 *
 */

angular.module('a8m.after', [])
    .filter('after', function() {
      return function (collection, count) {

        collection = (isObject(collection)) ?
            toArray(collection) :
            collection;

        return (isArray(collection)) ?
            collection.slice(count) :
            collection;

      }
    });

/**
 * @ngdoc filter
 * @name before-where
 * @kind function
 *
 * @description
 * get a collection and properties object, and returns all of the items
 * in the collection before the first that found with the given properties.
 *
 */

angular.module('a8m.before-where', [])
  .filter('beforeWhere', function() {
    return function (collection, object) {

      collection = (isObject(collection)) ?
        toArray(collection) :
        collection;

      if(!isArray(collection) || isUndefined(object))
        return collection;

      var index = collection.map( function( elm ) {
        return objectContains(object, elm);
      }).indexOf( true );

      return collection.slice(0, (index === -1) ? collection.length : ++index);
    }
  });

/**
 * @ngdoc filter
 * @name before
 * @kind function
 *
 * @description
 * get a collection and specified count, and returns all of the items
 * in the collection before the specified count.
 *
 */

angular.module('a8m.before', [])
    .filter('before', function() {
      return function (collection, count) {

        collection = (isObject(collection)) ?
            toArray(collection) :
            collection;

        return (isArray(collection)) ?
            collection.slice(0, (!count) ? count : --count) :
            collection;

      }
    });

/**
 * @ngdoc filter
 * @name concat
 * @kind function
 *
 * @description
 * get (array/object, object/array) and return merged collection
 *
 */

angular.module('a8m.concat', [])
  //TODO:unique option ? or use unique filter to filter result
  .filter('concat', [function () {
    return function (collection, joined) {

      if (isUndefined(joined)) {
        return collection;
      }
      if (isArray(collection)) {
        return (isObject(joined)) ?
            collection.concat(toArray(joined)) :
            collection.concat(joined);
      }

      if (isObject(collection)) {
        var array = toArray(collection);
        return (isObject(joined)) ?
            array.concat(toArray(joined)) :
            array.concat(joined);
      }
      return collection;
    };
  }
]);

/**
 * @ngdoc filter
 * @name contains
 * @kind function
 *
 * @description
 * Checks if given expression is present in one or more object in the collection
 */

angular.module('a8m.contains', [])
  .filter({
    contains: ['$parse', containsFilter],
    some: ['$parse', containsFilter]
  });

function containsFilter( $parse ) {
    return function (collection, expression) {

      collection = (isObject(collection)) ? toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(expression)) {
        return true;
      }

      return collection.some( function(elm) {

        return (isObject(elm) || isFunction(expression)) ?
          $parse(expression)(elm) :
          elm === expression;

      });

    }
 }

/**
 * @ngdoc filter
 * @name countBy
 * @kind function
 *
 * @description
 * Sorts a list into groups and returns a count for the number of objects in each group.
 */

angular.module('a8m.count-by', [])

  .filter('countBy', [ '$parse', function ( $parse ) {
    return function (collection, property) {

      var result = {},
        get = $parse(property),
        prop;

      collection = (isObject(collection)) ? toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(property)) {
        return collection;
      }

      collection.forEach( function( elm ) {
        prop = get(elm);

        if(!result[prop]) {
          result[prop] = 0;
        }

        result[prop]++;
      });

      return result;
    }
  }]);

/**
 * @ngdoc filter
 * @name defaults
 * @kind function
 *
 * @description
 * defaultsFilter allows to specify a default fallback value for properties that resolve to undefined.
 */

angular.module('a8m.defaults', [])
  .filter('defaults', ['$parse', function( $parse ) {
    return function(collection, defaults) {

      collection = (isObject(collection)) ? toArray(collection) : collection;

      if(!isArray(collection) || !isObject(defaults)) {
        return collection;
      }

      var keys = deepKeys(defaults);

      collection.forEach(function(elm) {
        //loop through all the keys
        keys.forEach(function(key) {
          var getter = $parse(key);
          var setter = getter.assign;
          //if it's not exist
          if(isUndefined(getter(elm))) {
            //get from defaults, and set to the returned object
            setter(elm, getter(defaults))
          }
        });
      });

      return collection;
    }
  }]);
/**
 * @ngdoc filter
 * @name every
 * @kind function
 *
 * @description
 * Checks if given expression is present in all members in the collection
 *
 */

angular.module('a8m.every', [])
  .filter('every', ['$parse', function($parse) {
    return function (collection, expression) {

      collection = (isObject(collection)) ? toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(expression)) {
        return true;
      }

      return collection.every( function(elm) {

        return (isObject(elm) || isFunction(expression)) ?
          $parse(expression)(elm) :
          elm === expression;
      });

    }
  }]);

/**
 * @ngdoc filter
 * @name filterBy
 * @kind function
 *
 * @description
 * filter by specific properties, avoid the rest
 */
angular.module('a8m.filter-by', [])

  .filter('filterBy', ['$parse', function( $parse ) {
    return function(collection, properties, search) {

      var comparator;

      search = (isString(search) || isNumber(search)) ?
        String(search).toLowerCase() : undefined;

      collection = (isObject(collection)) ? toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(search)) {
        return collection;
      }

      return collection.filter(function(elm) {

        return properties.some(function(prop) {

          /**
           * check if there is concatenate properties
           * example:
           * object: { first: 'foo', last:'bar' }
           * filterBy: ['first + last'] => search by full name(i.e 'foo bar')
           */
          if(!~prop.indexOf('+')) {
            comparator = $parse(prop)(elm)
          } else {
            var propList = prop.replace(new RegExp('\\s', 'g'), '').split('+');
            comparator = propList.reduce(function(prev, cur, index) {
              return (index === 1) ? $parse(prev)(elm) + ' ' + $parse(cur)(elm) :
                prev + ' ' + $parse(cur)(elm);
            });
          }

          return (isString(comparator) || isNumber(comparator)) ?
            String(comparator).toLowerCase().contains(search) :
            false;
        })

      });

    }
  }]);

/**
 * @ngdoc filter
 * @name first
 * @kind function
 *
 * @description
 * Gets the first element or first n elements of an array
 * if callback is provided, is returns as long the callback return truthy
 */
angular.module('a8m.first', [])

  .filter('first', ['$parse', function( $parse ) {
    return function(collection) {

      var n,
        getter,
        args;

      collection = (isObject(collection)) ? toArray(collection) :
        collection;

      if(!isArray(collection)) {
        return collection;
      }

      args = Array.prototype.slice.call(arguments, 1);
      n = (isNumber(args[0])) ? args[0] : 1;
      getter = (!isNumber(args[0]))  ? args[0] : (!isNumber(args[1])) ? args[1] : undefined;

      return (args.length) ? getFirstMatches(collection, n,(getter) ? $parse(getter) : getter) :
        collection[0];
    }
  }]);

/**
 * @ngdoc filter
 * @name flatten
 * @kind function
 *
 * @description
 * Flattens a nested array (the nesting can be to any depth).
 * If you pass shallow, the array will only be flattened a single level
 */

angular.module('a8m.flatten', [])
  .filter('flatten', function () {
    return function(collection, shallow) {

      shallow = shallow || false;
      collection = (isObject(collection)) ? toArray(collection)
        : collection;

      if(!isArray(collection)) {
        return collection;
      }

      return (!shallow) ? flatten(collection, 0) :
        [].concat.apply([], collection);
    }
  });

/**
 * flatten nested array (the nesting can be to any depth).
 * @param array {Array}
 * @param i {int}
 * @returns {Array}
 * @private
 */
function flatten(array, i) {
  i = i || 0;

  if(i >= array.length)
    return array;

  if(isArray(array[i])) {
    return flatten(array.slice(0,i)
      .concat(array[i], array.slice(i+1)), i);
  }
  return flatten(array, i+1);
}

/**
 * @ngdoc filter
 * @name fuzzyByKey
 * @kind function
 *
 * @description
 * fuzzy string searching by key
 */

angular.module('a8m.fuzzy-by', [])
  .filter('fuzzyBy', ['$parse', function ( $parse ) {
    return function (collection, property, search, csensitive) {

      var sensitive = csensitive || false,
        prop, getter;

      collection = (isObject(collection)) ? toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(property)
        || isUndefined(search)) {
        return collection;
      }

      getter = $parse(property);

      return collection.filter(function(elm) {

        prop = getter(elm);
        if(!isString(prop)) {
          return false;
        }

        prop = (sensitive) ? prop : prop.toLowerCase();
        search = (sensitive) ? search : search.toLowerCase();

        return hasApproxPattern(prop, search) !== false
      })
    }

 }]);
/**
 * @ngdoc filter
 * @name fuzzy
 * @kind function
 *
 * @description
 * fuzzy string searching for array of strings, objects
 */

angular.module('a8m.fuzzy', [])
  .filter('fuzzy', function () {
    return function (collection, search, csensitive) {

      var sensitive = csensitive || false;

      collection = (isObject(collection)) ? toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(search)) {
        return collection;
      }

      search = (sensitive) ? search : search.toLowerCase();

      return collection.filter(function(elm) {

        if(isString(elm)) {
          elm = (sensitive) ? elm : elm.toLowerCase();
          return hasApproxPattern(elm, search) !== false
        }

        return (isObject(elm)) ? _hasApproximateKey(elm, search) : false;

      });

      /**
       * checks if object has key{string} that match
       * to fuzzy search pattern
       * @param object
       * @param search
       * @returns {boolean}
       * @private
       */
      function _hasApproximateKey(object, search) {
        var properties = Object.keys(object),
          prop, flag;
        return 0 < properties.filter(function (elm) {
          prop = object[elm];

          //avoid iteration if we found some key that equal[performance]
          if(flag) return true;

          if (isString(prop)) {
            prop = (sensitive) ? prop : prop.toLowerCase();
            return flag = (hasApproxPattern(prop, search) !== false);
          }

          return false;

        }).length;
      }

    }
  });

/**
 * @ngdoc filter
 * @name groupBy
 * @kind function
 *
 * @description
 * Create an object composed of keys generated from the result of running each element of a collection,
 * each key is an array of the elements.
 */

angular.module('a8m.group-by', [ 'a8m.filter-watcher' ])

  .filter('groupBy', [ '$parse', 'filterWatcher', function ( $parse, filterWatcher ) {
    return function (collection, property) {

      if(!isObject(collection) || isUndefined(property)) {
        return collection;
      }

      var getterFn = $parse(property);

      return filterWatcher.isMemoized('groupBy', arguments) ||
        filterWatcher.memoize('groupBy', arguments, this,
          _groupBy(collection, getterFn));

      /**
       * groupBy function
       * @param collection
       * @param getter
       * @returns {{}}
       */
      function _groupBy(collection, getter) {
        var result = {};
        var prop;

        forEach( collection, function( elm ) {
          prop = getter(elm);

          if(!result[prop]) {
            result[prop] = [];
          }
          result[prop].push(elm);
        });
        return result;
      }
    }
 }]);

/**
 * @ngdoc filter
 * @name isEmpty
 * @kind function
 *
 * @description
 * get collection or string and return if it empty
 */

angular.module('a8m.is-empty', [])
  .filter('isEmpty', function () {
    return function(collection) {
      return (isObject(collection)) ?
        !toArray(collection).length :
        !collection.length;
    }
  });

/**
 * @ngdoc filter
 * @name last
 * @kind function
 *
 * @description
 * Gets the last element or last n elements of an array
 * if callback is provided, is returns as long the callback return truthy
 */
angular.module('a8m.last', [])

  .filter('last', ['$parse', function( $parse ) {
    return function(collection) {

      var n,
        getter,
        args,
      //cuz reverse change our src collection
      //and we don't want side effects
        reversed = copy(collection);

      reversed = (isObject(reversed)) ? toArray(reversed) :
        reversed;

      if(!isArray(reversed)) {
        return reversed;
      }

      args = Array.prototype.slice.call(arguments, 1);
      n = (isNumber(args[0])) ? args[0] : 1;
      getter = (!isNumber(args[0]))  ? args[0] : (!isNumber(args[1])) ? args[1] : undefined;

      return (args.length) ?
        //send reversed collection as arguments, and reverse it back as result
        getFirstMatches(reversed.reverse(), n,(getter) ? $parse(getter) : getter).reverse() :
        //get the last element
        reversed[reversed.length-1];
    }
  }]);

/**
 * @ngdoc filter
 * @name map
 * @kind function
 *
 * @description
 * Returns a new collection of the results of each expression execution.
 */

angular.module('a8m.map', [])

  .filter('map', ['$parse', function($parse) {
    return function (collection, expression) {

      collection = (isObject(collection)) ?
        toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(expression)) {
        return collection;
      }

      return collection.map(function (elm) {

        return $parse(expression)(elm);
      });
    }
  }]);

/**
 * @ngdoc filter
 * @name omit
 * @kind function
 *
 * @description
 * filter collection by expression
 */

angular.module('a8m.omit', [])

  .filter('omit', ['$parse', function($parse) {
    return function (collection, expression) {

      collection = (isObject(collection)) ?
        toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(expression)) {
        return collection;
      }

      return collection.filter(function (elm) {

        return !($parse(expression)(elm));
      });
    }
  }]);

/**
 * @ngdoc filter
 * @name omit
 * @kind function
 *
 * @description
 * filter collection by expression
 */

angular.module('a8m.pick', [])

  .filter('pick', ['$parse', function($parse) {
    return function (collection, expression) {

      collection = (isObject(collection)) ?
        toArray(collection) : collection;

      if(!isArray(collection) || isUndefined(expression)) {
        return collection;
      }

      return collection.filter(function (elm) {

        return $parse(expression)(elm);
      });
    }
  }]);

/**
 * @ngdoc filter
 * @name removeWith
 * @kind function
 *
 * @description
 * get collection and properties object, and removed elements
 * with this properties
 */

angular.module('a8m.remove-with', [])
  .filter('removeWith', function() {
    return function (collection, object) {

      if(isUndefined(object)) {
        return collection;
      }
      collection = (isObject(collection)) ?
        toArray(collection) : collection;

      return collection.filter(function (elm) {
        return !objectContains(object, elm);
      });
    }
  });


/**
 * @ngdoc filter
 * @name remove
 * @kind function
 *
 * @description
 * remove specific members from collection
 */

angular.module('a8m.remove', [])

  .filter('remove', function () {
    return function (collection) {

      collection = (isObject(collection)) ? toArray(collection) : collection;

      var args = Array.prototype.slice.call(arguments, 1);

      if(!isArray(collection)) {
        return collection;
      }

      return collection.filter( function( member ) {
        return !args.some(function(nest) {
          return equals(nest, member);
        })
      });

    }
  });

/**
 * @ngdoc filter
 * @name reverse
 * @kind function
 *
 * @description
 * Reverses a string or collection
 */

angular.module('a8m.reverse', [])

    .filter('reverse',[ function () {
      return function (input) {

        input = (isObject(input)) ? toArray(input) : input;

        if(isString(input)) {
          return input.split('').reverse().join('');
        }

        return (isArray(input)) ? input.slice().reverse() : input;
      }
    }]);


/**
 * @ngdoc filter
 * @name searchField
 * @kind function
 *
 * @description
 * for each member, join several strings field and add them to
 * new field called 'searchField' (use for search filtering)
 */

angular.module('a8m.search-field', [])

  .filter('searchField', ['$parse', function ($parse) {
    return function (collection) {

      var get, field;

      collection = (isObject(collection)) ? toArray(collection) : collection;

      var args = Array.prototype.slice.call(arguments, 1);

      if(!isArray(collection) || !args.length) {
        return collection;
      }

      return collection.map(function(member) {

        field = args.map(function(field) {
          get = $parse(field);
          return get(member);
        }).join(' ');

        return extend(member, { searchField: field });
      });
    }
  }]);

/**
 * @ngdoc filter
 * @name toArray
 * @kind function
 *
 * @description
 * Convert objects into stable arrays.
 * if addKey set to true,the filter also attaches a new property
 * $key to the value containing the original key that was used in
 * the object we are iterating over to reference the property
 */

angular.module('a8m.to-array', [])

  .filter('toArray', function() {
    return function (collection, addKey) {

      if(!isObject(collection)) {
        return collection;
      }

      return (!addKey) ? toArray(collection) :

        Object.keys(collection).map(function (key) {
          return extend(collection[key], { $key: key });
        });
    }
  });

/**
 * @ngdoc filter
 * @name unique/uniq
 * @kind function
 *
 * @description
 * get collection and filter duplicate members
 * if uniqueFilter get a property(nested to) as argument it's
 * filter by this property as unique identifier
 */

angular.module('a8m.unique', [])
  .filter({
      unique: ['$parse', uniqFilter],
      uniq: ['$parse', uniqFilter]
    });

function uniqFilter($parse) {
    return function (collection, property) {

      collection = (isObject(collection)) ? toArray(collection) : collection;

      if (!isArray(collection)) {
        return collection;
      }

      //store all unique identifiers
      var uniqueItems = [],
          get = $parse(property);

      return (isUndefined(property)) ?
        //if it's kind of primitive array
        collection.filter(function (elm, pos, self) {
          return self.indexOf(elm) === pos;
        }) :
        //else compare with equals
        collection.filter(function (elm) {
          var prop = get(elm);
          if(some(uniqueItems, prop)) {
            return false;
          }
          uniqueItems.push(prop);
          return true;
      });

      //checked if the unique identifier is already exist
      function some(array, member) {
        if(isUndefined(member)) {
          return false;
        }
        return array.some(function(el) {
          return equals(el, member);
        });
      }

    }
}

/**
 * @ngdoc filter
 * @name where
 * @kind function
 *
 * @description
 * of each element in a collection to the given properties object,
 * returning an array of all elements that have equivalent property values.
 *
 */

angular.module('a8m.where', [])
  .filter('where', function() {
    return function (collection, object) {

      if(isUndefined(object)) {
        return collection;
      }
      collection = (isObject(collection)) ?
        toArray(collection) : collection;

      return collection.filter(function (elm) {
        return objectContains(object, elm);
      });
    }
  });

/**
 * @ngdoc filter
 * @name xor
 * @kind function
 *
 * @description
 * Exclusive or filter by expression
 */

angular.module('a8m.xor', [])

  .filter('xor', ['$parse', function($parse) {
    return function (col1, col2, expression) {

      expression = expression || false;

      col1 = (isObject(col1)) ? toArray(col1) : col1;
      col2 = (isObject(col2)) ? toArray(col2) : col2;

      if(!isArray(col1) || !isArray(col2)) return col1;

      return col1.concat(col2)
        .filter(function(elm) {
          return !(some(elm, col1) && some(elm, col2));
        });

      function some(el, col) {
        var getter = $parse(expression);
        return col.some(function(dElm) {
          return expression ?
            equals(getter(dElm), getter(el)) :
            equals(dElm, el);
        })
      }
    }
  }]);

/**
 * @ngdoc filter
 * @name formatBytes
 * @kind function
 *
 * @description
 * Convert bytes into appropriate display 
 * 1024 bytes => 1 KB
 */

angular.module('a8m.math.byteFmt', ['a8m.math'])

  .filter('byteFmt', ['$math', function ($math) {
    return function (bytes, decimal) {

      if(isNumber(decimal) && isFinite(decimal) && decimal%1===0 && decimal >= 0 &&
        isNumber(bytes) && isFinite(bytes)) {

        if(bytes < 1024) { // within 1 KB so B
            return convertToDecimal(bytes, decimal, $math) + ' B';
        } else if(bytes < 1048576) { // within 1 MB so KB
            return convertToDecimal((bytes / 1024), decimal, $math) + ' KB';
        } else if(bytes < 1073741824){ // within 1 GB so MB
            return convertToDecimal((bytes / 1048576), decimal, $math) + ' MB';
        } else { // GB or more
            return convertToDecimal((bytes / 1073741824), decimal, $math) + ' GB';
        }

	  } else {
		return "NaN";
	  }
    }
  }]);
/**
 * @ngdoc filter
 * @name degrees
 * @kind function
 *
 * @description
 * Convert angle from radians to degrees
 *
 */

angular.module('a8m.math.degrees', ['a8m.math'])

  .filter('degrees', ['$math', function ($math) {
    return function (radians, decimal) {
	    // if decimal is not an integer greater than -1, we cannot do. quit with error "NaN"
		// if degrees is not a real number, we cannot do also. quit with error "NaN"
		if(isNumber(decimal) && isFinite(decimal) && decimal%1===0 && decimal >= 0 &&
          isNumber(radians) && isFinite(radians)) {
		    var degrees = (radians * 180) / $math.PI;
		    return $math.round(degrees * $math.pow(10,decimal)) / ($math.pow(10,decimal));
	    } else {
          return "NaN";
		}
	}
}]);

 
 
/**
 * @ngdoc filter
 * @name formatBytes
 * @kind function
 *
 * @description
 * Convert bytes into appropriate display 
 * 1024 kilobytes => 1 MB
 */

angular.module('a8m.math.kbFmt', ['a8m.math'])

  .filter('kbFmt', ['$math', function ($math) {
    return function (bytes, decimal) {

      if(isNumber(decimal) && isFinite(decimal) && decimal%1===0 && decimal >= 0 &&
        isNumber(bytes) && isFinite(bytes)) {

        if(bytes < 1024) { // within 1 MB so KB
            return convertToDecimal(bytes, decimal, $math) + ' KB';
        } else if(bytes < 1048576) { // within 1 GB so MB
            return convertToDecimal((bytes / 1024), decimal, $math) + ' MB';
        } else {
            return convertToDecimal((bytes / 1048576), decimal, $math) + ' GB';
        }

		} else {
			return "NaN";
		}
    }
}]);
/**
 * @ngdoc module
 * @name math
 * @description
 * reference to global Math object
 */

angular.module('a8m.math', [])
  .factory('$math', ['$window', function ($window) {

    return $window.Math;

  }]);

/**
 * @ngdoc filter
 * @name max
 * @kind function
 *
 * @description
 * Math.max will get an array and return the max value. if an expression
 * is provided, will return max value by expression.
 */

angular.module('a8m.math.max', ['a8m.math'])

  .filter('max', ['$math', '$parse', function ($math, $parse) {
    return function (input, expression) {

      if(!isArray(input)) {
        return input;
      }
      return isUndefined(expression)
        ? $math.max.apply($math, input)
        : input[indexByMax(input, expression)];
    };

    /**
     * @private
     * @param array
     * @param exp
     * @returns {number|*|Number}
     */
    function indexByMax(array, exp) {
      var mappedArray = array.map(function(elm){
        return $parse(exp)(elm);
      });
      return mappedArray.indexOf($math.max.apply($math, mappedArray));
    }

  }]);
/**
 * @ngdoc filter
 * @name min
 * @kind function
 *
 * @description
 * Math.min will get an array and return the min value. if an expression
 * is provided, will return min value by expression.
 */

angular.module('a8m.math.min', ['a8m.math'])

  .filter('min', ['$math', '$parse', function ($math, $parse) {
    return function (input, expression) {

      if(!isArray(input)) {
        return input;
      }
      return isUndefined(expression)
        ? $math.min.apply($math, input)
        : input[indexByMin(input, expression)];
    };

    /**
     * @private
     * @param array
     * @param exp
     * @returns {number|*|Number}
     */
    function indexByMin(array, exp) {
      var mappedArray = array.map(function(elm){
        return $parse(exp)(elm);
      });
      return mappedArray.indexOf($math.min.apply($math, mappedArray));
    }

  }]);
/**
 * @ngdoc filter
 * @name Percent
 * @kind function
 *
 * @description
 * percentage between two numbers
 *
 */

angular.module('a8m.math.percent', ['a8m.math'])

  .filter('percent', ['$math', '$window', function ($math, $window) {

    return function (input, divided, round) {

      var divider = (isString(input)) ? $window.Number(input) : input;
      divided = divided || 100;
      round = round || false;

      if (!isNumber(divider) || $window.isNaN(divider)) return input;

      return (round) ? $math.round((divider / divided) * 100) :
        ((divider / divided) * 100);
    }

  }]);

/**
 * @ngdoc filter
 * @name toRadians
 * @kind function
 *
 * @description
 * Convert angle from degrees to radians
 *
 */

angular.module('a8m.math.radians', ['a8m.math'])

  .filter('radians', ['$math', function ($math) {
    return function (degrees, decimal) {
	  // if decimal is not an integer greater than -1, we cannot do. quit with error "NaN"
	  // if degrees is not a real number, we cannot do also. quit with error "NaN"
        if(isNumber(decimal) && isFinite(decimal) && decimal%1===0 && decimal >= 0 &&
          isNumber(degrees) && isFinite(degrees)) {
          var radians = (degrees * 3.14159265359) / 180;
          return $math.round(radians * $math.pow(10,decimal)) / ($math.pow(10,decimal));
		} else {
		    return "NaN";
		}
	}
}]);

 
 
/**
 * @ngdoc filter
 * @name Radix
 * @kind function
 *
 * @description
 * converting decimal numbers to different bases(radix)
 */

angular.module('a8m.math.radix', [])

  .filter('radix', function () {

    return function (input, radix) {

      var RANGE = /^[2-9]$|^[1-2]\d$|^3[0-6]$/;

      if(!isNumber(input) || !RANGE.test(radix)) {
        return input;
      }

      return input.toString(radix).toUpperCase();

    }

  });

/**
 * @ngdoc filter
 * @name formatBytes
 * @kind function
 *
 * @description
 * Convert number into abbreviations.
 * i.e: K for one thousand, M for Million, B for billion
 * e.g: number of users:235,221, decimal:1 => 235.2 K
 */

angular.module('a8m.math.shortFmt', ['a8m.math'])

  .filter('shortFmt', ['$math', function ($math) {
    return function (number, decimal) {
      if(isNumber(decimal) && isFinite(decimal) && decimal%1===0 && decimal >= 0 &&
        isNumber(number) && isFinite(number)){
                    
          if(number < 1e3) {
              return number;
          } else if(number < 1e6) {
              return convertToDecimal((number / 1e3), decimal, $math) + ' K';
          } else if(number < 1e9){
              return convertToDecimal((number / 1e6), decimal, $math) + ' M';
          } else {
            return convertToDecimal((number / 1e9), decimal, $math) + ' B';
          }

	  }else{
        return "NaN";
	  }
	}
}]);
/**
 * @ngdoc filter
 * @name sum
 * @kind function
 *
 * @description
 * Sum up all values within an array
 *
 */

angular.module('a8m.math.sum', [])

  .filter('sum', function () {
    return function (input, initial) {

      return (!isArray(input)) ? input :
        input.reduce(function(prev, curr) {
          return prev + curr;
        }, initial || 0);

    }

  });

/**
 * @ngdoc filter
 * @name endsWith
 * @kind function
 *
 * @description
 * checks whether string ends with the ends parameter.
 */

angular.module('a8m.ends-with', [])

  .filter('endsWith', function () {
    return function (input, ends, csensitive) {

      var sensitive = csensitive || false,
        position;

      if(!isString(input) || isUndefined(ends)) {
        return input;
      }

      input = (sensitive) ? input : input.toLowerCase();
      position = input.length - ends.length;

      return input.indexOf((sensitive) ? ends : ends.toLowerCase(), position) !== -1;
    }
  });

/**
 * @ngdoc filter
 * @name ltrim
 * @kind function
 *
 * @description
 * Left trim. Similar to trimFilter, but only for left side.
 */

angular.module('a8m.ltrim', [])

  .filter('ltrim', function () {
    return function(input, chars) {

      var trim = chars || '\\s';

      if(!isString(input)) {
        return input;
      }

      return input.replace(new RegExp('^' + trim + '+'), '');
    }
  });

/**
 * @ngdoc filter
 * @name repeat
 * @kind function
 *
 * @description
 * Repeats a string n times
 */

angular.module('a8m.repeat', [])

  .filter('repeat',[ function () {
    return function (input, n, separator) {

      var times = ~~n;

      if(!isString(input)) {
        return input;
      }

      return (!times) ? input : strRepeat(input, --n, separator || '');
    }
  }]);

/**
 * Repeats a string n times with given separator
 * @param str string to repeat
 * @param n number of times
 * @param sep separator
 * @returns {*}
 */
function strRepeat(str, n, sep) {
  if(!n) {
    return str;
  }
  return str + sep + strRepeat(str, --n, sep);
}
/**
* @ngdoc filter
* @name rtrim
* @kind function
*
* @description
* Right trim. Similar to trimFilter, but only for right side.
*/

angular.module('a8m.rtrim', [])

  .filter('rtrim', function () {
    return function(input, chars) {

      var trim = chars || '\\s';

      if(!isString(input)) {
        return input;
      }

      return input.replace(new RegExp(trim + '+$'), '');
    }
  });

/**
 * @ngdoc filter
 * @name slugify
 * @kind function
 *
 * @description
 * remove spaces from string, replace with "-" or given argument
 */

angular.module('a8m.slugify', [])

  .filter('slugify',[ function () {
    return function (input, sub) {

      var replace = (isUndefined(sub)) ? '-' : sub;

      if(isString(input)) {
        return input.toLowerCase()
          .replace(/\s+/g, replace);
      }

      return input;
    }
  }]);

/**
 * @ngdoc filter
 * @name startWith
 * @kind function
 *
 * @description
 * checks whether string starts with the starts parameter.
 */

angular.module('a8m.starts-with', [])

  .filter('startsWith', function () {
    return function (input, start, csensitive) {

      var sensitive = csensitive || false;

      if(!isString(input) || isUndefined(start)) {
        return input;
      }

      input = (sensitive) ? input : input.toLowerCase();

      return !input.indexOf((sensitive) ? start : start.toLowerCase());
    }
  });

/**
 * @ngdoc filter
 * @name stringular
 * @kind function
 *
 * @description
 * get string with {n} and replace match with enumeration values
 */

angular.module('a8m.stringular', [])
  .filter('stringular', function () {
    return function(input) {

      var args = Array.prototype.slice.call(arguments, 1);

      return input.replace(/{(\d+)}/g, function (match, number) {
        return isUndefined(args[number]) ? match : args[number];
      });

    }
  });

/**
 * @ngdoc filter
 * @name stripTags
 * @kind function
 *
 * @description
 * strip html tags from string
 */

angular.module('a8m.strip-tags', [])
  .filter('stripTags', function () {
    return function(input) {
      if(isString(input)) {
        return input.replace(/<\S[^><]*>/g, '');
      }
      return input;
    }
  });

/**
 * @ngdoc filter
 * @name trim
 * @kind function
 *
 * @description
 *  Strip whitespace (or other characters) from the beginning and end of a string
 */

angular.module('a8m.trim', [])

  .filter('trim', function () {
    return function(input, chars) {

      var trim = chars || '\\s';

      if(!isString(input)) {
        return input;
      }

      return input.replace(new RegExp('^' + trim + '+|' + trim + '+$', 'g'), '');
    }
  });

/**
 * @ngdoc filter
 * @name truncate
 * @kind function
 *
 * @description
 * truncates a string given a specified length, providing a custom string to denote an omission.
 */

angular.module('a8m.truncate', [])
  .filter('truncate', function () {
    return function(input, length, suffix, preserve) {

      length = isUndefined(length) ? input.length : length;
      preserve = preserve || false;
      suffix = suffix || '';

      if(!isString(input) || (input.length <= length)) return input;

      return input.substring(0, (preserve) ?
          ((input.indexOf(' ', length) === -1) ? input.length : input.indexOf(' ', length)) :
          length) + suffix;

    };
  });

/**
 * @ngdoc filter
 * @name ucfirst
 * @kind function
 *
 * @description
 * ucfirst
 *
 */

angular.module('a8m.ucfirst', [])

  .filter('ucfirst', [function() {
    return function(input) {
      return angular.isString(input) ? input.split(' ')
        .map(function (char) {
          return char.charAt(0).toUpperCase() + char.substring(1);
        }).join(' ') : input;
    }

  }]);

/**
 * @ngdoc filter
 * @name uriComponentEncode
 * @kind function
 *
 * @description
 * get string as parameter and return encoded string
 */

angular.module('a8m.uri-component-encode', [])

  .filter('uriComponentEncode',['$window', function ($window) {
      return function (input) {

        if(isString(input)) {
          return $window.encodeURIComponent(input);
        }

        return input;
      }
    }]);

/**
 * @ngdoc filter
 * @name uriEncode
 * @kind function
 *
 * @description
 * get string as parameter and return encoded string
 */

angular.module('a8m.uri-encode', [])

  .filter('uriEncode',['$window', function ($window) {
      return function (input) {

        if(isString(input)) {
          return $window.encodeURI(input);
        }

        return input;
      }
    }]);

/**
 * @ngdoc filter
 * @name wrap
 * @kind function
 *
 * @description
 * Wrap a string with another string
 */

angular.module('a8m.wrap', [])

  .filter('wrap', function () {
    return function(input, wrap, ends) {

      if(!isString(input) || isUndefined(wrap)) {
        return input;
      }

      return [wrap, input, ends || wrap].join('');

    }
  });

/**
 * @ngdoc provider
 * @name filterWatcher
 * @kind function
 *
 * @description
 * store specific filters result in $$cache, based on scope life time(avoid memory leak).
 * on scope.$destroy remove it's cache from $$cache container
 */

angular.module('a8m.filter-watcher', [])
  .provider('filterWatcher', function() {

    this.$get = ['$window', '$rootScope', function($window, $rootScope) {

      /**
       * Cache storing
       * @type {Object}
       */
      var $$cache = {};

      /**
       * Scope listeners container
       * scope.$destroy => remove all cache keys
       * bind to current scope.
       * @type {Object}
       */
      var $$listeners = {};

      /**
       * $timeout without triggering the digest cycle
       * @type {function}
       */
      var $$timeout = $window.setTimeout;

      /**
       * @description
       * get `HashKey` string based on the given arguments.
       * @param fName
       * @param args
       * @returns {string}
       */
      function getHashKey(fName, args) {
        return [fName, JSON.stringify(args)]
          .join('#')
          .replace(/"/g,'');
      }

      /**
       * @description
       * fir on $scope.$destroy,
       * remove cache based scope from `$$cache`,
       * and remove itself from `$$listeners`
       * @param event
       */
      function removeCache(event) {
        var id = event.targetScope.$id;
        forEach($$listeners[id], function(key) {
          delete $$cache[key];
        });
        delete $$listeners[id];
      }

      /**
       * @description
       * for angular version that greater than v.1.3.0
       * if clear cache when the digest cycle end.
       */
      function cleanStateless() {
        $$timeout(function() {
          if(!$rootScope.$$phase)
            $$cache = {};
        });
      }

      /**
       * @description
       * Store hashKeys in $$listeners container
       * on scope.$destroy, remove them all(bind an event).
       * @param scope
       * @param hashKey
       * @returns {*}
       */
      function addListener(scope, hashKey) {
        var id = scope.$id;
        if(isUndefined($$listeners[id])) {
          scope.$on('$destroy', removeCache);
          $$listeners[id] = [];
        }
        return $$listeners[id].push(hashKey);
      }

      /**
       * @description
       * return the `cacheKey` or undefined.
       * @param filterName
       * @param args
       * @returns {*}
       */
      function $$isMemoized(filterName, args) {
        var hashKey = getHashKey(filterName, args);
        return $$cache[hashKey];
      }

      /**
       * @description
       * store `result` in `$$cache` container, based on the hashKey.
       * add $destroy listener and return result
       * @param filterName
       * @param args
       * @param scope
       * @param result
       * @returns {*}
       */
      function $$memoize(filterName, args, scope, result) {
        var hashKey = getHashKey(filterName, args);
        //store result in `$$cache` container
        $$cache[hashKey] = result;
        // for angular versions that less than 1.3
        // add to `$destroy` listener, a cleaner callback
        if(isScope(scope)) {
          addListener(scope, hashKey);
        } else {
          cleanStateless();
        }
        return result;
      }

      return {
        isMemoized: $$isMemoized,
        memoize: $$memoize
      }

    }];
  });




















/**
 * @ngdoc module
 * @name angular.filters
 * @description
 * Bunch of useful filters for angularJS
 */

angular.module('angular.filter', [

  'a8m.ucfirst',
  'a8m.uri-encode',
  'a8m.uri-component-encode',
  'a8m.slugify',
  'a8m.strip-tags',
  'a8m.stringular',
  'a8m.truncate',
  'a8m.starts-with',
  'a8m.ends-with',
  'a8m.wrap',
  'a8m.trim',
  'a8m.ltrim',
  'a8m.rtrim',
  'a8m.repeat',

  'a8m.to-array',
  'a8m.concat',
  'a8m.contains',
  'a8m.unique',
  'a8m.is-empty',
  'a8m.after',
  'a8m.after-where',
  'a8m.before',
  'a8m.before-where',
  'a8m.defaults',
  'a8m.where',
  'a8m.reverse',
  'a8m.remove',
  'a8m.remove-with',
  'a8m.group-by',
  'a8m.count-by',
  'a8m.search-field',
  'a8m.fuzzy-by',
  'a8m.fuzzy',
  'a8m.omit',
  'a8m.pick',
  'a8m.every',
  'a8m.filter-by',
  'a8m.xor',
  'a8m.map',
  'a8m.first',
  'a8m.last',
  'a8m.flatten',

  'a8m.math',
  'a8m.math.max',
  'a8m.math.min',
  'a8m.math.percent',
  'a8m.math.radix',
  'a8m.math.sum',
  'a8m.math.degrees',
  'a8m.math.radians',
  'a8m.math.byteFmt',
  'a8m.math.kbFmt',
  'a8m.math.shortFmt',

  'a8m.angular',
  'a8m.conditions',
  'a8m.is-null',

  'a8m.filter-watcher'
]);
})( window, window.angular );;
/**
  * x is a value between 0 and 1, indicating where in the animation you are.
  */
var duScrollDefaultEasing = function (x) {
  'use strict';

  if(x < 0.5) {
    return Math.pow(x*2, 2)/2;
  }
  return 1-Math.pow((1-x)*2, 2)/2;
};

var duScroll = angular.module('duScroll', [
  'duScroll.scrollspy',
  'duScroll.smoothScroll',
  'duScroll.scrollContainer',
  'duScroll.spyContext',
  'duScroll.scrollHelpers'
])
  //Default animation duration for smoothScroll directive
  .value('duScrollDuration', 350)
  //Scrollspy debounce interval, set to 0 to disable
  .value('duScrollSpyWait', 100)
  //Scrollspy forced refresh interval, use if your content changes or reflows without scrolling.
  //0 to disable
  .value('duScrollSpyRefreshInterval', 0)
  //Wether or not multiple scrollspies can be active at once
  .value('duScrollGreedy', false)
  //Default offset for smoothScroll directive
  .value('duScrollOffset', 0)
  //Default easing function for scroll animation
  .value('duScrollEasing', duScrollDefaultEasing)
  //Which events on the container (such as body) should cancel scroll animations
  .value('duScrollCancelOnEvents', 'scroll mousedown mousewheel touchmove keydown')
  //Whether or not to activate the last scrollspy, when page/container bottom is reached
  .value('duScrollBottomSpy', false)
  //Active class name
  .value('duScrollActiveClass', 'active');

if (typeof module !== 'undefined' && module && module.exports) {
  module.exports = duScroll;
}


angular.module('duScroll.scrollHelpers', ['duScroll.requestAnimation'])
.run(["$window", "$q", "cancelAnimation", "requestAnimation", "duScrollEasing", "duScrollDuration", "duScrollOffset", "duScrollCancelOnEvents", function($window, $q, cancelAnimation, requestAnimation, duScrollEasing, duScrollDuration, duScrollOffset, duScrollCancelOnEvents) {
  'use strict';

  var proto = {};

  var isDocument = function(el) {
    return (typeof HTMLDocument !== 'undefined' && el instanceof HTMLDocument) || (el.nodeType && el.nodeType === el.DOCUMENT_NODE);
  };

  var isElement = function(el) {
    return (typeof HTMLElement !== 'undefined' && el instanceof HTMLElement) || (el.nodeType && el.nodeType === el.ELEMENT_NODE);
  };

  var unwrap = function(el) {
    return isElement(el) || isDocument(el) ? el : el[0];
  };

  proto.duScrollTo = function(left, top, duration, easing) {
    var aliasFn;
    if(angular.isElement(left)) {
      aliasFn = this.duScrollToElement;
    } else if(angular.isDefined(duration)) {
      aliasFn = this.duScrollToAnimated;
    }
    if(aliasFn) {
      return aliasFn.apply(this, arguments);
    }
    var el = unwrap(this);
    if(isDocument(el)) {
      return $window.scrollTo(left, top);
    }
    el.scrollLeft = left;
    el.scrollTop = top;
  };

  var scrollAnimation, deferred;
  proto.duScrollToAnimated = function(left, top, duration, easing) {
    if(duration && !easing) {
      easing = duScrollEasing;
    }
    var startLeft = this.duScrollLeft(),
        startTop = this.duScrollTop(),
        deltaLeft = Math.round(left - startLeft),
        deltaTop = Math.round(top - startTop);

    var startTime = null, progress = 0;
    var el = this;

    var cancelScrollAnimation = function($event) {
      if (!$event || (progress && $event.which > 0)) {
        if(duScrollCancelOnEvents) {
          el.unbind(duScrollCancelOnEvents, cancelScrollAnimation);
        }
        cancelAnimation(scrollAnimation);
        deferred.reject();
        scrollAnimation = null;
      }
    };

    if(scrollAnimation) {
      cancelScrollAnimation();
    }
    deferred = $q.defer();

    if(duration === 0 || (!deltaLeft && !deltaTop)) {
      if(duration === 0) {
        el.duScrollTo(left, top);
      }
      deferred.resolve();
      return deferred.promise;
    }

    var animationStep = function(timestamp) {
      if (startTime === null) {
        startTime = timestamp;
      }

      progress = timestamp - startTime;
      var percent = (progress >= duration ? 1 : easing(progress/duration));

      el.scrollTo(
        startLeft + Math.ceil(deltaLeft * percent),
        startTop + Math.ceil(deltaTop * percent)
      );
      if(percent < 1) {
        scrollAnimation = requestAnimation(animationStep);
      } else {
        if(duScrollCancelOnEvents) {
          el.unbind(duScrollCancelOnEvents, cancelScrollAnimation);
        }
        scrollAnimation = null;
        deferred.resolve();
      }
    };

    //Fix random mobile safari bug when scrolling to top by hitting status bar
    el.duScrollTo(startLeft, startTop);

    if(duScrollCancelOnEvents) {
      el.bind(duScrollCancelOnEvents, cancelScrollAnimation);
    }

    scrollAnimation = requestAnimation(animationStep);
    return deferred.promise;
  };

  proto.duScrollToElement = function(target, offset, duration, easing) {
    var el = unwrap(this);
    if(!angular.isNumber(offset) || isNaN(offset)) {
      offset = duScrollOffset;
    }
    var top = this.duScrollTop() + unwrap(target).getBoundingClientRect().top - offset;
    if(isElement(el)) {
      top -= el.getBoundingClientRect().top;
    }
    return this.duScrollTo(0, top, duration, easing);
  };

  proto.duScrollLeft = function(value, duration, easing) {
    if(angular.isNumber(value)) {
      return this.duScrollTo(value, this.duScrollTop(), duration, easing);
    }
    var el = unwrap(this);
    if(isDocument(el)) {
      return $window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
    }
    return el.scrollLeft;
  };
  proto.duScrollTop = function(value, duration, easing) {
    if(angular.isNumber(value)) {
      return this.duScrollTo(this.duScrollLeft(), value, duration, easing);
    }
    var el = unwrap(this);
    if(isDocument(el)) {
      return $window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
    }
    return el.scrollTop;
  };

  proto.duScrollToElementAnimated = function(target, offset, duration, easing) {
    return this.duScrollToElement(target, offset, duration || duScrollDuration, easing);
  };

  proto.duScrollTopAnimated = function(top, duration, easing) {
    return this.duScrollTop(top, duration || duScrollDuration, easing);
  };

  proto.duScrollLeftAnimated = function(left, duration, easing) {
    return this.duScrollLeft(left, duration || duScrollDuration, easing);
  };

  angular.forEach(proto, function(fn, key) {
    angular.element.prototype[key] = fn;

    //Remove prefix if not already claimed by jQuery / ui.utils
    var unprefixed = key.replace(/^duScroll/, 'scroll');
    if(angular.isUndefined(angular.element.prototype[unprefixed])) {
      angular.element.prototype[unprefixed] = fn;
    }
  });

}]);


//Adapted from https://gist.github.com/paulirish/1579671
angular.module('duScroll.polyfill', [])
.factory('polyfill', ["$window", function($window) {
  'use strict';

  var vendors = ['webkit', 'moz', 'o', 'ms'];

  return function(fnName, fallback) {
    if($window[fnName]) {
      return $window[fnName];
    }
    var suffix = fnName.substr(0, 1).toUpperCase() + fnName.substr(1);
    for(var key, i = 0; i < vendors.length; i++) {
      key = vendors[i]+suffix;
      if($window[key]) {
        return $window[key];
      }
    }
    return fallback;
  };
}]);

angular.module('duScroll.requestAnimation', ['duScroll.polyfill'])
.factory('requestAnimation', ["polyfill", "$timeout", function(polyfill, $timeout) {
  'use strict';

  var lastTime = 0;
  var fallback = function(callback, element) {
    var currTime = new Date().getTime();
    var timeToCall = Math.max(0, 16 - (currTime - lastTime));
    var id = $timeout(function() { callback(currTime + timeToCall); },
      timeToCall);
    lastTime = currTime + timeToCall;
    return id;
  };

  return polyfill('requestAnimationFrame', fallback);
}])
.factory('cancelAnimation', ["polyfill", "$timeout", function(polyfill, $timeout) {
  'use strict';

  var fallback = function(promise) {
    $timeout.cancel(promise);
  };

  return polyfill('cancelAnimationFrame', fallback);
}]);


angular.module('duScroll.spyAPI', ['duScroll.scrollContainerAPI'])
.factory('spyAPI', ["$rootScope", "$timeout", "$interval", "$window", "$document", "scrollContainerAPI", "duScrollGreedy", "duScrollSpyWait", "duScrollSpyRefreshInterval", "duScrollBottomSpy", "duScrollActiveClass", function($rootScope, $timeout, $interval, $window, $document, scrollContainerAPI, duScrollGreedy, duScrollSpyWait, duScrollSpyRefreshInterval, duScrollBottomSpy, duScrollActiveClass) {
  'use strict';

  var createScrollHandler = function(context) {
    var timer = false, queued = false;
    var handler = function() {
      queued = false;
      var container = context.container,
          containerEl = container[0],
          containerOffset = 0,
          bottomReached;

      if (typeof HTMLElement !== 'undefined' && containerEl instanceof HTMLElement || containerEl.nodeType && containerEl.nodeType === containerEl.ELEMENT_NODE) {
        containerOffset = containerEl.getBoundingClientRect().top;
        bottomReached = Math.round(containerEl.scrollTop + containerEl.clientHeight) >= containerEl.scrollHeight;
      } else {
        var documentScrollHeight = $document[0].body.scrollHeight || $document[0].documentElement.scrollHeight; // documentElement for IE11
        bottomReached = Math.round($window.pageYOffset + $window.innerHeight) >= documentScrollHeight;
      }
      var compareProperty = (duScrollBottomSpy && bottomReached ? 'bottom' : 'top');

      var i, currentlyActive, toBeActive, spies, spy, pos;
      spies = context.spies;
      currentlyActive = context.currentlyActive;
      toBeActive = undefined;

      for(i = 0; i < spies.length; i++) {
        spy = spies[i];
        pos = spy.getTargetPosition();
        if (!pos || !spy.$element) continue;

        if((duScrollBottomSpy && bottomReached) || (pos.top + spy.offset - containerOffset < 20 && (duScrollGreedy || pos.top*-1 + containerOffset) < pos.height)) {
          //Find the one closest the viewport top or the page bottom if it's reached
          if(!toBeActive || toBeActive[compareProperty] < pos[compareProperty]) {
            toBeActive = {
              spy: spy
            };
            toBeActive[compareProperty] = pos[compareProperty];
          }
        }
      }

      if(toBeActive) {
        toBeActive = toBeActive.spy;
      }
      if(currentlyActive === toBeActive || (duScrollGreedy && !toBeActive)) return;
      if(currentlyActive && currentlyActive.$element) {
        currentlyActive.$element.removeClass(duScrollActiveClass);
        $rootScope.$broadcast(
          'duScrollspy:becameInactive',
          currentlyActive.$element,
          angular.element(currentlyActive.getTargetElement())
        );
      }
      if(toBeActive) {
        toBeActive.$element.addClass(duScrollActiveClass);
        $rootScope.$broadcast(
          'duScrollspy:becameActive',
          toBeActive.$element,
          angular.element(toBeActive.getTargetElement())
        );
      }
      context.currentlyActive = toBeActive;
    };

    if(!duScrollSpyWait) {
      return handler;
    }

    //Debounce for potential performance savings
    return function() {
      if(!timer) {
        handler();
        timer = $timeout(function() {
          timer = false;
          if(queued) {
            handler();
          }
        }, duScrollSpyWait, false);
      } else {
        queued = true;
      }
    };
  };

  var contexts = {};

  var createContext = function($scope) {
    var id = $scope.$id;
    var context = {
      spies: []
    };

    context.handler = createScrollHandler(context);
    contexts[id] = context;

    $scope.$on('$destroy', function() {
      destroyContext($scope);
    });

    return id;
  };

  var destroyContext = function($scope) {
    var id = $scope.$id;
    var context = contexts[id], container = context.container;
    if(context.intervalPromise) {
      $interval.cancel(context.intervalPromise);
    }
    if(container) {
      container.off('scroll', context.handler);
    }
    delete contexts[id];
  };

  var defaultContextId = createContext($rootScope);

  var getContextForScope = function(scope) {
    if(contexts[scope.$id]) {
      return contexts[scope.$id];
    }
    if(scope.$parent) {
      return getContextForScope(scope.$parent);
    }
    return contexts[defaultContextId];
  };

  var getContextForSpy = function(spy) {
    var context, contextId, scope = spy.$scope;
    if(scope) {
      return getContextForScope(scope);
    }
    //No scope, most likely destroyed
    for(contextId in contexts) {
      context = contexts[contextId];
      if(context.spies.indexOf(spy) !== -1) {
        return context;
      }
    }
  };

  var isElementInDocument = function(element) {
    while (element.parentNode) {
      element = element.parentNode;
      if (element === document) {
        return true;
      }
    }
    return false;
  };

  var addSpy = function(spy) {
    var context = getContextForSpy(spy);
    if (!context) return;
    context.spies.push(spy);
    if (!context.container || !isElementInDocument(context.container)) {
      if(context.container) {
        context.container.off('scroll', context.handler);
      }
      context.container = scrollContainerAPI.getContainer(spy.$scope);
      if (duScrollSpyRefreshInterval && !context.intervalPromise) {
        context.intervalPromise = $interval(context.handler, duScrollSpyRefreshInterval, 0, false);
      }
      context.container.on('scroll', context.handler).triggerHandler('scroll');
    }
  };

  var removeSpy = function(spy) {
    var context = getContextForSpy(spy);
    if(spy === context.currentlyActive) {
      $rootScope.$broadcast('duScrollspy:becameInactive', context.currentlyActive.$element);
      context.currentlyActive = null;
    }
    var i = context.spies.indexOf(spy);
    if(i !== -1) {
      context.spies.splice(i, 1);
    }
		spy.$element = null;
  };

  return {
    addSpy: addSpy,
    removeSpy: removeSpy,
    createContext: createContext,
    destroyContext: destroyContext,
    getContextForScope: getContextForScope
  };
}]);


angular.module('duScroll.scrollContainerAPI', [])
.factory('scrollContainerAPI', ["$document", function($document) {
  'use strict';

  var containers = {};

  var setContainer = function(scope, element) {
    var id = scope.$id;
    containers[id] = element;
    return id;
  };

  var getContainerId = function(scope) {
    if(containers[scope.$id]) {
      return scope.$id;
    }
    if(scope.$parent) {
      return getContainerId(scope.$parent);
    }
    return;
  };

  var getContainer = function(scope) {
    var id = getContainerId(scope);
    return id ? containers[id] : $document;
  };

  var removeContainer = function(scope) {
    var id = getContainerId(scope);
    if(id) {
      delete containers[id];
    }
  };

  return {
    getContainerId:   getContainerId,
    getContainer:     getContainer,
    setContainer:     setContainer,
    removeContainer:  removeContainer
  };
}]);


angular.module('duScroll.smoothScroll', ['duScroll.scrollHelpers', 'duScroll.scrollContainerAPI'])
.directive('duSmoothScroll', ["duScrollDuration", "duScrollOffset", "scrollContainerAPI", function(duScrollDuration, duScrollOffset, scrollContainerAPI) {
  'use strict';

  return {
    link : function($scope, $element, $attr) {
      $element.on('click', function(e) {
        if((!$attr.href || $attr.href.indexOf('#') === -1) && $attr.duSmoothScroll === '') return;

        var id = $attr.href ? $attr.href.replace(/.*(?=#[^\s]+$)/, '').substring(1) : $attr.duSmoothScroll;

        var target = document.getElementById(id) || document.getElementsByName(id)[0];
        if(!target || !target.getBoundingClientRect) return;

        if (e.stopPropagation) e.stopPropagation();
        if (e.preventDefault) e.preventDefault();

        var offset    = $attr.offset ? parseInt($attr.offset, 10) : duScrollOffset;
        var duration  = $attr.duration ? parseInt($attr.duration, 10) : duScrollDuration;
        var container = scrollContainerAPI.getContainer($scope);

        container.duScrollToElement(
          angular.element(target),
          isNaN(offset) ? 0 : offset,
          isNaN(duration) ? 0 : duration
        );
      });
    }
  };
}]);


angular.module('duScroll.spyContext', ['duScroll.spyAPI'])
.directive('duSpyContext', ["spyAPI", function(spyAPI) {
  'use strict';

  return {
    restrict: 'A',
    scope: true,
    compile: function compile(tElement, tAttrs, transclude) {
      return {
        pre: function preLink($scope, iElement, iAttrs, controller) {
          spyAPI.createContext($scope);
        }
      };
    }
  };
}]);


angular.module('duScroll.scrollContainer', ['duScroll.scrollContainerAPI'])
.directive('duScrollContainer', ["scrollContainerAPI", function(scrollContainerAPI){
  'use strict';

  return {
    restrict: 'A',
    scope: true,
    compile: function compile(tElement, tAttrs, transclude) {
      return {
        pre: function preLink($scope, iElement, iAttrs, controller) {
          iAttrs.$observe('duScrollContainer', function(element) {
            if(angular.isString(element)) {
              element = document.getElementById(element);
            }

            element = (angular.isElement(element) ? angular.element(element) : iElement);
            scrollContainerAPI.setContainer($scope, element);
            $scope.$on('$destroy', function() {
              scrollContainerAPI.removeContainer($scope);
            });
          });
        }
      };
    }
  };
}]);


angular.module('duScroll.scrollspy', ['duScroll.spyAPI'])
.directive('duScrollspy', ["spyAPI", "duScrollOffset", "$timeout", "$rootScope", function(spyAPI, duScrollOffset, $timeout, $rootScope) {
  'use strict';

  var Spy = function(targetElementOrId, $scope, $element, offset) {
    if(angular.isElement(targetElementOrId)) {
      this.target = targetElementOrId;
    } else if(angular.isString(targetElementOrId)) {
      this.targetId = targetElementOrId;
    }
    this.$scope = $scope;
    this.$element = $element;
    this.offset = offset;
  };

  Spy.prototype.getTargetElement = function() {
    if (!this.target && this.targetId) {
      this.target = document.getElementById(this.targetId) || document.getElementsByName(this.targetId)[0];
    }
    return this.target;
  };

  Spy.prototype.getTargetPosition = function() {
    var target = this.getTargetElement();
    if(target) {
      return target.getBoundingClientRect();
    }
  };

  Spy.prototype.flushTargetCache = function() {
    if(this.targetId) {
      this.target = undefined;
    }
  };

  return {
    link: function ($scope, $element, $attr) {
      var href = $attr.ngHref || $attr.href;
      var targetId;

      if (href && href.indexOf('#') !== -1) {
        targetId = href.replace(/.*(?=#[^\s]+$)/, '').substring(1);
      } else if($attr.duScrollspy) {
        targetId = $attr.duScrollspy;
      } else if($attr.duSmoothScroll) {
        targetId = $attr.duSmoothScroll;
      }
      if(!targetId) return;

      // Run this in the next execution loop so that the scroll context has a chance
      // to initialize
      var timeoutPromise = $timeout(function() {
        var spy = new Spy(targetId, $scope, $element, -($attr.offset ? parseInt($attr.offset, 10) : duScrollOffset));
        spyAPI.addSpy(spy);

        $scope.$on('$locationChangeSuccess', spy.flushTargetCache.bind(spy));
        var deregisterOnStateChange = $rootScope.$on('$stateChangeSuccess', spy.flushTargetCache.bind(spy));
        $scope.$on('$destroy', function() {
          spyAPI.removeSpy(spy);
          deregisterOnStateChange();
        });
      }, 0, false);
      $scope.$on('$destroy', function() {$timeout.cancel(timeoutPromise);});
    }
  };
}]);
;
/*! ngstorage 0.3.10 | Copyright (c) 2015 Gias Kay Lee | MIT License */!function(a,b){"use strict";"function"==typeof define&&define.amd?define(["angular"],b):a.hasOwnProperty("angular")?b(a.angular):"object"==typeof exports&&(module.exports=b(require("angular")))}(this,function(a){"use strict";function b(b){return function(){var c="ngStorage-";this.setKeyPrefix=function(a){if("string"!=typeof a)throw new TypeError("[ngStorage] - "+b+"Provider.setKeyPrefix() expects a String.");c=a};var d=a.toJson,e=a.fromJson;this.setSerializer=function(a){if("function"!=typeof a)throw new TypeError("[ngStorage] - "+b+"Provider.setSerializer expects a function.");d=a},this.setDeserializer=function(a){if("function"!=typeof a)throw new TypeError("[ngStorage] - "+b+"Provider.setDeserializer expects a function.");e=a},this.get=function(a){return e(window[b].getItem(c+a))},this.set=function(a,e){return window[b].setItem(c+a,d(e))},this.$get=["$rootScope","$window","$log","$timeout","$document",function(f,g,h,i,j){function k(a){var b;try{b=g[a]}catch(c){b=!1}if(b&&"localStorage"===a){var d="__"+Math.round(1e7*Math.random());try{localStorage.setItem(d,d),localStorage.removeItem(d)}catch(c){b=!1}}return b}var l,m,n=c.length,o=k(b)||(h.warn("This browser does not support Web Storage!"),{setItem:a.noop,getItem:a.noop,removeItem:a.noop}),p={$default:function(b){for(var c in b)a.isDefined(p[c])||(p[c]=a.copy(b[c]));return p.$sync(),p},$reset:function(a){for(var b in p)"$"===b[0]||delete p[b]&&o.removeItem(c+b);return p.$default(a)},$sync:function(){for(var a,b=0,d=o.length;d>b;b++)(a=o.key(b))&&c===a.slice(0,n)&&(p[a.slice(n)]=e(o.getItem(a)))},$apply:function(){var b;if(m=null,!a.equals(p,l)){b=a.copy(l),a.forEach(p,function(e,f){a.isDefined(e)&&"$"!==f[0]&&(o.setItem(c+f,d(e)),delete b[f])});for(var e in b)o.removeItem(c+e);l=a.copy(p)}}};return p.$sync(),l=a.copy(p),f.$watch(function(){m||(m=i(p.$apply,100,!1))}),g.addEventListener&&g.addEventListener("storage",function(b){if(b.key){var d=j[0];d.hasFocus&&d.hasFocus()||c!==b.key.slice(0,n)||(b.newValue?p[b.key.slice(n)]=e(b.newValue):delete p[b.key.slice(n)],l=a.copy(p),f.$apply())}}),g.addEventListener&&g.addEventListener("beforeunload",function(){p.$apply()}),p}]}}return a=a&&a.module?a:window.angular,a.module("ngStorage",[]).provider("$localStorage",b("localStorage")).provider("$sessionStorage",b("sessionStorage"))});;
/*
 AngularJS v1.4.8
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(p,c,n){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096<f&&a.warn("Cookie '"+b+"' possibly not set or overflowed because it was too large ("+
f+" > 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,n,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore",
["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular);
//# sourceMappingURL=angular-cookies.min.js.map
;
/*!

JSZip - A Javascript class for generating and reading zip files
<http://stuartk.com/jszip>

(c) 2009-2014 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.

JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/master/LICENSE
*/
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.JSZip=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a){if(a){this.data=a,this.length=this.data.length,this.index=0,this.zero=0;for(var b=0;b<this.data.length;b++)a[b]=255&a[b]}}var e=a("./dataReader");d.prototype=new e,d.prototype.byteAt=function(a){return this.data[this.zero+a]},d.prototype.lastIndexOfSignature=function(a){for(var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=this.length-4;f>=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)return f-this.zero;return-1},d.prototype.readData=function(a){if(this.checkOffset(a),0===a)return[];var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"./dataReader":6}],2:[function(a,b,c){"use strict";var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c.encode=function(a,b){for(var c,e,f,g,h,i,j,k="",l=0;l<a.length;)c=a.charCodeAt(l++),e=a.charCodeAt(l++),f=a.charCodeAt(l++),g=c>>2,h=(3&c)<<4|e>>4,i=(15&e)<<2|f>>6,j=63&f,isNaN(e)?i=j=64:isNaN(f)&&(j=64),k=k+d.charAt(g)+d.charAt(h)+d.charAt(i)+d.charAt(j);return k},c.decode=function(a,b){var c,e,f,g,h,i,j,k="",l=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<a.length;)g=d.indexOf(a.charAt(l++)),h=d.indexOf(a.charAt(l++)),i=d.indexOf(a.charAt(l++)),j=d.indexOf(a.charAt(l++)),c=g<<2|h>>4,e=(15&h)<<4|i>>2,f=(3&i)<<6|j,k+=String.fromCharCode(c),64!=i&&(k+=String.fromCharCode(e)),64!=j&&(k+=String.fromCharCode(f));return k}},{}],3:[function(a,b,c){"use strict";function d(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}d.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},b.exports=d},{}],4:[function(a,b,c){"use strict";c.STORE={magic:"\x00\x00",compress:function(a,b){return a},uncompress:function(a){return a},compressInputType:null,uncompressInputType:null},c.DEFLATE=a("./flate")},{"./flate":9}],5:[function(a,b,c){"use strict";var d=a("./utils"),e=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];b.exports=function(a,b){if("undefined"==typeof a||!a.length)return 0;var c="string"!==d.getTypeOf(a);"undefined"==typeof b&&(b=0);var f=0,g=0,h=0;b=-1^b;for(var i=0,j=a.length;j>i;i++)h=c?a[i]:a.charCodeAt(i),g=255&(b^h),f=e[g],b=b>>>8^f;return-1^b}},{"./utils":22}],6:[function(a,b,c){"use strict";function d(a){this.data=null,this.length=0,this.index=0,this.zero=0}var e=a("./utils");d.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||0>a)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(a){},readInt:function(a){var b,c=0;for(this.checkOffset(a),b=this.index+a-1;b>=this.index;b--)c=(c<<8)+this.byteAt(b);return this.index+=a,c},readString:function(a){return e.transformTo("string",this.readData(a))},readData:function(a){},lastIndexOfSignature:function(a){},readDate:function(){var a=this.readInt(4);return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1)}},b.exports=d},{"./utils":22}],7:[function(a,b,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!1,c.date=null,c.compression=null,c.compressionOptions=null,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],8:[function(a,b,c){"use strict";var d=a("./utils");c.string2binary=function(a){return d.string2binary(a)},c.string2Uint8Array=function(a){return d.transformTo("uint8array",a)},c.uint8Array2String=function(a){return d.transformTo("string",a)},c.string2Blob=function(a){var b=d.transformTo("arraybuffer",a);return d.arrayBuffer2Blob(b)},c.arrayBuffer2Blob=function(a){return d.arrayBuffer2Blob(a)},c.transformTo=function(a,b){return d.transformTo(a,b)},c.getTypeOf=function(a){return d.getTypeOf(a)},c.checkSupport=function(a){return d.checkSupport(a)},c.MAX_VALUE_16BITS=d.MAX_VALUE_16BITS,c.MAX_VALUE_32BITS=d.MAX_VALUE_32BITS,c.pretty=function(a){return d.pretty(a)},c.findCompression=function(a){return d.findCompression(a)},c.isRegExp=function(a){return d.isRegExp(a)}},{"./utils":22}],9:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,e=a("pako");c.uncompressInputType=d?"uint8array":"array",c.compressInputType=d?"uint8array":"array",c.magic="\b\x00",c.compress=function(a,b){return e.deflateRaw(a,{level:b.level||-1})},c.uncompress=function(a){return e.inflateRaw(a)}},{pako:25}],10:[function(a,b,c){"use strict";function d(a,b){return this instanceof d?(this.files={},this.comment=null,this.root="",a&&this.load(a,b),void(this.clone=function(){var a=new d;for(var b in this)"function"!=typeof this[b]&&(a[b]=this[b]);return a})):new d(a,b)}var e=a("./base64");d.prototype=a("./object"),d.prototype.load=a("./load"),d.support=a("./support"),d.defaults=a("./defaults"),d.utils=a("./deprecatedPublicUtils"),d.base64={encode:function(a){return e.encode(a)},decode:function(a){return e.decode(a)}},d.compressions=a("./compressions"),b.exports=d},{"./base64":2,"./compressions":4,"./defaults":7,"./deprecatedPublicUtils":8,"./load":11,"./object":14,"./support":18}],11:[function(a,b,c){"use strict";var d=a("./base64"),e=a("./utf8"),f=a("./utils"),g=a("./zipEntries");b.exports=function(a,b){var c,h,i,j;for(b=f.extend(b||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:e.utf8decode}),b.base64&&(a=d.decode(a)),h=new g(a,b),c=h.files,i=0;i<c.length;i++)j=c[i],this.file(j.fileNameStr,j.decompressed,{binary:!0,optimizedBinaryString:!0,date:j.date,dir:j.dir,comment:j.fileCommentStr.length?j.fileCommentStr:null,unixPermissions:j.unixPermissions,dosPermissions:j.dosPermissions,createFolders:b.createFolders});return h.zipComment.length&&(this.comment=h.zipComment),this}},{"./base64":2,"./utf8":21,"./utils":22,"./zipEntries":23}],12:[function(a,b,c){(function(a){"use strict";b.exports=function(b,c){return new a(b,c)},b.exports.test=function(b){return a.isBuffer(b)}}).call(this,"undefined"!=typeof Buffer?Buffer:void 0)},{}],13:[function(a,b,c){"use strict";function d(a){this.data=a,this.length=this.data.length,this.index=0,this.zero=0}var e=a("./uint8ArrayReader");d.prototype=new e,d.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"./uint8ArrayReader":19}],14:[function(a,b,c){"use strict";var d=a("./support"),e=a("./utils"),f=a("./crc32"),g=a("./signature"),h=a("./defaults"),i=a("./base64"),j=a("./compressions"),k=a("./compressedObject"),l=a("./nodeBuffer"),m=a("./utf8"),n=a("./stringWriter"),o=a("./uint8ArrayWriter"),p=function(a){if(a._data instanceof k&&(a._data=a._data.getContent(),a.options.binary=!0,a.options.base64=!1,"uint8array"===e.getTypeOf(a._data))){var b=a._data;a._data=new Uint8Array(b.length),0!==b.length&&a._data.set(b,0)}return a._data},q=function(a){var b=p(a),c=e.getTypeOf(b);return"string"===c?!a.options.binary&&d.nodebuffer?l(b,"utf-8"):a.asBinary():b},r=function(a){var b=p(this);return null===b||"undefined"==typeof b?"":(this.options.base64&&(b=i.decode(b)),b=a&&this.options.binary?D.utf8decode(b):e.transformTo("string",b),a||this.options.binary||(b=e.transformTo("string",D.utf8encode(b))),b)},s=function(a,b,c){this.name=a,this.dir=c.dir,this.date=c.date,this.comment=c.comment,this.unixPermissions=c.unixPermissions,this.dosPermissions=c.dosPermissions,this._data=b,this.options=c,this._initialMetadata={dir:c.dir,date:c.date}};s.prototype={asText:function(){return r.call(this,!0)},asBinary:function(){return r.call(this,!1)},asNodeBuffer:function(){var a=q(this);return e.transformTo("nodebuffer",a)},asUint8Array:function(){var a=q(this);return e.transformTo("uint8array",a)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var t=function(a,b){var c,d="";for(c=0;b>c;c++)d+=String.fromCharCode(255&a),a>>>=8;return d},u=function(a){return a=a||{},a.base64!==!0||null!==a.binary&&void 0!==a.binary||(a.binary=!0),a=e.extend(a,h),a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),a},v=function(a,b,c){var d,f=e.getTypeOf(b);if(c=u(c),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(a=x(a)),c.createFolders&&(d=w(a))&&y.call(this,d,!0),c.dir||null===b||"undefined"==typeof b)c.base64=!1,c.binary=!1,b=null,f=null;else if("string"===f)c.binary&&!c.base64&&c.optimizedBinaryString!==!0&&(b=e.string2binary(b));else{if(c.base64=!1,c.binary=!0,!(f||b instanceof k))throw new Error("The data of '"+a+"' is in an unsupported format !");"arraybuffer"===f&&(b=e.transformTo("uint8array",b))}var g=new s(a,b,c);return this.files[a]=g,g},w=function(a){"/"==a.slice(-1)&&(a=a.substring(0,a.length-1));var b=a.lastIndexOf("/");return b>0?a.substring(0,b):""},x=function(a){return"/"!=a.slice(-1)&&(a+="/"),a},y=function(a,b){return b="undefined"!=typeof b?b:!1,a=x(a),this.files[a]||v.call(this,a,null,{dir:!0,createFolders:b}),this.files[a]},z=function(a,b,c){var d,g=new k;return a._data instanceof k?(g.uncompressedSize=a._data.uncompressedSize,g.crc32=a._data.crc32,0===g.uncompressedSize||a.dir?(b=j.STORE,g.compressedContent="",g.crc32=0):a._data.compressionMethod===b.magic?g.compressedContent=a._data.getCompressedContent():(d=a._data.getContent(),g.compressedContent=b.compress(e.transformTo(b.compressInputType,d),c))):(d=q(a),d&&0!==d.length&&!a.dir||(b=j.STORE,d=""),g.uncompressedSize=d.length,g.crc32=f(d),g.compressedContent=b.compress(e.transformTo(b.compressInputType,d),c)),g.compressedSize=g.compressedContent.length,g.compressionMethod=b.magic,g},A=function(a,b){var c=a;return a||(c=b?16893:33204),(65535&c)<<16},B=function(a,b){return 63&(a||0)},C=function(a,b,c,d,h,i){var j,k,l,n,o=(c.compressedContent,i!==m.utf8encode),p=e.transformTo("string",i(b.name)),q=e.transformTo("string",m.utf8encode(b.name)),r=b.comment||"",s=e.transformTo("string",i(r)),u=e.transformTo("string",m.utf8encode(r)),v=q.length!==b.name.length,w=u.length!==r.length,x=b.options,y="",z="",C="";l=b._initialMetadata.dir!==b.dir?b.dir:x.dir,n=b._initialMetadata.date!==b.date?b.date:x.date;var D=0,E=0;l&&(D|=16),"UNIX"===h?(E=798,D|=A(b.unixPermissions,l)):(E=20,D|=B(b.dosPermissions,l)),j=n.getHours(),j<<=6,j|=n.getMinutes(),j<<=5,j|=n.getSeconds()/2,k=n.getFullYear()-1980,k<<=4,k|=n.getMonth()+1,k<<=5,k|=n.getDate(),v&&(z=t(1,1)+t(f(p),4)+q,y+="up"+t(z.length,2)+z),w&&(C=t(1,1)+t(this.crc32(s),4)+u,y+="uc"+t(C.length,2)+C);var F="";F+="\n\x00",F+=o||!v&&!w?"\x00\x00":"\x00\b",F+=c.compressionMethod,F+=t(j,2),F+=t(k,2),F+=t(c.crc32,4),F+=t(c.compressedSize,4),F+=t(c.uncompressedSize,4),F+=t(p.length,2),F+=t(y.length,2);var G=g.LOCAL_FILE_HEADER+F+p+y,H=g.CENTRAL_FILE_HEADER+t(E,2)+F+t(s.length,2)+"\x00\x00\x00\x00"+t(D,4)+t(d,4)+p+y+s;return{fileRecord:G,dirRecord:H,compressedObject:c}},D={load:function(a,b){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(a){var b,c,d,f,g=[];for(b in this.files)this.files.hasOwnProperty(b)&&(d=this.files[b],f=new s(d.name,d._data,e.extend(d.options)),c=b.slice(this.root.length,b.length),b.slice(0,this.root.length)===this.root&&a(c,f)&&g.push(f));return g},file:function(a,b,c){if(1===arguments.length){if(e.isRegExp(a)){var d=a;return this.filter(function(a,b){return!b.dir&&d.test(a)})}return this.filter(function(b,c){return!c.dir&&b===a})[0]||null}return a=this.root+a,v.call(this,a,b,c),this},folder:function(a){if(!a)return this;if(e.isRegExp(a))return this.filter(function(b,c){return c.dir&&a.test(b)});var b=this.root+a,c=y.call(this,b),d=this.clone();return d.root=c.name,d},remove:function(a){a=this.root+a;var b=this.files[a];if(b||("/"!=a.slice(-1)&&(a+="/"),b=this.files[a]),b&&!b.dir)delete this.files[a];else for(var c=this.filter(function(b,c){return c.name.slice(0,a.length)===a}),d=0;d<c.length;d++)delete this.files[c[d].name];return this},generate:function(a){a=e.extend(a||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:m.utf8encode}),e.checkSupport(a.type),"darwin"!==a.platform&&"freebsd"!==a.platform&&"linux"!==a.platform&&"sunos"!==a.platform||(a.platform="UNIX"),"win32"===a.platform&&(a.platform="DOS");var b,c,d=[],f=0,h=0,k=e.transformTo("string",a.encodeFileName(a.comment||this.comment||""));for(var l in this.files)if(this.files.hasOwnProperty(l)){var p=this.files[l],q=p.options.compression||a.compression.toUpperCase(),r=j[q];if(!r)throw new Error(q+" is not a valid compression method !");var s=p.options.compressionOptions||a.compressionOptions||{},u=z.call(this,p,r,s),v=C.call(this,l,p,u,f,a.platform,a.encodeFileName);f+=v.fileRecord.length+u.compressedSize,h+=v.dirRecord.length,d.push(v)}var w="";w=g.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+t(d.length,2)+t(d.length,2)+t(h,4)+t(f,4)+t(k.length,2)+k;var x=a.type.toLowerCase();for(b="uint8array"===x||"arraybuffer"===x||"blob"===x||"nodebuffer"===x?new o(f+h+w.length):new n(f+h+w.length),c=0;c<d.length;c++)b.append(d[c].fileRecord),b.append(d[c].compressedObject.compressedContent);for(c=0;c<d.length;c++)b.append(d[c].dirRecord);b.append(w);var y=b.finalize();switch(a.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return e.transformTo(a.type.toLowerCase(),y);case"blob":return e.arrayBuffer2Blob(e.transformTo("arraybuffer",y),a.mimeType);case"base64":return a.base64?i.encode(y):y;default:return y}},crc32:function(a,b){return f(a,b)},utf8encode:function(a){return e.transformTo("string",m.utf8encode(a))},utf8decode:function(a){return m.utf8decode(a)}};b.exports=D},{"./base64":2,"./compressedObject":3,"./compressions":4,"./crc32":5,"./defaults":7,"./nodeBuffer":12,"./signature":15,"./stringWriter":17,"./support":18,"./uint8ArrayWriter":20,"./utf8":21,"./utils":22}],15:[function(a,b,c){"use strict";c.LOCAL_FILE_HEADER="PK",c.CENTRAL_FILE_HEADER="PK",c.CENTRAL_DIRECTORY_END="PK",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",c.ZIP64_CENTRAL_DIRECTORY_END="PK",c.DATA_DESCRIPTOR="PK\b"},{}],16:[function(a,b,c){"use strict";function d(a,b){this.data=a,b||(this.data=f.string2binary(this.data)),this.length=this.data.length,this.index=0,this.zero=0}var e=a("./dataReader"),f=a("./utils");d.prototype=new e,d.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},d.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},d.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"./dataReader":6,"./utils":22}],17:[function(a,b,c){"use strict";var d=a("./utils"),e=function(){this.data=[]};e.prototype={append:function(a){a=d.transformTo("string",a),this.data.push(a)},finalize:function(){return this.data.join("")}},b.exports=e},{"./utils":22}],18:[function(a,b,c){(function(a){"use strict";if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,c.nodebuffer="undefined"!=typeof a,c.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)c.blob=!1;else{var b=new ArrayBuffer(0);try{c.blob=0===new Blob([b],{type:"application/zip"}).size}catch(d){try{var e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,f=new e;f.append(b),c.blob=0===f.getBlob("application/zip").size}catch(d){c.blob=!1}}}}).call(this,"undefined"!=typeof Buffer?Buffer:void 0)},{}],19:[function(a,b,c){"use strict";function d(a){a&&(this.data=a,this.length=this.data.length,this.index=0,this.zero=0)}var e=a("./arrayReader");d.prototype=new e,d.prototype.readData=function(a){if(this.checkOffset(a),0===a)return new Uint8Array(0);var b=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"./arrayReader":1}],20:[function(a,b,c){"use strict";var d=a("./utils"),e=function(a){this.data=new Uint8Array(a),this.index=0};e.prototype={append:function(a){0!==a.length&&(a=d.transformTo("uint8array",a),this.data.set(a,this.index),this.index+=a.length)},finalize:function(){return this.data}},b.exports=e},{"./utils":22}],21:[function(a,b,c){"use strict";for(var d=a("./utils"),e=a("./support"),f=a("./nodeBuffer"),g=new Array(256),h=0;256>h;h++)g[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;g[254]=g[254]=1;var i=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=e.uint8array?new Uint8Array(i):new Array(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},j=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+g[a[c]]>b?c:b},k=function(a){var b,c,e,f,h=a.length,i=new Array(2*h);for(c=0,b=0;h>b;)if(e=a[b++],128>e)i[c++]=e;else if(f=g[e],f>4)i[c++]=65533,b+=f-1;else{for(e&=2===f?31:3===f?15:7;f>1&&h>b;)e=e<<6|63&a[b++],f--;f>1?i[c++]=65533:65536>e?i[c++]=e:(e-=65536,i[c++]=55296|e>>10&1023,i[c++]=56320|1023&e)}return i.length!==c&&(i.subarray?i=i.subarray(0,c):i.length=c),d.applyFromCharCode(i)};c.utf8encode=function(a){return e.nodebuffer?f(a,"utf-8"):i(a)},c.utf8decode=function(a){if(e.nodebuffer)return d.transformTo("nodebuffer",a).toString("utf-8");a=d.transformTo(e.uint8array?"uint8array":"array",a);for(var b=[],c=0,f=a.length,g=65536;f>c;){var h=j(a,Math.min(c+g,f));e.uint8array?b.push(k(a.subarray(c,h))):b.push(k(a.slice(c,h))),c=h}return b.join("")}},{"./nodeBuffer":12,"./support":18,"./utils":22}],22:[function(a,b,c){"use strict";function d(a){return a}function e(a,b){for(var c=0;c<a.length;++c)b[c]=255&a.charCodeAt(c);return b}function f(a){var b=65536,d=[],e=a.length,f=c.getTypeOf(a),g=0,h=!0;try{switch(f){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,j(0))}}catch(i){h=!1}if(!h){for(var k="",l=0;l<a.length;l++)k+=String.fromCharCode(a[l]);return k}for(;e>g&&b>1;)try{"array"===f||"nodebuffer"===f?d.push(String.fromCharCode.apply(null,a.slice(g,Math.min(g+b,e)))):d.push(String.fromCharCode.apply(null,a.subarray(g,Math.min(g+b,e)))),g+=b}catch(i){b=Math.floor(b/2)}return d.join("")}function g(a,b){for(var c=0;c<a.length;c++)b[c]=a[c];return b}var h=a("./support"),i=a("./compressions"),j=a("./nodeBuffer");c.string2binary=function(a){for(var b="",c=0;c<a.length;c++)b+=String.fromCharCode(255&a.charCodeAt(c));return b},c.arrayBuffer2Blob=function(a,b){c.checkSupport("blob"),b=b||"application/zip";try{return new Blob([a],{type:b})}catch(d){try{var e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,f=new e;return f.append(a),f.getBlob(b)}catch(d){throw new Error("Bug : can't construct the Blob.")}}},c.applyFromCharCode=f;var k={};k.string={string:d,array:function(a){return e(a,new Array(a.length))},arraybuffer:function(a){return k.string.uint8array(a).buffer},uint8array:function(a){return e(a,new Uint8Array(a.length))},nodebuffer:function(a){return e(a,j(a.length))}},k.array={string:f,array:d,arraybuffer:function(a){return new Uint8Array(a).buffer},uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return j(a)}},k.arraybuffer={string:function(a){return f(new Uint8Array(a))},array:function(a){return g(new Uint8Array(a),new Array(a.byteLength))},arraybuffer:d,uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return j(new Uint8Array(a))}},k.uint8array={string:f,array:function(a){return g(a,new Array(a.length))},arraybuffer:function(a){return a.buffer},uint8array:d,nodebuffer:function(a){return j(a)}},k.nodebuffer={string:f,array:function(a){return g(a,new Array(a.length))},arraybuffer:function(a){return k.nodebuffer.uint8array(a).buffer},uint8array:function(a){return g(a,new Uint8Array(a.length))},nodebuffer:d},c.transformTo=function(a,b){if(b||(b=""),!a)return b;c.checkSupport(a);var d=c.getTypeOf(b),e=k[d][a](b);return e},c.getTypeOf=function(a){return"string"==typeof a?"string":"[object Array]"===Object.prototype.toString.call(a)?"array":h.nodebuffer&&j.test(a)?"nodebuffer":h.uint8array&&a instanceof Uint8Array?"uint8array":h.arraybuffer&&a instanceof ArrayBuffer?"arraybuffer":void 0},c.checkSupport=function(a){var b=h[a.toLowerCase()];if(!b)throw new Error(a+" is not supported by this browser")},c.MAX_VALUE_16BITS=65535,c.MAX_VALUE_32BITS=-1,c.pretty=function(a){var b,c,d="";for(c=0;c<(a||"").length;c++)b=a.charCodeAt(c),d+="\\x"+(16>b?"0":"")+b.toString(16).toUpperCase();return d},c.findCompression=function(a){for(var b in i)if(i.hasOwnProperty(b)&&i[b].magic===a)return i[b];return null},c.isRegExp=function(a){return"[object RegExp]"===Object.prototype.toString.call(a)},c.extend=function(){var a,b,c={};for(a=0;a<arguments.length;a++)for(b in arguments[a])arguments[a].hasOwnProperty(b)&&"undefined"==typeof c[b]&&(c[b]=arguments[a][b]);return c}},{"./compressions":4,"./nodeBuffer":12,"./support":18}],23:[function(a,b,c){"use strict";function d(a,b){this.files=[],this.loadOptions=b,a&&this.load(a)}var e=a("./stringReader"),f=a("./nodeBufferReader"),g=a("./uint8ArrayReader"),h=a("./arrayReader"),i=a("./utils"),j=a("./signature"),k=a("./zipEntry"),l=a("./support");a("./object");d.prototype={checkSignature:function(a){var b=this.reader.readString(4);if(b!==a)throw new Error("Corrupted zip or bug : unexpected signature ("+i.pretty(b)+", expected "+i.pretty(a)+")")},isSignature:function(a,b){var c=this.reader.index;this.reader.setIndex(a);var d=this.reader.readString(4),e=d===b;return this.reader.setIndex(c),e},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var a=this.reader.readData(this.zipCommentLength),b=l.uint8array?"uint8array":"array",c=i.transformTo(b,a);this.zipComment=this.loadOptions.decodeFileName(c)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var a,b,c,d=this.zip64EndOfCentralSize-44,e=0;d>e;)a=this.reader.readInt(2),b=this.reader.readInt(4),c=this.reader.readString(b),this.zip64ExtensibleData[a]={id:a,length:b,value:c}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var a,b;for(a=0;a<this.files.length;a++)b=this.files[a],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(j.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var a;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===j.CENTRAL_FILE_HEADER;)a=new k({zip64:this.zip64},this.loadOptions),a.readCentralPart(this.reader),this.files.push(a);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var a=this.reader.lastIndexOfSignature(j.CENTRAL_DIRECTORY_END);if(0>a){var b=!this.isSignature(0,j.LOCAL_FILE_HEADER);throw b?new Error("Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip : can't find end of central directory")}this.reader.setIndex(a);var c=a;if(this.checkSignature(j.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,a=this.reader.lastIndexOfSignature(j.ZIP64_CENTRAL_DIRECTORY_LOCATOR),0>a)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(a),this.checkSignature(j.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,j.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(j.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip : can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(j.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var e=c-d;if(e>0)this.isSignature(c,j.CENTRAL_FILE_HEADER)||(this.reader.zero=e);else if(0>e)throw new Error("Corrupted zip: missing "+Math.abs(e)+" bytes.")},prepareReader:function(a){var b=i.getTypeOf(a);if(i.checkSupport(b),"string"!==b||l.uint8array)if("nodebuffer"===b)this.reader=new f(a);else if(l.uint8array)this.reader=new g(i.transformTo("uint8array",a));else{if(!l.array)throw new Error("Unexpected error: unsupported type '"+b+"'");this.reader=new h(i.transformTo("array",a))}else this.reader=new e(a,this.loadOptions.optimizedBinaryString)},load:function(a){this.prepareReader(a),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=d},{"./arrayReader":1,"./nodeBufferReader":13,"./object":14,"./signature":15,"./stringReader":16,"./support":18,"./uint8ArrayReader":19,"./utils":22,"./zipEntry":24}],24:[function(a,b,c){"use strict";function d(a,b){this.options=a,this.loadOptions=b}var e=a("./stringReader"),f=a("./utils"),g=a("./compressedObject"),h=a("./object"),i=a("./support"),j=0,k=3;d.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},prepareCompressedContent:function(a,b,c){return function(){var d=a.index;a.setIndex(b);var e=a.readData(c);return a.setIndex(d),e}},prepareContent:function(a,b,c,d,e){return function(){var a=f.transformTo(d.uncompressInputType,this.getCompressedContent()),b=d.uncompress(a);if(b.length!==e)throw new Error("Bug : uncompressed data size mismatch");return b}},readLocalPart:function(a){var b,c;if(a.skip(22),this.fileNameLength=a.readInt(2),c=a.readInt(2),this.fileName=a.readData(this.fileNameLength),a.skip(c),-1==this.compressedSize||-1==this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(b=f.findCompression(this.compressionMethod),null===b)throw new Error("Corrupted zip : compression "+f.pretty(this.compressionMethod)+" unknown (inner file : "+f.transformTo("string",this.fileName)+")");if(this.decompressed=new g,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(a,a.index,this.compressedSize,b),this.decompressed.getContent=this.prepareContent(a,a.index,this.compressedSize,b,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=f.transformTo("string",this.decompressed.getContent()),
h.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(a){if(this.versionMadeBy=a.readInt(2),this.versionNeeded=a.readInt(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4),this.fileNameLength=a.readInt(2),this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=a.readData(this.fileNameLength),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var a=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),a===j&&(this.dosPermissions=63&this.externalFileAttributes),a===k&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(a){if(this.extraFields[1]){var b=new e(this.extraFields[1].value);this.uncompressedSize===f.MAX_VALUE_32BITS&&(this.uncompressedSize=b.readInt(8)),this.compressedSize===f.MAX_VALUE_32BITS&&(this.compressedSize=b.readInt(8)),this.localHeaderOffset===f.MAX_VALUE_32BITS&&(this.localHeaderOffset=b.readInt(8)),this.diskNumberStart===f.MAX_VALUE_32BITS&&(this.diskNumberStart=b.readInt(4))}},readExtraFields:function(a){var b,c,d,e=a.index;for(this.extraFields=this.extraFields||{};a.index<e+this.extraFieldsLength;)b=a.readInt(2),c=a.readInt(2),d=a.readString(c),this.extraFields[b]={id:b,length:c,value:d}},handleUTF8:function(){var a=i.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var b=this.findExtraFieldUnicodePath();if(null!==b)this.fileNameStr=b;else{var c=f.transformTo(a,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(c)}var d=this.findExtraFieldUnicodeComment();if(null!==d)this.fileCommentStr=d;else{var e=f.transformTo(a,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(e)}}},findExtraFieldUnicodePath:function(){var a=this.extraFields[28789];if(a){var b=new e(a.value);return 1!==b.readInt(1)?null:h.crc32(this.fileName)!==b.readInt(4)?null:h.utf8decode(b.readString(a.length-5))}return null},findExtraFieldUnicodeComment:function(){var a=this.extraFields[25461];if(a){var b=new e(a.value);return 1!==b.readInt(1)?null:h.crc32(this.fileComment)!==b.readInt(4)?null:h.utf8decode(b.readString(a.length-5))}return null}},b.exports=d},{"./compressedObject":3,"./object":14,"./stringReader":16,"./support":18,"./utils":22}],25:[function(a,b,c){"use strict";var d=a("./lib/utils/common").assign,e=a("./lib/deflate"),f=a("./lib/inflate"),g=a("./lib/zlib/constants"),h={};d(h,e,f,g),b.exports=h},{"./lib/deflate":26,"./lib/inflate":27,"./lib/utils/common":28,"./lib/zlib/constants":31}],26:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.options=i.assign({level:s,method:u,chunkSize:16384,windowBits:15,memLevel:8,strategy:t,to:""},a||{});var b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=h.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==p)throw new Error(k[c]);b.header&&h.deflateSetHeader(this.strm,b.header)}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}function g(a,b){return b=b||{},b.gzip=!0,e(a,b)}var h=a("./zlib/deflate"),i=a("./utils/common"),j=a("./utils/strings"),k=a("./zlib/messages"),l=a("./zlib/zstream"),m=Object.prototype.toString,n=0,o=4,p=0,q=1,r=2,s=-1,t=0,u=8;d.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?o:n,"string"==typeof a?e.input=j.string2buf(a):"[object ArrayBuffer]"===m.call(a)?e.input=new Uint8Array(a):e.input=a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new i.Buf8(f),e.next_out=0,e.avail_out=f),c=h.deflate(e,d),c!==q&&c!==p)return this.onEnd(c),this.ended=!0,!1;0!==e.avail_out&&(0!==e.avail_in||d!==o&&d!==r)||("string"===this.options.to?this.onData(j.buf2binstring(i.shrinkBuf(e.output,e.next_out))):this.onData(i.shrinkBuf(e.output,e.next_out)))}while((e.avail_in>0||0===e.avail_out)&&c!==q);return d===o?(c=h.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===p):d===r?(this.onEnd(p),e.avail_out=0,!0):!0},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=d,c.deflate=e,c.deflateRaw=f,c.gzip=g},{"./utils/common":28,"./utils/strings":29,"./zlib/deflate":33,"./zlib/messages":38,"./zlib/zstream":40}],27:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=g.inflateInit2(this.strm,b.windowBits);if(c!==j.Z_OK)throw new Error(k[c]);this.header=new m,g.inflateGetHeader(this.strm,this.header)}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}var g=a("./zlib/inflate"),h=a("./utils/common"),i=a("./utils/strings"),j=a("./zlib/constants"),k=a("./zlib/messages"),l=a("./zlib/zstream"),m=a("./zlib/gzheader"),n=Object.prototype.toString;d.prototype.push=function(a,b){var c,d,e,f,k,l=this.strm,m=this.options.chunkSize,o=!1;if(this.ended)return!1;d=b===~~b?b:b===!0?j.Z_FINISH:j.Z_NO_FLUSH,"string"==typeof a?l.input=i.binstring2buf(a):"[object ArrayBuffer]"===n.call(a)?l.input=new Uint8Array(a):l.input=a,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new h.Buf8(m),l.next_out=0,l.avail_out=m),c=g.inflate(l,j.Z_NO_FLUSH),c===j.Z_BUF_ERROR&&o===!0&&(c=j.Z_OK,o=!1),c!==j.Z_STREAM_END&&c!==j.Z_OK)return this.onEnd(c),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&c!==j.Z_STREAM_END&&(0!==l.avail_in||d!==j.Z_FINISH&&d!==j.Z_SYNC_FLUSH)||("string"===this.options.to?(e=i.utf8border(l.output,l.next_out),f=l.next_out-e,k=i.buf2string(l.output,e),l.next_out=f,l.avail_out=m-f,f&&h.arraySet(l.output,l.output,e,f,0),this.onData(k)):this.onData(h.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(o=!0)}while((l.avail_in>0||0===l.avail_out)&&c!==j.Z_STREAM_END);return c===j.Z_STREAM_END&&(d=j.Z_FINISH),d===j.Z_FINISH?(c=g.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===j.Z_OK):d===j.Z_SYNC_FLUSH?(this.onEnd(j.Z_OK),l.avail_out=0,!0):!0},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===j.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=d,c.inflate=e,c.inflateRaw=f,c.ungzip=e},{"./utils/common":28,"./utils/strings":29,"./zlib/constants":31,"./zlib/gzheader":34,"./zlib/inflate":36,"./zlib/messages":38,"./zlib/zstream":40}],28:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if("object"!=typeof c)throw new TypeError(c+"must be non-object");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){var b,c,d,e,f,g;for(d=0,b=0,c=a.length;c>b;b++)d+=a[b].length;for(g=new Uint8Array(d),e=0,b=0,c=a.length;c>b;b++)f=a[b],g.set(f,e),e+=f.length;return g}},f={arraySet:function(a,b,c,d,e){for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){return[].concat.apply([],a)}};c.setTyped=function(a){a?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,e)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,f))},c.setTyped(d)},{}],29:[function(a,b,c){"use strict";function d(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&f))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var c="",d=0;b>d;d++)c+=String.fromCharCode(a[d]);return c}var e=a("./common"),f=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(h){f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){g=!1}for(var i=new e.Buf8(256),j=0;256>j;j++)i[j]=j>=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=new e.Buf8(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;d>c;c++)b[c]=a.charCodeAt(c);return b},c.buf2string=function(a,b){var c,e,f,g,h=b||a.length,j=new Array(2*h);for(e=0,c=0;h>c;)if(f=a[c++],128>f)j[e++]=f;else if(g=i[f],g>4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&h>c;)f=f<<6|63&a[c++],g--;g>1?j[e++]=65533:65536>f?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+i[a[c]]>b?c:b}},{"./common":28}],30:[function(a,b,c){"use strict";function d(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0}b.exports=d},{}],31:[function(a,b,c){"use strict";b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],32:[function(a,b,c){"use strict";function d(){for(var a,b=[],c=0;256>c;c++){a=c;for(var d=0;8>d;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function e(a,b,c,d){var e=f,g=d+c;a^=-1;for(var h=d;g>h;h++)a=a>>>8^e[255&(a^b[h])];return-1^a}var f=d();b.exports=e},{}],33:[function(a,b,c){"use strict";function d(a,b){return a.msg=H[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(D.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){E._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}function j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,D.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=F(a.adler,b,e,c):2===a.state.wrap&&(a.adler=G(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-ka?a.strstart-(a.w_size-ka):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ja,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&m>f);if(d=ja-(m-f),f=m-ja,d>g){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-ka)){D.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=ia)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+ia-1])&a.hash_mask,a.prev[f&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=f,f++,a.insert--,!(a.lookahead+a.insert<ia)););}while(a.lookahead<ka&&0!==a.strm.avail_in)}function n(a,b){var c=65535;for(c>a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===I)return ta;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.strstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return ta;if(a.strstart-a.block_start>=a.w_size-ka&&(h(a,!1),0===a.strm.avail_out))return ta}return a.insert=0,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?ta:ta}function o(a,b){for(var c,d;;){if(a.lookahead<ka){if(m(a),a.lookahead<ka&&b===I)return ta;if(0===a.lookahead)break}if(c=0,a.lookahead>=ia&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ia-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),0!==c&&a.strstart-c<=a.w_size-ka&&(a.match_length=l(a,c)),a.match_length>=ia)if(d=E._tr_tally(a,a.strstart-a.match_start,a.match_length-ia),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=ia){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ia-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=E._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return ta}return a.insert=a.strstart<ia-1?a.strstart:ia-1,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ta:ua}function p(a,b){for(var c,d,e;;){if(a.lookahead<ka){if(m(a),a.lookahead<ka&&b===I)return ta;if(0===a.lookahead)break}if(c=0,a.lookahead>=ia&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ia-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=ia-1,0!==c&&a.prev_length<a.max_lazy_match&&a.strstart-c<=a.w_size-ka&&(a.match_length=l(a,c),a.match_length<=5&&(a.strategy===T||a.match_length===ia&&a.strstart-a.match_start>4096)&&(a.match_length=ia-1)),a.prev_length>=ia&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-ia,d=E._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-ia),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ia-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);if(a.match_available=0,a.match_length=ia-1,a.strstart++,d&&(h(a,!1),0===a.strm.avail_out))return ta}else if(a.match_available){if(d=E._tr_tally(a,0,a.window[a.strstart-1]),d&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return ta}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(d=E._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<ia-1?a.strstart:ia-1,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ta:ua}function q(a,b){for(var c,d,e,f,g=a.window;;){if(a.lookahead<=ja){if(m(a),a.lookahead<=ja&&b===I)return ta;if(0===a.lookahead)break}if(a.match_length=0,a.lookahead>=ia&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ja;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&f>e);a.match_length=ja-(f-e),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=ia?(c=E._tr_tally(a,1,a.match_length-ia),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=E._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return ta}return a.insert=0,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ta:ua}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===I)return ta;break}if(a.match_length=0,c=E._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return ta}return a.insert=0,b===L?(h(a,!0),0===a.strm.avail_out?va:wa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ta:ua}function s(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e}function t(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=C[a.level].max_lazy,a.good_match=C[a.level].good_length,a.nice_match=C[a.level].nice_length,a.max_chain_length=C[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=ia-1,a.match_available=0,a.ins_h=0}function u(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new D.Buf16(2*ga),this.dyn_dtree=new D.Buf16(2*(2*ea+1)),this.bl_tree=new D.Buf16(2*(2*fa+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new D.Buf16(ha+1),this.heap=new D.Buf16(2*da+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new D.Buf16(2*da+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=Y,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?ma:ra,a.adler=2===b.wrap?0:1,b.last_flush=I,E._tr_init(b),N):d(a,P)}function w(a){var b=v(a);return b===N&&t(a.state),b}function x(a,b){return a&&a.state?2!==a.state.wrap?P:(a.state.gzhead=b,N):P}function y(a,b,c,e,f,g){if(!a)return P;var h=1;if(b===S&&(b=6),0>e?(h=0,e=-e):e>15&&(h=2,e-=16),1>f||f>$||c!==Z||8>e||e>15||0>b||b>9||0>g||g>W)return d(a,P);8===e&&(e=9);var i=new u;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<<i.w_bits,i.w_mask=i.w_size-1,i.hash_bits=f+7,i.hash_size=1<<i.hash_bits,i.hash_mask=i.hash_size-1,i.hash_shift=~~((i.hash_bits+ia-1)/ia),i.window=new D.Buf8(2*i.w_size),i.head=new D.Buf16(i.hash_size),i.prev=new D.Buf16(i.w_size),i.lit_bufsize=1<<f+6,i.pending_buf_size=4*i.lit_bufsize,i.pending_buf=new D.Buf8(i.pending_buf_size),i.d_buf=i.lit_bufsize>>1,i.l_buf=3*i.lit_bufsize,i.level=b,i.strategy=g,i.method=c,w(a)}function z(a,b){return y(a,b,Z,_,aa,X)}function A(a,b){var c,h,k,l;if(!a||!a.state||b>M||0>b)return a?d(a,P):P;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===sa&&b!==L)return d(a,0===a.avail_out?R:P);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===ma)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.time>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=U||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=G(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=na):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=U||h.level<2?4:0),i(h,xa),h.status=ra);else{var m=Z+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=U||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=la),m+=31-m%31,h.status=ra,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===na)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=oa)}else h.status=oa;if(h.status===oa)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.name.length?255&h.gzhead.name.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=pa)}else h.status=pa;if(h.status===pa)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.comment.length?255&h.gzhead.comment.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=G(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=qa)}else h.status=qa;if(h.status===qa&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=ra)):h.status=ra),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,N}else if(0===a.avail_in&&e(b)<=e(c)&&b!==L)return d(a,R);if(h.status===sa&&0!==a.avail_in)return d(a,R);if(0!==a.avail_in||0!==h.lookahead||b!==I&&h.status!==sa){var o=h.strategy===U?r(h,b):h.strategy===V?q(h,b):C[h.level].func(h,b);if(o!==va&&o!==wa||(h.status=sa),o===ta||o===va)return 0===a.avail_out&&(h.last_flush=-1),N;if(o===ua&&(b===J?E._tr_align(h):b!==M&&(E._tr_stored_block(h,0,0,!1),b===K&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,N}return b!==L?N:h.wrap<=0?O:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>>>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?N:O)}function B(a){var b;return a&&a.state?(b=a.state.status,b!==ma&&b!==na&&b!==oa&&b!==pa&&b!==qa&&b!==ra&&b!==sa?d(a,P):(a.state=null,b===ra?d(a,Q):N)):P}var C,D=a("../utils/common"),E=a("./trees"),F=a("./adler32"),G=a("./crc32"),H=a("./messages"),I=0,J=1,K=3,L=4,M=5,N=0,O=1,P=-2,Q=-3,R=-5,S=-1,T=1,U=2,V=3,W=4,X=0,Y=2,Z=8,$=9,_=15,aa=8,ba=29,ca=256,da=ca+1+ba,ea=30,fa=19,ga=2*da+1,ha=15,ia=3,ja=258,ka=ja+ia+1,la=32,ma=42,na=69,oa=73,pa=91,qa=103,ra=113,sa=666,ta=1,ua=2,va=3,wa=4,xa=3;C=[new s(0,0,0,0,n),new s(4,4,8,4,o),new s(4,5,16,8,o),new s(4,6,32,32,o),new s(4,4,16,16,p),new s(8,16,32,32,p),new s(8,16,128,128,p),new s(8,32,128,256,p),new s(32,128,258,1024,p),new s(32,258,258,4096,p)],c.deflateInit=z,c.deflateInit2=y,c.deflateReset=w,c.deflateResetKeep=v,c.deflateSetHeader=x,c.deflate=A,c.deflateEnd=B,c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":28,"./adler32":30,"./crc32":32,"./messages":38,"./trees":39}],34:[function(a,b,c){"use strict";function d(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}b.exports=d},{}],35:[function(a,b,c){"use strict";var d=30,e=12;b.exports=function(a,b){var c,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;c=a.state,f=a.next_in,B=a.input,g=f+(a.avail_in-5),h=a.next_out,C=a.output,i=h-(b-a.avail_out),j=h+(a.avail_out-257),k=c.dmax,l=c.wsize,m=c.whave,n=c.wnext,o=c.window,p=c.hold,q=c.bits,r=c.lencode,s=c.distcode,t=(1<<c.lenbits)-1,u=(1<<c.distbits)-1;a:do{15>q&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=r[p&t];b:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<<w)-1)];continue b}if(32&w){c.mode=e;break a}a.msg="invalid literal/length code",c.mode=d;break a}x=65535&v,w&=15,w&&(w>q&&(p+=B[f++]<<q,q+=8),x+=p&(1<<w)-1,p>>>=w,q-=w),15>q&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=s[p&u];c:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<<w)-1)];continue c}a.msg="invalid distance code",c.mode=d;break a}if(y=65535&v,w&=15,w>q&&(p+=B[f++]<<q,q+=8,w>q&&(p+=B[f++]<<q,q+=8)),y+=p&(1<<w)-1,y>k){a.msg="invalid distance too far back",c.mode=d;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&c.sane){a.msg="invalid distance too far back",c.mode=d;break a}if(z=0,A=o,0===n){if(z+=l-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}else if(w>n){if(z+=l+n-w,w-=n,x>w){x-=w;do C[h++]=o[z++];while(--w);if(z=0,x>n){w=n,x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}}else if(z+=n-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}for(;x>2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}break}}break}}while(g>f&&j>h);x=q>>3,f-=x,q-=x<<3,p&=(1<<q)-1,a.next_in=f,a.next_out=h,a.avail_in=g>f?5+(g-f):5-(f-g),a.avail_out=j>h?257+(j-h):257-(h-j),c.hold=p,c.bits=q}},{}],36:[function(a,b,c){"use strict";function d(a){return(a>>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=K,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new r.Buf32(oa),b.distcode=b.distdyn=new r.Buf32(pa),b.sane=1,b.back=-1,C):F}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):F}function h(a,b){var c,d;return a&&a.state?(d=a.state,0>b?(c=0,b=-b):(c=(b>>4)+1,48>b&&(b&=15)),b&&(8>b||b>15)?F:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):F}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==C&&(a.state=null),c):F}function j(a){return i(a,ra)}function k(a){if(sa){var b;for(p=new r.Buf32(512),q=new r.Buf32(32),b=0;144>b;)a.lens[b++]=8;for(;256>b;)a.lens[b++]=9;for(;280>b;)a.lens[b++]=7;for(;288>b;)a.lens[b++]=8;for(v(x,a.lens,0,288,p,0,a.work,{bits:9}),b=0;32>b;)a.lens[b++]=5;v(y,a.lens,0,32,q,0,a.work,{bits:5}),sa=!1}a.lencode=p,a.lenbits=9,a.distcode=q,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<<f.wbits,f.wnext=0,f.whave=0,f.window=new r.Buf8(f.wsize)),d>=f.wsize?(r.arraySet(f.window,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),r.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(r.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whave<f.wsize&&(f.whave+=e))),0}function m(a,b){var c,e,f,g,h,i,j,m,n,o,p,q,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa=0,Ba=new r.Buf8(4),Ca=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return F;c=a.state,c.mode===V&&(c.mode=W),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,o=i,p=j,xa=C;a:for(;;)switch(c.mode){case K:if(0===c.wrap){c.mode=W;break}for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(2&c.wrap&&35615===m){c.check=0,Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0),m=0,n=0,c.mode=L;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg="incorrect header check",c.mode=la;break}if((15&m)!==J){a.msg="unknown compression method",c.mode=la;break}if(m>>>=4,n-=4,wa=(15&m)+8,0===c.wbits)c.wbits=wa;else if(wa>c.wbits){a.msg="invalid window size",c.mode=la;break}c.dmax=1<<wa,a.adler=c.check=1,c.mode=512&m?T:V,m=0,n=0;break;case L:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.flags=m,(255&c.flags)!==J){a.msg="unknown compression method",c.mode=la;break}if(57344&c.flags){a.msg="unknown header flags set",c.mode=la;break}c.head&&(c.head.text=m>>8&1),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0,c.mode=M;case M:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.time=m),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,Ba[2]=m>>>16&255,Ba[3]=m>>>24&255,c.check=t(c.check,Ba,4,0)),m=0,n=0,c.mode=N;case N:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.xflags=255&m,c.head.os=m>>8),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0,c.mode=O;case O:if(1024&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length=m,c.head&&(c.head.extra_len=m),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=P;case P:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wa=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),r.arraySet(c.head.extra,e,g,q,wa)),512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=Q;case Q:if(2048&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.name+=String.fromCharCode(wa));while(wa&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wa)break a}else c.head&&(c.head.name=null);c.length=0,c.mode=R;case R:if(4096&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.comment+=String.fromCharCode(wa));while(wa&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wa)break a}else c.head&&(c.head.comment=null);c.mode=S;case S:if(512&c.flags){for(;16>n;){
if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(65535&c.check)){a.msg="header crc mismatch",c.mode=la;break}m=0,n=0}c.head&&(c.head.hcrc=c.flags>>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=V;break;case T:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}a.adler=c.check=d(m),m=0,n=0,c.mode=U;case U:if(0===c.havedict)return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,E;a.adler=c.check=1,c.mode=V;case V:if(b===A||b===B)break a;case W:if(c.last){m>>>=7&n,n-=7&n,c.mode=ia;break}for(;3>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}switch(c.last=1&m,m>>>=1,n-=1,3&m){case 0:c.mode=X;break;case 1:if(k(c),c.mode=ba,b===B){m>>>=2,n-=2;break a}break;case 2:c.mode=$;break;case 3:a.msg="invalid block type",c.mode=la}m>>>=2,n-=2;break;case X:for(m>>>=7&n,n-=7&n;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if((65535&m)!==(m>>>16^65535)){a.msg="invalid stored block lengths",c.mode=la;break}if(c.length=65535&m,m=0,n=0,c.mode=Y,b===B)break a;case Y:c.mode=Z;case Z:if(q=c.length){if(q>i&&(q=i),q>j&&(q=j),0===q)break a;r.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=V;break;case $:for(;14>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.nlen=(31&m)+257,m>>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg="too many length or distance symbols",c.mode=la;break}c.have=0,c.mode=_;case _:for(;c.have<c.ncode;){for(;3>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.lens[Ca[c.have++]]=7&m,m>>>=3,n-=3}for(;c.have<19;)c.lens[Ca[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,ya={bits:c.lenbits},xa=v(w,c.lens,0,19,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid code lengths set",c.mode=la;break}c.have=0,c.mode=aa;case aa:for(;c.have<c.nlen+c.ndist;){for(;Aa=c.lencode[m&(1<<c.lenbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(16>sa)m>>>=qa,n-=qa,c.lens[c.have++]=sa;else{if(16===sa){for(za=qa+2;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m>>>=qa,n-=qa,0===c.have){a.msg="invalid bit length repeat",c.mode=la;break}wa=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sa){for(za=qa+3;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qa,n-=qa,wa=0,q=3+(7&m),m>>>=3,n-=3}else{for(za=qa+7;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qa,n-=qa,wa=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg="invalid bit length repeat",c.mode=la;break}for(;q--;)c.lens[c.have++]=wa}}if(c.mode===la)break;if(0===c.lens[256]){a.msg="invalid code -- missing end-of-block",c.mode=la;break}if(c.lenbits=9,ya={bits:c.lenbits},xa=v(x,c.lens,0,c.nlen,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid literal/lengths set",c.mode=la;break}if(c.distbits=6,c.distcode=c.distdyn,ya={bits:c.distbits},xa=v(y,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,ya),c.distbits=ya.bits,xa){a.msg="invalid distances set",c.mode=la;break}if(c.mode=ba,b===B)break a;case ba:c.mode=ca;case ca:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,u(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===V&&(c.back=-1);break}for(c.back=0;Aa=c.lencode[m&(1<<c.lenbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(ra&&0===(240&ra)){for(ta=qa,ua=ra,va=sa;Aa=c.lencode[va+((m&(1<<ta+ua)-1)>>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=ta+qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,c.length=sa,0===ra){c.mode=ha;break}if(32&ra){c.back=-1,c.mode=V;break}if(64&ra){a.msg="invalid literal/length code",c.mode=la;break}c.extra=15&ra,c.mode=da;case da:if(c.extra){for(za=c.extra;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=ea;case ea:for(;Aa=c.distcode[m&(1<<c.distbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(0===(240&ra)){for(ta=qa,ua=ra,va=sa;Aa=c.distcode[va+((m&(1<<ta+ua)-1)>>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=ta+qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,64&ra){a.msg="invalid distance code",c.mode=la;break}c.offset=sa,c.extra=15&ra,c.mode=fa;case fa:if(c.extra){for(za=c.extra;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.offset+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg="invalid distance too far back",c.mode=la;break}c.mode=ga;case ga:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg="invalid distance too far back",c.mode=la;break}q>c.wnext?(q-=c.wnext,oa=c.wsize-q):oa=c.wnext-q,q>c.length&&(q=c.length),pa=c.window}else pa=f,oa=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pa[oa++];while(--q);0===c.length&&(c.mode=ca);break;case ha:if(0===j)break a;f[h++]=c.length,j--,c.mode=ca;break;case ia:if(c.wrap){for(;32>n;){if(0===i)break a;i--,m|=e[g++]<<n,n+=8}if(p-=j,a.total_out+=p,c.total+=p,p&&(a.adler=c.check=c.flags?t(c.check,f,p,h-p):s(c.check,f,p,h-p)),p=j,(c.flags?m:d(m))!==c.check){a.msg="incorrect data check",c.mode=la;break}m=0,n=0}c.mode=ja;case ja:if(c.wrap&&c.flags){for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(4294967295&c.total)){a.msg="incorrect length check",c.mode=la;break}m=0,n=0}c.mode=ka;case ka:xa=D;break a;case la:xa=G;break a;case ma:return H;case na:default:return F}return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,(c.wsize||p!==a.avail_out&&c.mode<la&&(c.mode<ia||b!==z))&&l(a,a.output,a.next_out,p-a.avail_out)?(c.mode=ma,H):(o-=a.avail_in,p-=a.avail_out,a.total_in+=o,a.total_out+=p,c.total+=p,c.wrap&&p&&(a.adler=c.check=c.flags?t(c.check,f,p,a.next_out-p):s(c.check,f,p,a.next_out-p)),a.data_type=c.bits+(c.last?64:0)+(c.mode===V?128:0)+(c.mode===ba||c.mode===Y?256:0),(0===o&&0===p||b===z)&&xa===C&&(xa=I),xa)}function n(a){if(!a||!a.state)return F;var b=a.state;return b.window&&(b.window=null),a.state=null,C}function o(a,b){var c;return a&&a.state?(c=a.state,0===(2&c.wrap)?F:(c.head=b,b.done=!1,C)):F}var p,q,r=a("../utils/common"),s=a("./adler32"),t=a("./crc32"),u=a("./inffast"),v=a("./inftrees"),w=0,x=1,y=2,z=4,A=5,B=6,C=0,D=1,E=2,F=-2,G=-3,H=-4,I=-5,J=8,K=1,L=2,M=3,N=4,O=5,P=6,Q=7,R=8,S=9,T=10,U=11,V=12,W=13,X=14,Y=15,Z=16,$=17,_=18,aa=19,ba=20,ca=21,da=22,ea=23,fa=24,ga=25,ha=26,ia=27,ja=28,ka=29,la=30,ma=31,na=32,oa=852,pa=592,qa=15,ra=qa,sa=!0;c.inflateReset=g,c.inflateReset2=h,c.inflateResetKeep=f,c.inflateInit=j,c.inflateInit2=i,c.inflate=m,c.inflateEnd=n,c.inflateGetHeader=o,c.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":28,"./adler32":30,"./crc32":32,"./inffast":35,"./inftrees":37}],37:[function(a,b,c){"use strict";var d=a("../utils/common"),e=15,f=852,g=592,h=0,i=1,j=2,k=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],m=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],n=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];b.exports=function(a,b,c,o,p,q,r,s){var t,u,v,w,x,y,z,A,B,C=s.bits,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=null,O=0,P=new d.Buf16(e+1),Q=new d.Buf16(e+1),R=null,S=0;for(D=0;e>=D;D++)P[D]=0;for(E=0;o>E;E++)P[b[c+E]]++;for(H=C,G=e;G>=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;G>F&&0===P[F];F++);for(F>H&&(H=F),K=1,D=1;e>=D;D++)if(K<<=1,K-=P[D],0>K)return-1;if(K>0&&(a===h||1!==G))return-1;for(Q[1]=0,D=1;e>D;D++)Q[D+1]=Q[D]+P[D];for(E=0;o>E;E++)0!==b[c+E]&&(r[Q[b[c+E]]++]=E);if(a===h?(N=R=r,y=19):a===i?(N=k,O-=257,R=l,S-=257,y=256):(N=m,R=n,y=-1),M=0,E=0,D=F,x=q,I=H,J=0,v=-1,L=1<<H,w=L-1,a===i&&L>f||a===j&&L>g)return 1;for(var T=0;;){T++,z=D-J,r[E]<y?(A=0,B=r[E]):r[E]>y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<<D-J,u=1<<I,F=u;do u-=t,p[x+(M>>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<<D-1;M&t;)t>>=1;if(0!==t?(M&=t-1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[c+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<<I;G>I+J&&(K-=P[I+J],!(0>=K));)I++,K<<=1;if(L+=1<<I,a===i&&L>f||a===j&&L>g)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{"../utils/common":28}],38:[function(a,b,c){"use strict";b.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],39:[function(a,b,c){"use strict";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a,b,c,d,e){this.static_tree=a,this.extra_bits=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length}function f(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b}function g(a){return 256>a?ia[a]:ia[256+(a>>>7)]}function h(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function i(a,b,c){a.bi_valid>X-c?(a.bi_buf|=b<<a.bi_valid&65535,h(a,a.bi_buf),a.bi_buf=b>>X-a.bi_valid,a.bi_valid+=c-X):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=c)}function j(a,b,c){i(a,c[2*b],c[2*b+1])}function k(a,b){var c=0;do c|=1&a,a>>>=1,c<<=1;while(--b>0);return c>>>1}function l(a){16===a.bi_valid?(h(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function m(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;W>=f;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0,c=a.heap_max+1;V>c;c++)d=a.heap[c],f=i[2*i[2*d+1]+1]+1,f>o&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function n(a,b,c){var d,e,f=new Array(W+1),g=0;for(d=1;W>=d;d++)f[d]=g=g+c[d-1]<<1;for(e=0;b>=e;e++){var h=a[2*e+1];0!==h&&(a[2*e]=k(f[h]++,h))}}function o(){var a,b,c,d,f,g=new Array(W+1);for(c=0,d=0;Q-1>d;d++)for(ka[d]=c,a=0;a<1<<ba[d];a++)ja[c++]=d;for(ja[c-1]=d,f=0,d=0;16>d;d++)for(la[d]=f,a=0;a<1<<ca[d];a++)ia[f++]=d;for(f>>=7;T>d;d++)for(la[d]=f<<7,a=0;a<1<<ca[d]-7;a++)ia[256+f++]=d;for(b=0;W>=b;b++)g[b]=0;for(a=0;143>=a;)ga[2*a+1]=8,a++,g[8]++;for(;255>=a;)ga[2*a+1]=9,a++,g[9]++;for(;279>=a;)ga[2*a+1]=7,a++,g[7]++;for(;287>=a;)ga[2*a+1]=8,a++,g[8]++;for(n(ga,S+1,g),a=0;T>a;a++)ha[2*a+1]=5,ha[2*a]=k(a,5);ma=new e(ga,ba,R+1,S,W),na=new e(ha,ca,0,T,W),oa=new e(new Array(0),da,0,U,Y)}function p(a){var b;for(b=0;S>b;b++)a.dyn_ltree[2*b]=0;for(b=0;T>b;b++)a.dyn_dtree[2*b]=0;for(b=0;U>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[2*Z]=1,a.opt_len=a.static_len=0,a.last_lit=a.matches=0}function q(a){a.bi_valid>8?h(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function r(a,b,c,d){q(a),d&&(h(a,c),h(a,~c)),G.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function s(a,b,c,d){var e=2*b,f=2*c;return a[e]<a[f]||a[e]===a[f]&&d[b]<=d[c]}function t(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len&&(e<a.heap_len&&s(b,a.heap[e+1],a.heap[e],a.depth)&&e++,!s(b,d,a.heap[e],a.depth));)a.heap[c]=a.heap[e],c=e,e<<=1;a.heap[c]=d}function u(a,b,c){var d,e,f,h,k=0;if(0!==a.last_lit)do d=a.pending_buf[a.d_buf+2*k]<<8|a.pending_buf[a.d_buf+2*k+1],e=a.pending_buf[a.l_buf+k],k++,0===d?j(a,e,b):(f=ja[e],j(a,f+R+1,b),h=ba[f],0!==h&&(e-=ka[f],i(a,e,h)),d--,f=g(d),j(a,f,c),h=ca[f],0!==h&&(d-=la[f],i(a,d,h)));while(k<a.last_lit);j(a,Z,b)}function v(a,b){var c,d,e,f=b.dyn_tree,g=b.stat_desc.static_tree,h=b.stat_desc.has_stree,i=b.stat_desc.elems,j=-1;for(a.heap_len=0,a.heap_max=V,c=0;i>c;c++)0!==f[2*c]?(a.heap[++a.heap_len]=j=c,a.depth[c]=0):f[2*c+1]=0;for(;a.heap_len<2;)e=a.heap[++a.heap_len]=2>j?++j:0,f[2*e]=1,a.depth[e]=0,a.opt_len--,h&&(a.static_len-=g[2*e+1]);for(b.max_code=j,c=a.heap_len>>1;c>=1;c--)t(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],t(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,t(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],m(a,b),n(f,j,a.bl_count)}function w(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;c>=d;d++)e=g,g=b[2*(d+1)+1],++h<i&&e===g||(j>h?a.bl_tree[2*e]+=h:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*$]++):10>=h?a.bl_tree[2*_]++:a.bl_tree[2*aa]++,h=0,f=e,0===g?(i=138,j=3):e===g?(i=6,j=3):(i=7,j=4))}function x(a,b,c){var d,e,f=-1,g=b[1],h=0,k=7,l=4;for(0===g&&(k=138,l=3),d=0;c>=d;d++)if(e=g,g=b[2*(d+1)+1],!(++h<k&&e===g)){if(l>h){do j(a,e,a.bl_tree);while(0!==--h)}else 0!==e?(e!==f&&(j(a,e,a.bl_tree),h--),j(a,$,a.bl_tree),i(a,h-3,2)):10>=h?(j(a,_,a.bl_tree),i(a,h-3,3)):(j(a,aa,a.bl_tree),i(a,h-11,7));h=0,f=e,0===g?(k=138,l=3):e===g?(k=6,l=3):(k=7,l=4)}}function y(a){var b;for(w(a,a.dyn_ltree,a.l_desc.max_code),w(a,a.dyn_dtree,a.d_desc.max_code),v(a,a.bl_desc),b=U-1;b>=3&&0===a.bl_tree[2*ea[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function z(a,b,c,d){var e;for(i(a,b-257,5),i(a,c-1,5),i(a,d-4,4),e=0;d>e;e++)i(a,a.bl_tree[2*ea[e]+1],3);x(a,a.dyn_ltree,b-1),x(a,a.dyn_dtree,c-1)}function A(a){var b,c=4093624447;for(b=0;31>=b;b++,c>>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return I;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return J;for(b=32;R>b;b++)if(0!==a.dyn_ltree[2*b])return J;return I}function B(a){pa||(o(),pa=!0),a.l_desc=new f(a.dyn_ltree,ma),a.d_desc=new f(a.dyn_dtree,na),a.bl_desc=new f(a.bl_tree,oa),a.bi_buf=0,a.bi_valid=0,p(a)}function C(a,b,c,d){i(a,(L<<1)+(d?1:0),3),r(a,b,c,!0)}function D(a){i(a,M<<1,3),j(a,Z,ga),l(a)}function E(a,b,c,d){var e,f,g=0;a.level>0?(a.strm.data_type===K&&(a.strm.data_type=A(a)),v(a,a.l_desc),v(a,a.d_desc),g=y(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,e>=f&&(e=f)):e=f=c+5,e>=c+4&&-1!==b?C(a,b,c,d):a.strategy===H||f===e?(i(a,(M<<1)+(d?1:0),3),u(a,ga,ha)):(i(a,(N<<1)+(d?1:0),3),z(a,a.l_desc.max_code+1,a.d_desc.max_code+1,g+1),u(a,a.dyn_ltree,a.dyn_dtree)),p(a),d&&q(a)}function F(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(ja[c]+R+1)]++,a.dyn_dtree[2*g(b)]++),a.last_lit===a.lit_bufsize-1}var G=a("../utils/common"),H=4,I=0,J=1,K=2,L=0,M=1,N=2,O=3,P=258,Q=29,R=256,S=R+1+Q,T=30,U=19,V=2*S+1,W=15,X=16,Y=7,Z=256,$=16,_=17,aa=18,ba=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ca=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],da=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ea=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa=512,ga=new Array(2*(S+2));d(ga);var ha=new Array(2*T);d(ha);var ia=new Array(fa);d(ia);var ja=new Array(P-O+1);d(ja);var ka=new Array(Q);d(ka);var la=new Array(T);d(la);var ma,na,oa,pa=!1;c._tr_init=B,c._tr_stored_block=C,c._tr_flush_block=E,c._tr_tally=F,c._tr_align=D},{"../utils/common":28}],40:[function(a,b,c){"use strict";function d(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}b.exports=d},{}]},{},[10])(10)});;
/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.core.min",["jquery"],e)}(function(){return function(e,t,n){function i(){}function r(e,t){if(t)return"'"+e.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")+"'";var n=e.charAt(0),i=e.substring(1);return"="===n?"+("+i+")+":":"===n?"+$kendoHtmlEncode("+i+")+":";"+e+";$kendoOutput+="}function o(e,t,n){return e+="",t=t||2,n=t-e.length,n?W[t].substring(0,n)+e:e}function a(e){var t=e.css(ve.support.transitions.css+"box-shadow")||e.css("box-shadow"),n=t?t.match(Ee)||[0,0,0,0,0]:[0,0,0,0,0],i=xe.max(+n[3],+(n[4]||0));return{left:-n[1]+i,right:+n[1]+i,bottom:+n[2]+i}}function s(t,n){var i,r,o,a,s,l,d,c=Te.browser,u=ve._outerWidth,h=ve._outerHeight;return t.parent().hasClass("k-animation-container")?(l=t.parent(".k-animation-container"),d=l[0].style,l.is(":hidden")&&l.show(),i=Se.test(d.width)||Se.test(d.height),i||l.css({width:u(t),height:h(t),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"})):(r=t[0].style.width,o=t[0].style.height,a=Se.test(r),s=Se.test(o),i=a||s,!a&&(!n||n&&r)&&(r=u(t)),!s&&(!n||n&&o)&&(o=h(t)),t.wrap(e("<div/>").addClass("k-animation-container").css({width:r,height:o})),i&&t.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})),c.msie&&xe.floor(c.version)<=7&&(t.css({zoom:1}),t.children(".k-menu").width(t.width())),t.parent()}function l(e){var t=1,n=arguments.length;for(t=1;t<n;t++)d(e,arguments[t]);return e}function d(e,t){var n,i,r,o,a,s=ve.data.ObservableArray,l=ve.data.LazyObservableArray,c=ve.data.DataSource,u=ve.data.HierarchicalDataSource;for(n in t)i=t[n],r=typeof i,o=r===Me&&null!==i?i.constructor:null,o&&o!==Array&&o!==s&&o!==l&&o!==c&&o!==u?i instanceof Date?e[n]=new Date(i.getTime()):A(i.clone)?e[n]=i.clone():(a=e[n],e[n]=typeof a===Me?a||{}:{},d(e[n],i)):r!==Ne&&(e[n]=i);return e}function c(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&t[r].test(e))return r;return i!==n?i:e}function u(e){return e.replace(/([a-z][A-Z])/g,function(e){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})}function h(e){return e.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()})}function f(t,n){var i,r={};return document.defaultView&&document.defaultView.getComputedStyle?(i=document.defaultView.getComputedStyle(t,""),n&&e.each(n,function(e,t){r[t]=i.getPropertyValue(t)})):(i=t.currentStyle,n&&e.each(n,function(e,t){r[t]=i[h(t)]})),ve.size(r)||(r=i),r}function p(e){if(e&&e.className&&"string"==typeof e.className&&e.className.indexOf("k-auto-scrollable")>-1)return!0;var t=f(e,["overflow"]).overflow;return"auto"==t||"scroll"==t}function m(t,i){var r,o=Te.browser.webkit,a=Te.browser.mozilla,s=t instanceof e?t[0]:t;if(t)return r=Te.isRtl(t),i===n?r&&o?s.scrollWidth-s.clientWidth-s.scrollLeft:Math.abs(s.scrollLeft):(s.scrollLeft=r&&o?s.scrollWidth-s.clientWidth-i:r&&a?-i:i,n)}function g(e){var t,n=0;for(t in e)e.hasOwnProperty(t)&&"toJSON"!=t&&n++;return n}function v(e,n,i){var r,o,a;return n||(n="offset"),r=e[n](),o={top:r.top,right:r.right,bottom:r.bottom,left:r.left},Te.browser.msie&&(Te.pointers||Te.msPointers)&&!i&&(a=Te.isRtl(e)?1:-1,o.top-=t.pageYOffset+a*document.documentElement.scrollTop,o.left-=t.pageXOffset+a*document.documentElement.scrollLeft),o}function _(e){var t={};return be("string"==typeof e?e.split(" "):e,function(e){t[e]=this}),t}function b(e){return new ve.effects.Element(e)}function k(e,t,n,i){return typeof e===Ie&&(A(t)&&(i=t,t=400,n=!1),A(n)&&(i=n,n=!1),typeof t===He&&(n=t,t=400),e={effects:e,duration:t,reverse:n,complete:i}),_e({effects:{},duration:400,reverse:!1,init:ye,teardown:ye,hide:!1},e,{completeCallback:e.complete,complete:ye})}function w(t,n,i,r,o){for(var a,s=0,l=t.length;s<l;s++)a=e(t[s]),a.queue(function(){q.promise(a,k(n,i,r,o))});return t}function y(e,t,n,i){return t&&(t=t.split(" "),be(t,function(t,n){e.toggleClass(n,i)})),e}function x(e){return(""+e).replace(j,"&amp;").replace($,"&lt;").replace(K,"&gt;").replace(G,"&quot;").replace(Y,"&#39;")}function C(e,t){var i;return 0===t.indexOf("data")&&(t=t.substring(4),t=t.charAt(0).toLowerCase()+t.substring(1)),t=t.replace(re,"-$1"),i=e.getAttribute("data-"+ve.ns+t),null===i?i=n:"null"===i?i=null:"true"===i?i=!0:"false"===i?i=!1:Fe.test(i)?i=parseFloat(i):ne.test(i)&&!ie.test(i)&&(i=Function("return ("+i+")")()),i}function T(t,i){var r,o,a={};for(r in i)o=C(t,r),o!==n&&(te.test(r)&&(o=ve.template(e("#"+o).html())),a[r]=o);return a}function S(t,n){return e.contains(t,n)?-1:1}function D(){var t=e(this);return e.inArray(t.attr("data-"+ve.ns+"role"),["slider","rangeslider"])>-1||t.is(":visible")}function E(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n?e.href||t:t)&&F(e)}function F(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function R(e,t){return new R.fn.init(e,t)}var I,A,M,z,H,N,P,L,B,O,V,W,U,q,j,$,G,Y,K,Q,X,J,Z,ee,te,ne,ie,re,oe,ae,se,le,de,ce,ue,he,fe,pe,me,ge,ve=t.kendo=t.kendo||{cultures:{}},_e=e.extend,be=e.each,ke=e.isArray,we=e.proxy,ye=e.noop,xe=Math,Ce=t.JSON||{},Te={},Se=/%/,De=/\{(\d+)(:[^\}]+)?\}/g,Ee=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,Fe=/^(\+|-?)\d+(\.?)\d*$/,Re="function",Ie="string",Ae="number",Me="object",ze="null",He="boolean",Ne="undefined",Pe={},Le={},Be=[].slice;ve.version="2016.3.1118".replace(/^\s+|\s+$/g,""),i.extend=function(e){var t,n,i=function(){},r=this,o=e&&e.init?e.init:function(){r.apply(this,arguments)};i.prototype=r.prototype,n=o.fn=o.prototype=new i;for(t in e)n[t]=null!=e[t]&&e[t].constructor===Object?_e(!0,{},i.prototype[t],e[t]):e[t];return n.constructor=o,o.extend=r.extend,o},i.prototype._initOptions=function(e){this.options=l({},this.options,e)},A=ve.isFunction=function(e){return"function"==typeof e},M=function(){this._defaultPrevented=!0},z=function(){return this._defaultPrevented===!0},H=i.extend({init:function(){this._events={}},bind:function(e,t,i){var r,o,a,s,l,d=this,c=typeof e===Ie?[e]:e,u=typeof t===Re;if(t===n){for(r in e)d.bind(r,e[r]);return d}for(r=0,o=c.length;r<o;r++)e=c[r],s=u?t:t[e],s&&(i&&(a=s,s=function(){d.unbind(e,s),a.apply(d,arguments)},s.original=a),l=d._events[e]=d._events[e]||[],l.push(s));return d},one:function(e,t){return this.bind(e,t,!0)},first:function(e,t){var n,i,r,o,a=this,s=typeof e===Ie?[e]:e,l=typeof t===Re;for(n=0,i=s.length;n<i;n++)e=s[n],r=l?t:t[e],r&&(o=a._events[e]=a._events[e]||[],o.unshift(r));return a},trigger:function(e,t){var n,i,r=this,o=r._events[e];if(o){for(t=t||{},t.sender=r,t._defaultPrevented=!1,t.preventDefault=M,t.isDefaultPrevented=z,o=o.slice(),n=0,i=o.length;n<i;n++)o[n].call(r,t);return t._defaultPrevented===!0}return!1},unbind:function(e,t){var i,r=this,o=r._events[e];if(e===n)r._events={};else if(o)if(t)for(i=o.length-1;i>=0;i--)o[i]!==t&&o[i].original!==t||o.splice(i,1);else r._events[e]=[];return r}}),N=/^\w+/,P=/\$\{([^}]*)\}/g,L=/\\\}/g,B=/__CURLY__/g,O=/\\#/g,V=/__SHARP__/g,W=["","0","00","000","0000"],I={paramName:"data",useWithBlock:!0,render:function(e,t){var n,i,r="";for(n=0,i=t.length;n<i;n++)r+=e(t[n]);return r},compile:function(e,t){var n,i,o,a=_e({},this,t),s=a.paramName,l=s.match(N)[0],d=a.useWithBlock,c="var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;";if(A(e))return e;for(c+=d?"with("+s+"){":"",c+="$kendoOutput=",i=e.replace(L,"__CURLY__").replace(P,"#=$kendoHtmlEncode($1)#").replace(B,"}").replace(O,"__SHARP__").split("#"),o=0;o<i.length;o++)c+=r(i[o],o%2===0);c+=d?";}":";",c+="return $kendoOutput;",c=c.replace(V,"#");try{return n=Function(l,c),n._slotCount=Math.floor(i.length/2),n}catch(u){throw Error(ve.format("Invalid template:'{0}' Generated code:'{1}'",e,c))}}},function(){function e(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,function(e){var t=s[e];return typeof t===Ie?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function t(o,a){var s,d,c,u,h,f,p=n,m=a[o];if(m&&typeof m===Me&&typeof m.toJSON===Re&&(m=m.toJSON(o)),typeof r===Re&&(m=r.call(a,o,m)),f=typeof m,f===Ie)return e(m);if(f===Ae)return isFinite(m)?m+"":ze;if(f===He||f===ze)return m+"";if(f===Me){if(!m)return ze;if(n+=i,h=[],"[object Array]"===l.apply(m)){for(u=m.length,s=0;s<u;s++)h[s]=t(s,m)||ze;return c=0===h.length?"[]":n?"[\n"+n+h.join(",\n"+n)+"\n"+p+"]":"["+h.join(",")+"]",n=p,c}if(r&&typeof r===Me)for(u=r.length,s=0;s<u;s++)typeof r[s]===Ie&&(d=r[s],c=t(d,m),c&&h.push(e(d)+(n?": ":":")+c));else for(d in m)Object.hasOwnProperty.call(m,d)&&(c=t(d,m),c&&h.push(e(d)+(n?": ":":")+c));return c=0===h.length?"{}":n?"{\n"+n+h.join(",\n"+n)+"\n"+p+"}":"{"+h.join(",")+"}",n=p,c}}var n,i,r,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l={}.toString;typeof Date.prototype.toJSON!==Re&&(Date.prototype.toJSON=function(){var e=this;return isFinite(e.valueOf())?o(e.getUTCFullYear(),4)+"-"+o(e.getUTCMonth()+1)+"-"+o(e.getUTCDate())+"T"+o(e.getUTCHours())+":"+o(e.getUTCMinutes())+":"+o(e.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}),typeof Ce.stringify!==Re&&(Ce.stringify=function(e,o,a){var s;if(n="",i="",typeof a===Ae)for(s=0;s<a;s+=1)i+=" ";else typeof a===Ie&&(i=a);if(r=o,o&&typeof o!==Re&&(typeof o!==Me||typeof o.length!==Ae))throw Error("JSON.stringify");return t("",{"":e})})}(),function(){function t(e){if(e){if(e.numberFormat)return e;if(typeof e===Ie){var t=ve.cultures;return t[e]||t[e.split("-")[0]]||null}return null}return null}function i(e){return e&&(e=t(e)),e||ve.cultures.current}function r(e,t,r){r=i(r);var a=r.calendars.standard,s=a.days,l=a.months;return t=a.patterns[t]||t,t.replace(c,function(t){var i,r,d;return"d"===t?r=e.getDate():"dd"===t?r=o(e.getDate()):"ddd"===t?r=s.namesAbbr[e.getDay()]:"dddd"===t?r=s.names[e.getDay()]:"M"===t?r=e.getMonth()+1:"MM"===t?r=o(e.getMonth()+1):"MMM"===t?r=l.namesAbbr[e.getMonth()]:"MMMM"===t?r=l.names[e.getMonth()]:"yy"===t?r=o(e.getFullYear()%100):"yyyy"===t?r=o(e.getFullYear(),4):"h"===t?r=e.getHours()%12||12:"hh"===t?r=o(e.getHours()%12||12):"H"===t?r=e.getHours():"HH"===t?r=o(e.getHours()):"m"===t?r=e.getMinutes():"mm"===t?r=o(e.getMinutes()):"s"===t?r=e.getSeconds():"ss"===t?r=o(e.getSeconds()):"f"===t?r=xe.floor(e.getMilliseconds()/100):"ff"===t?(r=e.getMilliseconds(),r>99&&(r=xe.floor(r/10)),r=o(r)):"fff"===t?r=o(e.getMilliseconds(),3):"tt"===t?r=e.getHours()<12?a.AM[0]:a.PM[0]:"zzz"===t?(i=e.getTimezoneOffset(),d=i<0,r=(""+xe.abs(i/60)).split(".")[0],i=xe.abs(i)-60*r,r=(d?"+":"-")+o(r),r+=":"+o(i)):"zz"!==t&&"z"!==t||(r=e.getTimezoneOffset()/60,d=r<0,r=(""+xe.abs(r)).split(".")[0],r=(d?"+":"-")+("zz"===t?o(r):r)),r!==n?r:t.slice(1,t.length-1)})}function a(e,t,r){r=i(r);var o,a,d,c,k,w,y,x,C,T,S,D,E,F,R,I,A,M,z,H,N,P,L,B=r.numberFormat,O=B[m],V=B.decimals,W=B.pattern[0],U=[],q=e<0,j=p,$=p,G=-1;if(e===n)return p;if(!isFinite(e))return e;if(!t)return r.name.length?e.toLocaleString():""+e;if(k=u.exec(t)){if(t=k[1].toLowerCase(),a="c"===t,d="p"===t,(a||d)&&(B=a?B.currency:B.percent,O=B[m],V=B.decimals,o=B.symbol,W=B.pattern[q?0:1]),c=k[2],c&&(V=+c),"e"===t)return c?e.toExponential(V):e.toExponential();if(d&&(e*=100),e=l(e,V),q=e<0,e=e.split(m),w=e[0],y=e[1],q&&(w=w.substring(1)),$=s(w,0,w.length,B),y&&($+=O+y),"n"===t&&!q)return $;for(e=p,T=0,S=W.length;T<S;T++)D=W.charAt(T),e+="n"===D?$:"$"===D||"%"===D?o:D;return e}if(q&&(e=-e),(t.indexOf("'")>-1||t.indexOf('"')>-1||t.indexOf("\\")>-1)&&(t=t.replace(h,function(e){var t=e.charAt(0).replace("\\",""),n=e.slice(1).replace(t,"");return U.push(n),b})),t=t.split(";"),q&&t[1])t=t[1],F=!0;else if(0===e){if(t=t[2]||t[0],t.indexOf(v)==-1&&t.indexOf(_)==-1)return t}else t=t[0];if(H=t.indexOf("%"),N=t.indexOf("$"),d=H!=-1,a=N!=-1,d&&(e*=100),a&&"\\"===t[N-1]&&(t=t.split("\\").join(""),a=!1),(a||d)&&(B=a?B.currency:B.percent,O=B[m],V=B.decimals,o=B.symbol),E=t.indexOf(g)>-1,E&&(t=t.replace(f,p)),R=t.indexOf(m),S=t.length,R!=-1?(y=(""+e).split("e"),y=y[1]?l(e,Math.abs(y[1])):y[0],y=y.split(m)[1]||p,A=t.lastIndexOf(_)-R,I=t.lastIndexOf(v)-R,M=A>-1,z=I>-1,T=y.length,M||z||(t=t.substring(0,R)+t.substring(R+1),S=t.length,R=-1,T=0),M&&A>I?T=A:I>A&&(z&&T>I?T=I:M&&T<A&&(T=A)),T>-1&&(e=l(e,T))):e=l(e),I=t.indexOf(v),P=A=t.indexOf(_),G=I==-1&&A!=-1?A:I!=-1&&A==-1?I:I>A?A:I,I=t.lastIndexOf(v),A=t.lastIndexOf(_),L=I==-1&&A!=-1?A:I!=-1&&A==-1?I:I>A?I:A,G==S&&(L=G),G!=-1){for($=(""+e).split(m),w=$[0],y=$[1]||p,x=w.length,C=y.length,q&&e*-1>=0&&(q=!1),e=t.substring(0,G),q&&!F&&(e+="-"),T=G;T<S;T++){if(D=t.charAt(T),R==-1){if(L-T<x){e+=w;break}}else if(A!=-1&&A<T&&(j=p),R-T<=x&&R-T>-1&&(e+=w,T=R),R===T){e+=(y?O:p)+y,T+=L-R+1;continue}D===_?(e+=D,j=D):D===v&&(e+=j)}if(E&&(e=s(e,G+(q?1:0),Math.max(L,x+G),B)),L>=G&&(e+=t.substring(L+1)),a||d){for($=p,T=0,S=e.length;T<S;T++)D=e.charAt(T),$+="$"===D||"%"===D?o:D;e=$}if(S=U.length)for(T=0;T<S;T++)e=e.replace(b,U[T])}return e}var s,l,d,c=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|ss|s|zzz|zz|z|"[^"]*"|'[^']*'/g,u=/^(n|c|p|e)(\d*)$/i,h=/(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g,f=/\,/g,p="",m=".",g=",",v="#",_="0",b="??",k="en-US",w={}.toString;ve.cultures["en-US"]={name:k,numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{name:"US Dollar",abbr:"USD",pattern:["($n)","$n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"$"}},calendars:{standard:{days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December"],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",F:"dddd, MMMM dd, yyyy h:mm:ss tt",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",m:"MMMM dd",M:"MMMM dd",s:"yyyy'-'MM'-'ddTHH':'mm':'ss",t:"h:mm tt",T:"h:mm:ss tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM, yyyy",Y:"MMMM, yyyy"},"/":"/",":":":",firstDay:0,twoDigitYearMax:2029}}},ve.culture=function(e){var i,r=ve.cultures;return e===n?r.current:(i=t(e)||r[k],i.calendar=i.calendars.standard,r.current=i,n)},ve.findCulture=t,ve.getCulture=i,ve.culture(k),s=function(e,t,i,r){var o,a,s,l,d,c,u=e.indexOf(r[m]),h=r.groupSize.slice(),f=h.shift();if(i=u!==-1?u:i+1,o=e.substring(t,i),a=o.length,a>=f){for(s=a,l=[];s>-1;)if(d=o.substring(s-f,s),d&&l.push(d),s-=f,c=h.shift(),f=c!==n?c:f,0===f){l.push(o.substring(0,s));break}o=l.reverse().join(r[g]),e=e.substring(0,t)+o+e.substring(i)}return e},l=function(e,t){return t=t||0,e=(""+e).split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t))),e=(""+e).split("e"),e=+(e[0]+"e"+(e[1]?+e[1]-t:-t)),e.toFixed(Math.min(t,20))},d=function(e,t,i){if(t){if("[object Date]"===w.call(e))return r(e,t,i);if(typeof e===Ae)return a(e,t,i)}return e!==n?e:""},ve.format=function(e){var t=arguments;return e.replace(De,function(e,n,i){var r=t[parseInt(n,10)+1];return d(r,i?i.substring(1):"")})},ve._extractFormat=function(e){return"{0:"===e.slice(0,3)&&(e=e.slice(3,e.length-1)),e},ve._activeElement=function(){try{return document.activeElement}catch(e){return document.documentElement.activeElement}},ve._round=l,ve._outerWidth=function(t,n){return e(t).outerWidth(n||!1)||0},ve._outerHeight=function(t,n){return e(t).outerHeight(n||!1)||0},ve.toString=d}(),function(){function t(e,t,n){return!(e>=t&&e<=n)}function i(e){return e.charAt(0)}function r(t){return e.map(t,i)}function o(e,t){t||23!==e.getHours()||e.setHours(e.getHours()+2)}function a(e){for(var t=0,n=e.length,i=[];t<n;t++)i[t]=(e[t]+"").toLowerCase();return i}function s(e){var t,n={};for(t in e)n[t]=a(e[t]);return n}function l(e,i,a){if(!e)return null;var l,d,c,u,h,m,g,v,_,k,w,y,x,C=function(e){for(var t=0;i[N]===e;)t++,N++;return t>0&&(N-=1),t},T=function(t){var n=b[t]||RegExp("^\\d{1,"+t+"}"),i=e.substr(P,t).match(n);return i?(i=i[0],P+=i.length,parseInt(i,10)):null},S=function(t,n){for(var i,r,o,a=0,s=t.length,l=0,d=0;a<s;a++)i=t[a],r=i.length,o=e.substr(P,r),n&&(o=o.toLowerCase()),o==i&&r>l&&(l=r,d=a);return l?(P+=l,d+1):null},D=function(){var t=!1;return e.charAt(P)===i[N]&&(P++,t=!0),t},E=a.calendars.standard,F=null,R=null,I=null,A=null,M=null,z=null,H=null,N=0,P=0,L=!1,B=new Date,O=E.twoDigitYearMax||2029,V=B.getFullYear();for(i||(i="d"),u=E.patterns[i],u&&(i=u),i=i.split(""),c=i.length;N<c;N++)if(l=i[N],L)"'"===l?L=!1:D();else if("d"===l){if(d=C("d"),E._lowerDays||(E._lowerDays=s(E.days)),null!==I&&d>2)continue;if(I=d<3?T(2):S(E._lowerDays[3==d?"namesAbbr":"names"],!0),null===I||t(I,1,31))return null}else if("M"===l){if(d=C("M"),E._lowerMonths||(E._lowerMonths=s(E.months)),R=d<3?T(2):S(E._lowerMonths[3==d?"namesAbbr":"names"],!0),null===R||t(R,1,12))return null;R-=1}else if("y"===l){if(d=C("y"),F=T(d),null===F)return null;2==d&&("string"==typeof O&&(O=V+parseInt(O,10)),F=V-V%100+F,F>O&&(F-=100))}else if("h"===l){if(C("h"),A=T(2),12==A&&(A=0),null===A||t(A,0,11))return null}else if("H"===l){if(C("H"),A=T(2),null===A||t(A,0,23))return null}else if("m"===l){if(C("m"),M=T(2),null===M||t(M,0,59))return null}else if("s"===l){if(C("s"),z=T(2),null===z||t(z,0,59))return null}else if("f"===l){if(d=C("f"),x=e.substr(P,d).match(b[3]),H=T(d),null!==H&&(H=parseFloat("0."+x[0],10),H=ve._round(H,3),H*=1e3),null===H||t(H,0,999))return null}else if("t"===l){if(d=C("t"),v=E.AM,_=E.PM,1===d&&(v=r(v),_=r(_)),h=S(_),!h&&!S(v))return null}else if("z"===l){if(m=!0,d=C("z"),"Z"===e.substr(P,1)){D();continue}if(g=e.substr(P,6).match(d>2?p:f),!g)return null;if(g=g[0].split(":"),k=g[0],w=g[1],!w&&k.length>3&&(P=k.length-2,w=k.substring(P),k=k.substring(0,P)),k=parseInt(k,10),t(k,-12,13))return null;if(d>2&&(w=parseInt(w,10),isNaN(w)||t(w,0,59)))return null}else if("'"===l)L=!0,D();else if(!D())return null;return y=null!==A||null!==M||z||null,null===F&&null===R&&null===I&&y?(F=V,R=B.getMonth(),I=B.getDate()):(null===F&&(F=V),null===I&&(I=1)),h&&A<12&&(A+=12),m?(k&&(A+=-k),w&&(M+=-w),e=new Date(Date.UTC(F,R,I,A,M,z,H))):(e=new Date(F,R,I,A,M,z,H),o(e,A)),F<100&&e.setFullYear(F),e.getDate()!==I&&m===n?null:e}function d(e){var t="-"===e.substr(0,1)?-1:1;return e=e.substring(1),e=60*parseInt(e.substr(0,2),10)+parseInt(e.substring(2),10),t*e}function c(e){var t,n,i,r=xe.max(v.length,_.length),o=e.calendar.patterns,a=[];for(i=0;i<r;i++){for(t=v[i],n=0;n<t.length;n++)a.push(o[t[n]]);a=a.concat(_[i])}return a}var u=/\u00A0/g,h=/[eE][\-+]?[0-9]+/,f=/[+|\-]\d{1,2}/,p=/[+|\-]\d{1,2}:?\d{2}/,m=/^\/Date\((.*?)\)\/$/,g=/[+-]\d*/,v=[[],["G","g","F"],["D","d","y","m","T","t"]],_=[["yyyy-MM-ddTHH:mm:ss.fffffffzzz","yyyy-MM-ddTHH:mm:ss.fffffff","yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:ss.fff","ddd MMM dd yyyy HH:mm:ss","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mmzzz","yyyy-MM-ddTHH:mmzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss"],["yyyy-MM-ddTHH:mm","yyyy-MM-dd HH:mm","yyyy/MM/dd HH:mm"],["yyyy/MM/dd","yyyy-MM-dd","HH:mm:ss","HH:mm"]],b={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/},k={}.toString;ve.parseDate=function(e,t,n){var i,r,o,a;if("[object Date]"===k.call(e))return e;if(i=0,r=null,e&&0===e.indexOf("/D")&&(r=m.exec(e)))return r=r[1],a=g.exec(r.substring(1)),r=new Date(parseInt(r,10)),a&&(a=d(a[0]),r=ve.timezone.apply(r,0),r=ve.timezone.convert(r,0,-1*a)),r;for(n=ve.getCulture(n),t||(t=c(n)),t=ke(t)?t:[t],o=t.length;i<o;i++)if(r=l(e,t[i],n))return r;return r},ve.parseInt=function(e,t){var n=ve.parseFloat(e,t);return n&&(n=0|n),n},ve.parseFloat=function(e,t,n){if(!e&&0!==e)return null;if(typeof e===Ae)return e;e=""+e,t=ve.getCulture(t);var i,r,o=t.numberFormat,a=o.percent,s=o.currency,l=s.symbol,d=a.symbol,c=e.indexOf("-");return h.test(e)?(e=parseFloat(e.replace(o["."],".")),isNaN(e)&&(e=null),e):c>0?null:(c=c>-1,e.indexOf(l)>-1||n&&n.toLowerCase().indexOf("c")>-1?(o=s,i=o.pattern[0].replace("$",l).split("n"),e.indexOf(i[0])>-1&&e.indexOf(i[1])>-1&&(e=e.replace(i[0],"").replace(i[1],""),c=!0)):e.indexOf(d)>-1&&(r=!0,o=a,l=d),e=e.replace("-","").replace(l,"").replace(u," ").split(o[","].replace(u," ")).join("").replace(o["."],"."),e=parseFloat(e),isNaN(e)?e=null:c&&(e*=-1),e&&r&&(e/=100),e)}}(),function(){var i,r,o,a,s,l,d;Te._scrollbar=n,Te.scrollbar=function(e){if(isNaN(Te._scrollbar)||e){var t,n=document.createElement("div");return n.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",n.innerHTML="&nbsp;",document.body.appendChild(n),Te._scrollbar=t=n.offsetWidth-n.scrollWidth,document.body.removeChild(n),t}return Te._scrollbar},Te.isRtl=function(t){return e(t).closest(".k-rtl").length>0},i=document.createElement("table");try{i.innerHTML="<tr><td></td></tr>",Te.tbodyInnerHtml=!0}catch(u){Te.tbodyInnerHtml=!1}Te.touch="ontouchstart"in t,Te.msPointers=t.MSPointerEvent,Te.pointers=t.PointerEvent,r=Te.transitions=!1,o=Te.transforms=!1,a="HTMLElement"in t?HTMLElement.prototype:[],Te.hasHW3D="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix||"MozPerspective"in document.documentElement.style||"msPerspective"in document.documentElement.style,be(["Moz","webkit","O","ms"],function(){var e,t=""+this,n=typeof i.style[t+"Transition"]===Ie;if(n||typeof i.style[t+"Transform"]===Ie)return e=t.toLowerCase(),o={css:"ms"!=e?"-"+e+"-":"",prefix:t,event:"o"===e||"webkit"===e?e:""},n&&(r=o,r.event=r.event?r.event+"TransitionEnd":"transitionend"),!1}),i=null,Te.transforms=o,Te.transitions=r,Te.devicePixelRatio=t.devicePixelRatio===n?1:t.devicePixelRatio;try{Te.screenWidth=t.outerWidth||t.screen?t.screen.availWidth:t.innerWidth,Te.screenHeight=t.outerHeight||t.screen?t.screen.availHeight:t.innerHeight}catch(u){Te.screenWidth=t.screen.availWidth,Te.screenHeight=t.screen.availHeight}Te.detectOS=function(e){var n,i,r=!1,o=[],a=!/mobile safari/i.test(e),s={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.(\d+(\.\d+)?)/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},l={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},d={tablet:/playbook|ipad|fire/i},u={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i};for(i in s)if(s.hasOwnProperty(i)&&(o=e.match(s[i]))){if("windows"==i&&"plugins"in navigator)return!1;r={},r.device=i,r.tablet=c(i,d,!1),r.browser=c(e,u,"default"),r.name=c(i,l),r[r.name]=!0,r.majorVersion=o[2],r.minorVersion=o[3].replace("_","."),n=r.minorVersion.replace(".","").substr(0,2),r.flatVersion=r.majorVersion+n+Array(3-(n.length<3?n.length:2)).join("0"),r.cordova=typeof t.PhoneGap!==Ne||typeof t.cordova!==Ne,r.appMode=t.navigator.standalone||/file|local|wmapp/.test(t.location.protocol)||r.cordova,r.android&&(Te.devicePixelRatio<1.5&&r.flatVersion<400||a)&&(Te.screenWidth>800||Te.screenHeight>800)&&(r.tablet=i);break}return r},s=Te.mobileOS=Te.detectOS(navigator.userAgent),Te.wpDevicePixelRatio=s.wp?screen.width/320:0,Te.kineticScrollNeeded=s&&(Te.touch||Te.msPointers||Te.pointers),Te.hasNativeScrolling=!1,(s.ios||s.android&&s.majorVersion>2||s.wp)&&(Te.hasNativeScrolling=s),Te.delayedClick=function(){if(Te.touch){if(s.ios)return!0;if(s.android)return!Te.browser.chrome||!(Te.browser.version<32)&&!(e("meta[name=viewport]").attr("content")||"").match(/user-scalable=no/i)}return!1},Te.mouseAndTouchPresent=Te.touch&&!(Te.mobileOS.ios||Te.mobileOS.android),Te.detectBrowser=function(e){var t,n=!1,i=[],r={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(t in r)if(r.hasOwnProperty(t)&&(i=e.match(r[t]))){n={},n[t]=!0,n[i[1].toLowerCase().split(" ")[0].split("/")[0]]=!0,n.version=parseInt(document.documentMode||i[2],10);break}return n},Te.browser=Te.detectBrowser(navigator.userAgent),Te.detectClipboardAccess=function(){var e={copy:!!document.queryCommandSupported&&document.queryCommandSupported("copy"),cut:!!document.queryCommandSupported&&document.queryCommandSupported("cut"),paste:!!document.queryCommandSupported&&document.queryCommandSupported("paste")};return Te.browser.chrome&&(e.paste=!1,Te.browser.version>=43&&(e.copy=!0,e.cut=!0)),e},Te.clipboard=Te.detectClipboardAccess(),Te.zoomLevel=function(){var e,n,i;try{return e=Te.browser,n=0,i=document.documentElement,e.msie&&11==e.version&&i.scrollHeight>i.clientHeight&&!Te.touch&&(n=Te.scrollbar()),Te.touch?i.clientWidth/t.innerWidth:e.msie&&e.version>=10?((top||t).document.documentElement.offsetWidth+n)/(top||t).innerWidth:1}catch(r){return 1}},Te.cssBorderSpacing=n!==document.documentElement.style.borderSpacing&&!(Te.browser.msie&&Te.browser.version<8),function(t){var n="",i=e(document.documentElement),r=parseInt(t.version,10);t.msie?n="ie":t.mozilla?n="ff":t.safari?n="safari":t.webkit?n="webkit":t.opera?n="opera":t.edge&&(n="edge"),n&&(n="k-"+n+" k-"+n+r),Te.mobileOS&&(n+=" k-mobile"),i.addClass(n)}(Te.browser),Te.eventCapture=document.documentElement.addEventListener,l=document.createElement("input"),Te.placeholder="placeholder"in l,Te.propertyChangeEvent="onpropertychange"in l,Te.input=function(){for(var e,t=["number","date","time","month","week","datetime","datetime-local"],n=t.length,i="test",r={},o=0;o<n;o++)e=t[o],l.setAttribute("type",e),l.value=i,r[e.replace("-","")]="text"!==l.type&&l.value!==i;return r}(),l.style.cssText="float:left;",Te.cssFloat=!!l.style.cssFloat,l=null,Te.stableSort=function(){var e,t=513,n=[{index:0,field:"b"}];for(e=1;e<t;e++)n.push({index:e,field:"a"});return n.sort(function(e,t){return e.field>t.field?1:e.field<t.field?-1:0}),1===n[0].index}(),Te.matchesSelector=a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.matchesSelector||a.matches||function(t){for(var n=document.querySelectorAll?(this.parentNode||document).querySelectorAll(t)||[]:e(t),i=n.length;i--;)if(n[i]==this)return!0;return!1},Te.pushState=t.history&&t.history.pushState,d=document.documentMode,Te.hashChange="onhashchange"in t&&!(Te.browser.msie&&(!d||d<=8)),Te.customElements="registerElement"in t.document}(),U={left:{reverse:"right"},right:{reverse:"left"},down:{reverse:"up"},up:{reverse:"down"},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out"},out:{reverse:"in"}},q={},e.extend(q,{enabled:!0,Element:function(t){this.element=e(t)},promise:function(e,t){e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.hide&&e.data("olddisplay",e.css("display")).hide(),t.init&&t.init(),t.completeCallback&&t.completeCallback(e),e.dequeue()},disable:function(){this.enabled=!1,this.promise=this.promiseShim},enable:function(){this.enabled=!0,this.promise=this.animatedPromise}}),q.promiseShim=q.promise,"kendoAnimate"in e.fn||_e(e.fn,{kendoStop:function(e,t){return this.stop(e,t)},kendoAnimate:function(e,t,n,i){return w(this,e,t,n,i)},kendoAddClass:function(e,t){return ve.toggleClass(this,e,t,!0)},kendoRemoveClass:function(e,t){return ve.toggleClass(this,e,t,!1)},kendoToggleClass:function(e,t,n){return ve.toggleClass(this,e,t,n)}}),j=/&/g,$=/</g,G=/"/g,Y=/'/g,K=/>/g,Q=function(e){return e.target},Te.touch&&(Q=function(e){var t="originalEvent"in e?e.originalEvent.changedTouches:"changedTouches"in e?e.changedTouches:null;return t?document.elementFromPoint(t[0].clientX,t[0].clientY):e.target},be(["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"],function(t,n){e.fn[n]=function(e){return this.bind(n,e)}})),Te.touch?Te.mobileOS?(Te.mousedown="touchstart",Te.mouseup="touchend",Te.mousemove="touchmove",Te.mousecancel="touchcancel",Te.click="touchend",Te.resize="orientationchange"):(Te.mousedown="mousedown touchstart",Te.mouseup="mouseup touchend",Te.mousemove="mousemove touchmove",Te.mousecancel="mouseleave touchcancel",Te.click="click",Te.resize="resize"):Te.pointers?(Te.mousemove="pointermove",Te.mousedown="pointerdown",Te.mouseup="pointerup",Te.mousecancel="pointercancel",Te.click="pointerup",Te.resize="orientationchange resize"):Te.msPointers?(Te.mousemove="MSPointerMove",Te.mousedown="MSPointerDown",Te.mouseup="MSPointerUp",Te.mousecancel="MSPointerCancel",Te.click="MSPointerUp",Te.resize="orientationchange resize"):(Te.mousemove="mousemove",Te.mousedown="mousedown",Te.mouseup="mouseup",Te.mousecancel="mouseleave",Te.click="click",Te.resize="resize"),X=function(e,t){var n,i,r,o,a=t||"d",s=1;for(i=0,r=e.length;i<r;i++)o=e[i],""!==o&&(n=o.indexOf("["),0!==n&&(n==-1?o="."+o:(s++,o="."+o.substring(0,n)+" || {})"+o.substring(n))),s++,a+=o+(i<r-1?" || {})":")"));return Array(s).join("(")+a},J=/^([a-z]+:)?\/\//i,_e(ve,{widgets:[],_widgetRegisteredCallbacks:[],ui:ve.ui||{},fx:ve.fx||b,effects:ve.effects||q,mobile:ve.mobile||{},data:ve.data||{},dataviz:ve.dataviz||{},drawing:ve.drawing||{},spreadsheet:{messages:{}},keys:{INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110},support:ve.support||Te,animate:ve.animate||w,ns:"",attr:function(e){return"data-"+ve.ns+e},getShadows:a,wrap:s,deepExtend:l,getComputedStyles:f,webComponents:ve.webComponents||[],isScrollable:p,scrollLeft:m,size:g,toCamelCase:h,toHyphens:u,getOffset:ve.getOffset||v,parseEffects:ve.parseEffects||_,toggleClass:ve.toggleClass||y,directions:ve.directions||U,Observable:H,Class:i,Template:I,template:we(I.compile,I),render:we(I.render,I),stringify:we(Ce.stringify,Ce),eventTarget:Q,htmlEncode:x,isLocalUrl:function(e){return e&&!J.test(e)},expr:function(e,t,n){return e=e||"",typeof t==Ie&&(n=t,t=!1),n=n||"d",e&&"["!==e.charAt(0)&&(e="."+e),t?(e=e.replace(/"([^.]*)\.([^"]*)"/g,'"$1_$DOT$_$2"'),e=e.replace(/'([^.]*)\.([^']*)'/g,"'$1_$DOT$_$2'"),e=X(e.split("."),n),e=e.replace(/_\$DOT\$_/g,".")):e=n+e,e},getter:function(e,t){var n=e+t;return Pe[n]=Pe[n]||Function("d","return "+ve.expr(e,t))},setter:function(e){return Le[e]=Le[e]||Function("d,value",ve.expr(e)+"=value")},accessor:function(e){return{get:ve.getter(e),set:ve.setter(e)}},guid:function(){var e,t,n="";for(e=0;e<32;e++)t=16*xe.random()|0,8!=e&&12!=e&&16!=e&&20!=e||(n+="-"),n+=(12==e?4:16==e?3&t|8:t).toString(16);return n},roleSelector:function(e){return e.replace(/(\S+)/g,"["+ve.attr("role")+"=$1],").slice(0,-1)},directiveSelector:function(e){var t,n=e.split(" ");if(n)for(t=0;t<n.length;t++)"view"!=n[t]&&(n[t]=n[t].replace(/(\w*)(view|bar|strip|over)$/,"$1-$2"));return n.join(" ").replace(/(\S+)/g,"kendo-mobile-$1,").slice(0,-1)},triggeredByInput:function(e){return/^(label|input|textarea|select)$/i.test(e.target.tagName)},onWidgetRegistered:function(e){for(var t=0,n=ve.widgets.length;t<n;t++)e(ve.widgets[t]);ve._widgetRegisteredCallbacks.push(e)},logToConsole:function(e,i){var r=t.console;!ve.suppressLog&&n!==r&&r.log&&r[i||"log"](e)}}),Z=H.extend({init:function(e,t){var n,i=this;i.element=ve.jQuery(e).handler(i),i.angular("init",t),H.fn.init.call(i),n=t?t.dataSource:null,n&&(t=_e({},t,{dataSource:{}})),t=i.options=_e(!0,{},i.options,t),n&&(t.dataSource=n),
i.element.attr(ve.attr("role"))||i.element.attr(ve.attr("role"),(t.name||"").toLowerCase()),i.element.data("kendo"+t.prefix+t.name,i),i.bind(i.events,t)},events:[],options:{prefix:""},_hasBindingTarget:function(){return!!this.element[0].kendoBindingTarget},_tabindex:function(e){e=e||this.wrapper;var t=this.element,n="tabindex",i=e.attr(n)||t.attr(n);t.removeAttr(n),e.attr(n,isNaN(i)?0:i)},setOptions:function(t){this._setEvents(t),e.extend(this.options,t)},_setEvents:function(e){for(var t,n=this,i=0,r=n.events.length;i<r;i++)t=n.events[i],n.options[t]&&e[t]&&n.unbind(t,n.options[t]);n.bind(n.events,e)},resize:function(e){var t=this.getSize(),n=this._size;(e||(t.width>0||t.height>0)&&(!n||t.width!==n.width||t.height!==n.height))&&(this._size=t,this._resize(t,e),this.trigger("resize",t))},getSize:function(){return ve.dimensions(this.element)},size:function(e){return e?(this.setSize(e),n):this.getSize()},setSize:e.noop,_resize:e.noop,destroy:function(){var e=this;e.element.removeData("kendo"+e.options.prefix+e.options.name),e.element.removeData("handler"),e.unbind()},_destroy:function(){this.destroy()},angular:function(){},_muteAngularRebind:function(e){this._muteRebind=!0,e.call(this),this._muteRebind=!1}}),ee=Z.extend({dataItems:function(){return this.dataSource.flatView()},_angularItems:function(t){var n=this;n.angular(t,function(){return{elements:n.items(),data:e.map(n.dataItems(),function(e){return{dataItem:e}})}})}}),ve.dimensions=function(e,t){var n=e[0];return t&&e.css(t),{width:n.offsetWidth,height:n.offsetHeight}},ve.notify=ye,te=/template$/i,ne=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,ie=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,re=/([A-Z])/g,ve.initWidget=function(i,r,o){var a,s,l,d,c,u,h,f,p,m,g,v,_;if(o?o.roles&&(o=o.roles):o=ve.ui.roles,i=i.nodeType?i:i[0],u=i.getAttribute("data-"+ve.ns+"role")){p=u.indexOf(".")===-1,l=p?o[u]:ve.getter(u)(t),g=e(i).data(),v=l?"kendo"+l.fn.options.prefix+l.fn.options.name:"",m=p?RegExp("^kendo.*"+u+"$","i"):RegExp("^"+v+"$","i");for(_ in g)if(_.match(m)){if(_!==v)return g[_];a=g[_]}if(l){for(f=C(i,"dataSource"),r=e.extend({},T(i,l.fn.options),r),f&&(r.dataSource=typeof f===Ie?ve.getter(f)(t):f),d=0,c=l.fn.events.length;d<c;d++)s=l.fn.events[d],h=C(i,s),h!==n&&(r[s]=ve.getter(h)(t));return a?e.isEmptyObject(r)||a.setOptions(r):a=new l(i,r),a}}},ve.rolesFromNamespaces=function(e){var t,n,i=[];for(e[0]||(e=[ve.ui,ve.dataviz.ui]),t=0,n=e.length;t<n;t++)i[t]=e[t].roles;return _e.apply(null,[{}].concat(i.reverse()))},ve.init=function(t){var n=ve.rolesFromNamespaces(Be.call(arguments,1));e(t).find("[data-"+ve.ns+"role]").addBack().each(function(){ve.initWidget(this,{},n)})},ve.destroy=function(t){e(t).find("[data-"+ve.ns+"role]").addBack().each(function(){var t,n=e(this).data();for(t in n)0===t.indexOf("kendo")&&typeof n[t].destroy===Re&&n[t].destroy()})},ve.resize=function(t,n){var i,r=e(t).find("[data-"+ve.ns+"role]").addBack().filter(D);r.length&&(i=e.makeArray(r),i.sort(S),e.each(i,function(){var t=ve.widgetInstance(e(this));t&&t.resize(n)}))},ve.parseOptions=T,_e(ve.ui,{Widget:Z,DataBoundWidget:ee,roles:{},progress:function(t,n){var i,r,o,a,s=t.find(".k-loading-mask"),l=ve.support,d=l.browser;n?s.length||(i=l.isRtl(t),r=i?"right":"left",a=t.scrollLeft(),o=d.webkit&&i?t[0].scrollWidth-t.width()-2*a:0,s=e("<div class='k-loading-mask'><span class='k-loading-text'>"+ve.ui.progress.messages.loading+"</span><div class='k-loading-image'/><div class='k-loading-color'/></div>").width("100%").height("100%").css("top",t.scrollTop()).css(r,Math.abs(a)+o).prependTo(t)):s&&s.remove()},plugin:function(t,i,r){var o,a,s,l,d=t.fn.options.name;for(i=i||ve.ui,r=r||"",i[d]=t,i.roles[d.toLowerCase()]=t,o="getKendo"+r+d,d="kendo"+r+d,a={name:d,widget:t,prefix:r||""},ve.widgets.push(a),s=0,l=ve._widgetRegisteredCallbacks.length;s<l;s++)ve._widgetRegisteredCallbacks[s](a);e.fn[d]=function(i){var r,o=this;return typeof i===Ie?(r=Be.call(arguments,1),this.each(function(){var t,a,s=e.data(this,d);if(!s)throw Error(ve.format("Cannot call method '{0}' of {1} before it is initialized",i,d));if(t=s[i],typeof t!==Re)throw Error(ve.format("Cannot find method '{0}' of {1}",i,d));if(a=t.apply(s,r),a!==n)return o=a,!1})):this.each(function(){return new t(this,i)}),o},e.fn[d].widget=t,e.fn[o]=function(){return this.data(d)}}}),ve.ui.progress.messages={loading:"Loading..."},oe={bind:function(){return this},nullObject:!0,options:{}},ae=Z.extend({init:function(e,t){Z.fn.init.call(this,e,t),this.element.autoApplyNS(),this.wrapper=this.element,this.element.addClass("km-widget")},destroy:function(){Z.fn.destroy.call(this),this.element.kendoDestroy()},options:{prefix:"Mobile"},events:[],view:function(){var e=this.element.closest(ve.roleSelector("view splitview modalview drawer"));return ve.widgetInstance(e,ve.mobile.ui)||oe},viewHasNativeScrolling:function(){var e=this.view();return e&&e.options.useNativeScrolling},container:function(){var e=this.element.closest(ve.roleSelector("view layout modalview drawer splitview"));return ve.widgetInstance(e.eq(0),ve.mobile.ui)||oe}}),_e(ve.mobile,{init:function(e){ve.init(e,ve.mobile.ui,ve.ui,ve.dataviz.ui)},appLevelNativeScrolling:function(){return ve.mobile.application&&ve.mobile.application.options&&ve.mobile.application.options.useNativeScrolling},roles:{},ui:{Widget:ae,DataBoundWidget:ee.extend(ae.prototype),roles:{},plugin:function(e){ve.ui.plugin(e,ve.mobile.ui,"Mobile")}}}),l(ve.dataviz,{init:function(e){ve.init(e,ve.dataviz.ui)},ui:{roles:{},themes:{},views:[],plugin:function(e){ve.ui.plugin(e,ve.dataviz.ui)}},roles:{}}),ve.touchScroller=function(t,n){return n||(n={}),n.useNative=!0,e(t).map(function(t,i){return i=e(i),!(!Te.kineticScrollNeeded||!ve.mobile.ui.Scroller||i.data("kendoMobileScroller"))&&(i.kendoMobileScroller(n),i.data("kendoMobileScroller"))})[0]},ve.preventDefault=function(e){e.preventDefault()},ve.widgetInstance=function(e,n){var i,r,o,a,s=e.data(ve.ns+"role"),l=[];if(s){if("content"===s&&(s="scroller"),n)if(n[0])for(i=0,r=n.length;i<r;i++)l.push(n[i].roles[s]);else l.push(n.roles[s]);else l=[ve.ui.roles[s],ve.dataviz.ui.roles[s],ve.mobile.ui.roles[s]];for(s.indexOf(".")>=0&&(l=[ve.getter(s)(t)]),i=0,r=l.length;i<r;i++)if(o=l[i],o&&(a=e.data("kendo"+o.fn.options.prefix+o.fn.options.name)))return a}},ve.onResize=function(n){var i=n;return Te.mobileOS.android&&(i=function(){setTimeout(n,600)}),e(t).on(Te.resize,i),i},ve.unbindResize=function(n){e(t).off(Te.resize,n)},ve.attrValue=function(e,t){return e.data(ve.ns+t)},ve.days={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},e.extend(e.expr[":"],{kendoFocusable:function(t){var n=e.attr(t,"tabindex");return E(t,!isNaN(n)&&n>-1)}}),se=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"],le="label, input, [data-rel=external]",de={setupMouseMute:function(){var t,n=0,i=se.length,r=document.documentElement;if(!de.mouseTrap&&Te.eventCapture)for(de.mouseTrap=!0,de.bustClick=!1,de.captureMouse=!1,t=function(t){de.captureMouse&&("click"===t.type?de.bustClick&&!e(t.target).is(le)&&(t.preventDefault(),t.stopPropagation()):t.stopPropagation())};n<i;n++)r.addEventListener(se[n],t,!0)},muteMouse:function(e){de.captureMouse=!0,e.data.bustClick&&(de.bustClick=!0),clearTimeout(de.mouseTrapTimeoutID)},unMuteMouse:function(){clearTimeout(de.mouseTrapTimeoutID),de.mouseTrapTimeoutID=setTimeout(function(){de.captureMouse=!1,de.bustClick=!1},400)}},ce={down:"touchstart mousedown",move:"mousemove touchmove",up:"mouseup touchend touchcancel",cancel:"mouseleave touchcancel"},Te.touch&&(Te.mobileOS.ios||Te.mobileOS.android)?ce={down:"touchstart",move:"touchmove",up:"touchend touchcancel",cancel:"touchcancel"}:Te.pointers?ce={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"}:Te.msPointers&&(ce={down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp",cancel:"MSPointerCancel MSPointerLeave"}),!Te.msPointers||"onmspointerenter"in t||e.each({MSPointerEnter:"MSPointerOver",MSPointerLeave:"MSPointerOut"},function(t,n){e.event.special[t]={delegateType:n,bindType:n,handle:function(t){var i,r=this,o=t.relatedTarget,a=t.handleObj;return o&&(o===r||e.contains(r,o))||(t.type=a.origType,i=a.handler.apply(this,arguments),t.type=n),i}}}),ue=function(e){return ce[e]||e},he=/([^ ]+)/g,ve.applyEventMap=function(e,t){return e=e.replace(he,ue),t&&(e=e.replace(he,"$1."+t)),e},fe=e.fn.on,_e(!0,R,e),R.fn=R.prototype=new e,R.fn.constructor=R,R.fn.init=function(t,n){return n&&n instanceof e&&!(n instanceof R)&&(n=R(n)),e.fn.init.call(this,t,n,pe)},R.fn.init.prototype=R.fn,pe=R(document),_e(R.fn,{handler:function(e){return this.data("handler",e),this},autoApplyNS:function(e){return this.data("kendoNS",e||ve.guid()),this},on:function(){var e,t,n,i,r,o,a=this,s=a.data("kendoNS");return 1===arguments.length?fe.call(a,arguments[0]):(e=a,t=Be.call(arguments),typeof t[t.length-1]===Ne&&t.pop(),n=t[t.length-1],i=ve.applyEventMap(t[0],s),Te.mouseAndTouchPresent&&i.search(/mouse|click/)>-1&&this[0]!==document.documentElement&&(de.setupMouseMute(),r=2===t.length?null:t[1],o=i.indexOf("click")>-1&&i.indexOf("touchend")>-1,fe.call(this,{touchstart:de.muteMouse,touchend:de.unMuteMouse},r,{bustClick:o})),typeof n===Ie&&(e=a.data("handler"),n=e[n],t[t.length-1]=function(t){n.call(e,t)}),t[0]=i,fe.apply(a,t),a)},kendoDestroy:function(e){return e=e||this.data("kendoNS"),e&&this.off("."+e),this}}),ve.jQuery=R,ve.eventMap=ce,ve.timezone=function(){function e(e,t){var n,i,r,o=t[3],a=t[4],s=t[5],l=t[8];return l||(t[8]=l={}),l[e]?l[e]:(isNaN(a)?0===a.indexOf("last")?(n=new Date(Date.UTC(e,c[o]+1,1,s[0]-24,s[1],s[2],0)),i=u[a.substr(4,3)],r=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+i-r-(i>r?7:0))):a.indexOf(">=")>=0&&(n=new Date(Date.UTC(e,c[o],a.substr(5),s[0],s[1],s[2],0)),i=u[a.substr(0,3)],r=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+i-r+(i<r?7:0))):n=new Date(Date.UTC(e,c[o],a,s[0],s[1],s[2],0)),l[e]=n)}function t(t,n,i){var r,o,a,s;return(n=n[i])?(a=new Date(t).getUTCFullYear(),n=jQuery.grep(n,function(e){var t=e[0],n=e[1];return t<=a&&(n>=a||t==a&&"only"==n||"max"==n)}),n.push(t),n.sort(function(t,n){return"number"!=typeof t&&(t=+e(a,t)),"number"!=typeof n&&(n=+e(a,n)),t-n}),s=n[jQuery.inArray(t,n)-1]||n[n.length-1],isNaN(s)?s:null):(r=i.split(":"),o=0,r.length>1&&(o=60*r[0]+ +r[1]),[-1e6,"max","-","Jan",1,[0,0,0],o,"-"])}function n(e,t,n){var i,r,o,a=t[n];if("string"==typeof a&&(a=t[a]),!a)throw Error('Timezone "'+n+'" is either incorrect, or kendo.timezones.min.js is not included.');for(i=a.length-1;i>=0&&(r=a[i][3],!(r&&e>r));i--);if(o=a[i+1],!o)throw Error('Timezone "'+n+'" not found on '+e+".");return o}function i(e,i,r,o){typeof e!=Ae&&(e=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));var a=n(e,i,o);return{zone:a,rule:t(e,r,a[1])}}function r(e,t){var n,r,o;return"Etc/UTC"==t||"Etc/GMT"==t?0:(n=i(e,this.zones,this.rules,t),r=n.zone,o=n.rule,ve.parseFloat(o?r[0]-o[6]:r[0]))}function o(e,t){var n=i(e,this.zones,this.rules,t),r=n.zone,o=n.rule,a=r[2];return a.indexOf("/")>=0?a.split("/")[o&&+o[6]?1:0]:a.indexOf("%s")>=0?a.replace("%s",o&&"-"!=o[7]?o[7]:""):a}function a(e,t,n){var i,r;return typeof t==Ie&&(t=this.offset(e,t)),typeof n==Ie&&(n=this.offset(e,n)),i=e.getTimezoneOffset(),e=new Date(e.getTime()+6e4*(t-n)),r=e.getTimezoneOffset(),new Date(e.getTime()+6e4*(r-i))}function s(e,t){return this.convert(e,e.getTimezoneOffset(),t)}function l(e,t){return this.convert(e,t,e.getTimezoneOffset())}function d(e){return this.apply(new Date(e),"Etc/UTC")}var c={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},u={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};return{zones:{},rules:{},offset:r,convert:a,apply:s,remove:l,abbr:o,toLocalDate:d}}(),ve.date=function(){function e(e,t){return 0===t&&23===e.getHours()&&(e.setHours(e.getHours()+2),!0)}function t(t,n,i){var r=t.getHours();i=i||1,n=(n-t.getDay()+7*i)%7,t.setDate(t.getDate()+n),e(t,r)}function n(e,n,i){return e=new Date(e),t(e,n,i),e}function i(e){return new Date(e.getFullYear(),e.getMonth(),1)}function r(e){var t=new Date(e.getFullYear(),e.getMonth()+1,0),n=i(e),r=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return r&&t.setHours(n.getHours()+r/60),t}function o(t){return t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),e(t,0),t}function a(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function s(e){return e.getTime()-o(e)}function l(e,t,n){var i,r=s(t),o=s(n);return!e||r==o||(t>=n&&(n+=v),i=s(e),r>i&&(i+=v),o<r&&(o+=v),i>=r&&i<=o)}function d(e,t,n){var i,r=t.getTime(),o=n.getTime();return r>=o&&(o+=v),i=e.getTime(),i>=r&&i<=o}function c(t,n){var i=t.getHours();return t=new Date(t),u(t,n*v),e(t,i),t}function u(e,t,n){var i,r=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(i=e.getTimezoneOffset()-r,e.setTime(e.getTime()+i*g))}function h(t,n){return t=new Date(ve.date.getDate(t).getTime()+ve.date.getMilliseconds(n)),e(t,n.getHours()),t}function f(){return o(new Date)}function p(e){return o(e).getTime()==f().getTime()}function m(e){var t=new Date(1980,1,1,0,0,0);return e&&t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}var g=6e4,v=864e5;return{adjustDST:e,dayOfWeek:n,setDayOfWeek:t,getDate:o,isInDateRange:d,isInTimeRange:l,isToday:p,nextDay:function(e){return c(e,1)},previousDay:function(e){return c(e,-1)},toUtcTime:a,MS_PER_DAY:v,MS_PER_HOUR:60*g,MS_PER_MINUTE:g,setTime:u,setHours:h,addDays:c,today:f,toInvariantTime:m,firstDayOfMonth:i,lastDayOfMonth:r,getMilliseconds:s}}(),ve.stripWhitespace=function(e){var t,n,i;if(document.createNodeIterator)for(t=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,function(t){return t.parentNode==e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},!1);t.nextNode();)t.referenceNode&&!t.referenceNode.textContent.trim()&&t.referenceNode.parentNode.removeChild(t.referenceNode);else for(n=0;n<e.childNodes.length;n++)i=e.childNodes[n],3!=i.nodeType||/\S/.test(i.nodeValue)||(e.removeChild(i),n--),1==i.nodeType&&ve.stripWhitespace(i)},me=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},ve.animationFrame=function(e){me.call(t,e)},ge=[],ve.queueAnimation=function(e){ge[ge.length]=e,1===ge.length&&ve.runNextAnimation()},ve.runNextAnimation=function(){ve.animationFrame(function(){ge[0]&&(ge.shift()(),ge[0]&&ve.runNextAnimation())})},ve.parseQueryStringParams=function(e){for(var t=e.split("?")[1]||"",n={},i=t.split(/&|=/),r=i.length,o=0;o<r;o+=2)""!==i[o]&&(n[decodeURIComponent(i[o])]=decodeURIComponent(i[o+1]));return n},ve.elementUnderCursor=function(e){if(n!==e.x.client)return document.elementFromPoint(e.x.client,e.y.client)},ve.wheelDeltaY=function(e){var t,i=e.originalEvent,r=i.wheelDeltaY;return i.wheelDelta?(r===n||r)&&(t=i.wheelDelta):i.detail&&i.axis===i.VERTICAL_AXIS&&(t=10*-i.detail),t},ve.throttle=function(e,t){var i,r,o=0;return!t||t<=0?e:(r=function(){function r(){e.apply(a,l),o=+new Date}var a=this,s=+new Date-o,l=arguments;return o?(i&&clearTimeout(i),s>t?r():i=setTimeout(r,t-s),n):r()},r.cancel=function(){clearTimeout(i)},r)},ve.caret=function(t,i,r){var o,a,s,l,d=i!==n;if(r===n&&(r=i),t[0]&&(t=t[0]),!d||!t.disabled){try{t.selectionStart!==n?d?(t.focus(),t.setSelectionRange(i,r)):i=[t.selectionStart,t.selectionEnd]:document.selection&&(e(t).is(":visible")&&t.focus(),o=t.createTextRange(),d?(o.collapse(!0),o.moveStart("character",i),o.moveEnd("character",r-i),o.select()):(a=o.duplicate(),o.moveToBookmark(document.selection.createRange().getBookmark()),a.setEndPoint("EndToStart",o),s=a.text.length,l=s+o.text.length,i=[s,l]))}catch(c){i=[]}return i}},ve.compileMobileDirective=function(e,n){var i=t.angular;return e.attr("data-"+ve.ns+"role",e[0].tagName.toLowerCase().replace("kendo-mobile-","").replace("-","")),i.element(e).injector().invoke(["$compile",function(t){t(e)(n),/^\$(digest|apply)$/.test(n.$$phase)||n.$digest()}]),ve.widgetInstance(e,ve.mobile.ui)},ve.antiForgeryTokens=function(){var t={},i=e("meta[name=csrf-token],meta[name=_csrf]").attr("content"),r=e("meta[name=csrf-param],meta[name=_csrf_header]").attr("content");return e("input[name^='__RequestVerificationToken']").each(function(){t[this.name]=this.value}),r!==n&&i!==n&&(t[r]=i),t},ve.cycleForm=function(e){function t(e){var t=ve.widgetInstance(e);t&&t.focus?t.focus():e.focus()}var n=e.find("input, .k-widget").first(),i=e.find("button, .k-button").last();i.on("keydown",function(e){e.keyCode!=ve.keys.TAB||e.shiftKey||(e.preventDefault(),t(n))}),n.on("keydown",function(e){e.keyCode==ve.keys.TAB&&e.shiftKey&&(e.preventDefault(),t(i))})},function(){function n(t,n,i,r){var o,a,s=e("<form>").attr({action:i,method:"POST",target:r}),l=ve.antiForgeryTokens();l.fileName=n,o=t.split(";base64,"),l.contentType=o[0].replace("data:",""),l.base64=o[1];for(a in l)l.hasOwnProperty(a)&&e("<input>").attr({value:l[a],name:a,type:"hidden"}).appendTo(s);s.appendTo("body").submit().remove()}function i(e,t){var n,i,r,o,a,s=e;if("string"==typeof e){for(n=e.split(";base64,"),i=n[0],r=atob(n[1]),o=new Uint8Array(r.length),a=0;a<r.length;a++)o[a]=r.charCodeAt(a);s=new Blob([o.buffer],{type:i})}navigator.msSaveBlob(s,t)}function r(e,n){t.Blob&&e instanceof Blob&&(e=URL.createObjectURL(e)),o.download=n,o.href=e;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),o.dispatchEvent(i),setTimeout(function(){URL.revokeObjectURL(e)})}var o=document.createElement("a"),a="download"in o&&!ve.support.browser.edge;ve.saveAs=function(e){var t=n;e.forceProxy||(a?t=r:navigator.msSaveBlob&&(t=i)),t(e.dataURI,e.fileName,e.proxyURL,e.proxyTarget)}}(),ve.proxyModelSetters=function(e){var t={};return Object.keys(e||{}).forEach(function(n){Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){e[n]=t,e.dirty=!0}})}),t}}(jQuery,window),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.router.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(e,t){if(!t)return e;e+"/"===t&&(e=t);var n=RegExp("^"+t,"i");return n.test(e)||(e=t+"/"+e),f.protocol+"//"+(f.host+"/"+e).replace(/\/\/+/g,"/")}function i(e){return e?"#!":"#"}function r(e){var t=f.href;return"#!"===e&&t.indexOf("#")>-1&&t.indexOf("#!")<0?null:t.split(e)[1]||""}function o(e,t){return 0===t.indexOf(e)?t.substr(e.length).replace(/\/\//g,"/"):t}function a(e){return e.replace(/^(#)?/,"#")}function s(e){return e.replace(/^(#(!)?)?/,"#!")}var l=window.kendo,d="change",c="back",u="same",h=l.support,f=window.location,p=window.history,m=50,g=l.support.browser.msie,v=/^#*/,_=window.document,b=l.Class.extend({back:function(){g?setTimeout(function(){p.back()}):p.back()},forward:function(){g?setTimeout(function(){p.forward()}):p.forward()},length:function(){return p.length},replaceLocation:function(e){f.replace(e)}}),k=b.extend({init:function(e){this.root=e},navigate:function(e){p.pushState({},_.title,n(e,this.root))},replace:function(e){p.replaceState({},_.title,n(e,this.root))},normalize:function(e){return o(this.root,e)},current:function(){var e=f.pathname;return f.search&&(e+=f.search),o(this.root,e)},change:function(t){e(window).bind("popstate.kendo",t)},stop:function(){e(window).unbind("popstate.kendo")},normalizeCurrent:function(e){var t,o=e.root,a=f.pathname,s=r(i(e.hashBang));o===a+"/"&&(t=o),o===a&&s&&(t=n(s.replace(v,""),o)),t&&p.pushState({},_.title,t)}}),w=b.extend({init:function(e){this._id=l.guid(),this.prefix=i(e),this.fix=e?s:a},navigate:function(e){f.hash=this.fix(e)},replace:function(e){this.replaceLocation(this.fix(e))},normalize:function(e){return e.indexOf(this.prefix)<0?e:e.split(this.prefix)[1]},change:function(t){h.hashChange?e(window).on("hashchange."+this._id,t):this._interval=setInterval(t,m)},stop:function(){e(window).off("hashchange."+this._id),clearInterval(this._interval)},current:function(){return r(this.prefix)},normalizeCurrent:function(e){var t=f.pathname,n=e.root;return!(!e.pushState||n===t)&&(this.replaceLocation(n+this.prefix+o(n,t)),!0)}}),y=l.Observable.extend({start:function(t){if(t=t||{},this.bind([d,c,u],t),!this._started){this._started=!0,t.root=t.root||"/";var n,i=this.createAdapter(t);i.normalizeCurrent(t)||(n=i.current(),e.extend(this,{adapter:i,root:t.root,historyLength:i.length(),current:n,locations:[n]}),i.change(e.proxy(this,"_checkUrl")))}},createAdapter:function(e){return h.pushState&&e.pushState?new k(e.root):new w(e.hashBang)},stop:function(){this._started&&(this.adapter.stop(),this.unbind(d),this._started=!1)},change:function(e){this.bind(d,e)},replace:function(e,t){this._navigate(e,t,function(t){t.replace(e),this.locations[this.locations.length-1]=this.current})},navigate:function(e,n){return"#:back"===e?(this.backCalled=!0,this.adapter.back(),t):(this._navigate(e,n,function(t){t.navigate(e),this.locations.push(this.current)}),t)},_navigate:function(e,n,i){var r=this.adapter;return e=r.normalize(e),this.current===e||this.current===decodeURIComponent(e)?(this.trigger(u),t):(!n&&this.trigger(d,{url:e,decode:!1})||(this.current=e,i.call(this,r),this.historyLength=r.length()),t)},_checkUrl:function(){var e=this.adapter,n=e.current(),i=e.length(),r=this.historyLength===i,o=n===this.locations[this.locations.length-2]&&r,a=this.backCalled,s=this.current;return null===n||this.current===n||this.current===decodeURIComponent(n)||(this.historyLength=i,this.backCalled=!1,this.current=n,o&&this.trigger("back",{url:s,to:n})?(e.forward(),this.current=s,t):this.trigger(d,{url:n,backButtonPressed:!a})?(o?e.forward():(e.back(),this.historyLength--),this.current=s,t):(o?this.locations.pop():this.locations.push(n),t))}});l.History=y,l.History.HistoryAdapter=b,l.History.HashAdapter=w,l.History.PushStateAdapter=k,l.absoluteURL=n,l.history=new y}(window.kendo.jQuery),function(){function e(e,t){return t?e:"([^/]+)"}function t(t,n){return RegExp("^"+t.replace(p,"\\$&").replace(u,"(?:$1)?").replace(h,e).replace(f,"(.*?)")+"$",n?"i":"")}function n(e){return e.replace(/(\?.*)|(#.*)/g,"")}var i=window.kendo,r=i.history,o=i.Observable,a="init",s="routeMissing",l="change",d="back",c="same",u=/\((.*?)\)/g,h=/(\(\?)?:\w+/g,f=/\*\w+/g,p=/[\-{}\[\]+?.,\\\^$|#\s]/g,m=i.Class.extend({init:function(e,n,i){e instanceof RegExp||(e=t(e,i)),this.route=e,this._callback=n},callback:function(e,t,r){var o,a,s=0,l=i.parseQueryStringParams(e);if(l._back=t,e=n(e),o=this.route.exec(e).slice(1),a=o.length,r)for(;s<a;s++)void 0!==o[s]&&(o[s]=decodeURIComponent(o[s]));o.push(l),this._callback.apply(null,o)},worksWith:function(e,t,i){return!!this.route.test(n(e))&&(this.callback(e,t,i),!0)}}),g=o.extend({init:function(e){e||(e={}),o.fn.init.call(this),this.routes=[],this.pushState=e.pushState,this.hashBang=e.hashBang,this.root=e.root,this.ignoreCase=e.ignoreCase!==!1,this.bind([a,s,l,c],e)},destroy:function(){r.unbind(l,this._urlChangedProxy),r.unbind(c,this._sameProxy),r.unbind(d,this._backProxy),this.unbind()},start:function(){var e,t=this,n=function(){t._same()},i=function(e){t._back(e)},o=function(e){t._urlChanged(e)};r.start({same:n,change:o,back:i,pushState:t.pushState,hashBang:t.hashBang,root:t.root}),e={url:r.current||"/",preventDefault:$.noop},t.trigger(a,e)||t._urlChanged(e),this._urlChangedProxy=o,this._backProxy=i},route:function(e,t){this.routes.push(new m(e,t,this.ignoreCase))},navigate:function(e,t){i.history.navigate(e,t)},replace:function(e,t){i.history.replace(e,t)},_back:function(e){this.trigger(d,{url:e.url,to:e.to})&&e.preventDefault()},_same:function(){this.trigger(c)},_urlChanged:function(e){var t,n,r,o,a=e.url,d=void 0===e.decode,c=e.backButtonPressed;if(a||(a="/"),this.trigger(l,{url:e.url,params:i.parseQueryStringParams(e.url),backButtonPressed:c}))return void e.preventDefault();for(t=0,n=this.routes,o=n.length;t<o;t++)if(r=n[t],r.worksWith(a,c,d))return;this.trigger(s,{url:a,params:i.parseQueryStringParams(a),backButtonPressed:c})&&e.preventDefault()}});i.Router=g}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.data.odata.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(i,o){var l,d,c,u,h,f,p,m,g=[],v=i.logic||"and",_=i.filters;for(l=0,d=_.length;l<d;l++)i=_[l],c=i.field,p=i.value,f=i.operator,i.filters?i=n(i,o):(m=i.ignoreCase,c=c.replace(/\./g,"/"),i=a[f],o&&(i=s[f]),"isnull"===f||"isnotnull"===f?i=r.format("{0} {1} null",c,i):"isempty"===f||"isnotempty"===f?i=r.format("{0} {1} ''",c,i):i&&p!==t&&(u=e.type(p),"string"===u?(h="'{1}'",p=p.replace(/'/g,"''"),m===!0&&(c="tolower("+c+")")):"date"===u?o?(h="{1:yyyy-MM-ddTHH:mm:ss+00:00}",p=r.timezone.apply(p,"Etc/UTC")):h="datetime'{1:yyyy-MM-ddTHH:mm:ss}'":h="{1}",i.length>3?"substringof"!==i?h="{0}({2},"+h+")":(h="{0}("+h+",{2})","doesnotcontain"===f&&(o?(h="{0}({2},'{1}') eq -1",i="indexof"):h+=" eq false")):h="{2} {0} "+h,i=r.format(h,i,p,c))),g.push(i);return i=g.join(" "+v+" "),g.length>1&&(i="("+i+")"),i}function i(e){for(var t in e)0===t.indexOf("@odata")&&delete e[t]}var r=window.kendo,o=e.extend,a={eq:"eq",neq:"ne",gt:"gt",gte:"ge",lt:"lt",lte:"le",contains:"substringof",doesnotcontain:"substringof",endswith:"endswith",startswith:"startswith",isnull:"eq",isnotnull:"ne",isempty:"eq",isnotempty:"ne"},s=o({},a,{contains:"contains"}),l={pageSize:e.noop,page:e.noop,filter:function(e,t,i){t&&(t=n(t,i),t&&(e.$filter=t))},sort:function(t,n){var i=e.map(n,function(e){var t=e.field.replace(/\./g,"/");return"desc"===e.dir&&(t+=" desc"),t}).join(",");i&&(t.$orderby=i)},skip:function(e,t){t&&(e.$skip=t)},take:function(e,t){t&&(e.$top=t)}},d={read:{dataType:"jsonp"}};o(!0,r.data,{schemas:{odata:{type:"json",data:function(e){return e.d.results||[e.d]},total:"d.__count"}},transports:{odata:{read:{cache:!0,dataType:"jsonp",jsonp:"$callback"},update:{cache:!0,dataType:"json",contentType:"application/json",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(e,t,n){var i,o,a,s;if(e=e||{},t=t||"read",s=(this.options||d)[t],s=s?s.dataType:"json","read"===t){i={$inlinecount:"allpages"},"json"!=s&&(i.$format="json");for(a in e)l[a]?l[a](i,e[a],n):i[a]=e[a]}else{if("json"!==s)throw Error("Only json dataType can be used for "+t+" operation.");if("destroy"!==t){for(a in e)o=e[a],"number"==typeof o&&(e[a]=o+"");i=r.stringify(e)}}return i}}}}),o(!0,r.data,{schemas:{"odata-v4":{type:"json",data:function(t){return t=e.extend({},t),i(t),t.value?t.value:[t]},total:function(e){return e["@odata.count"]}}},transports:{"odata-v4":{read:{cache:!0,dataType:"json"},update:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json;IEEE754Compatible=true",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(e,t){var n=r.data.transports.odata.parameterMap(e,t,!0);return"read"==t&&(n.$count=!0,delete n.$inlinecount),n}}}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.data.xml.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,i=e.isArray,r=e.isPlainObject,o=e.map,a=e.each,s=e.extend,l=n.getter,d=n.Class,c=d.extend({init:function(t){var l,d,c,u,h=this,f=t.total,p=t.model,m=t.parse,g=t.errors,v=t.serialize,_=t.data;p&&(r(p)&&(l=t.modelBase||n.data.Model,p.fields&&a(p.fields,function(t,n){r(n)&&n.field?e.isFunction(n.field)||(n=s(n,{field:h.getter(n.field)})):n={field:h.getter(n)},p.fields[t]=n}),d=p.id,d&&(c={},c[h.xpathToMember(d,!0)]={field:h.getter(d)},p.fields=s(c,p.fields),p.id=h.xpathToMember(d)),p=l.define(p)),h.model=p),f&&("string"==typeof f?(f=h.getter(f),h.total=function(e){return parseInt(f(e),10)}):"function"==typeof f&&(h.total=f)),g&&("string"==typeof g?(g=h.getter(g),h.errors=function(e){return g(e)||null}):"function"==typeof g&&(h.errors=g)),_&&("string"==typeof _?(_=h.xpathToMember(_),h.data=function(e){var t,n=h.evaluate(e,_);return n=i(n)?n:[n],h.model&&p.fields?(t=new h.model,o(n,function(e){if(e){var n,i={};for(n in p.fields)i[n]=t._parse(n,p.fields[n].field(e));return i}})):n}):"function"==typeof _&&(h.data=_)),"function"==typeof m&&(u=h.parse,h.parse=function(e){var t=m.call(h,e);return u.call(h,t)}),"function"==typeof v&&(h.serialize=v)},total:function(e){return this.data(e).length},errors:function(e){return e?e.errors:null},serialize:function(e){return e},parseDOM:function(e){var n,r,o,a,s,l,d,c={},u=e.attributes,h=u.length;for(d=0;d<h;d++)l=u[d],c["@"+l.nodeName]=l.nodeValue;for(r=e.firstChild;r;r=r.nextSibling)o=r.nodeType,3===o||4===o?c["#text"]=r.nodeValue:1===o&&(n=this.parseDOM(r),a=r.nodeName,s=c[a],i(s)?s.push(n):s=s!==t?[s,n]:n,c[a]=s);return c},evaluate:function(e,t){for(var n,r,o,a,s,l=t.split(".");n=l.shift();)if(e=e[n],i(e)){for(r=[],t=l.join("."),s=0,o=e.length;s<o;s++)a=this.evaluate(e[s],t),a=i(a)?a:[a],r.push.apply(r,a);return r}return e},parse:function(t){var n,i,r={};return n=t.documentElement||e.parseXML(t).documentElement,i=this.parseDOM(n),r[n.nodeName]=i,r},xpathToMember:function(e,t){return e?(e=e.replace(/^\//,"").replace(/\//g,"."),e.indexOf("@")>=0?e.replace(/\.?(@.*)/,t?"$1":'["$1"]'):e.indexOf("text()")>=0?e.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):e):""},getter:function(e){return l(this.xpathToMember(e),!0)}});e.extend(!0,n.data,{XmlDataReader:c,readers:{xml:c}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.data.min",["kendo.core.min","kendo.data.odata.min","kendo.data.xml.min"],e)}(function(){return function(e,t){function n(e,t,n,i){return function(r){var o,a={};for(o in r)a[o]=r[o];a.field=i?n+"."+r.field:n,t==Ee&&e._notifyChange&&e._notifyChange(a),e.trigger(t,a)}}function i(t,n){if(t===n)return!0;var r,o=e.type(t),a=e.type(n);if(o!==a)return!1;if("date"===o)return t.getTime()===n.getTime();if("object"!==o&&"array"!==o)return!1;for(r in t)if(!i(t[r],n[r]))return!1;return!0}function r(e,t){var n,i;for(i in e){if(n=e[i],ue(n)&&n.field&&n.field===t)return n;if(n===t)return n}return null}function o(e){this.data=e||[]}function a(e,n){if(e){var i=typeof e===ye?{field:e,dir:n}:e,r=fe(i)?i:i!==t?[i]:[];return pe(r,function(e){return!!e.dir})}}function s(e){var t,n,i,r,o=e.filters;if(o)for(t=0,n=o.length;t<n;t++)i=o[t],r=i.operator,r&&typeof r===ye&&(i.operator=X[r.toLowerCase()]||r),s(i)}function l(e){if(e&&!he(e))return!fe(e)&&e.filters||(e={logic:"and",filters:fe(e)?e:[e]}),s(e),e}function d(e,t){return!e.logic&&!t.logic&&(e.field===t.field&&e.value===t.value&&e.operator===t.operator)}function c(e){return e=e||{},he(e)?{logic:"and",filters:[]}:l(e)}function u(e,t){return t.logic||e.field>t.field?1:e.field<t.field?-1:0}function h(e,t){var n,i,r,o,a;if(e=c(e),t=c(t),e.logic!==t.logic)return!1;if(r=(e.filters||[]).slice(),o=(t.filters||[]).slice(),r.length!==o.length)return!1;for(r=r.sort(u),o=o.sort(u),a=0;a<r.length;a++)if(n=r[a],i=o[a],n.logic&&i.logic){if(!h(n,i))return!1}else if(!d(n,i))return!1;return!0}function f(e){return fe(e)?e:[e]}function p(e,n){var i=typeof e===ye?{field:e,dir:n}:e,r=fe(i)?i:i!==t?[i]:[];return W(r,function(e){return{field:e.field,dir:e.dir||"asc",aggregates:e.aggregates}})}function m(e,t){return e&&e.getTime&&t&&t.getTime?e.getTime()===t.getTime():e===t}function g(e,t,n,i,r,o){var a,s,l,d,c;for(t=t||[],d=t.length,a=0;a<d;a++)s=t[a],l=s.aggregate,c=s.field,e[c]=e[c]||{},o[c]=o[c]||{},o[c][l]=o[c][l]||{},e[c][l]=J[l.toLowerCase()](e[c][l],n,_e.accessor(c),i,r,o[c][l])}function v(e){return"number"==typeof e&&!isNaN(e)}function _(e){return e&&e.getTime}function b(e){var t,n=e.length,i=Array(n);for(t=0;t<n;t++)i[t]=e[t].toJSON();return i}function k(e,t,n,i,r){var o,a,s,l,d,c={};for(l=0,
d=e.length;l<d;l++){o=e[l];for(a in t)s=r[a],s&&s!==a&&(c[s]||(c[s]=_e.setter(s)),c[s](o,t[a](o)),delete o[a])}}function w(e,t,n,i,r){var o,a,s,l,d;for(l=0,d=e.length;l<d;l++){o=e[l];for(a in t)o[a]=n._parse(a,t[a](o)),s=r[a],s&&s!==a&&delete o[s]}}function y(e,t,n,i,r){var o,a,s,l;for(a=0,l=e.length;a<l;a++)o=e[a],s=i[o.field],s&&s!=o.field&&(o.field=s),o.value=n._parse(o.field,o.value),o.hasSubgroups?y(o.items,t,n,i,r):w(o.items,t,n,i,r)}function x(e,t,n,i,r,o){return function(a){return a=e(a),a&&!he(i)&&("[object Array]"===Ge.call(a)||a instanceof Je||(a=[a]),n(a,i,new t,r,o)),a||[]}}function C(e,t,n,i){for(var r,o,a,s=0;t.length&&i&&(r=t[s],o=r.items,a=o.length,e&&e.field===r.field&&e.value===r.value?(e.hasSubgroups&&e.items.length?C(e.items[e.items.length-1],r.items,n,i):(o=o.slice(n,n+i),e.items=e.items.concat(o)),t.splice(s--,1)):r.hasSubgroups&&o.length?(C(r,o,n,i),r.items.length||t.splice(s--,1)):(o=o.slice(n,n+i),r.items=o,r.items.length||t.splice(s--,1)),0===o.length?n-=a:(n=0,i-=o.length),!(++s>=t.length)););s<t.length&&t.splice(s,t.length-s)}function T(e){var t,n,i,r,o,a=[];for(t=0,n=e.length;t<n;t++)if(o=e.at(t),o.hasSubgroups)a=a.concat(T(o.items));else for(i=o.items,r=0;r<i.length;r++)a.push(i.at(r));return a}function S(e,t){var n,i,r;if(t)for(n=0,i=e.length;n<i;n++)r=e.at(n),r.hasSubgroups?S(r.items,t):r.items=new U(r.items,t)}function D(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n].hasSubgroups){if(D(e[n].items,t))return!0}else if(t(e[n].items,e[n]))return!0}function E(e,t,n,i){for(var r=0;r<e.length&&e[r].data!==t&&!F(e[r].data,n,i);r++);}function F(e,t,n){for(var i=0,r=e.length;i<r;i++){if(e[i]&&e[i].hasSubgroups)return F(e[i].items,t,n);if(e[i]===t||e[i]===n)return e[i]=n,!0}}function R(e,n,i,r,o){var a,s,l,d;for(a=0,s=e.length;a<s;a++)if(l=e[a],l&&!(l instanceof r))if(l.hasSubgroups===t||o){for(d=0;d<n.length;d++)if(n[d]===l){e[a]=n.at(d),E(i,n,l,e[a]);break}}else R(l.items,n,i,r,o)}function I(e,t){var n,i,r;for(n=0,i=e.length;n<i;n++)if(r=e.at(n),r.uid==t.uid)return e.splice(n,1),r}function A(e,t){return t?z(e,function(e){return e.uid&&e.uid==t.uid||e[t.idField]===t.id&&t.id!==t._defaultId}):-1}function M(e,t){return t?z(e,function(e){return e.uid==t.uid}):-1}function z(e,t){var n,i;for(n=0,i=e.length;n<i;n++)if(t(e[n]))return n;return-1}function H(e,t){var n,i;return e&&!he(e)?(n=e[t],i=ue(n)?n.from||n.field||t:e[t]||t,be(i)?t:i):t}function N(e,t){var n,i,r,o={};for(r in e)"filters"!==r&&(o[r]=e[r]);if(e.filters)for(o.filters=[],n=0,i=e.filters.length;n<i;n++)o.filters[n]=N(e.filters[n],t);else o.field=H(t.fields,o.field);return o}function P(e,t){var n,i,r,o,a,s=[];for(n=0,i=e.length;n<i;n++){r={},o=e[n];for(a in o)r[a]=o[a];r.field=H(t.fields,r.field),r.aggregates&&fe(r.aggregates)&&(r.aggregates=P(r.aggregates,t)),s.push(r)}return s}function L(t,n){var i,r,o,a,s,l,d,c,u,h;for(t=e(t)[0],i=t.options,r=n[0],o=n[1],a=[],s=0,l=i.length;s<l;s++)u={},c=i[s],d=c.parentNode,d===t&&(d=null),c.disabled||d&&d.disabled||(d&&(u.optgroup=d.label),u[r.field]=c.text,h=c.attributes.value,h=h&&h.specified?c.value:c.text,u[o.field]=h,a.push(u));return a}function B(t,n){var i,r,o,a,s,l,d,c=e(t)[0].tBodies[0],u=c?c.rows:[],h=n.length,f=[];for(i=0,r=u.length;i<r;i++){for(s={},d=!0,a=u[i].cells,o=0;o<h;o++)l=a[o],"th"!==l.nodeName.toLowerCase()&&(d=!1,s[n[o].field]=l.innerHTML);d||f.push(s)}return f}function O(e){return function(){var t=this._data,n=ie.fn[e].apply(this,je.call(arguments));return this._data!=t&&this._attachBubbleHandlers(),n}}function V(t,n){function i(e,t){return e.filter(t).add(e.find(t))}var r,o,a,s,l,d,c,u,h=e(t).children(),f=[],p=n[0].field,m=n[1]&&n[1].field,g=n[2]&&n[2].field,v=n[3]&&n[3].field;for(r=0,o=h.length;r<o;r++)a={_loaded:!0},s=h.eq(r),d=s[0].firstChild,u=s.children(),t=u.filter("ul"),u=u.filter(":not(ul)"),l=s.attr("data-id"),l&&(a.id=l),d&&(a[p]=3==d.nodeType?d.nodeValue:u.text()),m&&(a[m]=i(u,"a").attr("href")),v&&(a[v]=i(u,"img").attr("src")),g&&(c=i(u,".k-sprite").prop("className"),a[g]=c&&e.trim(c.replace("k-sprite",""))),t.length&&(a.items=V(t.eq(0),n)),"true"==s.attr("data-hasChildren")&&(a.hasChildren=!0),f.push(a);return f}var W,U,q,j,$,G,Y,K,Q,X,J,Z,ee,te,ne,ie,re,oe,ae,se,le,de=e.extend,ce=e.proxy,ue=e.isPlainObject,he=e.isEmptyObject,fe=e.isArray,pe=e.grep,me=e.ajax,ge=e.each,ve=e.noop,_e=window.kendo,be=_e.isFunction,ke=_e.Observable,we=_e.Class,ye="string",xe="function",Ce="create",Te="read",Se="update",De="destroy",Ee="change",Fe="sync",Re="get",Ie="error",Ae="requestStart",Me="progress",ze="requestEnd",He=[Ce,Te,Se,De],Ne=function(e){return e},Pe=_e.getter,Le=_e.stringify,Be=Math,Oe=[].push,Ve=[].join,We=[].pop,Ue=[].splice,qe=[].shift,je=[].slice,$e=[].unshift,Ge={}.toString,Ye=_e.support.stableSort,Ke=/^\/Date\((.*?)\)\/$/,Qe=/(\r+|\n+)/g,Xe=/(?=['\\])/g,Je=ke.extend({init:function(e,t){var n=this;n.type=t||q,ke.fn.init.call(n),n.length=e.length,n.wrapAll(e,n)},at:function(e){return this[e]},toJSON:function(){var e,t,n=this.length,i=Array(n);for(e=0;e<n;e++)t=this[e],t instanceof q&&(t=t.toJSON()),i[e]=t;return i},parent:ve,wrapAll:function(e,t){var n,i,r=this,o=function(){return r};for(t=t||[],n=0,i=e.length;n<i;n++)t[n]=r.wrap(e[n],o);return t},wrap:function(e,t){var n,i=this;return null!==e&&"[object Object]"===Ge.call(e)&&(n=e instanceof i.type||e instanceof G,n||(e=e instanceof q?e.toJSON():e,e=new i.type(e)),e.parent=t,e.bind(Ee,function(e){i.trigger(Ee,{field:e.field,node:e.node,index:e.index,items:e.items||[this],action:e.node?e.action||"itemloaded":"itemchange"})})),e},push:function(){var e,t=this.length,n=this.wrapAll(arguments);return e=Oe.apply(this,n),this.trigger(Ee,{action:"add",index:t,items:n}),e},slice:je,sort:[].sort,join:Ve,pop:function(){var e=this.length,t=We.apply(this);return e&&this.trigger(Ee,{action:"remove",index:e-1,items:[t]}),t},splice:function(e,t,n){var i,r,o,a=this.wrapAll(je.call(arguments,2));if(i=Ue.apply(this,[e,t].concat(a)),i.length)for(this.trigger(Ee,{action:"remove",index:e,items:i}),r=0,o=i.length;r<o;r++)i[r]&&i[r].children&&i[r].unbind(Ee);return n&&this.trigger(Ee,{action:"add",index:e,items:a}),i},shift:function(){var e=this.length,t=qe.apply(this);return e&&this.trigger(Ee,{action:"remove",index:0,items:[t]}),t},unshift:function(){var e,t=this.wrapAll(arguments);return e=$e.apply(this,t),this.trigger(Ee,{action:"add",index:0,items:t}),e},indexOf:function(e){var t,n,i=this;for(t=0,n=i.length;t<n;t++)if(i[t]===e)return t;return-1},forEach:function(e){for(var t=0,n=this.length;t<n;t++)e(this[t],t,this)},map:function(e){for(var t=0,n=[],i=this.length;t<i;t++)n[t]=e(this[t],t,this);return n},reduce:function(e){var t,n=0,i=this.length;for(2==arguments.length?t=arguments[1]:n<i&&(t=this[n++]);n<i;n++)t=e(t,this[n],n,this);return t},reduceRight:function(e){var t,n=this.length-1;for(2==arguments.length?t=arguments[1]:n>0&&(t=this[n--]);n>=0;n--)t=e(t,this[n],n,this);return t},filter:function(e){for(var t,n=0,i=[],r=this.length;n<r;n++)t=this[n],e(t,n,this)&&(i[i.length]=t);return i},find:function(e){for(var t,n=0,i=this.length;n<i;n++)if(t=this[n],e(t,n,this))return t},every:function(e){for(var t,n=0,i=this.length;n<i;n++)if(t=this[n],!e(t,n,this))return!1;return!0},some:function(e){for(var t,n=0,i=this.length;n<i;n++)if(t=this[n],e(t,n,this))return!0;return!1},remove:function(e){var t=this.indexOf(e);t!==-1&&this.splice(t,1)},empty:function(){this.splice(0,this.length)}});"undefined"!=typeof Symbol&&Symbol.iterator&&!Je.prototype[Symbol.iterator]&&(Je.prototype[Symbol.iterator]=[][Symbol.iterator]),U=Je.extend({init:function(e,t){ke.fn.init.call(this),this.type=t||q;for(var n=0;n<e.length;n++)this[n]=e[n];this.length=n,this._parent=ce(function(){return this},this)},at:function(e){var t=this[e];return t instanceof this.type?t.parent=this._parent:t=this[e]=this.wrap(t,this._parent),t}}),q=ke.extend({init:function(e){var t,n,i=this,r=function(){return i};ke.fn.init.call(this),this._handlers={};for(n in e)t=e[n],"object"==typeof t&&t&&!t.getTime&&"_"!=n.charAt(0)&&(t=i.wrap(t,n,r)),i[n]=t;i.uid=_e.guid()},shouldSerialize:function(e){return this.hasOwnProperty(e)&&"_handlers"!==e&&"_events"!==e&&typeof this[e]!==xe&&"uid"!==e},forEach:function(e){for(var t in this)this.shouldSerialize(t)&&e(this[t],t)},toJSON:function(){var e,t,n={};for(t in this)this.shouldSerialize(t)&&(e=this[t],(e instanceof q||e instanceof Je)&&(e=e.toJSON()),n[t]=e);return n},get:function(e){var t,n=this;return n.trigger(Re,{field:e}),t="this"===e?n:_e.getter(e,!0)(n)},_set:function(e,t){var n,i,r,o=this,a=e.indexOf(".")>=0;if(a)for(n=e.split("."),i="";n.length>1;){if(i+=n.shift(),r=_e.getter(i,!0)(o),r instanceof q)return r.set(n.join("."),t),a;i+="."}return _e.setter(e)(o,t),a},set:function(e,t){var n=this,i=!1,r=e.indexOf(".")>=0,o=_e.getter(e,!0)(n);return o!==t&&(o instanceof ke&&this._handlers[e]&&(this._handlers[e].get&&o.unbind(Re,this._handlers[e].get),o.unbind(Ee,this._handlers[e].change)),i=n.trigger("set",{field:e,value:t}),i||(r||(t=n.wrap(t,e,function(){return n})),(!n._set(e,t)||e.indexOf("(")>=0||e.indexOf("[")>=0)&&n.trigger(Ee,{field:e}))),i},parent:ve,wrap:function(e,t,i){var r,o,a,s,l=this,d=Ge.call(e);return null==e||"[object Object]"!==d&&"[object Array]"!==d||(a=e instanceof Je,s=e instanceof ie,"[object Object]"!==d||s||a?("[object Array]"===d||a||s)&&(a||s||(e=new Je(e)),o=n(l,Ee,t,!1),e.bind(Ee,o),l._handlers[t]={change:o}):(e instanceof q||(e=new q(e)),r=n(l,Re,t,!0),e.bind(Re,r),o=n(l,Ee,t,!0),e.bind(Ee,o),l._handlers[t]={get:r,change:o}),e.parent=i),e}}),j={number:function(e){return _e.parseFloat(e)},date:function(e){return _e.parseDate(e)},"boolean":function(e){return typeof e===ye?"true"===e.toLowerCase():null!=e?!!e:e},string:function(e){return null!=e?e+"":e},"default":function(e){return e}},$={string:"",number:0,date:new Date,"boolean":!1,"default":""},G=q.extend({init:function(n){var i,r,o=this;if((!n||e.isEmptyObject(n))&&(n=e.extend({},o.defaults,n),o._initializers))for(i=0;i<o._initializers.length;i++)r=o._initializers[i],n[r]=o.defaults[r]();q.fn.init.call(o,n),o.dirty=!1,o.idField&&(o.id=o.get(o.idField),o.id===t&&(o.id=o._defaultId))},shouldSerialize:function(e){return q.fn.shouldSerialize.call(this,e)&&"uid"!==e&&!("id"!==this.idField&&"id"===e)&&"dirty"!==e&&"_accessors"!==e},_parse:function(e,t){var n,i=this,o=e,a=i.fields||{};return e=a[e],e||(e=r(a,o)),e&&(n=e.parse,!n&&e.type&&(n=j[e.type.toLowerCase()])),n?n(t):t},_notifyChange:function(e){var t=e.action;"add"!=t&&"remove"!=t||(this.dirty=!0)},editable:function(e){return e=(this.fields||{})[e],!e||e.editable!==!1},set:function(e,t,n){var r=this,o=r.dirty;r.editable(e)&&(t=r._parse(e,t),i(t,r.get(e))||(r.dirty=!0,q.fn.set.call(r,e,t,n)&&!o&&(r.dirty=o)))},accept:function(e){var t,n,i=this,r=function(){return i};for(t in e)n=e[t],"_"!=t.charAt(0)&&(n=i.wrap(e[t],t,r)),i._set(t,n);i.idField&&(i.id=i.get(i.idField)),i.dirty=!1},isNew:function(){return this.id===this._defaultId}}),G.define=function(e,n){n===t&&(n=e,e=G);var i,r,o,a,s,l,d,c,u=de({defaults:{}},n),h={},f=u.id,p=[];if(f&&(u.idField=f),u.id&&delete u.id,f&&(u.defaults[f]=u._defaultId=""),"[object Array]"===Ge.call(u.fields)){for(l=0,d=u.fields.length;l<d;l++)o=u.fields[l],typeof o===ye?h[o]={}:o.field&&(h[o.field]=o);u.fields=h}for(r in u.fields)o=u.fields[r],a=o.type||"default",s=null,c=r,r=typeof o.field===ye?o.field:r,o.nullable||(s=u.defaults[c!==r?c:r]=o.defaultValue!==t?o.defaultValue:$[a.toLowerCase()],"function"==typeof s&&p.push(r)),n.id===r&&(u._defaultId=s),u.defaults[c!==r?c:r]=s,o.parse=o.parse||j[a];return p.length>0&&(u._initializers=p),i=e.extend(u),i.define=function(e){return G.define(i,e)},u.fields&&(i.fields=u.fields,i.idField=u.idField),i},Y={selector:function(e){return be(e)?e:Pe(e)},compare:function(e){var t=this.selector(e);return function(e,n){return e=t(e),n=t(n),null==e&&null==n?0:null==e?-1:null==n?1:e.localeCompare?e.localeCompare(n):e>n?1:e<n?-1:0}},create:function(e){var t=e.compare||this.compare(e.field);return"desc"==e.dir?function(e,n){return t(n,e,!0)}:t},combine:function(e){return function(t,n){var i,r,o=e[0](t,n);for(i=1,r=e.length;i<r;i++)o=o||e[i](t,n);return o}}},K=de({},Y,{asc:function(e){var t=this.selector(e);return function(e,n){var i=t(e),r=t(n);return i&&i.getTime&&r&&r.getTime&&(i=i.getTime(),r=r.getTime()),i===r?e.__position-n.__position:null==i?-1:null==r?1:i.localeCompare?i.localeCompare(r):i>r?1:-1}},desc:function(e){var t=this.selector(e);return function(e,n){var i=t(e),r=t(n);return i&&i.getTime&&r&&r.getTime&&(i=i.getTime(),r=r.getTime()),i===r?e.__position-n.__position:null==i?1:null==r?-1:r.localeCompare?r.localeCompare(i):i<r?1:-1}},create:function(e){return this[e.dir](e.field)}}),W=function(e,t){var n,i=e.length,r=Array(i);for(n=0;n<i;n++)r[n]=t(e[n],n,e);return r},Q=function(){function e(e){return e.replace(Xe,"\\").replace(Qe,"")}function t(t,n,i,r){var o;return null!=i&&(typeof i===ye&&(i=e(i),o=Ke.exec(i),o?i=new Date((+o[1])):r?(i="'"+i.toLowerCase()+"'",n="(("+n+" || '')+'').toLowerCase()"):i="'"+i+"'"),i.getTime&&(n="("+n+"&&"+n+".getTime?"+n+".getTime():"+n+")",i=i.getTime())),n+" "+t+" "+i}return{quote:function(t){return t&&t.getTime?"new Date("+t.getTime()+")":"string"==typeof t?"'"+e(t)+"'":""+t},eq:function(e,n,i){return t("==",e,n,i)},neq:function(e,n,i){return t("!=",e,n,i)},gt:function(e,n,i){return t(">",e,n,i)},gte:function(e,n,i){return t(">=",e,n,i)},lt:function(e,n,i){return t("<",e,n,i)},lte:function(e,n,i){return t("<=",e,n,i)},startswith:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".lastIndexOf('"+n+"', 0) == 0"},doesnotstartwith:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".lastIndexOf('"+n+"', 0) == -1"},endswith:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"', "+t+".length - "+(n||"").length+") >= 0"},doesnotendwith:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"', "+t+".length - "+(n||"").length+") < 0"},contains:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"') >= 0"},doesnotcontain:function(t,n,i){return i&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"') == -1"},isempty:function(e){return e+" === ''"},isnotempty:function(e){return e+" !== ''"},isnull:function(e){return"("+e+" === null || "+e+" === undefined)"},isnotnull:function(e){return"("+e+" !== null && "+e+" !== undefined)"}}}(),o.filterExpr=function(e){var n,i,r,a,s,l,d=[],c={and:" && ",or:" || "},u=[],h=[],f=e.filters;for(n=0,i=f.length;n<i;n++)r=f[n],s=r.field,l=r.operator,r.filters?(a=o.filterExpr(r),r=a.expression.replace(/__o\[(\d+)\]/g,function(e,t){return t=+t,"__o["+(h.length+t)+"]"}).replace(/__f\[(\d+)\]/g,function(e,t){return t=+t,"__f["+(u.length+t)+"]"}),h.push.apply(h,a.operators),u.push.apply(u,a.fields)):(typeof s===xe?(a="__f["+u.length+"](d)",u.push(s)):a=_e.expr(s),typeof l===xe?(r="__o["+h.length+"]("+a+", "+Q.quote(r.value)+")",h.push(l)):r=Q[(l||"eq").toLowerCase()](a,r.value,r.ignoreCase===t||r.ignoreCase)),d.push(r);return{expression:"("+d.join(c[e.logic])+")",fields:u,operators:h}},X={"==":"eq",equals:"eq",isequalto:"eq",equalto:"eq",equal:"eq","!=":"neq",ne:"neq",notequals:"neq",isnotequalto:"neq",notequalto:"neq",notequal:"neq","<":"lt",islessthan:"lt",lessthan:"lt",less:"lt","<=":"lte",le:"lte",islessthanorequalto:"lte",lessthanequal:"lte",">":"gt",isgreaterthan:"gt",greaterthan:"gt",greater:"gt",">=":"gte",isgreaterthanorequalto:"gte",greaterthanequal:"gte",ge:"gte",notsubstringof:"doesnotcontain",isnull:"isnull",isempty:"isempty",isnotempty:"isnotempty"},o.normalizeFilter=l,o.compareFilters=h,o.prototype={toArray:function(){return this.data},range:function(e,t){return new o(this.data.slice(e,e+t))},skip:function(e){return new o(this.data.slice(e))},take:function(e){return new o(this.data.slice(0,e))},select:function(e){return new o(W(this.data,e))},order:function(e,t){var n={dir:t};return e&&(e.compare?n.compare=e.compare:n.field=e),new o(this.data.slice(0).sort(Y.create(n)))},orderBy:function(e){return this.order(e,"asc")},orderByDescending:function(e){return this.order(e,"desc")},sort:function(e,t,n){var i,r,o=a(e,t),s=[];if(n=n||Y,o.length){for(i=0,r=o.length;i<r;i++)s.push(n.create(o[i]));return this.orderBy({compare:n.combine(s)})}return this},filter:function(e){var t,n,i,r,a,s,d,c,u=this.data,h=[];if(e=l(e),!e||0===e.filters.length)return this;for(r=o.filterExpr(e),s=r.fields,d=r.operators,a=c=Function("d, __f, __o","return "+r.expression),(s.length||d.length)&&(c=function(e){return a(e,s,d)}),t=0,i=u.length;t<i;t++)n=u[t],c(n)&&h.push(n);return new o(h)},group:function(e,t){e=p(e||[]),t=t||this.data;var n,i=this,r=new o(i.data);return e.length>0&&(n=e[0],r=r.groupBy(n).select(function(i){var r=new o(t).filter([{field:i.field,operator:"eq",value:i.value,ignoreCase:!1}]);return{field:i.field,value:i.value,items:e.length>1?new o(i.items).group(e.slice(1),r.toArray()).toArray():i.items,hasSubgroups:e.length>1,aggregates:r.aggregate(n.aggregates)}})),r},groupBy:function(e){if(he(e)||!this.data.length)return new o([]);var t,n,i,r,a=e.field,s=this._sortForGrouping(a,e.dir||"asc"),l=_e.accessor(a),d=l.get(s[0],a),c={field:a,value:d,items:[]},u=[c];for(i=0,r=s.length;i<r;i++)t=s[i],n=l.get(t,a),m(d,n)||(d=n,c={field:a,value:d,items:[]},u.push(c)),c.items.push(t);return new o(u)},_sortForGrouping:function(e,t){var n,i,r=this.data;if(!Ye){for(n=0,i=r.length;n<i;n++)r[n].__position=n;for(r=new o(r).sort(e,t,K).toArray(),n=0,i=r.length;n<i;n++)delete r[n].__position;return r}return this.sort(e,t).toArray()},aggregate:function(e){var t,n,i={},r={};if(e&&e.length)for(t=0,n=this.data.length;t<n;t++)g(i,e,this.data[t],t,n,r);return i}},J={sum:function(e,t,n){var i=n.get(t);return v(e)?v(i)&&(e+=i):e=i,e},count:function(e){return(e||0)+1},average:function(e,n,i,r,o,a){var s=i.get(n);return a.count===t&&(a.count=0),v(e)?v(s)&&(e+=s):e=s,v(s)&&a.count++,r==o-1&&v(e)&&(e/=a.count),e},max:function(e,t,n){var i=n.get(t);return v(e)||_(e)||(e=i),e<i&&(v(i)||_(i))&&(e=i),e},min:function(e,t,n){var i=n.get(t);return v(e)||_(e)||(e=i),e>i&&(v(i)||_(i))&&(e=i),e}},o.process=function(e,n){n=n||{};var i,r=new o(e),s=n.group,l=p(s||[]).concat(a(n.sort||[])),d=n.filterCallback,c=n.filter,u=n.skip,h=n.take;return c&&(r=r.filter(c),d&&(r=d(r)),i=r.toArray().length),l&&(r=r.sort(l),s&&(e=r.toArray())),u!==t&&h!==t&&(r=r.range(u,h)),s&&(r=r.group(s,e)),{total:i,data:r.toArray()}},Z=we.extend({init:function(e){this.data=e.data},read:function(e){e.success(this.data)},update:function(e){e.success(e.data)},create:function(e){e.success(e.data)},destroy:function(e){e.success(e.data)}}),ee=we.extend({init:function(e){var t,n=this;e=n.options=de({},n.options,e),ge(He,function(t,n){typeof e[n]===ye&&(e[n]={url:e[n]})}),n.cache=e.cache?te.create(e.cache):{find:ve,add:ve},t=e.parameterMap,be(e.push)&&(n.push=e.push),n.push||(n.push=Ne),n.parameterMap=be(t)?t:function(e){var n={};return ge(e,function(e,i){e in t&&(e=t[e],ue(e)&&(i=e.value(i),e=e.key)),n[e]=i}),n}},options:{parameterMap:Ne},create:function(e){return me(this.setup(e,Ce))},read:function(n){var i,r,o,a=this,s=a.cache;n=a.setup(n,Te),i=n.success||ve,r=n.error||ve,o=s.find(n.data),o!==t?i(o):(n.success=function(e){s.add(n.data,e),i(e)},e.ajax(n))},update:function(e){return me(this.setup(e,Se))},destroy:function(e){return me(this.setup(e,De))},setup:function(e,t){e=e||{};var n,i=this,r=i.options[t],o=be(r.data)?r.data(e.data):r.data;return e=de(!0,{},r,e),n=de(!0,{},o,e.data),e.data=i.parameterMap(n,t),be(e.url)&&(e.url=e.url(n)),e}}),te=we.extend({init:function(){this._store={}},add:function(e,n){e!==t&&(this._store[Le(e)]=n)},find:function(e){return this._store[Le(e)]},clear:function(){this._store={}},remove:function(e){delete this._store[Le(e)]}}),te.create=function(e){var t={inmemory:function(){return new te}};return ue(e)&&be(e.find)?e:e===!0?new te:t[e]()},ne=we.extend({init:function(e){var t,n,i,r,o,a,s,l,d,c,u,h,f,p=this;e=e||{};for(t in e)n=e[t],p[t]=typeof n===ye?Pe(n):n;r=e.modelBase||G,ue(p.model)&&(p.model=i=r.define(p.model)),o=ce(p.data,p),p._dataAccessFunction=o,p.model&&(a=ce(p.groups,p),s=ce(p.serialize,p),l={},d={},c={},u={},h=!1,i=p.model,i.fields&&(ge(i.fields,function(e,t){var n;f=e,ue(t)&&t.field?f=t.field:typeof t===ye&&(f=t),ue(t)&&t.from&&(n=t.from),h=h||n&&n!==e||f!==e,d[e]=Pe(n||f),c[e]=Pe(e),l[n||f]=e,u[e]=n||f}),!e.serialize&&h&&(p.serialize=x(s,i,k,c,l,u))),p._dataAccessFunction=o,p.data=x(o,i,w,d,l,u),p.groups=x(a,i,y,d,l,u))},errors:function(e){return e?e.errors:null},parse:Ne,data:Ne,total:function(e){return e.length},groups:Ne,aggregates:function(){return{}},serialize:function(e){return e}}),ie=ke.extend({init:function(e){var n,i,r,o=this;e&&(i=e.data),e=o.options=de({},o.options,e),o._map={},o._prefetch={},o._data=[],o._pristineData=[],o._ranges=[],o._view=[],o._pristineTotal=0,o._destroyed=[],o._pageSize=e.pageSize,o._page=e.page||(e.pageSize?1:t),o._sort=a(e.sort),o._filter=l(e.filter),o._group=p(e.group),o._aggregate=e.aggregate,o._total=e.total,o._shouldDetachObservableParents=!0,ke.fn.init.call(o),o.transport=re.create(e,i,o),be(o.transport.push)&&o.transport.push({pushCreate:ce(o._pushCreate,o),pushUpdate:ce(o._pushUpdate,o),pushDestroy:ce(o._pushDestroy,o)}),null!=e.offlineStorage&&("string"==typeof e.offlineStorage?(r=e.offlineStorage,o._storage={getItem:function(){return JSON.parse(localStorage.getItem(r))},setItem:function(e){localStorage.setItem(r,Le(o.reader.serialize(e)))}}):o._storage=e.offlineStorage),o.reader=new _e.data.readers[e.schema.type||"json"](e.schema),n=o.reader.model||{},o._detachObservableParents(),o._data=o._observe(o._data),o._online=!0,o.bind(["push",Ie,Ee,Ae,Fe,ze,Me],e)},options:{data:null,schema:{modelBase:G},offlineStorage:null,serverSorting:!1,serverPaging:!1,serverFiltering:!1,serverGrouping:!1,serverAggregates:!1,batch:!1},clone:function(){return this},online:function(n){return n!==t?this._online!=n&&(this._online=n,n)?this.sync():e.Deferred().resolve().promise():this._online},offlineData:function(e){return null==this.options.offlineStorage?null:e!==t?this._storage.setItem(e):this._storage.getItem()||[]},_isServerGrouped:function(){var e=this.group()||[];return this.options.serverGrouping&&e.length},_pushCreate:function(e){this._push(e,"pushCreate")},_pushUpdate:function(e){this._push(e,"pushUpdate")},_pushDestroy:function(e){this._push(e,"pushDestroy")},_push:function(e,t){var n=this._readData(e);n||(n=e),this[t](n)},_flatData:function(e,t){if(e){if(this._isServerGrouped())return T(e);if(!t)for(var n=0;n<e.length;n++)e.at(n)}return e},parent:ve,get:function(e){var t,n,i=this._flatData(this._data);for(t=0,n=i.length;t<n;t++)if(i[t].id==e)return i[t]},getByUid:function(e){var t,n,i=this._flatData(this._data);if(i)for(t=0,n=i.length;t<n;t++)if(i[t].uid==e)return i[t]},indexOf:function(e){return M(this._data,e)},at:function(e){return this._data.at(e)},data:function(e){var n,i=this;if(e===t){if(i._data)for(n=0;n<i._data.length;n++)i._data.at(n);return i._data}i._detachObservableParents(),i._data=this._observe(e),i._pristineData=e.slice(0),i._storeData(),i._ranges=[],i.trigger("reset"),i._addRange(i._data),i._total=i._data.length,i._pristineTotal=i._total,i._process(i._data)},view:function(e){return e===t?this._view:(this._view=this._observeView(e),t)},_observeView:function(e){var t,n=this;return R(e,n._data,n._ranges,n.reader.model||q,n._isServerGrouped()),t=new U(e,n.reader.model),t.parent=function(){return n.parent()},t},flatView:function(){var e=this.group()||[];return e.length?T(this._view):this._view},add:function(e){return this.insert(this._data.length,e)},_createNewModel:function(e){return this.reader.model?new this.reader.model(e):e instanceof q?e:new q(e)},insert:function(e,t){return t||(t=e,e=0),t instanceof G||(t=this._createNewModel(t)),this._isServerGrouped()?this._data.splice(e,0,this._wrapInEmptyGroup(t)):this._data.splice(e,0,t),t},pushCreate:function(e){var t,n,i,r,o,a;fe(e)||(e=[e]),t=[],n=this.options.autoSync,this.options.autoSync=!1;try{for(i=0;i<e.length;i++)r=e[i],o=this.add(r),t.push(o),a=o.toJSON(),this._isServerGrouped()&&(a=this._wrapInEmptyGroup(a)),this._pristineData.push(a)}finally{this.options.autoSync=n}t.length&&this.trigger("push",{type:"create",items:t})},pushUpdate:function(e){var t,n,i,r,o;for(fe(e)||(e=[e]),t=[],n=0;n<e.length;n++)i=e[n],r=this._createNewModel(i),o=this.get(r.id),o?(t.push(o),o.accept(i),o.trigger(Ee),this._updatePristineForModel(o,i)):this.pushCreate(i);t.length&&this.trigger("push",{type:"update",items:t})},pushDestroy:function(e){var t=this._removeItems(e);t.length&&this.trigger("push",{type:"destroy",items:t})},_removeItems:function(e){var t,n,i,r,o,a;fe(e)||(e=[e]),t=[],n=this.options.autoSync,this.options.autoSync=!1;try{for(i=0;i<e.length;i++)r=e[i],o=this._createNewModel(r),a=!1,this._eachItem(this._data,function(e){var n,i;for(n=0;n<e.length;n++)if(i=e.at(n),i.id===o.id){t.push(i),e.splice(n,1),a=!0;break}}),a&&(this._removePristineForModel(o),this._destroyed.pop())}finally{this.options.autoSync=n}return t},remove:function(e){var t,n=this,i=n._isServerGrouped();return this._eachItem(n._data,function(r){if(t=I(r,e),t&&i)return t.isNew&&t.isNew()||n._destroyed.push(t),!0}),this._removeModelFromRanges(e),this._updateRangesLength(),e},destroyed:function(){return this._destroyed},created:function(){var e,t,n=[],i=this._flatData(this._data);for(e=0,t=i.length;e<t;e++)i[e].isNew&&i[e].isNew()&&n.push(i[e]);return n},updated:function(){var e,t,n=[],i=this._flatData(this._data);for(e=0,t=i.length;e<t;e++)i[e].isNew&&!i[e].isNew()&&i[e].dirty&&n.push(i[e]);return n},sync:function(){var t,n=this,i=[],r=[],o=n._destroyed,a=e.Deferred().resolve().promise();if(n.online()){if(!n.reader.model)return a;i=n.created(),r=n.updated(),t=[],n.options.batch&&n.transport.submit?t=n._sendSubmit(i,r,o):(t.push.apply(t,n._send("create",i)),t.push.apply(t,n._send("update",r)),t.push.apply(t,n._send("destroy",o))),a=e.when.apply(null,t).then(function(){var e,t;for(e=0,t=arguments.length;e<t;e++)arguments[e]&&n._accept(arguments[e]);n._storeData(!0),n._change({action:"sync"}),n.trigger(Fe)})}else n._storeData(!0),n._change({action:"sync"});return a},cancelChanges:function(e){var t=this;e instanceof _e.data.Model?t._cancelModel(e):(t._destroyed=[],t._detachObservableParents(),t._data=t._observe(t._pristineData),t.options.serverPaging&&(t._total=t._pristineTotal),t._ranges=[],t._addRange(t._data),t._change(),t._markOfflineUpdatesAsDirty())},_markOfflineUpdatesAsDirty:function(){var e=this;null!=e.options.offlineStorage&&e._eachItem(e._data,function(e){var t,n;for(t=0;t<e.length;t++)n=e.at(t),"update"!=n.__state__&&"create"!=n.__state__||(n.dirty=!0)})},hasChanges:function(){var e,t,n=this._flatData(this._data);if(this._destroyed.length)return!0;for(e=0,t=n.length;e<t;e++)if(n[e].isNew&&n[e].isNew()||n[e].dirty)return!0;return!1},_accept:function(t){var n,i=this,r=t.models,o=t.response,a=0,s=i._isServerGrouped(),l=i._pristineData,d=t.type;if(i.trigger(ze,{response:o,type:d}),o&&!he(o)){if(o=i.reader.parse(o),i._handleCustomErrors(o))return;o=i.reader.data(o),fe(o)||(o=[o])}else o=e.map(r,function(e){return e.toJSON()});for("destroy"===d&&(i._destroyed=[]),a=0,n=r.length;a<n;a++)"destroy"!==d?(r[a].accept(o[a]),"create"===d?l.push(s?i._wrapInEmptyGroup(r[a]):o[a]):"update"===d&&i._updatePristineForModel(r[a],o[a])):i._removePristineForModel(r[a])},_updatePristineForModel:function(e,t){this._executeOnPristineForModel(e,function(e,n){_e.deepExtend(n[e],t)})},_executeOnPristineForModel:function(e,t){this._eachPristineItem(function(n){var i=A(n,e);if(i>-1)return t(i,n),!0})},_removePristineForModel:function(e){this._executeOnPristineForModel(e,function(e,t){t.splice(e,1)})},_readData:function(e){var t=this._isServerGrouped()?this.reader.groups:this.reader.data;return t.call(this.reader,e)},_eachPristineItem:function(e){this._eachItem(this._pristineData,e)},_eachItem:function(e,t){e&&e.length&&(this._isServerGrouped()?D(e,t):t(e))},_pristineForModel:function(e){var t,n,i=function(i){if(n=A(i,e),n>-1)return t=i[n],!0};return this._eachPristineItem(i),t},_cancelModel:function(e){var t=this._pristineForModel(e);this._eachItem(this._data,function(n){var i=M(n,e);i>=0&&(!t||e.isNew()&&!t.__state__?n.splice(i,1):(n[i].accept(t),"update"==t.__state__&&(n[i].dirty=!0)))})},_submit:function(t,n){var i=this;i.trigger(Ae,{type:"submit"}),i.transport.submit(de({success:function(n,i){var r=e.grep(t,function(e){return e.type==i})[0];r&&r.resolve({response:n,models:r.models,type:i})},error:function(e,n,r){for(var o=0;o<t.length;o++)t[o].reject(e);i.error(e,n,r)}},n))},_sendSubmit:function(t,n,i){var r=this,o=[];return r.options.batch&&(t.length&&o.push(e.Deferred(function(e){e.type="create",e.models=t})),n.length&&o.push(e.Deferred(function(e){e.type="update",e.models=n})),i.length&&o.push(e.Deferred(function(e){e.type="destroy",e.models=i})),r._submit(o,{data:{created:r.reader.serialize(b(t)),updated:r.reader.serialize(b(n)),destroyed:r.reader.serialize(b(i))}})),o},_promise:function(t,n,i){var r=this;return e.Deferred(function(e){r.trigger(Ae,{type:i}),r.transport[i].call(r.transport,de({success:function(t){e.resolve({response:t,models:n,type:i})},error:function(t,n,i){e.reject(t),r.error(t,n,i)}},t))}).promise()},_send:function(e,t){var n,i,r=this,o=[],a=r.reader.serialize(b(t));if(r.options.batch)t.length&&o.push(r._promise({data:{models:a}},t,e));else for(n=0,i=t.length;n<i;n++)o.push(r._promise({data:a[n]},[t[n]],e));return o},read:function(t){var n=this,i=n._params(t),r=e.Deferred();return n._queueRequest(i,function(){var e=n.trigger(Ae,{type:"read"});e?(n._dequeueRequest(),r.resolve(e)):(n.trigger(Me),n._ranges=[],n.trigger("reset"),n.online()?n.transport.read({data:i,success:function(e){n._ranges=[],n.success(e,i),r.resolve()},error:function(){var e=je.call(arguments);n.error.apply(n,e),r.reject.apply(r,e)}}):null!=n.options.offlineStorage&&(n.success(n.offlineData(),i),r.resolve()))}),r.promise()},_readAggregates:function(e){return this.reader.aggregates(e)},success:function(e){var n,i,r,o,a,s,l,d,c=this,u=c.options;if(c.trigger(ze,{response:e,type:"read"}),c.online()){if(e=c.reader.parse(e),c._handleCustomErrors(e))return c._dequeueRequest(),t;c._total=c.reader.total(e),c._aggregate&&u.serverAggregates&&(c._aggregateResult=c._readAggregates(e)),e=c._readData(e),c._destroyed=[]}else{for(e=c._readData(e),n=[],i={},r=c.reader.model,o=r?r.idField:"id",a=0;a<this._destroyed.length;a++)s=this._destroyed[a][o],i[s]=s;for(a=0;a<e.length;a++)l=e[a],d=l.__state__,"destroy"==d?i[l[o]]||this._destroyed.push(this._createNewModel(l)):n.push(l);e=n,c._total=e.length}c._pristineTotal=c._total,c._pristineData=e.slice(0),c._detachObservableParents(),c._data=c._observe(e),c._markOfflineUpdatesAsDirty(),c._storeData(),c._addRange(c._data),c._process(c._data),c._dequeueRequest()},_detachObservableParents:function(){if(this._data&&this._shouldDetachObservableParents)for(var e=0;e<this._data.length;e++)this._data[e].parent&&(this._data[e].parent=ve)},_storeData:function(e){function t(e){var n,i,r,o=[];for(n=0;n<e.length;n++)i=e.at(n),r=i.toJSON(),a&&i.items?r.items=t(i.items):(r.uid=i.uid,s&&(i.isNew()?r.__state__="create":i.dirty&&(r.__state__="update"))),o.push(r);return o}var n,i,r,o,a=this._isServerGrouped(),s=this.reader.model;if(null!=this.options.offlineStorage){for(n=t(this._data),i=[],r=0;r<this._destroyed.length;r++)o=this._destroyed[r].toJSON(),o.__state__="destroy",i.push(o);this.offlineData(n.concat(i)),e&&(this._pristineData=this._readData(n))}},_addRange:function(e){var t=this,n=t._skip||0,i=n+t._flatData(e,!0).length;t._ranges.push({start:n,end:i,data:e,timestamp:(new Date).getTime()}),t._ranges.sort(function(e,t){return e.start-t.start})},error:function(e,t,n){
this._dequeueRequest(),this.trigger(ze,{}),this.trigger(Ie,{xhr:e,status:t,errorThrown:n})},_params:function(e){var t=this,n=de({take:t.take(),skip:t.skip(),page:t.page(),pageSize:t.pageSize(),sort:t._sort,filter:t._filter,group:t._group,aggregate:t._aggregate},e);return t.options.serverPaging||(delete n.take,delete n.skip,delete n.page,delete n.pageSize),t.options.serverGrouping?t.reader.model&&n.group&&(n.group=P(n.group,t.reader.model)):delete n.group,t.options.serverFiltering?t.reader.model&&n.filter&&(n.filter=N(n.filter,t.reader.model)):delete n.filter,t.options.serverSorting?t.reader.model&&n.sort&&(n.sort=P(n.sort,t.reader.model)):delete n.sort,t.options.serverAggregates?t.reader.model&&n.aggregate&&(n.aggregate=P(n.aggregate,t.reader.model)):delete n.aggregate,n},_queueRequest:function(e,n){var i=this;i._requestInProgress?i._pending={callback:ce(n,i),options:e}:(i._requestInProgress=!0,i._pending=t,n())},_dequeueRequest:function(){var e=this;e._requestInProgress=!1,e._pending&&e._queueRequest(e._pending.options,e._pending.callback)},_handleCustomErrors:function(e){if(this.reader.errors){var t=this.reader.errors(e);if(t)return this.trigger(Ie,{xhr:null,status:"customerror",errorThrown:"custom error",errors:t}),!0}return!1},_shouldWrap:function(e){var t=this.reader.model;return!(!t||!e.length)&&!(e[0]instanceof t)},_observe:function(e){var t,n=this,i=n.reader.model;return n._shouldDetachObservableParents=!0,e instanceof Je?(n._shouldDetachObservableParents=!1,n._shouldWrap(e)&&(e.type=n.reader.model,e.wrapAll(e,e))):(t=n.pageSize()&&!n.options.serverPaging?U:Je,e=new t(e,n.reader.model),e.parent=function(){return n.parent()}),n._isServerGrouped()&&S(e,i),n._changeHandler&&n._data&&n._data instanceof Je?n._data.unbind(Ee,n._changeHandler):n._changeHandler=ce(n._change,n),e.bind(Ee,n._changeHandler)},_updateTotalForAction:function(e,t){var n=this,i=parseInt(n._total,10);v(n._total)||(i=parseInt(n._pristineTotal,10)),"add"===e?i+=t.length:"remove"===e?i-=t.length:"itemchange"===e||"sync"===e||n.options.serverPaging?"sync"===e&&(i=n._pristineTotal=parseInt(n._total,10)):i=n._pristineTotal,n._total=i},_change:function(e){var t,n,i,r=this,o=e?e.action:"";if("remove"===o)for(t=0,n=e.items.length;t<n;t++)e.items[t].isNew&&e.items[t].isNew()||r._destroyed.push(e.items[t]);!r.options.autoSync||"add"!==o&&"remove"!==o&&"itemchange"!==o?(r._updateTotalForAction(o,e?e.items:[]),r._process(r._data,e)):(i=function(t){"sync"===t.action&&(r.unbind("change",i),r._updateTotalForAction(o,e.items))},r.first("change",i),r.sync())},_calculateAggregates:function(e,t){t=t||{};var n=new o(e),i=t.aggregate,r=t.filter;return r&&(n=n.filter(r)),n.aggregate(i)},_process:function(e,n){var i,r=this,o={};r.options.serverPaging!==!0&&(o.skip=r._skip,o.take=r._take||r._pageSize,o.skip===t&&r._page!==t&&r._pageSize!==t&&(o.skip=(r._page-1)*r._pageSize)),r.options.serverSorting!==!0&&(o.sort=r._sort),r.options.serverFiltering!==!0&&(o.filter=r._filter),r.options.serverGrouping!==!0&&(o.group=r._group),r.options.serverAggregates!==!0&&(o.aggregate=r._aggregate,r._aggregateResult=r._calculateAggregates(e,o)),i=r._queryProcess(e,o),r.view(i.data),i.total===t||r.options.serverFiltering||(r._total=i.total),n=n||{},n.items=n.items||r._view,r.trigger(Ee,n)},_queryProcess:function(e,t){return o.process(e,t)},_mergeState:function(e){var n=this;return e!==t&&(n._pageSize=e.pageSize,n._page=e.page,n._sort=e.sort,n._filter=e.filter,n._group=e.group,n._aggregate=e.aggregate,n._skip=n._currentRangeStart=e.skip,n._take=e.take,n._skip===t&&(n._skip=n._currentRangeStart=n.skip(),e.skip=n.skip()),n._take===t&&n._pageSize!==t&&(n._take=n._pageSize,e.take=n._take),e.sort&&(n._sort=e.sort=a(e.sort)),e.filter&&(n._filter=e.filter=l(e.filter)),e.group&&(n._group=e.group=p(e.group)),e.aggregate&&(n._aggregate=e.aggregate=f(e.aggregate))),e},query:function(n){var i,r,o=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates;return o||(this._data===t||0===this._data.length)&&!this._destroyed.length?this.read(this._mergeState(n)):(r=this.trigger(Ae,{type:"read"}),r||(this.trigger(Me),i=this._queryProcess(this._data,this._mergeState(n)),this.options.serverFiltering||(this._total=i.total!==t?i.total:this._data.length),this._aggregateResult=this._calculateAggregates(this._data,n),this.view(i.data),this.trigger(ze,{type:"read"}),this.trigger(Ee,{items:i.data})),e.Deferred().resolve(r).promise())},fetch:function(e){var t=this,n=function(n){n!==!0&&be(e)&&e.call(t)};return this._query().then(n)},_query:function(e){var t=this;return t.query(de({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate()},e))},next:function(e){var t=this,n=t.page(),i=t.total();if(e=e||{},n&&!(i&&n+1>t.totalPages()))return t._skip=t._currentRangeStart=n*t.take(),n+=1,e.page=n,t._query(e),n},prev:function(e){var t=this,n=t.page();if(e=e||{},n&&1!==n)return t._skip=t._currentRangeStart=t._skip-t.take(),n-=1,e.page=n,t._query(e),n},page:function(e){var n,i=this;return e!==t?(e=Be.max(Be.min(Be.max(e,1),i.totalPages()),1),i._query({page:e}),t):(n=i.skip(),n!==t?Be.round((n||0)/(i.take()||1))+1:t)},pageSize:function(e){var n=this;return e!==t?(n._query({pageSize:e,page:1}),t):n.take()},sort:function(e){var n=this;return e!==t?(n._query({sort:e}),t):n._sort},filter:function(e){var n=this;return e===t?n._filter:(n.trigger("reset"),n._query({filter:e,page:1}),t)},group:function(e){var n=this;return e!==t?(n._query({group:e}),t):n._group},total:function(){return parseInt(this._total||0,10)},aggregate:function(e){var n=this;return e!==t?(n._query({aggregate:e}),t):n._aggregate},aggregates:function(){var e=this._aggregateResult;return he(e)&&(e=this._emptyAggregates(this.aggregate())),e},_emptyAggregates:function(e){var t,n,i={};if(!he(e))for(t={},fe(e)||(e=[e]),n=0;n<e.length;n++)t[e[n].aggregate]=0,i[e[n].field]=t;return i},_wrapInEmptyGroup:function(e){var t,n,i,r,o=this.group();for(i=o.length-1,r=0;i>=r;i--)n=o[i],t={value:e.get(n.field),field:n.field,items:t?[t]:[e],hasSubgroups:!!t,aggregates:this._emptyAggregates(n.aggregates)};return t},totalPages:function(){var e=this,t=e.pageSize()||e.total();return Be.ceil((e.total()||0)/t)},inRange:function(e,t){var n=this,i=Be.min(e+t,n.total());return!n.options.serverPaging&&n._data.length>0||n._findRange(e,i).length>0},lastRange:function(){var e=this._ranges;return e[e.length-1]||{start:0,end:0,data:[]}},firstItemUid:function(){var e=this._ranges;return e.length&&e[0].data.length&&e[0].data[0].uid},enableRequestsInProgress:function(){this._skipRequestsInProgress=!1},_timeStamp:function(){return(new Date).getTime()},range:function(e,n){var i,r,o,a,s,l,d,c;if(this._currentRequestTimeStamp=this._timeStamp(),this._skipRequestsInProgress=!0,e=Be.min(e||0,this.total()),i=this,r=Be.max(Be.floor(e/n),0)*n,o=Be.min(r+n,i.total()),a=i._findRange(e,Be.min(e+n,i.total())),a.length){i._pending=t,i._skip=e>i.skip()?Be.min(o,(i.totalPages()-1)*i.take()):r,i._currentRangeStart=e,i._take=n,s=i.options.serverPaging,l=i.options.serverSorting,d=i.options.serverFiltering,c=i.options.serverAggregates;try{i.options.serverPaging=!0,i._isServerGrouped()||i.group()&&i.group().length||(i.options.serverSorting=!0),i.options.serverFiltering=!0,i.options.serverPaging=!0,i.options.serverAggregates=!0,s&&(i._detachObservableParents(),i._data=a=i._observe(a)),i._process(a)}finally{i.options.serverPaging=s,i.options.serverSorting=l,i.options.serverFiltering=d,i.options.serverAggregates=c}}else n!==t&&(i._rangeExists(r,o)?r<e&&i.prefetch(o,n,function(){i.range(e,n)}):i.prefetch(r,n,function(){e>r&&o<i.total()&&!i._rangeExists(o,Be.min(o+n,i.total()))?i.prefetch(o,n,function(){i.range(e,n)}):i.range(e,n)}))},_findRange:function(e,n){var i,r,o,s,l,d,c,u,h,f,m,g,v=this,_=v._ranges,b=[],k=v.options,w=k.serverSorting||k.serverPaging||k.serverFiltering||k.serverGrouping||k.serverAggregates;for(r=0,m=_.length;r<m;r++)if(i=_[r],e>=i.start&&e<=i.end){for(f=0,o=r;o<m;o++)if(i=_[o],h=v._flatData(i.data,!0),h.length&&e+f>=i.start&&(d=i.data,c=i.end,w||(g=p(v.group()||[]).concat(a(v.sort()||[])),u=v._queryProcess(i.data,{sort:g,filter:v.filter()}),h=d=u.data,u.total!==t&&(c=u.total)),s=0,e+f>i.start&&(s=e+f-i.start),l=h.length,c>n&&(l-=c-n),f+=l-s,b=v._mergeGroups(b,d,s,l),n<=i.end&&f==n-e))return b;break}return[]},_mergeGroups:function(e,t,n,i){if(this._isServerGrouped()){var r,o=t.toJSON();return e.length&&(r=e[e.length-1]),C(r,o,n,i),e.concat(o)}return e.concat(t.slice(n,i))},skip:function(){var e=this;return e._skip===t?e._page!==t?(e._page-1)*(e.take()||1):t:e._skip},currentRangeStart:function(){return this._currentRangeStart||0},take:function(){return this._take||this._pageSize},_prefetchSuccessHandler:function(e,t,n,i){var r=this,o=r._timeStamp();return function(a){var s,l,d,c=!1,u={start:e,end:t,data:[],timestamp:r._timeStamp()};if(r._dequeueRequest(),r.trigger(ze,{response:a,type:"read"}),a=r.reader.parse(a),d=r._readData(a),d.length){for(s=0,l=r._ranges.length;s<l;s++)if(r._ranges[s].start===e){c=!0,u=r._ranges[s];break}c||r._ranges.push(u)}u.data=r._observe(d),u.end=u.start+r._flatData(u.data,!0).length,r._ranges.sort(function(e,t){return e.start-t.start}),r._total=r.reader.total(a),(i||o>=r._currentRequestTimeStamp||!r._skipRequestsInProgress)&&(n&&d.length?n():r.trigger(Ee,{}))}},prefetch:function(e,t,n){var i=this,r=Be.min(e+t,i.total()),o={take:t,skip:e,page:e/t+1,pageSize:t,sort:i._sort,filter:i._filter,group:i._group,aggregate:i._aggregate};i._rangeExists(e,r)?n&&n():(clearTimeout(i._timeout),i._timeout=setTimeout(function(){i._queueRequest(o,function(){i.trigger(Ae,{type:"read"})?i._dequeueRequest():i.transport.read({data:i._params(o),success:i._prefetchSuccessHandler(e,r,n),error:function(){var e=je.call(arguments);i.error.apply(i,e)}})})},100))},_multiplePrefetch:function(e,t,n){var i=this,r=Be.min(e+t,i.total()),o={take:t,skip:e,page:e/t+1,pageSize:t,sort:i._sort,filter:i._filter,group:i._group,aggregate:i._aggregate};i._rangeExists(e,r)?n&&n():i.trigger(Ae,{type:"read"})||i.transport.read({data:i._params(o),success:i._prefetchSuccessHandler(e,r,n,!0)})},_rangeExists:function(e,t){var n,i,r=this,o=r._ranges;for(n=0,i=o.length;n<i;n++)if(o[n].start<=e&&o[n].end>=t)return!0;return!1},_removeModelFromRanges:function(e){var t,n,i,r,o;for(r=0,o=this._ranges.length;r<o&&(i=this._ranges[r],this._eachItem(i.data,function(i){t=I(i,e),t&&(n=!0)}),!n);r++);},_updateRangesLength:function(){var e,t,n,i,r=0;for(n=0,i=this._ranges.length;n<i;n++)e=this._ranges[n],e.start=e.start-r,t=this._flatData(e.data,!0).length,r=e.end-t,e.end=e.start+t}}),re={},re.create=function(t,n,i){var r,o=t.transport?e.extend({},t.transport):null;return o?(o.read=typeof o.read===ye?{url:o.read}:o.read,"jsdo"===t.type&&(o.dataSource=i),t.type&&(_e.data.transports=_e.data.transports||{},_e.data.schemas=_e.data.schemas||{},_e.data.transports[t.type]?ue(_e.data.transports[t.type])?o=de(!0,{},_e.data.transports[t.type],o):r=new _e.data.transports[t.type](de(o,{data:n})):_e.logToConsole("Unknown DataSource transport type '"+t.type+"'.\nVerify that registration scripts for this type are included after Kendo UI on the page.","warn"),t.schema=de(!0,{},_e.data.schemas[t.type],t.schema)),r||(r=be(o.read)?o:new ee(o))):r=new Z({data:t.data||[]}),r},ie.create=function(e){(fe(e)||e instanceof Je)&&(e={data:e});var n,i,r,o=e||{},a=o.data,s=o.fields,l=o.table,d=o.select,c={};if(a||!s||o.transport||(l?a=B(l,s):d&&(a=L(d,s),o.group===t&&a[0]&&a[0].optgroup!==t&&(o.group="optgroup"))),_e.data.Model&&s&&(!o.schema||!o.schema.model)){for(n=0,i=s.length;n<i;n++)r=s[n],r.type&&(c[r.field]=r);he(c)||(o.schema=de(!0,o.schema,{model:{fields:c}}))}return o.data=a,d=null,o.select=null,l=null,o.table=null,o instanceof ie?o:new ie(o)},oe=G.define({idField:"id",init:function(e){var t=this,n=t.hasChildren||e&&e.hasChildren,i="items",r={};_e.data.Model.fn.init.call(t,e),typeof t.children===ye&&(i=t.children),r={schema:{data:i,model:{hasChildren:n,id:t.idField,fields:t.fields}}},typeof t.children!==ye&&de(r,t.children),r.data=e,n||(n=r.schema.data),typeof n===ye&&(n=_e.getter(n)),be(n)&&(t.hasChildren=!!n.call(t,t)),t._childrenOptions=r,t.hasChildren&&t._initChildren(),t._loaded=!(!e||!e._loaded)},_initChildren:function(){var e,t,n,i=this;i.children instanceof ae||(e=i.children=new ae(i._childrenOptions),t=e.transport,n=t.parameterMap,t.parameterMap=function(e,t){return e[i.idField||"id"]=i.id,n&&(e=n(e,t)),e},e.parent=function(){return i},e.bind(Ee,function(e){e.node=e.node||i,i.trigger(Ee,e)}),e.bind(Ie,function(e){var t=i.parent();t&&(e.node=e.node||i,t.trigger(Ie,e))}),i._updateChildrenField())},append:function(e){this._initChildren(),this.loaded(!0),this.children.add(e)},hasChildren:!1,level:function(){for(var e=this.parentNode(),t=0;e&&e.parentNode;)t++,e=e.parentNode?e.parentNode():null;return t},_updateChildrenField:function(){var e=this._childrenOptions.schema.data;this[e||"items"]=this.children.data()},_childrenLoaded:function(){this._loaded=!0,this._updateChildrenField()},load:function(){var n,i,r={},o="_query";return this.hasChildren?(this._initChildren(),n=this.children,r[this.idField||"id"]=this.id,this._loaded||(n._data=t,o="read"),n.one(Ee,ce(this._childrenLoaded,this)),i=n[o](r)):this.loaded(!0),i||e.Deferred().resolve().promise()},parentNode:function(){var e=this.parent();return e.parent()},loaded:function(e){return e===t?this._loaded:(this._loaded=e,t)},shouldSerialize:function(e){return G.fn.shouldSerialize.call(this,e)&&"children"!==e&&"_loaded"!==e&&"hasChildren"!==e&&"_childrenOptions"!==e}}),ae=ie.extend({init:function(e){var t=oe.define({children:e});ie.fn.init.call(this,de(!0,{},{schema:{modelBase:t,model:t}},e)),this._attachBubbleHandlers()},_attachBubbleHandlers:function(){var e=this;e._data.bind(Ie,function(t){e.trigger(Ie,t)})},remove:function(e){var t,n=e.parentNode(),i=this;return n&&n._initChildren&&(i=n.children),t=ie.fn.remove.call(i,e),n&&!i.data().length&&(n.hasChildren=!1),t},success:O("success"),data:O("data"),insert:function(e,t){var n=this.parent();return n&&n._initChildren&&(n.hasChildren=!0,n._initChildren()),ie.fn.insert.call(this,e,t)},_find:function(e,t){var n,i,r,o,a=this._data;if(a){if(r=ie.fn[e].call(this,t))return r;for(a=this._flatData(this._data),n=0,i=a.length;n<i;n++)if(o=a[n].children,o instanceof ae&&(r=o[e](t)))return r}},get:function(e){return this._find("get",e)},getByUid:function(e){return this._find("getByUid",e)}}),ae.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},n=t.data,i=t.fields,r=t.list;return n&&n._dataSource?n._dataSource:(n||!i||t.transport||r&&(n=V(r,i)),t.data=n,t instanceof ae?t:new ae(t))},se=_e.Observable.extend({init:function(e,t,n){_e.Observable.fn.init.call(this),this._prefetching=!1,this.dataSource=e,this.prefetch=!n;var i=this;e.bind("change",function(){i._change()}),e.bind("reset",function(){i._reset()}),this._syncWithDataSource(),this.setViewSize(t)},setViewSize:function(e){this.viewSize=e,this._recalculate()},at:function(e){var n=this.pageSize,i=!0;return e>=this.total()?(this.trigger("endreached",{index:e}),null):this.useRanges?this.useRanges?((e<this.dataOffset||e>=this.skip+n)&&(i=this.range(Math.floor(e/n)*n)),e===this.prefetchThreshold&&this._prefetch(),e===this.midPageThreshold?this.range(this.nextMidRange,!0):e===this.nextPageThreshold?this.range(this.nextFullRange):e===this.pullBackThreshold&&this.range(this.offset===this.skip?this.previousMidRange:this.previousFullRange),i?this.dataSource.at(e-this.dataOffset):(this.trigger("endreached",{index:e}),null)):t:this.dataSource.view()[e]},indexOf:function(e){return this.dataSource.data().indexOf(e)+this.dataOffset},total:function(){return parseInt(this.dataSource.total(),10)},next:function(){var e=this,t=e.pageSize,n=e.skip-e.viewSize+t,i=Be.max(Be.floor(n/t),0)*t;this.offset=n,this.dataSource.prefetch(i,t,function(){e._goToRange(n,!0)})},range:function(e,t){if(this.offset===e)return!0;var n=this,i=this.pageSize,r=Be.max(Be.floor(e/i),0)*i,o=this.dataSource;return t&&(r+=i),o.inRange(e,i)?(this.offset=e,this._recalculate(),this._goToRange(e),!0):!this.prefetch||(o.prefetch(r,i,function(){n.offset=e,n._recalculate(),n._goToRange(e,!0)}),!1)},syncDataSource:function(){var e=this.offset;this.offset=null,this.range(e)},destroy:function(){this.unbind()},_prefetch:function(){var e=this,t=this.pageSize,n=this.skip+t,i=this.dataSource;i.inRange(n,t)||this._prefetching||!this.prefetch||(this._prefetching=!0,this.trigger("prefetching",{skip:n,take:t}),i.prefetch(n,t,function(){e._prefetching=!1,e.trigger("prefetched",{skip:n,take:t})}))},_goToRange:function(e,t){this.offset===e&&(this.dataOffset=e,this._expanding=t,this.dataSource.range(e,this.pageSize),this.dataSource.enableRequestsInProgress())},_reset:function(){this._syncPending=!0},_change:function(){var e=this.dataSource;this.length=this.useRanges?e.lastRange().end:e.view().length,this._syncPending&&(this._syncWithDataSource(),this._recalculate(),this._syncPending=!1,this.trigger("reset",{offset:this.offset})),this.trigger("resize"),this._expanding&&this.trigger("expand"),delete this._expanding},_syncWithDataSource:function(){var e=this.dataSource;this._firstItemUid=e.firstItemUid(),this.dataOffset=this.offset=e.skip()||0,this.pageSize=e.pageSize(),this.useRanges=e.options.serverPaging},_recalculate:function(){var e=this.pageSize,t=this.offset,n=this.viewSize,i=Math.ceil(t/e)*e;this.skip=i,this.midPageThreshold=i+e-1,this.nextPageThreshold=i+n-1,this.prefetchThreshold=i+Math.floor(e/3*2),this.pullBackThreshold=this.offset-1,this.nextMidRange=i+e-n,this.nextFullRange=i,this.previousMidRange=t-n,this.previousFullRange=i-e}}),le=_e.Observable.extend({init:function(e,t){var n=this;_e.Observable.fn.init.call(n),this.dataSource=e,this.batchSize=t,this._total=0,this.buffer=new se(e,3*t),this.buffer.bind({endreached:function(e){n.trigger("endreached",{index:e.index})},prefetching:function(e){n.trigger("prefetching",{skip:e.skip,take:e.take})},prefetched:function(e){n.trigger("prefetched",{skip:e.skip,take:e.take})},reset:function(){n._total=0,n.trigger("reset")},resize:function(){n._total=Math.ceil(this.length/n.batchSize),n.trigger("resize",{total:n.total(),offset:this.offset})}})},syncDataSource:function(){this.buffer.syncDataSource()},at:function(e){var t,n,i=this.buffer,r=e*this.batchSize,o=this.batchSize,a=[];for(i.offset>r&&i.at(i.offset-1),n=0;n<o&&(t=i.at(r+n),null!==t);n++)a.push(t);return a},total:function(){return this._total},destroy:function(){this.buffer.destroy(),this.unbind()}}),de(!0,_e.data,{readers:{json:ne},Query:o,DataSource:ie,HierarchicalDataSource:ae,Node:oe,ObservableObject:q,ObservableArray:Je,LazyObservableArray:U,LocalTransport:Z,RemoteTransport:ee,Cache:te,DataReader:ne,Model:G,Buffer:se,BatchBuffer:le})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.binder.min",["kendo.core.min","kendo.data.min"],e)}(function(){return function(e,t){function n(t,n,i){return v.extend({init:function(e,t,n){var i=this;v.fn.init.call(i,e.element[0],t,n),i.widget=e,i._dataBinding=I(i.dataBinding,i),i._dataBound=I(i.dataBound,i),i._itemChange=I(i.itemChange,i)},itemChange:function(e){a(e.item[0],e.data,this._ns(e.ns),[e.data].concat(this.bindings[t]._parents()))},dataBinding:function(e){var t,n,i=this.widget,r=e.removedItems||i.items();for(t=0,n=r.length;t<n;t++)d(r[t],!1)},_ns:function(t){t=t||C.ui;var n=[C.ui,C.dataviz.ui,C.mobile.ui];return n.splice(e.inArray(t,n),1),n.unshift(t),C.rolesFromNamespaces(n)},dataBound:function(e){var i,r,o,s,l=this.widget,d=e.addedItems||l.items(),c=l[n],u=C.data.HierarchicalDataSource;if(!(u&&c instanceof u)&&d.length)for(o=e.addedDataItems||c.flatView(),s=this.bindings[t]._parents(),i=0,r=o.length;i<r;i++)a(d[i],o[i],this._ns(e.ns),[o[i]].concat(s))},refresh:function(e){var r,o,a,s=this,l=s.widget;e=e||{},e.action||(s.destroy(),l.bind("dataBinding",s._dataBinding),l.bind("dataBound",s._dataBound),l.bind("itemChange",s._itemChange),r=s.bindings[t].get(),l[n]instanceof C.data.DataSource&&l[n]!=r&&(r instanceof C.data.DataSource?l[i](r):r&&r._dataSource?l[i](r._dataSource):(l[n].data(r),o=C.ui.Select&&l instanceof C.ui.Select,a=C.ui.MultiSelect&&l instanceof C.ui.MultiSelect,s.bindings.value&&(o||a)&&l.value(f(s.bindings.value.get(),l.options.dataValueField)))))},destroy:function(){var e=this.widget;e.unbind("dataBinding",this._dataBinding),e.unbind("dataBound",this._dataBound),e.unbind("itemChange",this._itemChange)}})}function i(e,t){var n=C.initWidget(e,{},t);if(n)return new w(n)}function r(e){var t,n,i,o,a,s,l,d={};for(l=e.match(y),t=0,n=l.length;t<n;t++)i=l[t],o=i.indexOf(":"),a=i.substring(0,o),s=i.substring(o+1),"{"==s.charAt(0)&&(s=r(s)),d[a]=s;return d}function o(e,t,n){var i,r={};for(i in e)r[i]=new n(t,e[i]);return r}function a(e,t,n,s){var d,c,u,h,f=e.getAttribute("data-"+C.ns+"role"),v=e.getAttribute("data-"+C.ns+"bind"),_=[],b=!0,w={};if(s=s||[t],(f||v)&&l(e,!1),f&&(u=i(e,n)),v&&(v=r(v.replace(x,"")),u||(w=C.parseOptions(e,{textField:"",valueField:"",template:"",valueUpdate:B,valuePrimitive:!1,autoBind:!0}),w.roles=n,u=new k(e,w)),u.source=t,c=o(v,s,p),w.template&&(c.template=new g(s,"",w.template)),c.click&&(v.events=v.events||{},v.events.click=v.click,c.click.destroy(),delete c.click),c.source&&(b=!1),v.attr&&(c.attr=o(v.attr,s,p)),v.style&&(c.style=o(v.style,s,p)),v.events&&(c.events=o(v.events,s,m)),v.css&&(c.css=o(v.css,s,p)),u.bind(c)),u&&(e.kendoBindingTarget=u),h=e.children,b&&h){for(d=0;d<h.length;d++)_[d]=h[d];for(d=0;d<_.length;d++)a(_[d],t,n,s)}}function s(t,n){var i,r,o,s=C.rolesFromNamespaces([].slice.call(arguments,2));for(n=C.observable(n),t=e(t),i=0,r=t.length;i<r;i++)o=t[i],1===o.nodeType&&a(o,n,s)}function l(t,n){var i,r=t.kendoBindingTarget;r&&(r.destroy(),P?delete t.kendoBindingTarget:t.removeAttribute?t.removeAttribute("kendoBindingTarget"):t.kendoBindingTarget=null),n&&(i=C.widgetInstance(e(t)),i&&typeof i.destroy===L&&i.destroy())}function d(e,t){l(e,t),c(e,t)}function c(e,t){var n,i,r=e.children;if(r)for(n=0,i=r.length;n<i;n++)d(r[n],t)}function u(t){var n,i;for(t=e(t),n=0,i=t.length;n<i;n++)d(t[n],!1)}function h(e,t){var n=e.element,i=n[0].kendoBindingTarget;i&&s(n,i.source,t)}function f(e,t){var n,i,r=[],o=0;if(!t)return e;if(e instanceof D){for(n=e.length;o<n;o++)i=e[o],r[o]=i.get?i.get(t):i[t];e=r}else e instanceof S&&(e=e.get(t));return e}var p,m,g,v,_,b,k,w,y,x,C=window.kendo,T=C.Observable,S=C.data.ObservableObject,D=C.data.ObservableArray,E={}.toString,F={},R=C.Class,I=e.proxy,A="value",M="source",z="events",H="checked",N="css",P=!0,L="function",B="change";!function(){var e=document.createElement("a");try{delete e.test}catch(t){P=!1}}(),p=T.extend({init:function(e,t){var n=this;T.fn.init.call(n),n.source=e[0],n.parents=e,n.path=t,n.dependencies={},n.dependencies[t]=!0,n.observable=n.source instanceof T,n._access=function(e){n.dependencies[e.field]=!0},n.observable&&(n._change=function(e){n.change(e)},n.source.bind(B,n._change))},_parents:function(){var t,n=this.parents,i=this.get();return i&&"function"==typeof i.parent&&(t=i.parent(),e.inArray(t,n)<0&&(n=[t].concat(n))),n},change:function(e){var t,n,i=e.field,r=this;if("this"===r.path)r.trigger(B,e);else for(t in r.dependencies)if(0===t.indexOf(i)&&(n=t.charAt(i.length),!n||"."===n||"["===n)){r.trigger(B,e);break}},start:function(e){e.bind("get",this._access)},stop:function(e){e.unbind("get",this._access)},get:function(){var e=this,n=e.source,i=0,r=e.path,o=n;if(!e.observable)return o;for(e.start(e.source),o=n.get(r);o===t&&n;)n=e.parents[++i],n instanceof S&&(o=n.get(r));if(o===t)for(n=e.source;o===t&&n;)n=n.parent(),n instanceof S&&(o=n.get(r));return"function"==typeof o&&(i=r.lastIndexOf("."),i>0&&(n=n.get(r.substring(0,i))),e.start(n),o=n!==e.source?o.call(n,e.source):o.call(n),e.stop(n)),n&&n!==e.source&&(e.currentSource=n,n.unbind(B,e._change).bind(B,e._change)),e.stop(e.source),o},set:function(e){var t=this.currentSource||this.source,n=C.getter(this.path)(t);"function"==typeof n?t!==this.source?n.call(t,this.source,e):n.call(t,e):t.set(this.path,e)},destroy:function(){this.observable&&(this.source.unbind(B,this._change),this.currentSource&&this.currentSource.unbind(B,this._change)),this.unbind()}}),m=p.extend({get:function(){var e,t=this.source,n=this.path,i=0;for(e=t.get(n);!e&&t;)t=this.parents[++i],t instanceof S&&(e=t.get(n));return I(e,t)}}),g=p.extend({init:function(e,t,n){var i=this;p.fn.init.call(i,e,t),i.template=n},render:function(e){var t;return this.start(this.source),t=C.render(this.template,e),this.stop(this.source),t}}),v=R.extend({init:function(e,t,n){this.element=e,this.bindings=t,this.options=n},bind:function(e,t){var n=this;e=t?e[t]:e,e.bind(B,function(e){n.refresh(t||e)}),n.refresh(t)},destroy:function(){}}),_=v.extend({dataType:function(){var e=this.element.getAttribute("data-type")||this.element.type||"text";return e.toLowerCase()},parsedValue:function(){return this._parseValue(this.element.value,this.dataType())},_parseValue:function(e,t){return"date"==t?e=C.parseDate(e,"yyyy-MM-dd"):"datetime-local"==t?e=C.parseDate(e,["yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm"]):"number"==t?e=C.parseFloat(e):"boolean"==t&&(e=e.toLowerCase(),e=null!==C.parseFloat(e)?!!C.parseFloat(e):"true"===e.toLowerCase()),e}}),F.attr=v.extend({refresh:function(e){this.element.setAttribute(e,this.bindings.attr[e].get())}}),F.css=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n),this.classes={}},refresh:function(t){var n=e(this.element),i=this.bindings.css[t],r=this.classes[t]=i.get();r?n.addClass(t):n.removeClass(t)}}),F.style=v.extend({refresh:function(e){this.element.style[e]=this.bindings.style[e].get()||""}}),F.enabled=v.extend({refresh:function(){this.bindings.enabled.get()?this.element.removeAttribute("disabled"):this.element.setAttribute("disabled","disabled")}}),F.readonly=v.extend({refresh:function(){this.bindings.readonly.get()?this.element.setAttribute("readonly","readonly"):this.element.removeAttribute("readonly")}}),F.disabled=v.extend({refresh:function(){this.bindings.disabled.get()?this.element.setAttribute("disabled","disabled"):this.element.removeAttribute("disabled")}}),F.events=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n),this.handlers={}},refresh:function(t){var n=e(this.element),i=this.bindings.events[t],r=this.handlers[t];r&&n.off(t,r),r=this.handlers[t]=i.get(),n.on(t,i.source,r)},destroy:function(){var t,n=e(this.element);for(t in this.handlers)n.off(t,this.handlers[t])}}),F.text=v.extend({refresh:function(){var t=this.bindings.text.get(),n=this.element.getAttribute("data-format")||"";null==t&&(t=""),e(this.element).text(C.toString(t,n))}}),F.visible=v.extend({refresh:function(){this.element.style.display=this.bindings.visible.get()?"":"none"}}),F.invisible=v.extend({refresh:function(){this.element.style.display=this.bindings.invisible.get()?"none":""}}),F.html=v.extend({refresh:function(){this.element.innerHTML=this.bindings.html.get()}}),F.value=_.extend({init:function(t,n,i){_.fn.init.call(this,t,n,i),this._change=I(this.change,this),this.eventName=i.valueUpdate||B,e(this.element).on(this.eventName,this._change),this._initChange=!1},change:function(){this._initChange=this.eventName!=B,this.bindings[A].set(this.parsedValue()),this._initChange=!1},refresh:function(){var e,t;this._initChange||(e=this.bindings[A].get(),null==e&&(e=""),t=this.dataType(),"date"==t?e=C.toString(e,"yyyy-MM-dd"):"datetime-local"==t&&(e=C.toString(e,"yyyy-MM-ddTHH:mm:ss")),this.element.value=e),this._initChange=!1},destroy:function(){e(this.element).off(this.eventName,this._change)}}),F.source=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n);var i=this.bindings.source.get();i instanceof C.data.DataSource&&n.autoBind!==!1&&i.fetch()},refresh:function(e){var t=this,n=t.bindings.source.get();n instanceof D||n instanceof C.data.DataSource?(e=e||{},"add"==e.action?t.add(e.index,e.items):"remove"==e.action?t.remove(e.index,e.items):"itemchange"!=e.action&&t.render()):t.render()},container:function(){var e=this.element;return"table"==e.nodeName.toLowerCase()&&(e.tBodies[0]||e.appendChild(document.createElement("tbody")),e=e.tBodies[0]),e},template:function(){var e=this.options,t=e.template,n=this.container().nodeName.toLowerCase();return t||(t="select"==n?e.valueField||e.textField?C.format('<option value="#:{0}#">#:{1}#</option>',e.valueField||e.textField,e.textField||e.valueField):"<option>#:data#</option>":"tbody"==n?"<tr><td>#:data#</td></tr>":"ul"==n||"ol"==n?"<li>#:data#</li>":"#:data#",t=C.template(t)),t},add:function(t,n){var i,r,o,s,l=this.container(),d=l.cloneNode(!1),c=l.children[t];if(e(d).html(C.render(this.template(),n)),d.children.length)for(i=this.bindings.source._parents(),r=0,o=n.length;r<o;r++)s=d.children[0],l.insertBefore(s,c||null),a(s,n[r],this.options.roles,[n[r]].concat(i))},remove:function(e,t){var n,i,r=this.container();for(n=0;n<t.length;n++)i=r.children[e],d(i,!0),i.parentNode==r&&r.removeChild(i)},render:function(){var t,n,i,r=this.bindings.source.get(),o=this.container(),s=this.template();if(null!=r)if(r instanceof C.data.DataSource&&(r=r.view()),r instanceof D||"[object Array]"===E.call(r)||(r=[r]),this.bindings.template){if(c(o,!0),e(o).html(this.bindings.template.render(r)),o.children.length)for(t=this.bindings.source._parents(),n=0,i=r.length;n<i;n++)a(o.children[n],r[n],this.options.roles,[r[n]].concat(t))}else e(o).html(C.render(s,r))}}),F.input={checked:_.extend({init:function(t,n,i){_.fn.init.call(this,t,n,i),this._change=I(this.change,this),e(this.element).change(this._change)},change:function(){var e,t,n,i=this.element,r=this.value();if("radio"==i.type)r=this.parsedValue(),this.bindings[H].set(r);else if("checkbox"==i.type)if(e=this.bindings[H].get(),e instanceof D){if(r=this.parsedValue(),r instanceof Date){for(n=0;n<e.length;n++)if(e[n]instanceof Date&&+e[n]===+r){t=n;break}}else t=e.indexOf(r);t>-1?e.splice(t,1):e.push(r)}else this.bindings[H].set(r)},refresh:function(){var e,t,n=this.bindings[H].get(),i=n,r=this.dataType(),o=this.element;if("checkbox"==o.type)if(i instanceof D){if(e=-1,n=this.parsedValue(),n instanceof Date){for(t=0;t<i.length;t++)if(i[t]instanceof Date&&+i[t]===+n){e=t;break}}else e=i.indexOf(n);o.checked=e>=0}else o.checked=i;else"radio"==o.type&&null!=n&&("date"==r?n=C.toString(n,"yyyy-MM-dd"):"datetime-local"==r&&(n=C.toString(n,"yyyy-MM-ddTHH:mm:ss")),o.checked=o.value===""+n)},value:function(){var e=this.element,t=e.value;return"checkbox"==e.type&&(t=e.checked),t},destroy:function(){e(this.element).off(B,this._change)}})},F.select={source:F.source.extend({refresh:function(n){var i,r=this,o=r.bindings.source.get();o instanceof D||o instanceof C.data.DataSource?(n=n||{},"add"==n.action?r.add(n.index,n.items):"remove"==n.action?r.remove(n.index,n.items):"itemchange"!=n.action&&n.action!==t||(r.render(),r.bindings.value&&r.bindings.value&&(i=f(r.bindings.value.get(),e(r.element).data("valueField")),null===i?r.element.selectedIndex=-1:r.element.value=i))):r.render()}}),value:_.extend({init:function(t,n,i){_.fn.init.call(this,t,n,i),this._change=I(this.change,this),e(this.element).change(this._change)},parsedValue:function(){var e,t,n,i,r=this.dataType(),o=[];for(n=0,i=this.element.options.length;n<i;n++)t=this.element.options[n],t.selected&&(e=t.attributes.value,e=e&&e.specified?t.value:t.text,o.push(this._parseValue(e,r)));return o},change:function(){var e,n,i,r,o,a,s,l,d=[],c=this.element,u=this.options.valueField||this.options.textField,h=this.options.valuePrimitive;for(o=0,a=c.options.length;o<a;o++)n=c.options[o],n.selected&&(r=n.attributes.value,r=r&&r.specified?n.value:n.text,d.push(u?r:this._parseValue(r,this.dataType())));if(u)for(e=this.bindings.source.get(),e instanceof C.data.DataSource&&(e=e.view()),i=0;i<d.length;i++)for(o=0,a=e.length;o<a;o++)if(s=e[o].get(u),l=s+""===d[i]){d[i]=e[o];break}r=this.bindings[A].get(),
r instanceof D?r.splice.apply(r,[0,r.length].concat(d)):this.bindings[A].set(h||!(r instanceof S||null===r||r===t)&&u?d[0].get(u):d[0])},refresh:function(){var e,t,n,i=this.element,r=i.options,o=this.bindings[A].get(),a=o,s=this.options.valueField||this.options.textField,l=!1,d=this.dataType();for(a instanceof D||(a=new D([o])),i.selectedIndex=-1,n=0;n<a.length;n++)for(o=a[n],s&&o instanceof S&&(o=o.get(s)),"date"==d?o=C.toString(a[n],"yyyy-MM-dd"):"datetime-local"==d&&(o=C.toString(a[n],"yyyy-MM-ddTHH:mm:ss")),e=0;e<r.length;e++)t=r[e].value,""===t&&""!==o&&(t=r[e].text),null!=o&&t==""+o&&(r[e].selected=!0,l=!0)},destroy:function(){e(this.element).off(B,this._change)}})},F.widget={events:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e,this.handlers={}},refresh:function(e){var t=this.bindings.events[e],n=this.handlers[e];n&&this.widget.unbind(e,n),n=t.get(),this.handlers[e]=function(e){e.data=t.source,n(e),e.data===t.source&&delete e.data},this.widget.bind(e,this.handlers[e])},destroy:function(){var e;for(e in this.handlers)this.widget.unbind(e,this.handlers[e])}}),checked:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e,this._change=I(this.change,this),this.widget.bind(B,this._change)},change:function(){this.bindings[H].set(this.value())},refresh:function(){this.widget.check(this.bindings[H].get()===!0)},value:function(){var e=this.element,t=e.value;return"on"!=t&&"off"!=t||(t=e.checked),t},destroy:function(){this.widget.unbind(B,this._change)}}),visible:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){var e=this.bindings.visible.get();this.widget.wrapper[0].style.display=e?"":"none"}}),invisible:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){var e=this.bindings.invisible.get();this.widget.wrapper[0].style.display=e?"none":""}}),enabled:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(this.bindings.enabled.get())}}),disabled:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(!this.bindings.disabled.get())}}),source:n("source","dataSource","setDataSource"),value:v.extend({init:function(t,n,i){v.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(B,this._change);var r=this.bindings.value.get();this._valueIsObservableObject=!i.valuePrimitive&&(null==r||r instanceof S),this._valueIsObservableArray=r instanceof D,this._initChange=!1},_source:function(){var e;return this.widget.dataItem&&(e=this.widget.dataItem(),e&&e instanceof S)?[e]:(this.bindings.source&&(e=this.bindings.source.get()),(!e||e instanceof C.data.DataSource)&&(e=this.widget.dataSource.flatView()),e)},change:function(){var e,t,n,i,r,o,a,s=this.widget.value(),l=this.options.dataValueField||this.options.dataTextField,d="[object Array]"===E.call(s),c=this._valueIsObservableObject,u=[];if(this._initChange=!0,l)if(""===s&&(c||this.options.valuePrimitive))s=null;else{for(a=this._source(),d&&(t=s.length,u=s.slice(0)),r=0,o=a.length;r<o;r++)if(n=a[r],i=n.get(l),d){for(e=0;e<t;e++)if(i==u[e]){u[e]=n;break}}else if(i==s){s=c?n:i;break}u[0]&&(s=this._valueIsObservableArray?u:c||!l?u[0]:u[0].get(l))}this.bindings.value.set(s),this._initChange=!1},refresh:function(){var e,n,i,r,o,a,s,l,d;if(!this._initChange){if(e=this.widget,n=e.options,i=n.dataTextField,r=n.dataValueField||i,o=this.bindings.value.get(),a=n.text||"",s=0,d=[],o===t&&(o=null),r)if(o instanceof D){for(l=o.length;s<l;s++)d[s]=o[s].get(r);o=d}else o instanceof S&&(a=o.get(i),o=o.get(r));n.autoBind!==!1||n.cascadeFrom||!e.listView||e.listView.bound()?e.value(o):(i!==r||a||(a=o),a||!o&&0!==o||!n.valuePrimitive?e._preselect(o,a):e.value(o))}this._initChange=!1},destroy:function(){this.widget.unbind(B,this._change)}}),gantt:{dependencies:n("dependencies","dependencies","setDependenciesDataSource")},multiselect:{value:v.extend({init:function(t,n,i){v.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(B,this._change),this._initChange=!1},change:function(){var e,n,i,r,o,a,s,l,d,c=this,u=c.bindings[A].get(),h=c.options.valuePrimitive,f=h?c.widget.value():c.widget.dataItems(),p=this.options.dataValueField||this.options.dataTextField;if(f=f.slice(0),c._initChange=!0,u instanceof D){for(e=[],n=f.length,i=0,r=0,o=u[i],a=!1;o!==t;){for(d=!1,r=0;r<n;r++)if(h?a=f[r]==o:(l=f[r],l=l.get?l.get(p):l,a=l==(o.get?o.get(p):o)),a){f.splice(r,1),n-=1,d=!0;break}d?i+=1:(e.push(o),b(u,i,1),s=i),o=u[i]}b(u,u.length,0,f),e.length&&u.trigger("change",{action:"remove",items:e,index:s}),f.length&&u.trigger("change",{action:"add",items:f,index:u.length-1})}else c.bindings[A].set(f);c._initChange=!1},refresh:function(){if(!this._initChange){var e,n,i=this.options,r=this.widget,o=i.dataValueField||i.dataTextField,a=this.bindings.value.get(),s=a,l=0,d=[];if(a===t&&(a=null),o)if(a instanceof D){for(e=a.length;l<e;l++)n=a[l],d[l]=n.get?n.get(o):n;a=d}else a instanceof S&&(a=a.get(o));i.autoBind!==!1||i.valuePrimitive===!0||r._isBound()?r.value(a):r._preselect(s,a)}},destroy:function(){this.widget.unbind(B,this._change)}})},scheduler:{source:n("source","dataSource","setDataSource").extend({dataBound:function(e){var t,n,i,r,o=this.widget,s=e.addedItems||o.items();if(s.length)for(i=e.addedDataItems||o.dataItems(),r=this.bindings.source._parents(),t=0,n=i.length;t<n;t++)a(s[t],i[t],this._ns(e.ns),[i[t]].concat(r))}})}},b=function(e,t,n,i){var r,o,a,s,l;if(i=i||[],n=n||0,r=i.length,o=e.length,a=[].slice.call(e,t+n),s=a.length,r){for(r=t+r,l=0;t<r;t++)e[t]=i[l],l++;e.length=r}else if(n)for(e.length=t,n+=t;t<n;)delete e[--n];if(s){for(s=t+s,l=0;t<s;t++)e[t]=a[l],l++;e.length=s}for(t=e.length;t<o;)delete e[t],t++},k=R.extend({init:function(e,t){this.target=e,this.options=t,this.toDestroy=[]},bind:function(e){var t,n,i,r,o,a,s=this instanceof w,l=this.binders();for(t in e)t==A?n=!0:t==M?i=!0:t!=z||s?t==H?o=!0:t==N?a=!0:this.applyBinding(t,e,l):r=!0;i&&this.applyBinding(M,e,l),n&&this.applyBinding(A,e,l),o&&this.applyBinding(H,e,l),r&&!s&&this.applyBinding(z,e,l),a&&!s&&this.applyBinding(N,e,l)},binders:function(){return F[this.target.nodeName.toLowerCase()]||{}},applyBinding:function(e,t,n){var i,r=n[e]||F[e],o=this.toDestroy,a=t[e];if(r)if(r=new r(this.target,t,this.options),o.push(r),a instanceof p)r.bind(a),o.push(a);else for(i in a)r.bind(a,i),o.push(a[i]);else if("template"!==e)throw Error("The "+e+" binding is not supported by the "+this.target.nodeName.toLowerCase()+" element")},destroy:function(){var e,t,n=this.toDestroy;for(e=0,t=n.length;e<t;e++)n[e].destroy()}}),w=k.extend({binders:function(){return F.widget[this.target.options.name.toLowerCase()]||{}},applyBinding:function(e,t,n){var i,r=n[e]||F.widget[e],o=this.toDestroy,a=t[e];if(!r)throw Error("The "+e+" binding is not supported by the "+this.target.options.name+" widget");if(r=new r(this.target,t,this.target.options),o.push(r),a instanceof p)r.bind(a),o.push(a);else for(i in a)r.bind(a,i),o.push(a[i])}}),y=/[A-Za-z0-9_\-]+:(\{([^}]*)\}|[^,}]+)/g,x=/\s/g,C.unbind=u,C.bind=s,C.data.binders=F,C.data.Binder=v,C.notify=h,C.observable=function(e){return e instanceof S||(e=new S(e)),e},C.observableHierarchy=function(e){function t(e){var n,i;for(n=0;n<e.length;n++)e[n]._initChildren(),i=e[n].children,i.fetch(),e[n].items=i.data(),t(e[n].items)}var n=C.data.HierarchicalDataSource.create(e);return n.fetch(),t(n.data()),n._data._dataSource=n,n._data}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.fx.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(e){return parseInt(e,10)}function i(e,t){return n(e.css(t))}function r(e){var t,n=[];for(t in e)n.push(t);return n}function o(e){for(var t in e)W.indexOf(t)!=-1&&U.indexOf(t)==-1&&delete e[t];return e}function a(e,t){var n,i,r,o,a=[],s={};for(i in t)n=i.toLowerCase(),o=I&&W.indexOf(n)!=-1,!F.hasHW3D&&o&&U.indexOf(n)==-1?delete t[i]:(r=t[i],o?a.push(i+"("+r+")"):s[i]=r);return a.length&&(s[se]=a.join(" ")),s}function s(e,t){var i,r,o;return I?(i=e.css(se),i==K?"scale"==t?1:0:(r=i.match(RegExp(t+"\\s*\\(([\\d\\w\\.]+)")),o=0,r?o=n(r[1]):(r=i.match(N)||[0,0,0,0,0],t=t.toLowerCase(),L.test(t)?o=parseFloat(r[3]/r[2]):"translatey"==t?o=parseFloat(r[4]/r[2]):"scale"==t?o=parseFloat(r[2]):"rotate"==t&&(o=parseFloat(Math.atan2(r[2],r[1])))),o)):parseFloat(e.css(t))}function l(e){return e.charAt(0).toUpperCase()+e.substring(1)}function d(e,t){var n=p.extend(t),i=n.prototype.directions;T[l(e)]=n,T.Element.prototype[e]=function(e,t,i,r){return new n(this.element,e,t,i,r)},S(i,function(t,i){T.Element.prototype[e+l(i)]=function(e,t,r){return new n(this.element,i,e,t,r)}})}function c(e,n,i,r){d(e,{directions:g,startValue:function(e){return this._startValue=e,this},endValue:function(e){return this._endValue=e,this},shouldHide:function(){return this._shouldHide},prepare:function(e,o){var a,s,l=this,d="out"===this._direction,c=l.element.data(n),u=!(isNaN(c)||c==i);a=u?c:t!==this._startValue?this._startValue:d?i:r,s=t!==this._endValue?this._endValue:d?r:i,this._reverse?(e[n]=s,o[n]=a):(e[n]=a,o[n]=s),l._shouldHide=o[n]===r}})}function u(e,t){var n=C.directions[t].vertical,i=e[n?J:X]()/2+"px";return _[t].replace("$size",i)}var h,f,p,m,g,v,_,b,k,w,y,x,C=window.kendo,T=C.effects,S=e.each,D=e.extend,E=e.proxy,F=C.support,R=F.browser,I=F.transforms,A=F.transitions,M={scale:0,scalex:0,scaley:0,scale3d:0},z={translate:0,translatex:0,translatey:0,translate3d:0},H=t!==document.documentElement.style.zoom&&!I,N=/matrix3?d?\s*\(.*,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?/i,P=/^(-?[\d\.\-]+)?[\w\s]*,?\s*(-?[\d\.\-]+)?[\w\s]*/i,L=/translatex?$/i,B=/(zoom|fade|expand)(\w+)/,O=/(zoom|fade|expand)/,V=/[xy]$/i,W=["perspective","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","translate","translatex","translatey","translatez","translate3d","matrix","matrix3d"],U=["rotate","scale","scalex","scaley","skew","skewx","skewy","translate","translatex","translatey","matrix"],q={rotate:"deg",scale:"",skew:"px",translate:"px"},j=I.css,$=Math.round,G="",Y="px",K="none",Q="auto",X="width",J="height",Z="hidden",ee="origin",te="abortId",ne="overflow",ie="translate",re="position",oe="completeCallback",ae=j+"transition",se=j+"transform",le=j+"backface-visibility",de=j+"perspective",ce="1500px",ue="perspective("+ce+")",he={left:{reverse:"right",property:"left",transition:"translatex",vertical:!1,modifier:-1},right:{reverse:"left",property:"left",transition:"translatex",vertical:!1,modifier:1},down:{reverse:"up",property:"top",transition:"translatey",vertical:!0,modifier:1},up:{reverse:"down",property:"top",transition:"translatey",vertical:!0,modifier:-1},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out",modifier:-1},out:{reverse:"in",modifier:1},vertical:{reverse:"vertical"},horizontal:{reverse:"horizontal"}};C.directions=he,D(e.fn,{kendoStop:function(e,t){return A?T.stopQueue(this,e||!1,t||!1):this.stop(e,t)}}),I&&!A&&(S(U,function(n,i){e.fn[i]=function(n){if(t===n)return s(this,i);var r=e(this)[0],o=i+"("+n+q[i.replace(V,"")]+")";return r.style.cssText.indexOf(se)==-1?e(this).css(se,o):r.style.cssText=r.style.cssText.replace(RegExp(i+"\\(.*?\\)","i"),o),this},e.fx.step[i]=function(t){e(t.elem)[i](t.now)}}),h=e.fx.prototype.cur,e.fx.prototype.cur=function(){return U.indexOf(this.prop)!=-1?parseFloat(e(this.elem)[this.prop]()):h.apply(this,arguments)}),C.toggleClass=function(e,t,n,i){return t&&(t=t.split(" "),A&&(n=D({exclusive:"all",duration:400,ease:"ease-out"},n),e.css(ae,n.exclusive+" "+n.duration+"ms "+n.ease),setTimeout(function(){e.css(ae,"").css(J)},n.duration)),S(t,function(t,n){e.toggleClass(n,i)})),e},C.parseEffects=function(e,t){var n={};return"string"==typeof e?S(e.split(" "),function(e,i){var r=!O.test(i),o=i.replace(B,function(e,t,n){return t+":"+n.toLowerCase()}),a=o.split(":"),s=a[1],l={};a.length>1&&(l.direction=t&&r?he[s].reverse:s),n[a[0]]=l}):S(e,function(e){var i=this.direction;i&&t&&!O.test(e)&&(this.direction=he[i].reverse),n[e]=this}),n},A&&D(T,{transition:function(t,n,i){var o,s,l,d,c=0,u=t.data("keys")||[];i=D({duration:200,ease:"ease-out",complete:null,exclusive:"all"},i),l=!1,d=function(){l||(l=!0,s&&(clearTimeout(s),s=null),t.removeData(te).dequeue().css(ae,"").css(ae),i.complete.call(t))},i.duration=e.fx?e.fx.speeds[i.duration]||i.duration:i.duration,o=a(t,n),e.merge(u,r(o)),t.data("keys",e.unique(u)).height(),t.css(ae,i.exclusive+" "+i.duration+"ms "+i.ease).css(ae),t.css(o).css(se),A.event&&(t.one(A.event,d),0!==i.duration&&(c=500)),s=setTimeout(d,i.duration+c),t.data(te,s),t.data(oe,d)},stopQueue:function(e,t,n){var i,r=e.data("keys"),o=!n&&r,a=e.data(oe);return o&&(i=C.getComputedStyles(e[0],r)),a&&a(),o&&e.css(i),e.removeData("keys").stop(t)}}),f=C.Class.extend({init:function(e,t){var n=this;n.element=e,n.effects=[],n.options=t,n.restore=[]},run:function(t){var n,i,r,s,l,d,c,u=this,h=t.length,f=u.element,p=u.options,m=e.Deferred(),g={},v={};for(u.effects=t,m.then(e.proxy(u,"complete")),f.data("animating",!0),i=0;i<h;i++)for(n=t[i],n.setReverse(p.reverse),n.setOptions(p),u.addRestoreProperties(n.restore),n.prepare(g,v),l=n.children(),r=0,d=l.length;r<d;r++)l[r].duration(p.duration).run();for(c in p.effects)D(v,p.effects[c].properties);for(f.is(":visible")||D(g,{display:f.data("olddisplay")||"block"}),I&&!p.reset&&(s=f.data("targetTransform"),s&&(g=D(s,g))),g=a(f,g),I&&!A&&(g=o(g)),f.css(g).css(se),i=0;i<h;i++)t[i].setup();return p.init&&p.init(),f.data("targetTransform",v),T.animate(f,v,D({},p,{complete:m.resolve})),m.promise()},stop:function(){e(this.element).kendoStop(!0,!0)},addRestoreProperties:function(e){for(var t,n=this.element,i=0,r=e.length;i<r;i++)t=e[i],this.restore.push(t),n.data(t)||n.data(t,n.css(t))},restoreCallback:function(){var e,t,n,i=this.element;for(e=0,t=this.restore.length;e<t;e++)n=this.restore[e],i.css(n,i.data(n))},complete:function(){var t=this,n=0,i=t.element,r=t.options,o=t.effects,a=o.length;for(i.removeData("animating").dequeue(),r.hide&&i.data("olddisplay",i.css("display")).hide(),this.restoreCallback(),H&&!I&&setTimeout(e.proxy(this,"restoreCallback"),0);n<a;n++)o[n].teardown();r.completeCallback&&r.completeCallback(i)}}),T.promise=function(e,t){var n,i,r,o=[],a=new f(e,t),s=C.parseEffects(t.effects);t.effects=s;for(r in s)n=T[l(r)],n&&(i=new n(e,s[r].direction),o.push(i));o[0]?a.run(o):(e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.init&&t.init(),e.dequeue(),a.complete())},D(T,{animate:function(n,r,a){var s=a.transition!==!1;delete a.transition,A&&"transition"in T&&s?T.transition(n,r,a):I?n.animate(o(r),{queue:!1,show:!1,hide:!1,duration:a.duration,complete:a.complete}):n.each(function(){var n=e(this),o={};S(W,function(e,a){var s,l,d,c,u,h,f,p=r?r[a]+" ":null;p&&(l=r,a in M&&r[a]!==t?(s=p.match(P),I&&D(l,{scale:+s[0]})):a in z&&r[a]!==t&&(d=n.css(re),c="absolute"==d||"fixed"==d,n.data(ie)||(c?n.data(ie,{top:i(n,"top")||0,left:i(n,"left")||0,bottom:i(n,"bottom"),right:i(n,"right")}):n.data(ie,{top:i(n,"marginTop")||0,left:i(n,"marginLeft")||0})),u=n.data(ie),s=p.match(P),s&&(h=a==ie+"y"?0:+s[1],f=a==ie+"y"?+s[1]:+s[2],c?(isNaN(u.right)?isNaN(h)||D(l,{left:u.left+h}):isNaN(h)||D(l,{right:u.right-h}),isNaN(u.bottom)?isNaN(f)||D(l,{top:u.top+f}):isNaN(f)||D(l,{bottom:u.bottom-f})):(isNaN(h)||D(l,{marginLeft:u.left+h}),isNaN(f)||D(l,{marginTop:u.top+f})))),!I&&"scale"!=a&&a in l&&delete l[a],l&&D(o,l))}),R.msie&&delete o.scale,n.animate(o,{queue:!1,show:!1,hide:!1,duration:a.duration,complete:a.complete})})}}),T.animatedPromise=T.promise,p=C.Class.extend({init:function(e,t){var n=this;n.element=e,n._direction=t,n.options={},n._additionalEffects=[],n.restore||(n.restore=[])},reverse:function(){return this._reverse=!0,this.run()},play:function(){return this._reverse=!1,this.run()},add:function(e){return this._additionalEffects.push(e),this},direction:function(e){return this._direction=e,this},duration:function(e){return this._duration=e,this},compositeRun:function(){var e=this,t=new f(e.element,{reverse:e._reverse,duration:e._duration}),n=e._additionalEffects.concat([e]);return t.run(n)},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var t,n,i=this,r=i.element,s=0,l=i.restore,d=l.length,c=e.Deferred(),u={},h={},f=i.children(),p=f.length;for(c.then(e.proxy(i,"_complete")),r.data("animating",!0),s=0;s<d;s++)t=l[s],r.data(t)||r.data(t,r.css(t));for(s=0;s<p;s++)f[s].duration(i._duration).run();return i.prepare(u,h),r.is(":visible")||D(u,{display:r.data("olddisplay")||"block"}),I&&(n=r.data("targetTransform"),n&&(u=D(n,u))),u=a(r,u),I&&!A&&(u=o(u)),r.css(u).css(se),i.setup(),r.data("targetTransform",h),T.animate(r,h,{duration:i._duration,complete:c.resolve}),c.promise()},stop:function(){var t=0,n=this.children(),i=n.length;for(t=0;t<i;t++)n[t].stop();return e(this.element).kendoStop(!0,!0),this},restoreCallback:function(){var e,t,n,i=this.element;for(e=0,t=this.restore.length;e<t;e++)n=this.restore[e],i.css(n,i.data(n))},_complete:function(){var t=this,n=t.element;n.removeData("animating").dequeue(),t.restoreCallback(),t.shouldHide()&&n.data("olddisplay",n.css("display")).hide(),H&&!I&&setTimeout(e.proxy(t,"restoreCallback"),0),t.teardown()},setOptions:function(e){D(!0,this.options,e)},children:function(){return[]},shouldHide:e.noop,setup:e.noop,prepare:e.noop,teardown:e.noop,directions:[],setReverse:function(e){return this._reverse=e,this}}),m=["left","right","up","down"],g=["in","out"],d("slideIn",{directions:m,divisor:function(e){return this.options.divisor=e,this},prepare:function(e,t){var n,i=this,r=i.element,o=C._outerWidth,a=C._outerHeight,s=he[i._direction],l=-s.modifier*(s.vertical?a(r):o(r)),d=l/(i.options&&i.options.divisor||1)+Y,c="0px";i._reverse&&(n=e,e=t,t=n),I?(e[s.transition]=d,t[s.transition]=c):(e[s.property]=d,t[s.property]=c)}}),d("tile",{directions:m,init:function(e,t,n){p.prototype.init.call(this,e,t),this.options={previous:n}},previousDivisor:function(e){return this.options.previousDivisor=e,this},children:function(){var e=this,t=e._reverse,n=e.options.previous,i=e.options.previousDivisor||1,r=e._direction,o=[C.fx(e.element).slideIn(r).setReverse(t)];return n&&o.push(C.fx(n).slideIn(he[r].reverse).divisor(i).setReverse(!t)),o}}),c("fade","opacity",1,0),c("zoom","scale",1,.01),d("slideMargin",{prepare:function(e,t){var n,i=this,r=i.element,o=i.options,a=r.data(ee),s=o.offset,l=i._reverse;l||null!==a||r.data(ee,parseFloat(r.css("margin-"+o.axis))),n=r.data(ee)||0,t["margin-"+o.axis]=l?n:n+s}}),d("slideTo",{prepare:function(e,t){var n=this,i=n.element,r=n.options,o=r.offset.split(","),a=n._reverse;I?(t.translatex=a?0:o[0],t.translatey=a?0:o[1]):(t.left=a?0:o[0],t.top=a?0:o[1]),i.css("left")}}),d("expand",{directions:["horizontal","vertical"],restore:[ne],prepare:function(e,n){var i=this,r=i.element,o=i.options,a=i._reverse,s="vertical"===i._direction?J:X,l=r[0].style[s],d=r.data(s),c=parseFloat(d||l),u=$(r.css(s,Q)[s]());e.overflow=Z,c=o&&o.reset?u||c:c||u,n[s]=(a?0:c)+Y,e[s]=(a?c:0)+Y,d===t&&r.data(s,l)},shouldHide:function(){return this._reverse},teardown:function(){var e=this,t=e.element,n="vertical"===e._direction?J:X,i=t.data(n);i!=Q&&i!==G||setTimeout(function(){t.css(n,Q).css(n)},0)}}),v={position:"absolute",marginLeft:0,marginTop:0,scale:1},d("transfer",{init:function(e,t){this.element=e,this.options={target:t},this.restore=[]},setup:function(){this.element.appendTo(document.body)},prepare:function(e,t){var n=this,i=n.element,r=T.box(i),o=T.box(n.options.target),a=s(i,"scale"),l=T.fillScale(o,r),d=T.transformOrigin(o,r);D(e,v),t.scale=1,i.css(se,"scale(1)").css(se),i.css(se,"scale("+a+")"),e.top=r.top,e.left=r.left,e.transformOrigin=d.x+Y+" "+d.y+Y,n._reverse?e.scale=l:t.scale=l}}),_={top:"rect(auto auto $size auto)",bottom:"rect($size auto auto auto)",left:"rect(auto $size auto auto)",right:"rect(auto auto auto $size)"},b={top:{start:"rotatex(0deg)",end:"rotatex(180deg)"},bottom:{start:"rotatex(-180deg)",end:"rotatex(0deg)"},left:{start:"rotatey(0deg)",end:"rotatey(-180deg)"},right:{start:"rotatey(180deg)",end:"rotatey(0deg)"}},d("turningPage",{directions:m,init:function(e,t,n){p.prototype.init.call(this,e,t),this._container=n},prepare:function(e,t){var n=this,i=n._reverse,r=i?he[n._direction].reverse:n._direction,o=b[r];e.zIndex=1,n._clipInHalf&&(e.clip=u(n._container,C.directions[r].reverse)),e[le]=Z,t[se]=ue+(i?o.start:o.end),e[se]=ue+(i?o.end:o.start)},setup:function(){this._container.append(this.element)},face:function(e){return this._face=e,this},shouldHide:function(){var e=this,t=e._reverse,n=e._face;return t&&!n||!t&&n},clipInHalf:function(e){return this._clipInHalf=e,this},temporary:function(){return this.element.addClass("temp-page"),this}}),d("staticPage",{directions:m,init:function(e,t,n){p.prototype.init.call(this,e,t),this._container=n},restore:["clip"],prepare:function(e,t){var n=this,i=n._reverse?he[n._direction].reverse:n._direction;e.clip=u(n._container,i),e.opacity=.999,t.opacity=1},shouldHide:function(){var e=this,t=e._reverse,n=e._face;return t&&!n||!t&&n},face:function(e){return this._face=e,this}}),d("pageturn",{directions:["horizontal","vertical"],init:function(e,t,n,i){p.prototype.init.call(this,e,t),this.options={},this.options.face=n,this.options.back=i},children:function(){var e,t=this,n=t.options,i="horizontal"===t._direction?"left":"top",r=C.directions[i].reverse,o=t._reverse,a=n.face.clone(!0).removeAttr("id"),s=n.back.clone(!0).removeAttr("id"),l=t.element;return o&&(e=i,i=r,r=e),[C.fx(n.face).staticPage(i,l).face(!0).setReverse(o),C.fx(n.back).staticPage(r,l).setReverse(o),C.fx(a).turningPage(i,l).face(!0).clipInHalf(!0).temporary().setReverse(o),C.fx(s).turningPage(r,l).clipInHalf(!0).temporary().setReverse(o)]},prepare:function(e,t){e[de]=ce,e.transformStyle="preserve-3d",e.opacity=.999,t.opacity=1},teardown:function(){this.element.find(".temp-page").remove()}}),d("flip",{directions:["horizontal","vertical"],init:function(e,t,n,i){p.prototype.init.call(this,e,t),this.options={},this.options.face=n,this.options.back=i},children:function(){var e,t=this,n=t.options,i="horizontal"===t._direction?"left":"top",r=C.directions[i].reverse,o=t._reverse,a=t.element;return o&&(e=i,i=r,r=e),[C.fx(n.face).turningPage(i,a).face(!0).setReverse(o),C.fx(n.back).turningPage(r,a).setReverse(o)]},prepare:function(e){e[de]=ce,e.transformStyle="preserve-3d"}}),k=!F.mobileOS.android,w=".km-touch-scrollbar, .km-actionsheet-wrapper",d("replace",{_before:e.noop,_after:e.noop,init:function(t,n,i){p.prototype.init.call(this,t),this._previous=e(n),this._transitionClass=i},duration:function(){throw Error("The replace effect does not support duration setting; the effect duration may be customized through the transition class rule")},beforeTransition:function(e){return this._before=e,this},afterTransition:function(e){return this._after=e,this},_both:function(){return e().add(this._element).add(this._previous)},_containerClass:function(){var e=this._direction,t="k-fx k-fx-start k-fx-"+this._transitionClass;return e&&(t+=" k-fx-"+e),this._reverse&&(t+=" k-fx-reverse"),t},complete:function(t){if(!(!this.deferred||t&&e(t.target).is(w))){var n=this.container;n.removeClass("k-fx-end").removeClass(this._containerClass()).off(A.event,this.completeProxy),this._previous.hide().removeClass("k-fx-current"),this.element.removeClass("k-fx-next"),k&&n.css(ne,""),this.isAbsolute||this._both().css(re,""),this.deferred.resolve(),delete this.deferred}},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var t,n=this,i=n.element,r=n._previous,o=i.parents().filter(r.parents()).first(),a=n._both(),s=e.Deferred(),l=i.css(re);return o.length||(o=i.parent()),this.container=o,this.deferred=s,this.isAbsolute="absolute"==l,this.isAbsolute||a.css(re,"absolute"),k&&(t=o.css(ne),o.css(ne,"hidden")),A?(i.addClass("k-fx-hidden"),o.addClass(this._containerClass()),this.completeProxy=e.proxy(this,"complete"),o.on(A.event,this.completeProxy),C.animationFrame(function(){i.removeClass("k-fx-hidden").addClass("k-fx-next"),r.css("display","").addClass("k-fx-current"),n._before(r,i),C.animationFrame(function(){o.removeClass("k-fx-start").addClass("k-fx-end"),n._after(r,i)})})):this.complete(),s.promise()},stop:function(){this.complete()}}),y=C.Class.extend({init:function(){var e=this;e._tickProxy=E(e._tick,e),e._started=!1},tick:e.noop,done:e.noop,onEnd:e.noop,onCancel:e.noop,start:function(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,C.animationFrame(this._tickProxy)))},enabled:function(){return!0},cancel:function(){this._started=!1,this.onCancel()},_tick:function(){var e=this;e._started&&(e.tick(),e.done()?(e._started=!1,e.onEnd()):C.animationFrame(e._tickProxy))}}),x=y.extend({init:function(e){var t=this;D(t,e),y.fn.init.call(t)},done:function(){return this.timePassed()>=this.duration},timePassed:function(){return Math.min(this.duration,new Date-this.startDate)},moveTo:function(e){var t=this,n=t.movable;t.initial=n[t.axis],t.delta=e.location-t.initial,t.duration="number"==typeof e.duration?e.duration:300,t.tick=t._easeProxy(e.ease),t.startDate=new Date,t.start()},_easeProxy:function(e){var t=this;return function(){t.movable.moveAxis(t.axis,e(t.timePassed(),t.initial,t.delta,t.duration))}}}),D(x,{easeOutExpo:function(e,t,n,i){return e==i?t+n:n*(-Math.pow(2,-10*e/i)+1)+t},easeOutBack:function(e,t,n,i,r){return r=1.70158,n*((e=e/i-1)*e*((r+1)*e+r)+1)+t}}),T.Animation=y,T.Transition=x,T.createEffect=d,T.box=function(t){t=e(t);var n=t.offset();return n.width=C._outerWidth(t),n.height=C._outerHeight(t),n},T.transformOrigin=function(e,t){var n=(e.left-t.left)*t.width/(t.width-e.width),i=(e.top-t.top)*t.height/(t.height-e.height);return{x:isNaN(n)?0:n,y:isNaN(i)?0:i}},T.fillScale=function(e,t){return Math.min(e.width/t.width,e.height/t.height)},T.fitScale=function(e,t){return Math.max(e.width/t.width,e.height/t.height)}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.view.min",["kendo.core.min","kendo.binder.min","kendo.fx.min"],e)}(function(){return function(e,t){function n(e){if(!e)return{};var t=e.match(_)||[];return{type:t[1],direction:t[3],reverse:"reverse"===t[5]}}var i=window.kendo,r=i.Observable,o="SCRIPT",a="init",s="show",l="hide",d="transitionStart",c="transitionEnd",u="attach",h="detach",f=/unrecognized expression/,p=r.extend({init:function(e,t){var n=this;t=t||{},r.fn.init.call(n),n.content=e,n.id=i.guid(),n.tagName=t.tagName||"div",n.model=t.model,n._wrap=t.wrap!==!1,this._evalTemplate=t.evalTemplate||!1,n._fragments={},n.bind([a,s,l,d,c],t)},render:function(t){var n=this,r=!n.element;return r&&(n.element=n._createElement()),t&&e(t).append(n.element),r&&(i.bind(n.element,n.model),n.trigger(a)),t&&(n._eachFragment(u),n.trigger(s)),n.element},clone:function(){return new m(this)},triggerBeforeShow:function(){return!0},triggerBeforeHide:function(){return!0},showStart:function(){this.element.css("display","")},showEnd:function(){},hideEnd:function(){this.hide()},beforeTransition:function(e){this.trigger(d,{type:e})},afterTransition:function(e){this.trigger(c,{type:e})},hide:function(){this._eachFragment(h),this.element.detach(),this.trigger(l)},destroy:function(){var e=this.element;e&&(i.unbind(e),i.destroy(e),e.remove())},fragments:function(t){e.extend(this._fragments,t)},_eachFragment:function(e){for(var t in this._fragments)this._fragments[t][e](this,t)},_createElement:function(){var t,n,r,a=this,s="<"+a.tagName+" />";try{n=e(document.getElementById(a.content)||a.content),n[0].tagName===o&&(n=n.html())}catch(l){f.test(l.message)&&(n=a.content)}return"string"==typeof n?(n=n.replace(/^\s+|\s+$/g,""),a._evalTemplate&&(n=i.template(n)(a.model||{})),t=e(s).append(n),a._wrap||(t=t.contents())):(t=n,a._evalTemplate&&(r=e(i.template(e("<div />").append(t.clone(!0)).html())(a.model||{})),e.contains(document,t[0])&&t.replaceWith(r),t=r),a._wrap&&(t=t.wrapAll(s).parent())),t}}),m=i.Class.extend({init:function(t){e.extend(this,{element:t.element.clone(!0),transition:t.transition,id:t.id}),t.element.parent().append(this.element)},hideEnd:function(){this.element.remove()},beforeTransition:e.noop,afterTransition:e.noop}),g=p.extend({init:function(e,t){p.fn.init.call(this,e,t),this.containers={}},container:function(e){var t=this.containers[e];return t||(t=this._createContainer(e),this.containers[e]=t),t},showIn:function(e,t,n){this.container(e).show(t,n)},_createContainer:function(e){var t,n=this.render(),i=n.find(e);if(!i.length&&n.is(e)){if(!n.is(e))throw Error("can't find a container with the specified "+e+" selector");i=n}return t=new b(i),t.bind("accepted",function(e){e.view.render(i)}),t}}),v=p.extend({attach:function(e,t){e.element.find(t).replaceWith(this.render())},detach:function(){}}),_=/^(\w+)(:(\w+))?( (\w+))?$/,b=r.extend({init:function(e){r.fn.init.call(this),this.container=e,this.history=[],this.view=null,this.running=!1},after:function(){this.running=!1,this.trigger("complete",{view:this.view}),this.trigger("after")},end:function(){this.view.showEnd(),this.previous.hideEnd(),this.after()},show:function(e,t,r){if(!e.triggerBeforeShow()||this.view&&!this.view.triggerBeforeHide())return this.trigger("after"),!1;r=r||e.id;var o=this,a=e===o.view?e.clone():o.view,s=o.history,l=s[s.length-2]||{},d=l.id===r,c=t||(d?s[s.length-1].transition:e.transition),u=n(c);return o.running&&o.effect.stop(),"none"===c&&(c=null),o.trigger("accepted",{view:e}),o.view=e,o.previous=a,o.running=!0,d?s.pop():s.push({id:r,transition:c}),a?(c&&i.effects.enabled?(e.element.addClass("k-fx-hidden"),e.showStart(),d&&!t&&(u.reverse=!u.reverse),o.effect=i.fx(e.element).replace(a.element,u.type).beforeTransition(function(){e.beforeTransition("show"),a.beforeTransition("hide")}).afterTransition(function(){e.afterTransition("show"),a.afterTransition("hide")}).direction(u.direction).setReverse(u.reverse),o.effect.run().then(function(){o.end()})):(e.showStart(),o.end()),!0):(e.showStart(),e.showEnd(),o.after(),!0)}});i.ViewContainer=b,i.Fragment=v,i.Layout=g,i.View=p,i.ViewClone=m}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.dom.min",["kendo.core.min"],e)}(function(){return function(e){function t(){this.node=null}function n(){}function i(e,t,n){this.nodeName=e,this.attr=t||{},this.children=n||[]}function r(e){this.nodeValue=e}function o(e){this.html=e}function a(e,t){for(h.innerHTML=t;h.firstChild;)e.appendChild(h.firstChild)}function s(e){return new o(e)}function l(e,t,n){return new i(e,t,n)}function d(e){return new r(e)}function c(e){this.root=e,this.children=[]}var u,h;t.prototype={remove:function(){this.node.parentNode.removeChild(this.node),this.attr={}},attr:{},text:function(){return""}},n.prototype={nodeName:"#null",attr:{style:{}},children:[],remove:function(){}},u=new n,i.prototype=new t,i.prototype.appendTo=function(e){var t,n=document.createElement(this.nodeName),i=this.children;for(t=0;t<i.length;t++)i[t].render(n,u);return e.appendChild(n),n},i.prototype.render=function(e,t){var n,i,r,o,a,s;if(t.nodeName!==this.nodeName)t.remove(),n=this.appendTo(e);else{if(n=t.node,r=this.children,o=r.length,a=t.children,s=a.length,Math.abs(s-o)>2)return void this.render({appendChild:function(n){e.replaceChild(n,t.node)}},u);for(i=0;i<o;i++)r[i].render(n,a[i]||u);for(i=o;i<s;i++)a[i].remove()}this.node=n,this.syncAttributes(t.attr),this.removeAttributes(t.attr)},i.prototype.syncAttributes=function(e){var t,n,i,r=this.attr;for(t in r)n=r[t],i=e[t],"style"===t?this.setStyle(n,i):n!==i&&this.setAttribute(t,n,i);
},i.prototype.setStyle=function(e,t){var n,i=this.node;if(t)for(n in e)e[n]!==t[n]&&(i.style[n]=e[n]);else for(n in e)i.style[n]=e[n]},i.prototype.removeStyle=function(e){var t,n=this.attr.style||{},i=this.node;for(t in e)void 0===n[t]&&(i.style[t]="")},i.prototype.removeAttributes=function(e){var t,n=this.attr;for(t in e)"style"===t?this.removeStyle(e.style):void 0===n[t]&&this.removeAttribute(t)},i.prototype.removeAttribute=function(e){var t=this.node;"style"===e?t.style.cssText="":"className"===e?t.className="":t.removeAttribute(e)},i.prototype.setAttribute=function(e,t){var n=this.node;void 0!==n[e]?n[e]=t:n.setAttribute(e,t)},i.prototype.text=function(){var e,t="";for(e=0;e<this.children.length;++e)t+=this.children[e].text();return t},r.prototype=new t,r.prototype.nodeName="#text",r.prototype.render=function(e,t){var n;t.nodeName!==this.nodeName?(t.remove(),n=document.createTextNode(this.nodeValue),e.appendChild(n)):(n=t.node,this.nodeValue!==t.nodeValue&&(n.nodeValue=this.nodeValue)),this.node=n},r.prototype.text=function(){return this.nodeValue},o.prototype={nodeName:"#html",attr:{},remove:function(){for(var e=0;e<this.nodes.length;e++)this.nodes[e].parentNode.removeChild(this.nodes[e])},render:function(e,t){var n,i;if(t.nodeName!==this.nodeName||t.html!==this.html)for(t.remove(),n=e.lastChild,a(e,this.html),this.nodes=[],i=n?n.nextSibling:e.firstChild;i;i=i.nextSibling)this.nodes.push(i);else this.nodes=t.nodes.slice(0)}},h=document.createElement("div"),c.prototype={html:s,element:l,text:d,render:function(e){var t,n,i=this.children;for(t=0,n=e.length;t<n;t++)e[t].render(this.root,i[t]||u);for(t=n;t<i.length;t++)i[t].remove();this.children=e}},e.dom={html:s,text:d,element:l,Tree:c,Node:t}}(window.kendo),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.ooxml.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(e){var t=Math.floor(e/26)-1;return(t>=0?n(t):"")+String.fromCharCode(65+e%26)}function i(e,t){return n(t)+(e+1)}function r(e,t){return n(t)+"$"+(e+1)}function o(e){var t=e.frozenRows||(e.freezePane||{}).rowSplit||1;return t-1}function a(e){return(e/7*100+.5)/100}function s(e){return.75*e}function l(e){return(e+"").replace(/[\x00-\x08]/g,"").replace(/\n/g,"\r\n")}function d(e){return e.length<6&&(e=e.replace(/(\w)/g,function(e,t){return t+t})),e=e.substring(1).toUpperCase(),e.length<8&&(e="FF"+e),e}function c(e){var t="thin";return 2===e?t="medium":3===e&&(t="thick"),t}function u(e,t){var n="";return t&&(n+="<"+e+' style="'+c(t.size)+'">',t.color&&(n+='<color rgb="'+d(t.color)+'"/>'),n+="</"+e+">"),n}function h(e){return"<border>"+u("left",e.left)+u("right",e.right)+u("top",e.top)+u("bottom",e.bottom)+"</border>"}function f(e,t){var n,i,r,o=[],a=[];for(p(e,function(e,t){var n={_source:e,index:t,height:e.height,cells:[]};o.push(n),a[t]=n}),n=m(o).slice(0),i={rowData:o,rowsByIndex:a,mergedCells:t},r=0;r<n.length;r++)g(n[r],i),delete n[r]._source;return m(o)}function p(e,t){var n,i,r;for(n=0;n<e.length;n++)i=e[n],i&&(r=i.index,"number"!=typeof r&&(r=n),t(i,r))}function m(e){return e.sort(function(e,t){return e.index-t.index})}function g(e,t){var n,r,o,a,s,l,d,c=e._source,u=e.index,h=c.cells,f=e.cells;if(h)for(n=0;n<h.length;n++)if(r=h[n]||H,o=r.rowSpan||1,a=r.colSpan||1,s=v(f,r),k(r,f,s,a),(o>1||a>1)&&t.mergedCells.push(i(u,s)+":"+i(u+o-1,s+a-1)),o>1)for(l=u+1;l<u+o;l++)d=t.rowsByIndex[l],d||(d=t.rowsByIndex[l]={index:l,cells:[]},t.rowData.push(d)),k(r,d.cells,s-1,a+1)}function v(e,t){var n;return"number"==typeof t.index?(n=t.index,_(e,t,t.index)):n=b(e,t),n}function _(e,t,n){e[n]=t}function b(e,t){var n,i=e.length;for(n=0;n<e.length+1;n++)if(!e[n]){e[n]=t,i=n;break}return i}function k(e,t,n,i){var r,o;for(r=1;r<i;r++)o={borderTop:e.borderTop,borderRight:e.borderRight,borderBottom:e.borderBottom,borderLeft:e.borderLeft},_(t,o,n+r)}var w='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',y=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${creator}</dc:creator><cp:lastModifiedBy>${lastModifiedBy}</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">${created}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${modified}</dcterms:modified></cp:coreProperties>'),x=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>${sheets.length}</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="${sheets.length}" baseType="lpstr"># for (var idx = 0; idx < sheets.length; idx++) { ## if (sheets[idx].options.title) { #<vt:lpstr>${sheets[idx].options.title}</vt:lpstr># } else { #<vt:lpstr>Sheet${idx+1}</vt:lpstr># } ## } #</vt:vector></TitlesOfParts><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>14.0300</AppVersion></Properties>'),C=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/># for (var idx = 1; idx <= count; idx++) { #<Override PartName="/xl/worksheets/sheet${idx}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /># } #<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /></Types>'),T=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303" /><workbookPr defaultThemeVersion="124226" /><bookViews><workbookView xWindow="240" yWindow="45" windowWidth="18195" windowHeight="7995" /></bookViews><sheets># for (var idx = 0; idx < sheets.length; idx++) { ## var options = sheets[idx].options; ## var name = options.name || options.title ## if (name) { #<sheet name="${name}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } else { #<sheet name="Sheet${idx+1}" sheetId="${idx+1}" r:id="rId${idx+1}" /># } ## } #</sheets># if (filterNames.length || userNames.length) { #<definedNames> # for (var di = 0; di < filterNames.length; di++) { #<definedName name="_xlnm._FilterDatabase" hidden="1" localSheetId="${filterNames[di].localSheetId}">${filterNames[di].name}!$${filterNames[di].from}:$${filterNames[di].to}</definedName> # } # # for (var i = 0; i < userNames.length; ++i) { #<definedName name="${userNames[i].name}" hidden="${userNames[i].hidden ? 1 : 0}" # if (userNames[i].localSheetId != null) { # localSheetId="${userNames[i].localSheetId}" # } #>${userNames[i].value}</definedName> # } #</definedNames># } #<calcPr fullCalcOnLoad="1" calcId="145621" /></workbook>'),S=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac"><dimension ref="A1" /><sheetViews><sheetView #if(index==0) {# tabSelected="1" #}# workbookViewId="0" #if (showGridLines === false) {# showGridLines="0" #}#># if (frozenRows || frozenColumns) { #<pane state="frozen"# if (frozenColumns) { # xSplit="${frozenColumns}"# } ## if (frozenRows) { # ySplit="${frozenRows}"# } # topLeftCell="${String.fromCharCode(65 + (frozenColumns || 0))}${(frozenRows || 0)+1}"/># } #</sheetView></sheetViews><sheetFormatPr x14ac:dyDescent="0.25" defaultRowHeight="#= defaults.rowHeight ? defaults.rowHeight * 0.75 : 15 #" # if (defaults.columnWidth) { # defaultColWidth="#= kendo.ooxml.toWidth(defaults.columnWidth) #" # } # /># if (columns && columns.length > 0) { #<cols># for (var ci = 0; ci < columns.length; ci++) { ## var column = columns[ci]; ## var columnIndex = typeof column.index === "number" ? column.index + 1 : (ci + 1); ## if (column.width === 0) { #<col min="${columnIndex}" max="${columnIndex}" hidden="1" customWidth="1" /># } else if (column.width) { #<col min="${columnIndex}" max="${columnIndex}" customWidth="1"# if (column.autoWidth) { # width="${((column.width*7+5)/7*256)/256}" bestFit="1"# } else { # width="#= kendo.ooxml.toWidth(column.width) #" # } #/># } ## } #</cols># } #<sheetData># for (var ri = 0; ri < data.length; ri++) { ## var row = data[ri]; ## var rowIndex = typeof row.index === "number" ? row.index + 1 : (ri + 1); #<row r="${rowIndex}" x14ac:dyDescent="0.25" # if (row.height) { # ht="#= kendo.ooxml.toHeight(row.height) #" customHeight="1" # } # ># for (var ci = 0; ci < row.data.length; ci++) { ## var cell = row.data[ci];#<c r="#=cell.ref#"# if (cell.style) { # s="#=cell.style#" # } ## if (cell.type) { # t="#=cell.type#"# } #># if (cell.formula != null) { #<f>${cell.formula}</f># } ## if (cell.value != null) { #<v>${cell.value}</v># } #</c># } #</row># } #</sheetData># if (hyperlinks.length) { #<hyperlinks># for (var hi = 0; hi < hyperlinks.length; hi++) { #<hyperlink ref="${hyperlinks[hi].ref}" r:id="rId${hi}"/># } #</hyperlinks># } ## if (filter) { #<autoFilter ref="${filter.from}:${filter.to}"/># } ## if (mergeCells.length) { #<mergeCells count="${mergeCells.length}"># for (var ci = 0; ci < mergeCells.length; ci++) { #<mergeCell ref="${mergeCells[ci]}"/># } #</mergeCells># } #<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" /></worksheet>'),D=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"># for (var idx = 1; idx <= count; idx++) { #<Relationship Id="rId${idx}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${idx}.xml" /># } #<Relationship Id="rId${count+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" /><Relationship Id="rId${count+2}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" /></Relationships>'),E=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"># for (var i = 0; i < hyperlinks.length; i++) { #<Relationship Id="rId${i}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="${hyperlinks[i].target}" TargetMode="External" /># } #</Relationships>'),F=t.template('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${count}" uniqueCount="${uniqueCount}"># for (var index in indexes) { #<si><t>${index.substring(1)}</t></si># } #</sst>'),R=t.template('<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="${formats.length}"># for (var fi = 0; fi < formats.length; fi++) { ## var format = formats[fi]; #<numFmt formatCode="${format.format}" numFmtId="${165+fi}" /># } #</numFmts><fonts count="${fonts.length+1}" x14ac:knownFonts="1"><font><sz val="11" /><color theme="1" /><name val="Calibri" /><family val="2" /><scheme val="minor" /></font># for (var fi = 0; fi < fonts.length; fi++) { ## var font = fonts[fi]; #<font># if (font.fontSize) { #<sz val="${font.fontSize}" /># } else { #<sz val="11" /># } ## if (font.bold) { #<b/># } ## if (font.italic) { #<i/># } ## if (font.underline) { #<u/># } ## if (font.color) { #<color rgb="${font.color}" /># } else { #<color theme="1" /># } ## if (font.fontFamily) { #<name val="${font.fontFamily}" /><family val="2" /># } else { #<name val="Calibri" /><family val="2" /><scheme val="minor" /># } #</font># } #</fonts><fills count="${fills.length+2}"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill># for (var fi = 0; fi < fills.length; fi++) { ## var fill = fills[fi]; ## if (fill.background) { #<fill><patternFill patternType="solid"><fgColor rgb="${fill.background}"/></patternFill></fill># } ## } #</fills><borders count="${borders.length+1}"><border><left/><right/><top/><bottom/><diagonal/></border># for (var bi = 0; bi < borders.length; bi++) { ##= kendo.ooxml.borderTemplate(borders[bi]) ## } #</borders><cellStyleXfs count="1"><xf borderId="0" fillId="0" fontId="0" /></cellStyleXfs><cellXfs count="${styles.length+1}"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/># for (var si = 0; si < styles.length; si++) { ## var style = styles[si]; #<xf xfId="0"# if (style.fontId) { # fontId="${style.fontId}" applyFont="1"# } ## if (style.fillId) { # fillId="${style.fillId}" applyFill="1"# } ## if (style.numFmtId) { # numFmtId="${style.numFmtId}" applyNumberFormat="1"# } ## if (style.textAlign || style.verticalAlign || style.wrap) { # applyAlignment="1"# } ## if (style.borderId) { # borderId="${style.borderId}" applyBorder="1"# } #># if (style.textAlign || style.verticalAlign || style.wrap) { #<alignment# if (style.textAlign) { # horizontal="${style.textAlign}"# } ## if (style.verticalAlign) { # vertical="${style.verticalAlign}"# } ## if (style.wrap) { # wrapText="1"# } #/># } #</xf># } #</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleMedium9" /></styleSheet>'),I=new Date(1900,0,0),A=t.Class.extend({init:function(e,t,n,i){this.options=e,this._strings=t,this._styles=n,this._borders=i},relsToXML:function(){var e=this.options.hyperlinks||[];return e.length?E({hyperlinks:e}):""},toXML:function(e){var t,n,r=this.options.mergedCells||[],a=this.options.rows||[],s=f(a,r);return this._readCells(s),t=this.options.filter,t&&"number"==typeof t.from&&"number"==typeof t.to&&(t={from:i(o(this.options),t.from),to:i(o(this.options),t.to)}),n=this.options.freezePane||{},S({frozenColumns:this.options.frozenColumns||n.colSplit,frozenRows:this.options.frozenRows||n.rowSplit,columns:this.options.columns,defaults:this.options.defaults||{},data:s,index:e,mergeCells:r,filter:t,showGridLines:this.options.showGridLines,hyperlinks:this.options.hyperlinks||[]})},_lookupString:function(e){var t="$"+e,n=this._strings.indexes[t];return void 0!==n?e=n:(e=this._strings.indexes[t]=this._strings.uniqueCount,this._strings.uniqueCount++),this._strings.count++,e},_lookupStyle:function(n){var i,r=t.stringify(n);return"{}"==r?0:(i=e.inArray(r,this._styles),i<0&&(i=this._styles.push(r)-1),i+1)},_lookupBorder:function(n){var i,r=t.stringify(n);if("{}"!=r)return i=e.inArray(r,this._borders),i<0&&(i=this._borders.push(r)-1),i+1},_readCells:function(e){var t,n,i,r,o;for(t=0;t<e.length;t++)for(n=e[t],i=n.cells,n.data=[],r=0;r<i.length;r++)o=this._cell(i[r],n.index,r),o&&n.data.push(o)},_cell:function(e,n,r){var o,a,s,d,c,u,h,f;return e&&e!==H?(o=e.value,a={},e.borderLeft&&(a.left=e.borderLeft),e.borderRight&&(a.right=e.borderRight),e.borderTop&&(a.top=e.borderTop),e.borderBottom&&(a.bottom=e.borderBottom),a=this._lookupBorder(a),s={bold:e.bold,color:e.color,background:e.background,italic:e.italic,underline:e.underline,fontFamily:e.fontFamily||e.fontName,fontSize:e.fontSize,format:e.format,textAlign:e.textAlign||e.hAlign,verticalAlign:e.verticalAlign||e.vAlign,wrap:e.wrap,borderId:a},d=this.options.columns||[],c=d[r],u=typeof o,c&&c.autoWidth&&(h=o,"number"===u&&(h=t.toString(o,e.format)),c.width=Math.max(c.width||0,(h+"").length)),"string"===u?(o=l(o),o=this._lookupString(o),u="s"):"number"===u?u="n":"boolean"===u?(u="b",o=+o):o&&o.getTime?(u=null,f=(o.getTimezoneOffset()-I.getTimezoneOffset())*t.date.MS_PER_MINUTE,o=(o-I-f)/t.date.MS_PER_DAY+1,s.format||(s.format="mm-dd-yy")):(u=null,o=null),s=this._lookupStyle(s),{value:o,formula:e.formula,type:u,style:s,ref:i(n,r)}):null}}),M={General:0,0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"[$-404]e/m/d":27,"m/d/yy":30,t0:59,"t0.00":60,"t#,##0":61,"t#,##0.00":62,"t0%":67,"t0.00%":68,"t# ?/?":69,"t# ??/??":70},z=t.Class.extend({init:function(t){this.options=t||{},this._strings={indexes:{},count:0,uniqueCount:0},this._styles=[],this._borders=[],this._sheets=e.map(this.options.sheets||[],e.proxy(function(e){return e.defaults=this.options,new A(e,this._strings,this._styles,this._borders)},this))},toDataURL:function(){var n,i,a,s,l,c,u,h,f,p,m,g,v,_,b,k,S,E,I;if("undefined"==typeof JSZip)throw Error("JSZip not found. Check http://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements for more details.");for(n=new JSZip,i=n.folder("docProps"),i.file("core.xml",y({creator:this.options.creator||"Kendo UI",lastModifiedBy:this.options.creator||"Kendo UI",created:this.options.date||(new Date).toJSON(),modified:this.options.date||(new Date).toJSON()})),a=this._sheets.length,i.file("app.xml",x({sheets:this._sheets})),s=n.folder("_rels"),s.file(".rels",w),l=n.folder("xl"),c=l.folder("_rels"),c.file("workbook.xml.rels",D({count:a})),u={},l.file("workbook.xml",T({sheets:this._sheets,filterNames:e.map(this._sheets,function(e,t){var n,i=e.options,a=i.name||i.title||"Sheet"+(t+1);if(u[a.toLowerCase()]=t,n=i.filter,n&&void 0!==n.from&&void 0!==n.to)return{localSheetId:t,name:a,from:r(o(i),n.from),to:r(o(i),n.to)}}),userNames:e.map(this.options.names||[],function(e){return{name:e.localName,localSheetId:e.sheet?u[e.sheet.toLowerCase()]:null,value:e.value,hidden:e.hidden}})})),h=l.folder("worksheets"),f=h.folder("_rels"),p=0;p<a;p++)m=this._sheets[p],g=t.format("sheet{0}.xml",p+1),v=m.relsToXML(),v&&f.file(g+".rels",v),h.file(g,m.toXML(p));return _=e.map(this._borders,e.parseJSON),b=e.map(this._styles,e.parseJSON),k=function(e){return e.underline||e.bold||e.italic||e.color||e.fontFamily||e.fontSize},S=e.map(b,function(e){if(e.color&&(e.color=d(e.color)),k(e))return e}),E=e.map(b,function(e){if(e.format&&void 0===M[e.format])return e}),I=e.map(b,function(e){if(e.background)return e.background=d(e.background),e}),l.file("styles.xml",R({fonts:S,fills:I,formats:E,borders:_,styles:e.map(b,function(t){var n={};return k(t)&&(n.fontId=e.inArray(t,S)+1),t.background&&(n.fillId=e.inArray(t,I)+2),n.textAlign=t.textAlign,n.verticalAlign=t.verticalAlign,n.wrap=t.wrap,n.borderId=t.borderId,t.format&&(n.numFmtId=void 0!==M[t.format]?M[t.format]:165+e.inArray(t,E)),n})})),l.file("sharedStrings.xml",F(this._strings)),n.file("[Content_Types].xml",C({count:a})),"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+n.generate({compression:"DEFLATE"})}}),H={};t.ooxml={Workbook:z,Worksheet:A,toWidth:a,toHeight:s,borderTemplate:h}}(kendo.jQuery,kendo),kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.excel.min",["kendo.core.min","kendo.data.min","kendo.ooxml.min"],e)}(function(){return function(e,t){t.ExcelExporter=t.Class.extend({init:function(n){var i,r,o;n.columns=this._trimColumns(n.columns||[]),this.allColumns=e.map(this._leafColumns(n.columns||[]),this._prepareColumn),this.columns=e.grep(this.allColumns,function(e){return!e.hidden}),this.options=n,i=n.dataSource,i instanceof t.data.DataSource?(this.dataSource=new i.constructor(e.extend({},i.options,{page:n.allPages?0:i.page(),filter:i.filter(),pageSize:n.allPages?i.total():i.pageSize(),sort:i.sort(),group:i.group(),aggregate:i.aggregate()})),r=i.data(),r.length>0&&(this.dataSource._data=r,o=this.dataSource.transport,i._isServerGrouped()&&o.options&&o.options.data&&(o.options.data=null))):this.dataSource=t.data.DataSource.create(i)},_trimColumns:function(t){var n=this;return e.grep(t,function(e){var t=!!e.field;return!t&&e.columns&&(t=n._trimColumns(e.columns).length>0),t})},_leafColumns:function(e){var t,n=[];for(t=0;t<e.length;t++)e[t].columns?n=n.concat(this._leafColumns(e[t].columns)):n.push(e[t]);return n},workbook:function(){return e.Deferred(e.proxy(function(t){this.dataSource.fetch().then(e.proxy(function(){var e={sheets:[{columns:this._columns(),rows:this._rows(),freezePane:this._freezePane(),filter:this._filter()}]};t.resolve(e,this.dataSource.view())},this))},this)).promise()},_prepareColumn:function(n){var i,r;if(n.field)return i=function(e){return e.get(n.field)},r=null,n.values&&(r={},e.each(n.values,function(){r[this.value]=this.text}),i=function(e){return r[e.get(n.field)]}),e.extend({},n,{value:i,values:r,groupHeaderTemplate:t.template(n.groupHeaderTemplate||"#= title #: #= value #"),groupFooterTemplate:n.groupFooterTemplate?t.template(n.groupFooterTemplate):null,footerTemplate:n.footerTemplate?t.template(n.footerTemplate):null})},_filter:function(){if(!this.options.filterable)return null;var e=this._depth();return{from:e,to:e+this.columns.length-1}},_dataRow:function(t,n,i){var r,o,a,s,l,d,c,u,h,f;for(this._hierarchical()&&(n=this.dataSource.level(t)+1),r=[],o=0;o<n;o++)r[o]={background:"#dfdfdf",color:"#333"};if(i&&t.items)return a=e.grep(this.allColumns,function(e){return e.field==t.field})[0],s=a&&a.title?a.title:t.field,l=a?a.groupHeaderTemplate:null,d=s+": "+t.value,c=e.extend({title:s,field:t.field,value:a&&a.values?a.values[t.value]:t.value,aggregates:t.aggregates},t.aggregates[t.field]),l&&(d=l(c)),r.push({value:d,background:"#dfdfdf",color:"#333",colSpan:this.columns.length+i-n}),u=this._dataRows(t.items,n+1),u.unshift({type:"group-header",cells:r}),u.concat(this._footer(t));for(h=[],f=0;f<this.columns.length;f++)h[f]=this._cell(t,this.columns[f]);return this._hierarchical()&&(h[0].colSpan=i-n+1),[{type:"data",cells:r.concat(h)}]},_dataRows:function(e,t){var n,i=this._depth(),r=[];for(n=0;n<e.length;n++)r.push.apply(r,this._dataRow(e[n],t,i));return r},_footer:function(t){var n=[],i=!1,r=e.map(this.columns,e.proxy(function(n){return n.groupFooterTemplate?(i=!0,{background:"#dfdfdf",color:"#333",value:n.groupFooterTemplate(e.extend({},this.dataSource.aggregates(),t.aggregates,t.aggregates[n.field]))}):{background:"#dfdfdf",color:"#333"}},this));return i&&n.push({type:"group-footer",cells:e.map(Array(this.dataSource.group().length),function(){return{background:"#dfdfdf",color:"#333"}}).concat(r)}),n},_isColumnVisible:function(e){return this._visibleColumns([e]).length>0&&(e.field||e.columns)},_visibleColumns:function(t){var n=this;return e.grep(t,function(e){var t=!e.hidden;return t&&e.columns&&(t=n._visibleColumns(e.columns).length>0),t})},_headerRow:function(t,n){var i=e.map(t.cells,function(e){return{background:"#7a7a7a",color:"#fff",value:e.title,colSpan:e.colSpan>1?e.colSpan:1,rowSpan:t.rowSpan>1&&!e.colSpan?t.rowSpan:1}});return this._hierarchical()&&(i[0].colSpan=this._depth()+1),{type:"header",cells:e.map(Array(n.length),function(){return{background:"#7a7a7a",color:"#fff"}}).concat(i)}},_prependHeaderRows:function(e){var t,n=this.dataSource.group(),i=[{rowSpan:1,cells:[],index:0}];for(this._prepareHeaderRows(i,this.options.columns),t=i.length-1;t>=0;t--)e.unshift(this._headerRow(i[t],n))},_prepareHeaderRows:function(e,t,n,i){var r,o,a,s=i||e[e.length-1],l=e[s.index+1],d=0;for(a=0;a<t.length;a++)r=t[a],this._isColumnVisible(r)&&(o={title:r.title||r.field,colSpan:0},s.cells.push(o),r.columns&&r.columns.length&&(l||(l={rowSpan:0,cells:[],index:e.length},e.push(l)),o.colSpan=this._trimColumns(this._visibleColumns(r.columns)).length,this._prepareHeaderRows(e,r.columns,o,l),d+=o.colSpan-1,s.rowSpan=e.length-s.index));n&&(n.colSpan+=d)},_rows:function(){var t,n,i=this.dataSource.group(),r=this._dataRows(this.dataSource.view(),0);return this.columns.length&&(this._prependHeaderRows(r),t=!1,n=e.map(this.columns,e.proxy(function(n){if(n.footerTemplate){t=!0;var i=this.dataSource.aggregates();return{background:"#dfdfdf",color:"#333",value:n.footerTemplate(e.extend({},i,i[n.field]))}}return{background:"#dfdfdf",color:"#333"}},this)),t&&r.push({type:"footer",cells:e.map(Array(i.length),function(){return{background:"#dfdfdf",color:"#333"}}).concat(n)})),r},_headerDepth:function(e){var t,n,i=1,r=0;for(t=0;t<e.length;t++)e[t].columns&&(n=this._headerDepth(e[t].columns),n>r&&(r=n));return i+r},_freezePane:function(){var t=this._visibleColumns(this.options.columns||[]),n=this._visibleColumns(this._trimColumns(this._leafColumns(e.grep(t,function(e){return e.locked})))).length;return{rowSplit:this._headerDepth(t),colSplit:n?n+this.dataSource.group().length:0}},_cell:function(e,t){return{value:t.value(e)}},_hierarchical:function(){return this.options.hierarchy&&this.dataSource.level},_depth:function(){var e,t,n,i=this.dataSource,r=0;if(this._hierarchical()){for(e=i.view(),t=0;t<e.length;t++)n=i.level(e[t]),n>r&&(r=n);r++}else r=i.group().length;return r},_columns:function(){var t=this._depth(),n=e.map(Array(t),function(){return{width:20}});return n.concat(e.map(this.columns,function(e){return{width:parseInt(e.width,10),autoWidth:!e.width}}))}}),t.ExcelMixin={extend:function(t){t.events.push("excelExport"),t.options.excel=e.extend(t.options.excel,this.options),t.saveAsExcel=this.saveAsExcel},options:{proxyURL:"",allPages:!1,filterable:!1,fileName:"Export.xlsx"},saveAsExcel:function(){var n=this.options.excel||{},i=new t.ExcelExporter({columns:this.columns,dataSource:this.dataSource,allPages:n.allPages,filterable:n.filterable,hierarchy:n.hierarchy});i.workbook().then(e.proxy(function(e,i){if(!this.trigger("excelExport",{workbook:e,data:i})){var r=new t.ooxml.Workbook(e);t.saveAs({dataURI:r.toDataURL(),fileName:e.fileName||n.fileName,proxyURL:n.proxyURL,forceProxy:n.forceProxy})}},this))}}}(kendo.jQuery,kendo),kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.data.signalr.min",["kendo.data.min"],e)}(function(){return function(e){var t=kendo.data.RemoteTransport.extend({init:function(e){var t,n=e&&e.signalr?e.signalr:{},i=n.promise;if(!i)throw Error('The "promise" option must be set.');if("function"!=typeof i.done||"function"!=typeof i.fail)throw Error('The "promise" option must be a Promise.');if(this.promise=i,t=n.hub,!t)throw Error('The "hub" option must be set.');if("function"!=typeof t.on||"function"!=typeof t.invoke)throw Error('The "hub" option is not a valid SignalR hub proxy.');this.hub=t,kendo.data.RemoteTransport.fn.init.call(this,e)},push:function(e){var t=this.options.signalr.client||{};t.create&&this.hub.on(t.create,e.pushCreate),t.update&&this.hub.on(t.update,e.pushUpdate),t.destroy&&this.hub.on(t.destroy,e.pushDestroy)},_crud:function(t,n){var i,r,o=this.hub,a=this.options.signalr.server;if(!a||!a[n])throw Error(kendo.format('The "server.{0}" option must be set.',n));i=[a[n]],r=this.parameterMap(t.data,n),e.isEmptyObject(r)||i.push(r),this.promise.done(function(){o.invoke.apply(o,i).done(t.success).fail(t.error)})},read:function(e){this._crud(e,"read")},create:function(e){this._crud(e,"create")},update:function(e){this._crud(e,"update")},destroy:function(e){this._crud(e,"destroy")}});e.extend(!0,kendo.data,{transports:{signalr:t}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.color.min",["kendo.core.min"],e)}(function(){!function(e,t,n){function i(e,r){var o,s;if(null==e||"none"==e)return null;if(e instanceof l)return e;if(e=e.toLowerCase(),o=a.exec(e))return e="transparent"==o[1]?new d(1,1,1,0):i(f.namedColors[o[1]],r),e.match=[o[1]],e;if((o=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(e))?s=new c(n(o[1],16),n(o[2],16),n(o[3],16),1):(o=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(e))?s=new c(n(o[1]+o[1],16),n(o[2]+o[2],16),n(o[3]+o[3],16),1):(o=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(e))?s=new c(n(o[1],10),n(o[2],10),n(o[3],10),1):(o=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(e))?s=new c(n(o[1],10),n(o[2],10),n(o[3],10),t(o[4])):(o=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(e))?s=new d(t(o[1])/100,t(o[2])/100,t(o[3])/100,1):(o=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(e))&&(s=new d(t(o[1])/100,t(o[2])/100,t(o[3])/100,t(o[4]))),s)s.match=o;else if(!r)throw Error("Cannot parse color: "+e);return s}function r(e,t,n){for(n||(n="0"),e=e.toString(16);t>e.length;)e="0"+e;return e}function o(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var a,s,l,d,c,u,h,f=function(e){var t,n,i,r,o,a=this,s=f.formats;if(1===arguments.length)for(e=a.resolveColor(e),r=0;r<s.length;r++)t=s[r].re,n=s[r].process,i=t.exec(e),i&&(o=n(i),a.r=o[0],a.g=o[1],a.b=o[2]);else a.r=arguments[0],a.g=arguments[1],a.b=arguments[2];a.r=a.normalizeByte(a.r),a.g=a.normalizeByte(a.g),a.b=a.normalizeByte(a.b)};f.prototype={toHex:function(){var e=this,t=e.padDigit,n=e.r.toString(16),i=e.g.toString(16),r=e.b.toString(16);return"#"+t(n)+t(i)+t(r)},resolveColor:function(e){return e=e||"black","#"==e.charAt(0)&&(e=e.substr(1,6)),e=e.replace(/ /g,""),e=e.toLowerCase(),e=f.namedColors[e]||e},normalizeByte:function(e){return e<0||isNaN(e)?0:e>255?255:e},padDigit:function(e){return 1===e.length?"0"+e:e},brightness:function(e){var t=this,n=Math.round;return t.r=n(t.normalizeByte(t.r*e)),t.g=n(t.normalizeByte(t.g*e)),t.b=n(t.normalizeByte(t.b*e)),t},percBrightness:function(){var e=this;return Math.sqrt(.241*e.r*e.r+.691*e.g*e.g+.068*e.b*e.b)}},f.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[n(e[1],10),n(e[2],10),n(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[n(e[1],16),n(e[2],16),n(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[n(e[1]+e[1],16),n(e[2]+e[2],16),n(e[3]+e[3],16)];
}}],f.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},a=["transparent"];for(s in f.namedColors)f.namedColors.hasOwnProperty(s)&&a.push(s);a=RegExp("^("+a.join("|")+")(\\W|$)","i"),l=kendo.Class.extend({toHSV:function(){return this},toRGB:function(){return this},toHex:function(){return this.toBytes().toHex()},toBytes:function(){return this},toCss:function(){return"#"+this.toHex()},toCssRgba:function(){var e=this.toBytes();return"rgba("+e.r+", "+e.g+", "+e.b+", "+t((+this.a).toFixed(3))+")"},toDisplay:function(){return kendo.support.browser.msie&&kendo.support.browser.version<9?this.toCss():this.toCssRgba()},equals:function(e){return e===this||null!==e&&this.toCssRgba()==i(e).toCssRgba()},diff:function(e){if(null==e)return NaN;var t=this.toBytes();return e=e.toBytes(),Math.sqrt(Math.pow(.3*(t.r-e.r),2)+Math.pow(.59*(t.g-e.g),2)+Math.pow(.11*(t.b-e.b),2))},clone:function(){var e=this.toBytes();return e===this&&(e=new c(e.r,e.g,e.b,e.a)),e}}),d=l.extend({init:function(e,t,n,i){this.r=e,this.g=t,this.b=n,this.a=i},toHSV:function(){var e,t,n=this.r,i=this.g,r=this.b,o=Math.min(n,i,r),a=Math.max(n,i,r),s=a,l=a-o;return 0===l?new u(0,0,s,this.a):(0!==a?(t=l/a,e=n==a?(i-r)/l:i==a?2+(r-n)/l:4+(n-i)/l,e*=60,e<0&&(e+=360)):(t=0,e=-1),new u(e,t,s,this.a))},toHSL:function(){var e,t,n,i=this.r,r=this.g,o=this.b,a=Math.max(i,r,o),s=Math.min(i,r,o),l=(a+s)/2;if(a==s)e=t=0;else{switch(n=a-s,t=l>.5?n/(2-a-s):n/(a+s),a){case i:e=(r-o)/n+(r<o?6:0);break;case r:e=(o-i)/n+2;break;case o:e=(i-r)/n+4}e*=60,t*=100,l*=100}return new h(e,t,l,this.a)},toBytes:function(){return new c(255*this.r,255*this.g,255*this.b,this.a)}}),c=d.extend({init:function(e,t,n,i){this.r=Math.round(e),this.g=Math.round(t),this.b=Math.round(n),this.a=i},toRGB:function(){return new d(this.r/255,this.g/255,this.b/255,this.a)},toHSV:function(){return this.toRGB().toHSV()},toHSL:function(){return this.toRGB().toHSL()},toHex:function(){return r(this.r,2)+r(this.g,2)+r(this.b,2)},toBytes:function(){return this}}),u=l.extend({init:function(e,t,n,i){this.h=e,this.s=t,this.v=n,this.a=i},toRGB:function(){var e,t,n,i,r,o,a,s,l=this.h,c=this.s,u=this.v;if(0===c)t=n=i=u;else switch(l/=60,e=Math.floor(l),r=l-e,o=u*(1-c),a=u*(1-c*r),s=u*(1-c*(1-r)),e){case 0:t=u,n=s,i=o;break;case 1:t=a,n=u,i=o;break;case 2:t=o,n=u,i=s;break;case 3:t=o,n=a,i=u;break;case 4:t=s,n=o,i=u;break;default:t=u,n=o,i=a}return new d(t,n,i,this.a)},toHSL:function(){return this.toRGB().toHSL()},toBytes:function(){return this.toRGB().toBytes()}}),h=l.extend({init:function(e,t,n,i){this.h=e,this.s=t,this.l=n,this.a=i},toRGB:function(){var e,t,n,i,r,a=this.h,s=this.s,l=this.l;return 0===s?e=t=n=l:(a/=360,s/=100,l/=100,i=l<.5?l*(1+s):l+s-l*s,r=2*l-i,e=o(r,i,a+1/3),t=o(r,i,a),n=o(r,i,a-1/3)),new d(e,t,n,this.a)},toHSV:function(){return this.toRGB().toHSV()},toBytes:function(){return this.toRGB().toBytes()}}),f.fromBytes=function(e,t,n,i){return new c(e,t,n,null!=i?i:1)},f.fromRGB=function(e,t,n,i){return new d(e,t,n,null!=i?i:1)},f.fromHSV=function(e,t,n,i){return new u(e,t,n,null!=i?i:1)},f.fromHSL=function(e,t,n,i){return new h(e,t,n,null!=i?i:1)},kendo.Color=f,kendo.parseColor=i}(window.kendo.jQuery,parseFloat,parseInt)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/main.min",["kendo.core.min"],e)}(function(){return function(){function e(e){return typeof e!==B}function t(e,t){var i=n(t);return M.round(e*i)/i}function n(e){return e?M.pow(10,e):1}function i(e,t,n){return M.max(M.min(e,n),t)}function r(e){return e*N}function o(e){return e/N}function a(e){return"number"==typeof e&&!isNaN(e)}function s(t,n){return e(t)?t:n}function l(e){return e*e}function d(e){var t,n=[];for(t in e)n.push(t+e[t]);return n.sort().join("")}function c(e){var t,n=2166136261;for(t=0;t<e.length;++t)n+=(n<<1)+(n<<4)+(n<<7)+(n<<8)+(n<<24),n^=e.charCodeAt(t);return n>>>0}function u(e){return c(d(e))}function h(e){var t,n=e.length,i=P,r=L;for(t=0;t<n;t++)r=M.max(r,e[t]),i=M.min(i,e[t]);return{min:i,max:r}}function f(e){return h(e).min}function p(e){return h(e).max}function m(e){return v(e).min}function g(e){return v(e).max}function v(e){var t,n,i,r=P,o=L;for(t=0,n=e.length;t<n;t++)i=e[t],null!==i&&isFinite(i)&&(r=M.min(r,i),o=M.max(o,i));return{min:r===P?void 0:r,max:o===L?void 0:o}}function _(e){if(e)return e[e.length-1]}function b(e,t){return e.push.apply(e,t),e}function k(e){return z.template(e,{useWithBlock:!1,paramName:"d"})}function w(t,n){return e(n)&&null!==n?" "+t+"='"+n+"' ":""}function y(e){var t,n="";for(t=0;t<e.length;t++)n+=w(e[t][0],e[t][1]);return n}function x(t){var n,i,r="";for(n=0;n<t.length;n++)i=t[n][1],e(i)&&(r+=t[n][0]+":"+i+";");if(""!==r)return r}function C(e){return"string"!=typeof e&&(e+="px"),e}function T(e){var t,n,i=[];if(e)for(t=z.toHyphens(e).split("-"),n=0;n<t.length;n++)i.push("k-pos-"+t[n]);return i.join(" ")}function S(t){return""===t||null===t||"none"===t||"transparent"===t||!e(t)}function D(e){for(var t={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"},n=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],i="";e>0;)e<n[0]?n.shift():(i+=t[n[0]],e-=n[0]);return i}function E(e){var t,n,i,r,o;for(e=e.toLowerCase(),t={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},n=0,i=0,r=0;r<e.length;++r){if(o=t[e.charAt(r)],!o)return null;n+=o,o>i&&(n-=2*i),i=o}return n}function F(e){var t=Object.create(null);return function(){var n,i="";for(n=arguments.length;--n>=0;)i+=":"+arguments[n];return i in t?t[i]:t[i]=e.apply(this,arguments)}}function R(e){for(var t,n,i=[],r=0,o=e.length;r<o;)t=e.charCodeAt(r++),t>=55296&&t<=56319&&r<o?(n=e.charCodeAt(r++),56320==(64512&n)?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),r--)):i.push(t);return i}function I(e){return e.map(function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}).join("")}function A(e,t){function n(e,n){for(var i=[],r=0,o=0,a=0;r<e.length&&o<n.length;)t(e[r],n[o])<=0?i[a++]=e[r++]:i[a++]=n[o++];return r<e.length&&i.push.apply(i,e.slice(r)),o<n.length&&i.push.apply(i,n.slice(o)),i}return e.length<2?e.slice():function i(e){var t,r,o;return e.length<=1?e:(t=Math.floor(e.length/2),r=e.slice(0,t),o=e.slice(t),r=i(r),o=i(o),n(r,o))}(e)}var M=Math,z=window.kendo,H=z.deepExtend,N=M.PI/180,P=Number.MAX_VALUE,L=-Number.MAX_VALUE,B="undefined",O=Date.now;O||(O=function(){return(new Date).getTime()}),H(z,{util:{MAX_NUM:P,MIN_NUM:L,append:b,arrayLimits:h,arrayMin:f,arrayMax:p,defined:e,deg:o,hashKey:c,hashObject:u,isNumber:a,isTransparent:S,last:_,limitValue:i,now:O,objectKey:d,round:t,rad:r,renderAttr:w,renderAllAttr:y,renderPos:T,renderSize:C,renderStyle:x,renderTemplate:k,sparseArrayLimits:v,sparseArrayMin:m,sparseArrayMax:g,sqr:l,valueOrDefault:s,romanToArabic:E,arabicToRoman:D,memoize:F,ucs2encode:I,ucs2decode:R,mergeSort:A}}),z.drawing.util=z.util,z.dataviz.util=z.util}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/text-metrics.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e){function t(){return{width:0,height:0,baseline:0}}function n(e,t,n){return u.current.measure(e,t,n)}function i(e,t){var n=[];if(e.length>0&&document.fonts){try{n=e.map(function(e){return document.fonts.load(e)})}catch(i){o.logToConsole(i)}Promise.all(n).then(t,t)}else t()}var r=document,o=window.kendo,a=o.Class,s=o.util,l=s.defined,d=a.extend({init:function(e){this._size=e,this._length=0,this._map={}},put:function(e,t){var n=this,i=n._map,r={key:e,value:t};i[e]=r,n._head?(n._tail.newer=r,r.older=n._tail,n._tail=r):n._head=n._tail=r,n._length>=n._size?(i[n._head.key]=null,n._head=n._head.newer,n._head.older=null):n._length++},get:function(e){var t=this,n=t._map[e];if(n)return n===t._head&&n!==t._tail&&(t._head=n.newer,t._head.older=null),n!==t._tail&&(n.older&&(n.older.newer=n.newer,n.newer.older=n.older),n.older=t._tail,n.newer=null,t._tail.newer=n,t._tail=n),n.value}}),c=e("<div style='position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;' />")[0],u=a.extend({init:function(e){this._cache=new d(1e3),this._initOptions(e)},options:{baselineMarkerSize:1},measure:function(n,i,o){var a,d,u,h,f,p,m,g;if(!n)return t();if(a=s.objectKey(i),d=s.hashKey(n+a),u=this._cache.get(d),u)return u;h=t(),f=o?o:c,p=this._baselineMarker().cloneNode(!1);for(m in i)g=i[m],l(g)&&(f.style[m]=g);return e(f).text(n),f.appendChild(p),r.body.appendChild(f),(n+"").length&&(h.width=f.offsetWidth-this.options.baselineMarkerSize,h.height=f.offsetHeight,h.baseline=p.offsetTop+this.options.baselineMarkerSize),h.width>0&&h.height>0&&this._cache.put(d,h),f.parentNode.removeChild(f),h},_baselineMarker:function(){return e("<div class='k-baseline-marker' style='display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;' />")[0]}});u.current=new u,o.util.TextMetrics=u,o.util.LRUCache=d,o.util.loadFonts=i,o.util.measureText=n}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/base64.min",["util/main.min"],e)}(function(){return function(){function e(e){var n,i,r,a,s,l,d,c="",u=0;for(e=t(e);u<e.length;)n=e.charCodeAt(u++),i=e.charCodeAt(u++),r=e.charCodeAt(u++),a=n>>2,s=(3&n)<<4|i>>4,l=(15&i)<<2|r>>6,d=63&r,isNaN(i)?l=d=64:isNaN(r)&&(d=64),c=c+o.charAt(a)+o.charAt(s)+o.charAt(l)+o.charAt(d);return c}function t(e){var t,n,i="";for(t=0;t<e.length;t++)n=e.charCodeAt(t),n<128?i+=r(n):n<2048?(i+=r(192|n>>>6),i+=r(128|63&n)):n<65536&&(i+=r(224|n>>>12),i+=r(128|n>>>6&63),i+=r(128|63&n));return i}var n=window.kendo,i=n.deepExtend,r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i(n.util,{encodeBase64:e,encodeUTF8:t})}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("mixins/observers.min",["kendo.core.min"],e)}(function(){return function(e){var t=Math,n=window.kendo,i=n.deepExtend,r=e.inArray,o={observers:function(){return this._observers=this._observers||[]},addObserver:function(e){return this._observers?this._observers.push(e):this._observers=[e],this},removeObserver:function(e){var t=this.observers(),n=r(e,t);return n!=-1&&t.splice(n,1),this},trigger:function(e,t){var n,i,r=this._observers;if(r&&!this._suspended)for(i=0;i<r.length;i++)n=r[i],n[e]&&n[e](t);return this},optionsChange:function(e){e=e||{},e.element=this,this.trigger("optionsChange",e)},geometryChange:function(){this.trigger("geometryChange",{element:this})},suspend:function(){return this._suspended=(this._suspended||0)+1,this},resume:function(){return this._suspended=t.max((this._suspended||0)-1,0),this},_observerField:function(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};i(n,{mixins:{ObserversMixin:o}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/geometry.min",["util/main.min","mixins/observers.min"],e)}(function(){return function(){function e(e){return null===e?null:e instanceof D?e:new D(e)}function t(e){return e&&I.isFunction(e.matrix)?e.matrix():e}function n(e,t,n,i){var r=0,o=0;return i&&(r=F.atan2(i.c*n,i.a*t),0!==i.b&&(o=F.atan2(i.d*n,i.b*t))),{x:r,y:o}}function i(e,t){for(;e<t;)e+=90;return e}function r(e,t){var n,i,r;for(n=0;n<t.length;n++)i=t[n],r=i.charAt(0).toUpperCase()+i.substring(1,i.length),e["set"+r]=o(i),e["get"+r]=a(i)}function o(e){return function(t){return this[e]!==t&&(this[e]=t,this.geometryChange()),this}}function a(e){return function(){return this[e]}}function s(e,t,n){e>t&&(t+=360);var i=F.abs(t-e);return n||(i=360-i),i}function l(e,t,n,i,r,o){var a=B((r-e)/n,3),s=B((o-t)/i,3);return B(L(F.atan2(s,a)))}function d(e,t,n,i,r,o,a,d){var c,u,h,f,p,m,g,v,_,b,k,w,y,x,C,T,S,D;if(t!==i)_=n-e,b=i-t,k=R(r,2),w=R(o,2),y=(w*_*(e+n)+k*b*(t+i))/(2*k*b),x=y-i,C=-(_*w)/(k*b),p=1/k+R(C,2)/w,m=2*(C*x/w-n/k),g=R(n,2)/k+R(x,2)/w-1,v=F.sqrt(R(m,2)-4*p*g),c=(-m-v)/(2*p),u=y+C*c,h=(-m+v)/(2*p),f=y+C*h;else{if(e===n)return!1;m=-2*i,g=R((n-e)*o/(2*r),2)+R(i,2)-R(o,2),v=F.sqrt(R(m,2)-4*g),c=h=(e+n)/2,u=(-m-v)/2,f=(-m+v)/2}return T=l(c,u,r,o,e,t),S=l(c,u,r,o,n,i),D=s(T,S,d),(a&&D<=180||!a&&D>180)&&(c=h,u=f,T=l(c,u,r,o,e,t),S=l(c,u,r,o,n,i)),{center:new q(c,u),startAngle:T,endAngle:S}}function c(e,t,n,i){if(0===e)return w(t,n,i);var r,o,a,s,l,d,c,u=(3*e*n-F.pow(t,2))/(3*F.pow(e,2)),h=(2*F.pow(t,3)-9*e*t*n+27*F.pow(e,2)*i)/(27*F.pow(e,3)),f=F.pow(u/3,3)+F.pow(h/2,2),p=new E(0,1),m=-t/(3*e),g=[];return f<0?(r=new E(-h/2,F.sqrt(-f)).nthRoot(3),o=new E(-h/2,(-F.sqrt(-f))).nthRoot(3)):(r=-h/2+F.sqrt(f),r=new E(_(r)*F.pow(F.abs(r),1/3)),o=-h/2-F.sqrt(f),o=new E(_(o)*F.pow(F.abs(o),1/3))),a=r.add(o),d=r.add(o).multiplyConstant(-.5),c=r.add(o.negate()).multiplyConstant(F.sqrt(3)/2),s=d.add(p.multiply(c)),l=d.add(p.negate().multiply(c)),a.isReal()&&g.push(B(a.real+m,U)),s.isReal()&&g.push(B(s.real+m,U)),l.isReal()&&g.push(B(l.real+m,U)),g}function u(e,t){return[-e[0][t]+3*e[1][t]-3*e[2][t]+e[3][t],3*(e[0][t]-2*e[1][t]+e[2][t]),3*(-e[0][t]+e[1][t]),e[0][t]]}function h(e,t,n){var i=1-e;return F.pow(i,3)*n[0][t]+3*F.pow(i,2)*e*n[1][t]+3*F.pow(e,2)*i*n[2][t]+F.pow(e,3)*n[3][t]}function f(e,t,n){var i,r,o,a=u(e,"x"),s=c(a[0],a[1],a[2],a[3]-t.x),l=0;for(o=0;o<s.length;o++)i=h(s[o],"y",e),r=g(i,t.y)||i>t.y,r&&((0===s[o]||1===s[o])&&n.bottomRight().x>t.x||0<s[o]&&s[o]<1)&&l++;return l}function p(e,t,n){var i,r,o,a,s,l;return e.x!=t.x&&(r=F.min(e.x,t.x),o=F.max(e.x,t.x),a=F.min(e.y,t.y),s=F.max(e.y,t.y),l=r<=n.x&&n.x<o,i=a==s?n.y<=a&&l:l&&(s-a)*((e.x-t.x)*(e.y-t.y)>0?n.x-r:o-n.x)/(o-r)+a-n.y>=0),i?1:0}function m(e,t,n,i){var r=t.x-e.x,o=i.x-n.x,a=t.y-e.y,s=i.y-n.y,l=e.x-n.x,d=e.y-n.y,c=r*s-o*a,u=(r*d-a*l)/c,h=(o*d-s*l)/c;if(u>=0&&u<=1&&h>=0&&h<=1)return new q(e.x+h*r,e.y+h*a)}function g(e,t,n){return 0===B(F.abs(e-t),n||U)}function v(e,t,n){return e<t||g(e,t,n)}function _(e){return e<0?-1:1}function b(t,n,i){var r=H.deg(F.atan2(n.y-t.y,n.x-t.x)),o=i.transformCopy(e().rotate(-r,t));return o.x<t.x}function k(e,t,n,i,r){var o,a,s=u(e,i),l=c(s[0],s[1],s[2],s[3]-t[i]);for(a=0;a<l.length;a++)if(0<=l[a]&&l[a]<=1&&(o=h(l[a],n,e),F.abs(o-t[n])<=r))return!0}function w(e,t,n){var i=F.sqrt(F.pow(t,2)-4*e*n);return[(-t+i)/(2*e),(-t-i)/(2*e)]}var y,x,C,T,S,D,E,F=Math,R=F.pow,I=window.kendo,A=I.Class,M=I.deepExtend,z=I.mixins.ObserversMixin,H=I.util,N=H.defined,P=H.rad,L=H.deg,B=H.round,O=F.PI/2,V=H.MIN_NUM,W=H.MAX_NUM,U=10,q=A.extend({init:function(e,t){this.x=e||0,this.y=t||0},equals:function(e){return e&&e.x===this.x&&e.y===this.y},clone:function(){return new q(this.x,this.y)},rotate:function(t,n){return this.transform(e().rotate(t,n))},translate:function(e,t){return this.x+=e,this.y+=t,this.geometryChange(),this},translateWith:function(e){return this.translate(e.x,e.y)},move:function(e,t){return this.x=this.y=0,this.translate(e,t)},scale:function(e,t){return N(t)||(t=e),this.x*=e,this.y*=t,this.geometryChange(),this},scaleCopy:function(e,t){return this.clone().scale(e,t)},transform:function(e){var n=t(e),i=this.x,r=this.y;return this.x=n.a*i+n.c*r+n.e,this.y=n.b*i+n.d*r+n.f,this.geometryChange(),this},transformCopy:function(e){var t=this.clone();return e&&t.transform(e),t},distanceTo:function(e){var t=this.x-e.x,n=this.y-e.y;return F.sqrt(t*t+n*n)},round:function(e){return this.x=B(this.x,e),this.y=B(this.y,e),this.geometryChange(),this},toArray:function(e){var t=N(e),n=t?B(this.x,e):this.x,i=t?B(this.y,e):this.y;return[n,i]}});r(q.fn,["x","y"]),M(q.fn,z),q.fn.toString=function(e,t){var n=this.x,i=this.y;return N(e)&&(n=B(n,e),i=B(i,e)),t=t||" ",n+t+i},q.create=function(e,t){if(N(e))return e instanceof q?e:1===arguments.length&&2===e.length?new q(e[0],e[1]):new q(e,t)},q.min=function(){var e,t,n=H.MAX_NUM,i=H.MAX_NUM;for(e=0;e<arguments.length;e++)t=arguments[e],n=F.min(t.x,n),i=F.min(t.y,i);return new q(n,i)},q.max=function(){var e,t,n=H.MIN_NUM,i=H.MIN_NUM;for(e=0;e<arguments.length;e++)t=arguments[e],n=F.max(t.x,n),i=F.max(t.y,i);return new q(n,i)},q.minPoint=function(){return new q(V,V)},q.maxPoint=function(){return new q(W,W)},q.ZERO=new q(0,0),y=A.extend({init:function(e,t){this.width=e||0,this.height=t||0},equals:function(e){return e&&e.width===this.width&&e.height===this.height},clone:function(){return new y(this.width,this.height)},toArray:function(e){var t=N(e),n=t?B(this.width,e):this.width,i=t?B(this.height,e):this.height;return[n,i]}}),r(y.fn,["width","height"]),M(y.fn,z),y.create=function(e,t){if(N(e))return e instanceof y?e:1===arguments.length&&2===e.length?new y(e[0],e[1]):new y(e,t)},y.ZERO=new y(0,0),x=A.extend({init:function(e,t){this.setOrigin(e||new q),this.setSize(t||new y)},clone:function(){return new x(this.origin.clone(),this.size.clone())},equals:function(e){return e&&e.origin.equals(this.origin)&&e.size.equals(this.size)},setOrigin:function(e){return this._observerField("origin",q.create(e)),this.geometryChange(),this},getOrigin:function(){return this.origin},setSize:function(e){return this._observerField("size",y.create(e)),this.geometryChange(),this},getSize:function(){return this.size},width:function(){return this.size.width},height:function(){return this.size.height},topLeft:function(){return this.origin.clone()},bottomRight:function(){return this.origin.clone().translate(this.width(),this.height())},topRight:function(){return this.origin.clone().translate(this.width(),0)},bottomLeft:function(){return this.origin.clone().translate(0,this.height())},center:function(){return this.origin.clone().translate(this.width()/2,this.height()/2)},bbox:function(e){var t=this.topLeft().transformCopy(e),n=this.topRight().transformCopy(e),i=this.bottomRight().transformCopy(e),r=this.bottomLeft().transformCopy(e);return x.fromPoints(t,n,i,r)},transformCopy:function(e){return x.fromPoints(this.topLeft().transform(e),this.bottomRight().transform(e))},expand:function(e,t){return N(t)||(t=e),this.size.width+=2*e,this.size.height+=2*t,this.origin.translate(-e,-t),this},expandCopy:function(e,t){return this.clone().expand(e,t)},containsPoint:function(e){var t=this.origin,n=this.bottomRight();return!(e.x<t.x||e.y<t.y||n.x<e.x||n.y<e.y)},_isOnPath:function(e,t){var n=this.expandCopy(t,t),i=this.expandCopy(-t,-t);return n.containsPoint(e)&&!i.containsPoint(e)}}),M(x.fn,z),x.fromPoints=function(){var e=q.min.apply(this,arguments),t=q.max.apply(this,arguments),n=new y(t.x-e.x,t.y-e.y);return new x(e,n)},x.union=function(e,t){return x.fromPoints(q.min(e.topLeft(),t.topLeft()),q.max(e.bottomRight(),t.bottomRight()))},x.intersect=function(e,t){if(e={left:e.topLeft().x,top:e.topLeft().y,right:e.bottomRight().x,bottom:e.bottomRight().y},t={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},e.left<=t.right&&t.left<=e.right&&e.top<=t.bottom&&t.top<=e.bottom)return x.fromPoints(new q(F.max(e.left,t.left),F.max(e.top,t.top)),new q(F.min(e.right,t.right),F.min(e.bottom,t.bottom)))},C=A.extend({init:function(e,t){this.setCenter(e||new q),this.setRadius(t||0)},setCenter:function(e){return this._observerField("center",q.create(e)),this.geometryChange(),this},getCenter:function(){return this.center},equals:function(e){return e&&e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return new C(this.center.clone(),this.radius)},pointAt:function(e){return this._pointAt(P(e))},bbox:function(e){var t,i,r,o,a=q.maxPoint(),s=q.minPoint(),l=n(this.center,this.radius,this.radius,e);for(t=0;t<4;t++)i=this._pointAt(l.x+t*O).transformCopy(e),r=this._pointAt(l.y+t*O).transformCopy(e),o=new q(i.x,r.y),a=q.min(a,o),s=q.max(s,o);return x.fromPoints(a,s)},_pointAt:function(e){var t=this.center,n=this.radius;return new q(t.x-n*F.cos(e),t.y-n*F.sin(e))},containsPoint:function(e){var t=this.center,n=F.pow(e.x-t.x,2)+F.pow(e.y-t.y,2)<=F.pow(this.radius,2);return n},_isOnPath:function(e,t){var n=this.center,i=this.radius,r=n.distanceTo(e);return i-t<=r&&r<=i+t}}),r(C.fn,["radius"]),M(C.fn,z),T=A.extend({init:function(e,t){this.setCenter(e||new q),t=t||{},this.radiusX=t.radiusX,this.radiusY=t.radiusY||t.radiusX,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.anticlockwise=t.anticlockwise||!1},clone:function(){return new T(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})},setCenter:function(e){return this._observerField("center",q.create(e)),this.geometryChange(),this},getCenter:function(){return this.center},MAX_INTERVAL:45,pointAt:function(e){var t=this.center,n=P(e);return new q(t.x+this.radiusX*F.cos(n),t.y+this.radiusY*F.sin(n))},curvePoints:function(){var e,t,n,i=this.startAngle,r=this.anticlockwise?-1:1,o=[this.pointAt(i)],a=i,s=this._arcInterval(),l=s.endAngle-s.startAngle,d=F.ceil(l/this.MAX_INTERVAL),c=l/d;for(e=1;e<=d;e++)t=a+r*c,n=this._intervalCurvePoints(a,t),o.push(n.cp1,n.cp2,n.p2),a=t;return o},bbox:function(e){for(var t,r,o=this,a=o._arcInterval(),s=a.startAngle,l=a.endAngle,d=n(this.center,this.radiusX,this.radiusY,e),c=L(d.x),u=L(d.y),h=o.pointAt(s).transformCopy(e),f=o.pointAt(l).transformCopy(e),p=q.min(h,f),m=q.max(h,f),g=i(c,s),v=i(u,s);g<l||v<l;)g<l&&(t=o.pointAt(g).transformCopy(e),g+=90),v<l&&(r=o.pointAt(v).transformCopy(e),v+=90),h=new q(t.x,r.y),p=q.min(p,h),m=q.max(m,h);return x.fromPoints(p,m)},_arcInterval:function(){var e,t=this.startAngle,n=this.endAngle,i=this.anticlockwise;return i&&(e=t,t=n,n=e),(t>n||i&&t===n)&&(n+=360),{startAngle:t,endAngle:n}},_intervalCurvePoints:function(e,t){var n=this,i=n.pointAt(e),r=n.pointAt(t),o=n._derivativeAt(e),a=n._derivativeAt(t),s=(P(t)-P(e))/3,l=new q(i.x+s*o.x,i.y+s*o.y),d=new q(r.x-s*a.x,r.y-s*a.y);return{p1:i,cp1:l,cp2:d,p2:r}},_derivativeAt:function(e){var t=this,n=P(e);return new q(-t.radiusX*F.sin(n),t.radiusY*F.cos(n))},containsPoint:function(e){var t,n,i,r=this._arcInterval(),o=r.endAngle-r.startAngle,a=this.center,s=a.distanceTo(e),d=F.atan2(e.y-a.y,e.x-a.x),c=this.radiusX*this.radiusY/F.sqrt(F.pow(this.radiusX,2)*F.pow(F.sin(d),2)+F.pow(this.radiusY,2)*F.pow(F.cos(d),2)),u=this.pointAt(this.startAngle).round(U),h=this.pointAt(this.endAngle).round(U),f=m(a,e.round(U),u,h);return o<180?t=f&&v(a.distanceTo(f),s)&&v(s,c):(n=l(a.x,a.y,this.radiusX,this.radiusY,e.x,e.y),360!=n&&(n=(360+n)%360),i=r.startAngle<=n&&n<=r.endAngle,t=i&&v(s,c)||!i&&(!f||f.equals(e))),t},_isOnPath:function(e,t){var n,i=this._arcInterval(),r=this.center,o=l(r.x,r.y,this.radiusX,this.radiusY,e.x,e.y);return 360!=o&&(o=(360+o)%360),n=i.startAngle<=o&&o<=i.endAngle,n&&this.pointAt(o).distanceTo(e)<=t}}),r(T.fn,["radiusX","radiusY","startAngle","endAngle","anticlockwise"]),M(T.fn,z),T.fromPoints=function(e,t,n,i,r,o){var a=d(e.x,e.y,t.x,t.y,n,i,r,o);return new T(a.center,{startAngle:a.startAngle,endAngle:a.endAngle,radiusX:n,radiusY:i,anticlockwise:0===o})},S=A.extend({init:function(e,t,n,i,r,o){this.a=e||0,this.b=t||0,this.c=n||0,this.d=i||0,this.e=r||0,this.f=o||0},multiplyCopy:function(e){return new S(this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.e+this.c*e.f+this.e,this.b*e.e+this.d*e.f+this.f)},invert:function(){var e=this.a,t=this.b,n=this.c,i=this.d,r=this.e,o=this.f,a=e*i-t*n;return 0===a?null:new S(i/a,-t/a,-n/a,e/a,(n*o-i*r)/a,(t*r-e*o)/a)},clone:function(){return new S(this.a,this.b,this.c,this.d,this.e,this.f)},equals:function(e){return!!e&&(this.a===e.a&&this.b===e.b&&this.c===e.c&&this.d===e.d&&this.e===e.e&&this.f===e.f)},round:function(e){return this.a=B(this.a,e),this.b=B(this.b,e),this.c=B(this.c,e),this.d=B(this.d,e),this.e=B(this.e,e),this.f=B(this.f,e),this},toArray:function(e){var t,n=[this.a,this.b,this.c,this.d,this.e,this.f];if(N(e))for(t=0;t<n.length;t++)n[t]=B(n[t],e);return n}}),S.fn.toString=function(e,t){return this.toArray(e).join(t||",")},S.translate=function(e,t){return new S(1,0,0,1,e,t)},S.unit=function(){return new S(1,0,0,1,0,0)},S.rotate=function(e,t,n){var i=new S;return i.a=F.cos(P(e)),i.b=F.sin(P(e)),i.c=-i.b,i.d=i.a,i.e=t-t*i.a+n*i.b||0,i.f=n-n*i.a-t*i.b||0,i},S.scale=function(e,t){return new S(e,0,0,t,0,0)},S.IDENTITY=S.unit(),D=A.extend({init:function(e){this._matrix=e||S.unit()},clone:function(){return new D(this._matrix.clone())},equals:function(e){return e&&e._matrix.equals(this._matrix)},_optionsChange:function(){this.optionsChange({field:"transform",value:this})},translate:function(e,t){return this._matrix=this._matrix.multiplyCopy(S.translate(e,t)),this._optionsChange(),this},scale:function(e,t,n){return N(t)||(t=e),n&&(n=q.create(n),this._matrix=this._matrix.multiplyCopy(S.translate(n.x,n.y))),this._matrix=this._matrix.multiplyCopy(S.scale(e,t)),n&&(this._matrix=this._matrix.multiplyCopy(S.translate(-n.x,-n.y))),this._optionsChange(),this},rotate:function(e,t){return t=q.create(t)||q.ZERO,this._matrix=this._matrix.multiplyCopy(S.rotate(e,t.x,t.y)),this._optionsChange(),this},multiply:function(e){var n=t(e);return this._matrix=this._matrix.multiplyCopy(n),this._optionsChange(),this},matrix:function(e){return e?(this._matrix=e,this._optionsChange(),this):this._matrix}}),M(D.fn,z),E=function(e,t){this.real=e||0,this.img=t||0},E.fn=E.prototype={add:function(e){return new E(B(this.real+e.real,U),B(this.img+e.img,U))},addConstant:function(e){return new E(this.real+e,this.img)},negate:function(){return new E((-this.real),(-this.img))},multiply:function(e){return new E(this.real*e.real-this.img*e.img,this.real*e.img+this.img*e.real)},multiplyConstant:function(e){return new E(this.real*e,this.img*e)},nthRoot:function(e){var t=F.atan2(this.img,this.real),n=F.sqrt(F.pow(this.img,2)+F.pow(this.real,2)),i=F.pow(n,1/e);return new E(i*F.cos(t/e),i*F.sin(t/e))},equals:function(e){return this.real===e.real&&this.img===e.img},isReal:function(){return 0===this.img}},M(I,{geometry:{Arc:T,Circle:C,curveIntersectionsCount:f,lineIntersectionsCount:p,Matrix:S,Point:q,Rect:x,Size:y,Transformation:D,transform:e,toMatrix:t,isOutOfEndPoint:b,hasRootsInRange:k}}),I.dataviz.geometry=I.geometry}(),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.popup.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(t,n){return!(!t||!n)&&(t===n||e.contains(t,n))}var i=window.kendo,r=i.ui,o=r.Widget,a=i.support,s=i.getOffset,l=i._outerWidth,d=i._outerHeight,c="open",u="close",h="deactivate",f="activate",p="center",m="left",g="right",v="top",_="bottom",b="absolute",k="hidden",w="body",y="location",x="position",C="visible",T="effects",S="k-state-active",D="k-state-border",E=/k-state-border-(\w+)/,F=".k-picker-wrap, .k-dropdown-wrap, .k-link",R="down",I=e(document.documentElement),A=e(window),M="scroll",z=a.transitions.css,H=z+"transform",N=e.extend,P=".kendoPopup",L=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],B=o.extend({init:function(t,n){var r,s=this;n=n||{},n.isRtl&&(n.origin=n.origin||_+" "+g,n.position=n.position||v+" "+g),o.fn.init.call(s,t,n),t=s.element,n=s.options,s.collisions=n.collision?n.collision.split(" "):[],s.downEvent=i.applyEventMap(R,i.guid()),1===s.collisions.length&&s.collisions.push(s.collisions[0]),r=e(s.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"),n.appendTo=e(e(n.appendTo)[0]||r[0]||w),s.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!n.isRtl).css({position:b}).appendTo(n.appendTo).on("mouseenter"+P,function(){s._hovered=!0}).on("mouseleave"+P,function(){s._hovered=!1}),s.wrapper=e(),n.animation===!1&&(n.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),N(n.animation.open,{complete:function(){s.wrapper.css({overflow:C}),s._activated=!0,s._trigger(f)}}),N(n.animation.close,{complete:function(){s._animationClose()}}),s._mousedownProxy=function(e){s._mousedown(e)},s._resizeProxy=a.mobileOS.android?function(e){setTimeout(function(){s._resize(e)},600)}:function(e){s._resize(e)},n.toggleTarget&&e(n.toggleTarget).on(n.toggleEvent+P,e.proxy(s.toggle,s))},events:[c,f,u,h],options:{name:"Popup",toggleEvent:"click",origin:_+" "+m,position:v+" "+m,anchor:w,appendTo:null,collision:"flip fit",viewport:window,copyAnchorStyles:!0,autosize:!1,modal:!1,adjustSize:{width:0,height:0},animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},_animationClose:function(){var e=this,t=e.wrapper.data(y);e.wrapper.hide(),t&&e.wrapper.css(t),e.options.anchor!=w&&e._hideDirClass(),e._closing=!1,e._trigger(h)},destroy:function(){var t,n=this,r=n.options,a=n.element.off(P);o.fn.destroy.call(n),r.toggleTarget&&e(r.toggleTarget).off(P),r.modal||(I.unbind(n.downEvent,n._mousedownProxy),n._toggleResize(!1)),i.destroy(n.element.children()),a.removeData(),r.appendTo[0]===document.body&&(t=a.parent(".k-animation-container"),t[0]?t.remove():a.remove())},open:function(t,n){var r,o,s=this,l={
isFixed:!isNaN(parseInt(n,10)),x:t,y:n},d=s.element,u=s.options,h=e(u.anchor),f=d[0]&&d.hasClass("km-widget");if(!s.visible()){if(u.copyAnchorStyles&&(f&&"font-size"==L[0]&&L.shift(),d.css(i.getComputedStyles(h[0],L))),d.data("animating")||s._trigger(c))return;s._activated=!1,u.modal||(I.unbind(s.downEvent,s._mousedownProxy).bind(s.downEvent,s._mousedownProxy),s._toggleResize(!1),s._toggleResize(!0)),s.wrapper=o=i.wrap(d,u.autosize).css({overflow:k,display:"block",position:b}),a.mobileOS.android&&o.css(H,"translatez(0)"),o.css(x),e(u.appendTo)[0]==document.body&&o.css(v,"-10000px"),s.flipped=s._position(l),r=s._openAnimation(),u.anchor!=w&&s._showDirClass(r),d.data(T,r.effects).kendoStop(!0).kendoAnimate(r)}},_openAnimation:function(){var e=N(!0,{},this.options.animation.open);return e.effects=i.parseEffects(e.effects,this.flipped),e},_hideDirClass:function(){var t=e(this.options.anchor),n=((t.attr("class")||"").match(E)||["","down"])[1],r=D+"-"+n;t.removeClass(r).children(F).removeClass(S).removeClass(r),this.element.removeClass(D+"-"+i.directions[n].reverse)},_showDirClass:function(t){var n=t.effects.slideIn?t.effects.slideIn.direction:"down",r=D+"-"+n;e(this.options.anchor).addClass(r).children(F).addClass(S).addClass(r),this.element.addClass(D+"-"+i.directions[n].reverse)},position:function(){this.visible()&&(this.flipped=this._position())},toggle:function(){var e=this;e[e.visible()?u:c]()},visible:function(){return this.element.is(":"+C)},close:function(n){var r,o,a,s,l=this,d=l.options;if(l.visible()){if(r=l.wrapper[0]?l.wrapper:i.wrap(l.element).hide(),l._toggleResize(!1),l._closing||l._trigger(u))return l._toggleResize(!0),t;l.element.find(".k-popup").each(function(){var t=e(this),i=t.data("kendoPopup");i&&i.close(n)}),I.unbind(l.downEvent,l._mousedownProxy),n?o={hide:!0,effects:{}}:(o=N(!0,{},d.animation.close),a=l.element.data(T),s=o.effects,!s&&!i.size(s)&&a&&i.size(a)&&(o.effects=a,o.reverse=!0),l._closing=!0),l.element.kendoStop(!0),r.css({overflow:k}),l.element.kendoAnimate(o),n&&l._animationClose()}},_trigger:function(e){return this.trigger(e,{type:e})},_resize:function(e){var t=this;a.resize.indexOf(e.type)!==-1?(clearTimeout(t._resizeTimeout),t._resizeTimeout=setTimeout(function(){t._position(),t._resizeTimeout=null},50)):(!t._hovered||t._activated&&t.element.hasClass("k-list-container"))&&t.close()},_toggleResize:function(e){var t=e?"on":"off",n=a.resize;a.mobileOS.ios||a.mobileOS.android||(n+=" "+M),this._scrollableParents()[t](M,this._resizeProxy),A[t](n,this._resizeProxy)},_mousedown:function(t){var r=this,o=r.element[0],a=r.options,s=e(a.anchor)[0],l=a.toggleTarget,d=i.eventTarget(t),c=e(d).closest(".k-popup"),u=c.parent().parent(".km-shim").length;c=c[0],!u&&c&&c!==r.element[0]||"popover"!==e(t.target).closest("a").data("rel")&&(n(o,d)||n(s,d)||l&&n(e(l)[0],d)||r.close())},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),e<0&&(i=-e),i},_flip:function(e,t,n,i,r,o,a){var s=0;return a=a||t,o!==r&&o!==p&&r!==p&&(e+a>i&&(s+=-(n+t)),e+s<0&&(s+=n+t)),s},_scrollableParents:function(){return e(this.options.anchor).parentsUntil("body").filter(function(e,t){return i.isScrollable(t)})},_position:function(t){var n,r,o,c,u,h,f,p,m,g,v,_,k,w,C,T,S=this,D=S.element,E=S.wrapper,F=S.options,R=e(F.viewport),I=a.zoomLevel(),A=!!(R[0]==window&&window.innerWidth&&I<=1.02),M=e(F.anchor),z=F.origin.toLowerCase().split(" "),H=F.position.toLowerCase().split(" "),P=S.collisions,L=10002,B=0,O=document.documentElement;if(u=F.viewport===window?{top:window.pageYOffset||document.documentElement.scrollTop||0,left:window.pageXOffset||document.documentElement.scrollLeft||0}:R.offset(),A?(h=window.innerWidth,f=window.innerHeight):(h=R.width(),f=R.height()),A&&O.scrollHeight-O.clientHeight>0&&(h-=i.support.scrollbar()),n=M.parents().filter(E.siblings()),n[0])if(o=Math.max(+n.css("zIndex"),0))L=o+10;else for(r=M.parentsUntil(n),c=r.length;B<c;B++)o=+e(r[B]).css("zIndex"),o&&L<o&&(L=o+10);return E.css("zIndex",L),E.css(t&&t.isFixed?{left:t.x,top:t.y}:S._align(z,H)),p=s(E,x,M[0]===E.offsetParent()[0]),m=s(E),g=M.offsetParent().parent(".k-animation-container,.k-popup,.k-group"),g.length&&(p=s(E,x,!0),m=s(E)),m.top-=u.top,m.left-=u.left,S.wrapper.data(y)||E.data(y,N({},p)),v=N({},m),_=N({},p),k=F.adjustSize,"fit"===P[0]&&(_.top+=S._fit(v.top,d(E)+k.height,f/I)),"fit"===P[1]&&(_.left+=S._fit(v.left,l(E)+k.width,h/I)),w=N({},_),C=d(D),T=d(E),!E.height()&&C&&(T+=C),"flip"===P[0]&&(_.top+=S._flip(v.top,C,d(M),f/I,z[0],H[0],T)),"flip"===P[1]&&(_.left+=S._flip(v.left,l(D),l(M),h/I,z[1],H[1],l(E))),D.css(x,b),E.css(_),_.left!=w.left||_.top!=w.top},_align:function(t,n){var i,r=this,o=r.wrapper,a=e(r.options.anchor),c=t[0],u=t[1],h=n[0],f=n[1],m=s(a),v=e(r.options.appendTo),b=l(o),k=d(o),w=l(a),y=d(a),x=m.top,C=m.left,T=Math.round;return v[0]!=document.body&&(i=s(v),x-=i.top,C-=i.left),c===_&&(x+=y),c===p&&(x+=T(y/2)),h===_&&(x-=k),h===p&&(x-=T(k/2)),u===g&&(C+=w),u===p&&(C+=T(w/2)),f===g&&(C-=b),f===p&&(C-=T(b/2)),{top:x,left:C}}});r.plugin(B)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/core.min",["drawing/geometry.min","kendo.popup.min"],e)}(function(){!function(e){function t(e){var t,n;return e.touch?(t=e.x.location,n=e.y.location):(t=e.pageX||e.clientX||0,n=e.pageY||e.clientY||0),{x:t,y:n}}var n,i,r,o,a=e.noop,s=Object.prototype.toString,l=window.kendo,d=l._outerWidth,c=l._outerHeight,u=l.Class,h=l.ui.Widget,f=l.deepExtend,p=l.util,m=p.defined,g=p.limitValue,v=l.geometry,_=e.proxy,b=".kendo",k='<div class="k-tooltip"><div class="k-tooltip-content"></div></div>',w='<div class="k-tooltip-button"><a href="\\#" class="k-icon k-i-close">close</a></div>',y=h.extend({init:function(e,t){this.options=f({},this.options,t),h.fn.init.call(this,e,this.options),this._click=this._handler("click"),this._mouseenter=this._handler("mouseenter"),this._mouseleave=this._handler("mouseleave"),this._mousemove=this._handler("mousemove"),this._visual=new l.drawing.Group,this.options.width&&this.element.css("width",this.options.width),this.options.height&&this.element.css("height",this.options.height),this._enableTracking()},options:{name:"Surface",tooltip:{}},events:["click","mouseenter","mouseleave","mousemove","resize","tooltipOpen","tooltipClose"],draw:function(e){this._visual.children.push(e)},clear:function(){this._visual.children=[],this.hideTooltip()},destroy:function(){this._visual=null,this._tooltip&&(this._tooltip.destroy(),delete this._tooltip),h.fn.destroy.call(this)},exportVisual:function(){return this._visual},getSize:function(){return{width:this.element.width(),height:this.element.height()}},setSize:function(e){this.element.css({width:e.width,height:e.height}),this._size=e,this._resize()},eventTarget:function(t){for(var n,i=e(t.touch?t.touch.initialTouch:t.target);!n&&i.length>0&&(n=i[0]._kendoNode,!i.is(this.element)&&0!==i.length);)i=i.parent();if(n)return n.srcElement},showTooltip:function(e,t){this._tooltip&&this._tooltip.show(e,t)},hideTooltip:function(){this._tooltip&&this._tooltip.hide()},suspendTracking:function(){this._suspendedTracking=!0,this.hideTooltip()},resumeTracking:function(){this._suspendedTracking=!1},_resize:a,_handler:function(e){var t=this;return function(n){var i=t.eventTarget(n);i&&!t._suspendedTracking&&t.trigger(e,{element:i,originalEvent:n,type:e})}},_enableTracking:function(){l.ui.Popup&&(this._tooltip=new o(this,this.options.tooltip||{}))},_elementOffset:function(){var e=this.element,t=e.offset(),n=parseInt(e.css("paddingLeft"),10),i=parseInt(e.css("paddingTop"),10);return{left:t.left+n,top:t.top+i}},_surfacePoint:function(e){var n=this._elementOffset(),i=t(e),r=i.x-n.left,o=i.y-n.top;return new v.Point(r,o)}});l.ui.plugin(y),y.create=function(e,t){return r.current.create(e,t)},n=u.extend({init:function(e){this.childNodes=[],this.parent=null,e&&(this.srcElement=e,this.observe())},destroy:function(){var e,t;for(this.srcElement&&this.srcElement.removeObserver(this),e=this.childNodes,t=0;t<e.length;t++)this.childNodes[t].destroy();this.parent=null},load:a,observe:function(){this.srcElement&&this.srcElement.addObserver(this)},append:function(e){this.childNodes.push(e),e.parent=this},insertAt:function(e,t){this.childNodes.splice(t,0,e),e.parent=this},remove:function(e,t){var n,i=e+t;for(n=e;n<i;n++)this.childNodes[n].removeSelf();this.childNodes.splice(e,t)},removeSelf:function(){this.clear(),this.destroy()},clear:function(){this.remove(0,this.childNodes.length)},invalidate:function(){this.parent&&this.parent.invalidate()},geometryChange:function(){this.invalidate()},optionsChange:function(){this.invalidate()},childrenChange:function(e){"add"===e.action?this.load(e.items,e.index):"remove"===e.action&&this.remove(e.index,e.items.length),this.invalidate()}}),i=u.extend({init:function(e,t){var n,i;this.prefix=t||"";for(n in e)i=e[n],i=this._wrap(i,n),this[n]=i},get:function(e){return l.getter(e,!0)(this)},set:function(e,t){var n,i=l.getter(e,!0)(this);i!==t&&(n=this._set(e,this._wrap(t,e)),n||this.optionsChange({field:this.prefix+e,value:t}))},_set:function(e,t){var n,r,o,a=e.indexOf(".")>=0;if(a)for(n=e.split("."),r="";n.length>1;){if(r+=n.shift(),o=l.getter(r,!0)(this),o||(o=new i({},r+"."),o.addObserver(this),this[r]=o),o instanceof i)return o.set(n.join("."),t),a;r+="."}return this._clear(e),l.setter(e)(this,t),a},_clear:function(e){var t=l.getter(e,!0)(this);t&&t.removeObserver&&t.removeObserver(this)},_wrap:function(e,t){var n=s.call(e);return null!==e&&m(e)&&"[object Object]"===n&&(e instanceof i||e instanceof u||(e=new i(e,this.prefix+t+".")),e.addObserver(this)),e}}),f(i.fn,l.mixins.ObserversMixin),r=function(){this._items=[]},r.prototype={register:function(e,t,n){var i=this._items,r=i[0],o={name:e,type:t,order:n};!r||n<r.order?i.unshift(o):i.push(o)},create:function(e,t){var n,i,r=this._items,o=r[0];if(t&&t.type)for(n=t.type.toLowerCase(),i=0;i<r.length;i++)if(r[i].name===n){o=r[i];break}return o?new o.type(e,t):void l.logToConsole("Warning: Unable to create Kendo UI Drawing Surface. Possible causes:\n- The browser does not support SVG, VML and Canvas. User agent: "+navigator.userAgent+"\n- The Kendo UI scripts are not fully loaded")}},r.current=new r,o=u.extend({init:function(t,n){this.element=e(k),this.content=this.element.children(".k-tooltip-content"),n=n||{},this.options=f({},this.options,this._tooltipOptions(n)),this.popup=new l.ui.Popup(this.element,{appendTo:n.appendTo,animation:n.animation,copyAnchorStyles:!1,collision:"fit fit"}),this._openPopupHandler=e.proxy(this._openPopup,this),this.surface=t,this._bindEvents()},options:{position:"top",showOn:"mouseenter",offset:7,autoHide:!0,hideDelay:0,showAfter:100},_bindEvents:function(){this._showHandler=_(this._showEvent,this),this._surfaceLeaveHandler=_(this._surfaceLeave,this),this._mouseleaveHandler=_(this._mouseleave,this),this._mousemoveHandler=_(this._mousemove,this),this.surface.bind("click",this._showHandler),this.surface.bind("mouseenter",this._showHandler),this.surface.bind("mouseleave",this._mouseleaveHandler),this.surface.bind("mousemove",this._mousemoveHandler),this.surface.element.on("mouseleave"+b,this._surfaceLeaveHandler),this.element.on("click"+b,".k-tooltip-button",_(this._hideClick,this))},destroy:function(){var e=this.popup;this.surface.unbind("click",this._showHandler),this.surface.unbind("mouseenter",this._showHandler),this.surface.unbind("mouseleave",this._mouseleaveHandler),this.surface.unbind("mousemove",this._mousemoveHandler),this.surface.element.off("mouseleave"+b,this._surfaceLeaveHandler),this.element.off("click"+b),e&&(e.destroy(),delete this.popup),clearTimeout(this._timeout),delete this.popup,delete this.element,delete this.content,delete this.surface},_tooltipOptions:function(e){return e=e||{},{position:e.position,showOn:e.showOn,offset:e.offset,autoHide:e.autoHide,width:e.width,height:e.height,content:e.content,shared:e.shared,hideDelay:e.hideDelay,showAfter:e.showAfter}},_tooltipShape:function(e){for(;e&&!e.options.tooltip;)e=e.parent;return e},_updateContent:function(e,t,n){var i=n.content;if(l.isFunction(i)&&(i=i({element:t,target:e})),i)return this.content.html(i),!0},_position:function(e,n,i,r){var o,a=n.position,s=n.offset||0,l=this.surface,d=l._elementOffset(),c=l.getSize(),u=l._offset,h=e.bbox(),f=i.width,p=i.height,m=0,v=0;return h.origin.translate(d.left,d.top),u&&h.origin.translate(-u.x,-u.y),"cursor"==a&&r?(o=t(r),m=o.x-f/2,v=o.y-p-s):"left"==a?(m=h.origin.x-f-s,v=h.center().y-p/2):"right"==a?(m=h.bottomRight().x+s,v=h.center().y-p/2):"bottom"==a?(m=h.center().x-f/2,v=h.bottomRight().y+s):(m=h.center().x-f/2,v=h.origin.y-p-s),{left:g(m,d.left,d.left+c.width),top:g(v,d.top,d.top+c.height)}},show:function(e,t){this._show(e,e,f({},this.options,this._tooltipOptions(e.options.tooltip),t))},hide:function(){var e=this._current;delete this._current,clearTimeout(this._showTimeout),this.popup.visible()&&e&&!this.surface.trigger("tooltipClose",{element:e.shape,target:e.target,popup:this.popup})&&this.popup.close()},_hideClick:function(e){e.preventDefault(),this.hide()},_show:function(e,t,n,i,r){var o,a,s=this._current;clearTimeout(this._timeout),s&&(s.shape===t&&n.shared||s.target===e)||(clearTimeout(this._showTimeout),!this.surface.trigger("tooltipOpen",{element:t,target:e,popup:this.popup})&&this._updateContent(e,t,n)&&(this._autoHide(n),o=this._measure(n),a=this.popup,a.visible()&&a.close(!0),this._current={options:n,elementSize:o,shape:t,target:e,position:this._position(n.shared?t:e,n,o,i)},r?this._showTimeout=setTimeout(this._openPopupHandler,n.showAfter||0):this._openPopup()))},_openPopup:function(){var e=this._current,t=e.position;this.popup.open(t.left,t.top)},_autoHide:function(t){t.autoHide&&this._closeButton&&(this.element.removeClass("k-tooltip-closable"),this._closeButton.remove(),delete this._closeButton),t.autoHide||this._closeButton||(this.element.addClass("k-tooltip-closable"),this._closeButton=e(w).prependTo(this.element))},_showEvent:function(e){var t,n=this._tooltipShape(e.element);n&&(t=f({},this.options,this._tooltipOptions(n.options.tooltip)),t&&t.showOn==e.type&&this._show(e.element,n,t,e.originalEvent,!0))},_measure:function(e){var t,n,i;return this.element.css({width:"auto",height:"auto"}),i=this.popup.visible(),i||this.popup.wrapper.show(),this.element.css({width:m(e.width)?e.width:"auto",height:m(e.height)?e.height:"auto"}),t=d(this.element),n=c(this.element),i||this.popup.wrapper.hide(),{width:t,height:n}},_mouseleave:function(e){var t,n;this._popupRelatedTarget(e.originalEvent)||(t=this,n=t._current,n&&n.options.autoHide&&(t._timeout=setTimeout(function(){clearTimeout(t._showTimeout),t.hide()},n.options.hideDelay||0)))},_mousemove:function(e){var t,n,i=this._current;i&&e.element&&(t=i.options,"cursor"==t.position&&(n=this._position(e.element,t,i.elementSize,e.originalEvent),i.position=n,this.popup.wrapper.css({left:n.left,top:n.top})))},_surfaceLeave:function(e){this._popupRelatedTarget(e)||(clearTimeout(this._showTimeout),this.hide())},_popupRelatedTarget:function(t){return t.relatedTarget&&e(t.relatedTarget).closest(this.popup.wrapper).length}}),f(l,{drawing:{DASH_ARRAYS:{dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Color:l.Color,BaseNode:n,OptionsStore:i,Surface:y,SurfaceFactory:r,SurfaceTooltip:o}}),l.dataviz.drawing=l.drawing}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/mixins.min",["drawing/core.min"],e)}(function(){!function(){var e=window.kendo,t=e.deepExtend,n=e.util.defined,i=e.geometry,r="gradient",o=""+i.Matrix.IDENTITY,a={extend:function(e){e.fill=this.fill,e.stroke=this.stroke},fill:function(e,t){var i,o=this.options;return n(e)?(e&&e.nodeType!=r?(i={color:e},n(t)&&(i.opacity=t),o.set("fill",i)):o.set("fill",e),this):o.get("fill")},stroke:function(e,t,i){return n(e)?(this.options.set("stroke.color",e),n(t)&&this.options.set("stroke.width",t),n(i)&&this.options.set("stroke.opacity",i),this):this.options.get("stroke")}},s={extend:function(e,t){e.traverse=function(e){var n,i,r=this[t];for(n=0;n<r.length;n++)i=r[n],i.traverse?i.traverse(e):e(i);return this}}},l={extend:function(e){e.bbox=this.bbox,e.geometryChange=this.geometryChange},bbox:function(e){var t,n,r=i.toMatrix(this.currentTransform(e)),a=r?""+r:o;return this._bboxCache&&this._matrixHash==a?t=this._bboxCache.clone():(t=this._bbox(r),this._bboxCache=t?t.clone():null,this._matrixHash=a),n=this.options.get("stroke.width"),n&&t&&t.expand(n/2),t},geometryChange:function(){delete this._bboxCache,this.trigger("geometryChange",{element:this})}};t(e.drawing,{mixins:{Paintable:a,Traversable:s,Measurable:l}})}()},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/shapes.min",["drawing/core.min","drawing/mixins.min","util/text-metrics.min","mixins/observers.min"],e)}(function(){!function(e){function t(e,t,n){var i,r,o,a;for(r=0;r<e.length;r++)o=e[r],o.visible()&&(a=t?o.bbox(n):o.rawBBox(),a&&(i=i?j.Rect.union(i,a):a));return i}function n(e,t){var n,i,r,o;for(i=0;i<e.length;i++)r=e[i],r.visible()&&(o=r.clippedBBox(t),o&&(n=n?j.Rect.union(n,o):o));return n}function i(e,t){for(var n=0;n<t.length;n++)e[t[n]]=r(t[n])}function r(e){var t="_"+e;return function(e){return ie(e)?(this._observerField(t,e),this.geometryChange(),this):this[t]}}function o(e,t){for(var n=0;n<t.length;n++)e[t[n]]=a(t[n])}function a(e){var t="_"+e;return function(e){return ie(e)?(this._observerField(t,$.create(e)),this.geometryChange(),this):this[t]}}function s(e,t){for(var n=0;n<t.length;n++)e[t[n]]=l(t[n])}function l(e){return function(t){return ie(t)?(this.options.set(e,t),this):this.options.get(e)}}function d(){return"kdef"+pe++}function c(e,t,n){w(e,t,n,"x","width")}function u(e,t,n){w(e,t,n,"y","height")}function h(e){k(b(e),"x","y","width")}function f(e){k(b(e),"y","x","height")}function p(e,t){return g(e,t,"x","y","width")}function m(e,t){return g(e,t,"y","x","height")}function g(e,t,n,i,r){var o,a,s,l,d=[],c=_(e,t,r),u=t.origin.clone();for(l=0;l<c.length;l++)for(s=c[l],o=s[0],u[i]=o.bbox.origin[i],C(u,o.bbox,o.element),o.bbox.origin[n]=u[n],k(s,n,i,r),d.push([]),a=0;a<s.length;a++)d[l].push(s[a].element);return d}function v(e,t){var n,i,r=e.clippedBBox(),o=r.size,a=t.size;(a.width<o.width||a.height<o.height)&&(n=J.min(a.width/o.width,a.height/o.height),i=e.transform()||j.transform(),i.scale(n,n),e.transform(i))}function _(e,t,n){var i,r,o,a,s=t.size[n],l=0,d=[],c=[],u=function(){c.push({element:i,bbox:o})};for(a=0;a<e.length;a++)i=e[a],o=i.clippedBBox(),o&&(r=o.size[n],l+r>s?c.length?(d.push(c),c=[],u(),l=r):(u(),d.push(c),c=[],l=0):(u(),l+=r));return c.length&&d.push(c),d}function b(e){var t,n,i,r=[];for(i=0;i<e.length;i++)t=e[i],n=t.clippedBBox(),n&&r.push({element:t,bbox:n});return r}function k(e,t,n,i){var r,o,a,s,l;if(e.length>1)for(r=e[0].bbox,o=new $,l=1;l<e.length;l++)a=e[l].element,s=e[l].bbox,o[t]=r.origin[t]+r.size[i],o[n]=s.origin[n],C(o,s,a),s.origin[t]=o[t],r=s}function w(e,t,n,i,r){var o,a,s;for(n=n||"start",s=0;s<e.length;s++)o=e[s].clippedBBox(),o&&(a=o.origin.clone(),a[i]=y(o.size[r],t,n,i,r),C(a,o,e[s]))}function y(e,t,n,i,r){var o;return o=n==me?t.origin[i]:n==ge?t.origin[i]+t.size[r]-e:t.origin[i]+(t.size[r]-e)/2}function x(e,t,n){var i=n.transform()||j.transform(),r=i.matrix();r.e+=e,r.f+=t,i.matrix(r),n.transform(i)}function C(e,t,n){x(e.x-t.origin.x,e.y-t.origin.y,n)}var T,S,D,E,F,R,I,A,M,z,H,N,P,L,B,O,V,W=window.kendo,U=W.Class,q=W.deepExtend,j=W.geometry,$=j.Point,G=j.Size,Y=j.Matrix,K=j.toMatrix,Q=W.drawing,X=Q.OptionsStore,J=Math,Z=J.pow,ee=W.util,te=ee.append,ne=ee.arrayLimits,ie=ee.defined,re=ee.last,oe=ee.valueOrDefault,ae=W.mixins.ObserversMixin,se=e.inArray,le=[].push,de=[].pop,ce=[].splice,ue=[].shift,he=[].slice,fe=[].unshift,pe=1,me="start",ge="end",ve="horizontal",_e=U.extend({nodeType:"Element",init:function(e){this._initOptions(e)},_initOptions:function(e){var t,n;e=e||{},t=e.transform,n=e.clip,t&&(e.transform=j.transform(t)),n&&!n.id&&(n.id=d()),this.options=new X(e),this.options.addObserver(this)},transform:function(e){return ie(e)?void this.options.set("transform",j.transform(e)):this.options.get("transform")},parentTransform:function(){for(var e,t,n=this;n.parent;)n=n.parent,e=n.transform(),e&&(t=e.matrix().multiplyCopy(t||Y.unit()));if(t)return j.transform(t)},currentTransform:function(e){var t,n,i=this.transform(),r=K(i);if(ie(e)||(e=this.parentTransform()),t=K(e),n=r&&t?t.multiplyCopy(r):r||t)return j.transform(n)},visible:function(e){return ie(e)?(this.options.set("visible",e),this):this.options.get("visible")!==!1},clip:function(e){var t=this.options;return ie(e)?(e&&!e.id&&(e.id=d()),t.set("clip",e),this):t.get("clip")},opacity:function(e){return ie(e)?(this.options.set("opacity",e),this):oe(this.options.get("opacity"),1)},clippedBBox:function(e){var t,n=this._clippedBBox(e);if(n)return t=this.clip(),t?j.Rect.intersect(n,t.bbox(e)):n},containsPoint:function(e,t){if(this.visible()){var n=this.currentTransform(t);return n&&(e=e.transformCopy(n.matrix().invert())),this._hasFill()&&this._containsPoint(e)||this._isOnPath&&this._hasStroke()&&this._isOnPath(e)}return!1},_hasFill:function(){var e=this.options.fill;return e&&!ee.isTransparent(e.color)},_hasStroke:function(){var e=this.options.stroke;return e&&e.width>0&&!ee.isTransparent(e.color)},_clippedBBox:function(e){return this.bbox(e)}});q(_e.fn,ae),T=U.extend({init:function(e){e=e||[],this.length=0,this._splice(0,e.length,e)},elements:function(e){return e?(this._splice(0,this.length,e),this._change(),this):this.slice(0)},push:function(){var e=arguments,t=le.apply(this,e);return this._add(e),t},slice:he,pop:function(){var e=this.length,t=de.apply(this);return e&&this._remove([t]),t},splice:function(e,t){var n=he.call(arguments,2),i=this._splice(e,t,n);return this._change(),i},shift:function(){var e=this.length,t=ue.apply(this);return e&&this._remove([t]),t},unshift:function(){var e=arguments,t=fe.apply(this,e);return this._add(e),t},indexOf:function(e){var t,n,i=this;for(t=0,n=i.length;t<n;t++)if(i[t]===e)return t;return-1},_splice:function(e,t,n){var i=ce.apply(this,[e,t].concat(n));return this._clearObserver(i),this._setObserver(n),i},_add:function(e){this._setObserver(e),this._change()},_remove:function(e){this._clearObserver(e),this._change()},_setObserver:function(e){for(var t=0;t<e.length;t++)e[t].addObserver(this)},_clearObserver:function(e){for(var t=0;t<e.length;t++)e[t].removeObserver(this)},_change:function(){}}),q(T.fn,ae),S=_e.extend({nodeType:"Group",init:function(e){_e.fn.init.call(this,e),this.children=[]},childrenChange:function(e,t,n){this.trigger("childrenChange",{action:e,items:t,index:n})},append:function(){return te(this.children,arguments),this._reparent(arguments,this),this.childrenChange("add",arguments),this},insert:function(e,t){return this.children.splice(e,0,t),t.parent=this,this.childrenChange("add",[t],e),this},insertAt:function(e,t){return this.insert(t,e)},remove:function(e){var t=se(e,this.children);return t>=0&&(this.children.splice(t,1),e.parent=null,this.childrenChange("remove",[e],t)),this},removeAt:function(e){if(0<=e&&e<this.children.length){var t=this.children[e];this.children.splice(e,1),t.parent=null,this.childrenChange("remove",[t],e)}return this},clear:function(){var e=this.children;return this.children=[],this._reparent(e,null),this.childrenChange("remove",e,0),this},bbox:function(e){return t(this.children,!0,this.currentTransform(e))},rawBBox:function(){return t(this.children,!1)},_clippedBBox:function(e){return n(this.children,this.currentTransform(e))},currentTransform:function(e){return _e.fn.currentTransform.call(this,e)||null},containsPoint:function(e,t){var n,i,r;if(this.visible())for(n=this.children,i=this.currentTransform(t),r=0;r<n.length;r++)if(n[r].containsPoint(e,i))return!0;return!1},_reparent:function(e,t){var n,i,r;for(n=0;n<e.length;n++)i=e[n],r=i.parent,r&&r!=this&&r.remove&&r.remove(i),i.parent=t}}),Q.mixins.Traversable.extend(S.fn,"children"),D=_e.extend({nodeType:"Text",init:function(e,t,n){_e.fn.init.call(this,n),this.content(e),this.position(t||new j.Point),this.options.font||(this.options.font="12px sans-serif"),ie(this.options.fill)||this.fill("#000")},content:function(e){return ie(e)?(this.options.set("content",e),this):this.options.get("content")},measure:function(){var e=ee.measureText(this.content(),{font:this.options.get("font")});return e},rect:function(){var e=this.measure(),t=this.position().clone();return new j.Rect(t,[e.width,e.height])},bbox:function(e){var t=K(this.currentTransform(e));return this.rect().bbox(t)},rawBBox:function(){return this.rect().bbox()},_containsPoint:function(e){return this.rect().containsPoint(e)}}),Q.mixins.Paintable.extend(D.fn),o(D.fn,["position"]),E=_e.extend({nodeType:"Circle",init:function(e,t){_e.fn.init.call(this,t),this.geometry(e||new j.Circle),ie(this.options.stroke)||this.stroke("#000")},_bbox:function(e){return this._geometry.bbox(e)},rawBBox:function(){return this._geometry.bbox()},_containsPoint:function(e){return this.geometry().containsPoint(e)},_isOnPath:function(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}}),Q.mixins.Paintable.extend(E.fn),Q.mixins.Measurable.extend(E.fn),i(E.fn,["geometry"]),F=_e.extend({nodeType:"Arc",init:function(e,t){_e.fn.init.call(this,t),this.geometry(e||new j.Arc),ie(this.options.stroke)||this.stroke("#000")},_bbox:function(e){return this._geometry.bbox(e)},rawBBox:function(){return this.geometry().bbox()},toPath:function(){var e,t=new A,n=this.geometry().curvePoints();if(n.length>0)for(t.moveTo(n[0].x,n[0].y),e=1;e<n.length;e+=3)t.curveTo(n[e],n[e+1],n[e+2]);return t},_containsPoint:function(e){return this.geometry().containsPoint(e)},_isOnPath:function(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}}),Q.mixins.Paintable.extend(F.fn),Q.mixins.Measurable.extend(F.fn),i(F.fn,["geometry"]),R=T.extend({_change:function(){this.geometryChange()}}),I=U.extend({init:function(e,t,n){this.anchor(e||new $),this.controlIn(t),this.controlOut(n)},bboxTo:function(e,t){var n,i=this.anchor().transformCopy(t),r=e.anchor().transformCopy(t);return n=this.controlOut()&&e.controlIn()?this._curveBoundingBox(i,this.controlOut().transformCopy(t),e.controlIn().transformCopy(t),r):this._lineBoundingBox(i,r)},_lineBoundingBox:function(e,t){return j.Rect.fromPoints(e,t)},_curveBoundingBox:function(e,t,n,i){var r=[e,t,n,i],o=this._curveExtremesFor(r,"x"),a=this._curveExtremesFor(r,"y"),s=ne([o.min,o.max,e.x,i.x]),l=ne([a.min,a.max,e.y,i.y]);return j.Rect.fromPoints(new $(s.min,l.min),new $(s.max,l.max))},_curveExtremesFor:function(e,t){var n=this._curveExtremes(e[0][t],e[1][t],e[2][t],e[3][t]);return{min:this._calculateCurveAt(n.min,t,e),max:this._calculateCurveAt(n.max,t,e)}},_calculateCurveAt:function(e,t,n){var i=1-e;return Z(i,3)*n[0][t]+3*Z(i,2)*e*n[1][t]+3*Z(e,2)*i*n[2][t]+Z(e,3)*n[3][t]},_curveExtremes:function(e,t,n,i){var r,o,a=e-3*t+3*n-i,s=-2*(e-2*t+n),l=e-t,d=J.sqrt(s*s-4*a*l),c=0,u=1;return 0===a?0!==s&&(c=u=-l/s):isNaN(d)||(c=(-s+d)/(2*a),u=(-s-d)/(2*a)),r=J.max(J.min(c,u),0),(r<0||r>1)&&(r=0),o=J.min(J.max(c,u),1),(o>1||o<0)&&(o=1),{min:r,max:o}},_intersectionsTo:function(e,t){var n;return n=this.controlOut()&&e.controlIn()?j.curveIntersectionsCount([this.anchor(),this.controlOut(),e.controlIn(),e.anchor()],t,this.bboxTo(e)):j.lineIntersectionsCount(this.anchor(),e.anchor(),t)},_isOnCurveTo:function(e,t,n,i){var r,o,a,s,l,d,c,u,h=this.bboxTo(e).expand(n,n);if(h.containsPoint(t))return r=this.anchor(),o=this.controlOut(),a=e.controlIn(),s=e.anchor(),"start"==i&&r.distanceTo(t)<=n?!j.isOutOfEndPoint(r,o,t):"end"==i&&s.distanceTo(t)<=n?!j.isOutOfEndPoint(s,a,t):(l=j.hasRootsInRange,d=[r,o,a,s],!(!l(d,t,"x","y",n)&&!l(d,t,"y","x",n))||(c=j.transform().rotate(45,t),u=[r.transformCopy(c),o.transformCopy(c),a.transformCopy(c),s.transformCopy(c)],l(u,t,"x","y",n)||l(u,t,"y","x",n)))},_isOnLineTo:function(e,t,n){var i=this.anchor(),r=e.anchor(),o=ee.deg(J.atan2(r.y-i.y,r.x-i.x)),a=new j.Rect([i.x,i.y-n/2],[i.distanceTo(r),n]);return a.containsPoint(t.transformCopy(j.transform().rotate(-o,i)))},_isOnPathTo:function(e,t,n,i){var r;return r=this.controlOut()&&e.controlIn()?this._isOnCurveTo(e,t,n/2,i):this._isOnLineTo(e,t,n)}}),o(I.fn,["anchor","controlIn","controlOut"]),q(I.fn,ae),A=_e.extend({nodeType:"Path",init:function(e){_e.fn.init.call(this,e),this.segments=new R,this.segments.addObserver(this),ie(this.options.stroke)||(this.stroke("#000"),ie(this.options.stroke.lineJoin)||this.options.set("stroke.lineJoin","miter"))},moveTo:function(e,t){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(e,t),this},lineTo:function(e,t){var n=ie(t)?new $(e,t):e,i=new I(n);return this.segments.push(i),this},curveTo:function(e,t,n){var i,r;return this.segments.length>0&&(i=re(this.segments),r=new I(n,t),this.suspend(),i.controlOut(e),this.resume(),this.segments.push(r)),this},arc:function(e,t,n,i,r){var o,a,s,l,d;return this.segments.length>0&&(o=re(this.segments),a=o.anchor(),s=ee.rad(e),l=new $(a.x-n*J.cos(s),a.y-i*J.sin(s)),d=new j.Arc(l,{startAngle:e,endAngle:t,radiusX:n,radiusY:i,anticlockwise:r}),this._addArcSegments(d)),this},arcTo:function(e,t,n,i,r){var o,a,s;return this.segments.length>0&&(o=re(this.segments),a=o.anchor(),s=j.Arc.fromPoints(a,e,t,n,i,r),this._addArcSegments(s)),this},_addArcSegments:function(e){var t,n;for(this.suspend(),t=e.curvePoints(),n=1;n<t.length;n+=3)this.curveTo(t[n],t[n+1],t[n+2]);this.resume(),this.geometryChange()},close:function(){return this.options.closed=!0,this.geometryChange(),this},rawBBox:function(){return this._bbox()},_containsPoint:function(e){var t,n,i,r=this.segments,o=r.length,a=0;for(i=1;i<o;i++)t=r[i-1],n=r[i],a+=t._intersectionsTo(n,e);return!this.options.closed&&r[0].anchor().equals(r[o-1].anchor())||(a+=j.lineIntersectionsCount(r[0].anchor(),r[o-1].anchor(),e)),a%2!==0},_isOnPath:function(e,t){var n,i=this.segments,r=i.length;if(t=t||this.options.stroke.width,r>1){if(i[0]._isOnPathTo(i[1],e,t,"start"))return!0;for(n=2;n<=r-2;n++)if(i[n-1]._isOnPathTo(i[n],e,t))return!0;if(i[r-2]._isOnPathTo(i[r-1],e,t,"end"))return!0}return!1},_bbox:function(e){var t,n,i,r,o=this.segments,a=o.length;if(1===a)n=o[0].anchor().transformCopy(e),t=new j.Rect(n,G.ZERO);else if(a>0)for(i=1;i<a;i++)r=o[i-1].bboxTo(o[i],e),t=t?j.Rect.union(t,r):r;return t}}),Q.mixins.Paintable.extend(A.fn),Q.mixins.Measurable.extend(A.fn),A.fromRect=function(e,t){return new A(t).moveTo(e.topLeft()).lineTo(e.topRight()).lineTo(e.bottomRight()).lineTo(e.bottomLeft()).close()},A.fromPoints=function(e,t){var n,i,r;if(e){for(n=new A(t),i=0;i<e.length;i++)r=$.create(e[i]),r&&(0===i?n.moveTo(r):n.lineTo(r));return n}},A.fromArc=function(e,t){var n=new A(t),i=e.startAngle,r=e.pointAt(i);return n.moveTo(r.x,r.y),n.arc(i,e.endAngle,e.radiusX,e.radiusY,e.anticlockwise),n},M=_e.extend({nodeType:"MultiPath",init:function(e){_e.fn.init.call(this,e),this.paths=new R,this.paths.addObserver(this),ie(this.options.stroke)||this.stroke("#000")},moveTo:function(e,t){var n=new A;return n.moveTo(e,t),this.paths.push(n),this},lineTo:function(e,t){return this.paths.length>0&&re(this.paths).lineTo(e,t),this},curveTo:function(e,t,n){return this.paths.length>0&&re(this.paths).curveTo(e,t,n),this},arc:function(e,t,n,i,r){return this.paths.length>0&&re(this.paths).arc(e,t,n,i,r),this},arcTo:function(e,t,n,i,r){return this.paths.length>0&&re(this.paths).arcTo(e,t,n,i,r),this},close:function(){return this.paths.length>0&&re(this.paths).close(),this},_bbox:function(e){return t(this.paths,!0,e)},rawBBox:function(){return t(this.paths,!1)},_containsPoint:function(e){var t,n=this.paths;for(t=0;t<n.length;t++)if(n[t]._containsPoint(e))return!0;return!1},_isOnPath:function(e){var t,n=this.paths,i=this.options.stroke.width;for(t=0;t<n.length;t++)if(n[t]._isOnPath(e,i))return!0;return!1;
},_clippedBBox:function(e){return n(this.paths,this.currentTransform(e))}}),Q.mixins.Paintable.extend(M.fn),Q.mixins.Measurable.extend(M.fn),z=_e.extend({nodeType:"Image",init:function(e,t,n){_e.fn.init.call(this,n),this.src(e),this.rect(t||new j.Rect)},src:function(e){return ie(e)?(this.options.set("src",e),this):this.options.get("src")},bbox:function(e){var t=K(this.currentTransform(e));return this._rect.bbox(t)},rawBBox:function(){return this._rect.bbox()},_containsPoint:function(e){return this._rect.containsPoint(e)},_hasFill:function(){return this.src()}}),i(z.fn,["rect"]),H=U.extend({init:function(e,t,n){this.options=new X({offset:e,color:t,opacity:ie(n)?n:1}),this.options.addObserver(this)}}),s(H.fn,["offset","color","opacity"]),q(H.fn,ae),H.create=function(e){if(ie(e)){var t;return t=e instanceof H?e:e.length>1?new H(e[0],e[1],e[2]):new H(e.offset,e.color,e.opacity)}},N=T.extend({_change:function(){this.optionsChange({field:"stops"})}}),P=U.extend({nodeType:"gradient",init:function(e){this.stops=new N(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=d()},userSpace:function(e){return ie(e)?(this._userSpace=e,this.optionsChange(),this):this._userSpace},_createStops:function(e){var t,n=[];for(e=e||[],t=0;t<e.length;t++)n.push(H.create(e[t]));return n},addStop:function(e,t,n){this.stops.push(new H(e,t,n))},removeStop:function(e){var t=this.stops.indexOf(e);t>=0&&this.stops.splice(t,1)}}),q(P.fn,ae,{optionsChange:function(e){this.trigger("optionsChange",{field:"gradient"+(e?"."+e.field:""),value:this})},geometryChange:function(){this.optionsChange()}}),L=P.extend({init:function(e){e=e||{},P.fn.init.call(this,e),this.start(e.start||new $),this.end(e.end||new $(1,0))}}),o(L.fn,["start","end"]),B=P.extend({init:function(e){e=e||{},P.fn.init.call(this,e),this.center(e.center||new $),this._radius=ie(e.radius)?e.radius:1,this._fallbackFill=e.fallbackFill},radius:function(e){return ie(e)?(this._radius=e,this.geometryChange(),this):this._radius},fallbackFill:function(e){return ie(e)?(this._fallbackFill=e,this.optionsChange(),this):this._fallbackFill}}),o(B.fn,["center"]),O=_e.extend({nodeType:"Rect",init:function(e,t){_e.fn.init.call(this,t),this.geometry(e||new j.Rect),ie(this.options.stroke)||this.stroke("#000")},_bbox:function(e){return this._geometry.bbox(e)},rawBBox:function(){return this._geometry.bbox()},_containsPoint:function(e){return this._geometry.containsPoint(e)},_isOnPath:function(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}}),Q.mixins.Paintable.extend(O.fn),Q.mixins.Measurable.extend(O.fn),i(O.fn,["geometry"]),V=S.extend({init:function(e,t){S.fn.init.call(this,W.deepExtend({},this._defaults,t)),this._rect=e,this._fieldMap={}},_defaults:{alignContent:me,justifyContent:me,alignItems:me,spacing:0,orientation:ve,lineSpacing:0,wrap:!0},rect:function(e){return e?(this._rect=e,this):this._rect},_initMap:function(){var e=this.options,t=this._fieldMap;e.orientation==ve?(t.sizeField="width",t.groupsSizeField="height",t.groupAxis="x",t.groupsAxis="y"):(t.sizeField="height",t.groupsSizeField="width",t.groupAxis="y",t.groupsAxis="x")},reflow:function(){var e,t,n,i,r,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,k,w,x,T,S,D;if(this._rect&&0!==this.children.length){for(this._initMap(),this.options.transform&&this.transform(null),e=this.options,t=this._fieldMap,n=this._rect,i=this._initGroups(),r=i.groups,o=i.groupsSize,a=t.sizeField,s=t.groupsSizeField,l=t.groupAxis,d=t.groupsAxis,c=y(o,n,e.alignContent,d,s),u=new $,h=new $,f=new j.Size,b=0;b<r.length;b++){for(v=r[b],u[l]=p=y(v.size,n,e.justifyContent,l,a),u[d]=c,f[a]=v.size,f[s]=v.lineSize,_=new j.Rect(u,f),k=0;k<v.bboxes.length;k++)g=v.elements[k],m=v.bboxes[k],h[l]=p,h[d]=y(m.size[s],_,e.alignItems,d,s),C(h,m,g),p+=m.size[a]+e.spacing;c+=v.lineSize+e.lineSpacing}!e.wrap&&v.size>n.size[a]&&(w=n.size[a]/_.size[a],x=_.topLeft().scale(w,w),T=_.size[s]*w,S=y(T,n,e.alignContent,d,s),D=j.transform(),"x"===l?D.translate(n.origin.x-x.x,S-x.y):D.translate(S-x.x,n.origin.y-x.y),D.scale(w,w),this.transform(D))}},_initGroups:function(){var e,t,n,i=this.options,r=this.children,o=i.lineSpacing,a=this._fieldMap.sizeField,s=-o,l=[],d=this._newGroup(),c=function(){l.push(d),s+=d.lineSize+o};for(n=0;n<r.length;n++)t=r[n],e=r[n].clippedBBox(),t.visible()&&e&&(i.wrap&&d.size+e.size[a]+i.spacing>this._rect.size[a]?0===d.bboxes.length?(this._addToGroup(d,e,t),c(),d=this._newGroup()):(c(),d=this._newGroup(),this._addToGroup(d,e,t)):this._addToGroup(d,e,t));return d.bboxes.length&&c(),{groups:l,groupsSize:s}},_addToGroup:function(e,t,n){e.size+=t.size[this._fieldMap.sizeField]+this.options.spacing,e.lineSize=Math.max(t.size[this._fieldMap.groupsSizeField],e.lineSize),e.bboxes.push(t),e.elements.push(n)},_newGroup:function(){return{lineSize:0,size:-this.options.spacing,bboxes:[],elements:[]}}}),q(Q,{align:c,Arc:F,Circle:E,Element:_e,ElementsArray:T,fit:v,Gradient:P,GradientStop:H,Group:S,Image:z,Layout:V,LinearGradient:L,MultiPath:M,Path:A,RadialGradient:B,Rect:O,Segment:I,stack:h,Text:D,vAlign:u,vStack:f,vWrap:m,wrap:p})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/parser.min",["drawing/shapes.min"],e)}(function(){!function(e){function t(e){var t=[];return e.replace(m,function(e,n){t.push(parseFloat(n))}),t}function n(e,t,n){var i,r=t?0:1;for(i=0;i<e.length;i+=2)e.splice(i+r,0,n)}function i(e,t){if(e&&t)return t.scaleCopy(2).translate(-e.x,-e.y)}function r(e,t,n){var i=1/3;return t=t.clone().scale(2/3),{controlOut:t.clone().translateWith(e.scaleCopy(i)),controlIn:t.translateWith(n.scaleCopy(i))}}var o=window.kendo,a=o.drawing,s=o.geometry,l=o.Class,d=s.Point,c=o.deepExtend,u=e.trim,h=o.util,f=h.last,p=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,m=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g,g="m",v="z",_=l.extend({parse:function(e,n){var i,r=new a.MultiPath(n),o=new d;return e.replace(p,function(e,n,a,s){var l=n.toLowerCase(),d=l===n,c=t(u(a));if(l===g&&(d?(o.x+=c[0],o.y+=c[1]):(o.x=c[0],o.y=c[1]),r.moveTo(o.x,o.y),c.length>2&&(l="l",c.splice(0,2))),b[l])b[l](r,{parameters:c,position:o,isRelative:d,previousCommand:i}),s&&s.toLowerCase()===v&&r.close();else if(l!==g)throw Error("Error while parsing SVG path. Unsupported command: "+l);i=l}),r}}),b={l:function(e,t){var n,i,r=t.parameters,o=t.position;for(n=0;n<r.length;n+=2)i=new d(r[n],r[n+1]),t.isRelative&&i.translateWith(o),e.lineTo(i.x,i.y),o.x=i.x,o.y=i.y},c:function(e,t){var n,i,r,o,a=t.parameters,s=t.position;for(o=0;o<a.length;o+=6)n=new d(a[o],a[o+1]),i=new d(a[o+2],a[o+3]),r=new d(a[o+4],a[o+5]),t.isRelative&&(i.translateWith(s),n.translateWith(s),r.translateWith(s)),e.curveTo(n,i,r),s.x=r.x,s.y=r.y},v:function(e,t){var i=t.isRelative?0:t.position.x;n(t.parameters,!0,i),this.l(e,t)},h:function(e,t){var i=t.isRelative?0:t.position.y;n(t.parameters,!1,i),this.l(e,t)},a:function(e,t){var n,i,r,o,a,s,l=t.parameters,c=t.position;for(n=0;n<l.length;n+=7)i=l[n],r=l[n+1],o=l[n+3],a=l[n+4],s=new d(l[n+5],l[n+6]),t.isRelative&&s.translateWith(c),e.arcTo(s,i,r,o,a),c.x=s.x,c.y=s.y},s:function(e,t){var n,r,o,a,s,l=t.parameters,c=t.position,u=t.previousCommand;for("s"!=u&&"c"!=u||(a=f(f(e.paths).segments).controlIn()),s=0;s<l.length;s+=4)o=new d(l[s],l[s+1]),r=new d(l[s+2],l[s+3]),t.isRelative&&(o.translateWith(c),r.translateWith(c)),n=a?i(a,c):c.clone(),a=o,e.curveTo(n,o,r),c.x=r.x,c.y=r.y},q:function(e,t){var n,i,o,a,s=t.parameters,l=t.position;for(a=0;a<s.length;a+=4)o=new d(s[a],s[a+1]),i=new d(s[a+2],s[a+3]),t.isRelative&&(o.translateWith(l),i.translateWith(l)),n=r(l,o,i),e.curveTo(n.controlOut,n.controlIn,i),l.x=i.x,l.y=i.y},t:function(e,t){var n,o,a,s,l,c=t.parameters,u=t.position,h=t.previousCommand;for("q"!=h&&"t"!=h||(s=f(f(e.paths).segments),o=s.controlIn().clone().translateWith(u.scaleCopy(-1/3)).scale(1.5)),l=0;l<c.length;l+=2)a=new d(c[l],c[l+1]),t.isRelative&&a.translateWith(u),o=o?i(o,u):u.clone(),n=r(u,o,a),e.curveTo(n.controlOut,n.controlIn,a),u.x=a.x,u.y=a.y}};_.current=new _,a.Path.parse=function(e,t){return _.current.parse(e,t)},c(a,{PathParser:_})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/search.min",["drawing/shapes.min"],e)}(function(){!function(e){function t(e,t){return e._zIndex<t._zIndex?1:e._zIndex>t._zIndex?-1:0}var n=window.kendo,i=n.drawing,r=n.geometry,o=n.Class,a=r.Rect,s=n.deepExtend,l=e.isArray,d=e.inArray,c=Math,u=1e4,h=75,f=o.extend({init:function(){this.shapes=[]},_add:function(e,t){this.shapes.push({bbox:t,shape:e}),e._quadNode=this},pointShapes:function(e){var t,n=this.shapes,i=n.length,r=[];for(t=0;t<i;t++)n[t].bbox.containsPoint(e)&&r.push(n[t].shape);return r},insert:function(e,t){this._add(e,t)},remove:function(e){var t,n=this.shapes,i=n.length;for(t=0;t<i;t++)if(n[t].shape===e){n.splice(t,1);break}}}),p=f.extend({init:function(e){f.fn.init.call(this),this.children=[],this.rect=e},inBounds:function(e){var t=this.rect,n=t.bottomRight(),i=e.bottomRight(),r=t.origin.x<=e.origin.x&&t.origin.y<=e.origin.y&&i.x<=n.x&&i.y<=n.y;return r},pointShapes:function(e){var t,n=this.children,i=n.length,r=f.fn.pointShapes.call(this,e);for(t=0;t<i;t++)r=r.concat(n[t].pointShapes(e));return r},insert:function(e,t){var n,i=!1,r=this.children;if(this.inBounds(t)){if(this.shapes.length<4)this._add(e,t);else{for(r.length||this._initChildren(),n=0;n<r.length;n++)if(r[n].insert(e,t)){i=!0;break}i||this._add(e,t)}i=!0}return i},_initChildren:function(){var e=this.rect,t=this.children,n=e.center(),i=e.width()/2,r=e.height()/2;t.push(new p(new a([e.origin.x,e.origin.y],[i,r])),new p(new a([n.x,e.origin.y],[i,r])),new p(new a([e.origin.x,n.y],[i,r])),new p(new a([n.x,n.y],[i,r])))}}),m=o.extend({ROOT_SIZE:1e3,init:function(){this.initRoots()},initRoots:function(){this.rootMap={},this.root=new f,this.rootElements=[]},clear:function(){var e,t=this,n=t.rootElements;for(e=0;e<n.length;e++)this.remove(n[e]);this.initRoots()},pointShape:function(e){var n,i=this.ROOT_SIZE,r=this.root.pointShapes(e),o=(this.rootMap[c.floor(e.x/i)]||{})[c.floor(e.y/i)];for(o&&(r=r.concat(o.pointShapes(e))),this.assignZindex(r),r.sort(t),n=0;n<r.length;n++)if(r[n].containsPoint(e))return r[n]},assignZindex:function(e){var t,n,i,r,o;for(o=0;o<e.length;o++){for(t=e[o],i=0,n=c.pow(u,h),r=[];t;)r.push(t),t=t.parent;for(;r.length;)t=r.pop(),i+=(d(t,t.parent?t.parent.children:this.rootElements)+1)*n,n/=u;e[o]._zIndex=i}},optionsChange:function(e){"transform"!=e.field&&"stroke.width"!=e.field||this.bboxChange(e.element)},geometryChange:function(e){this.bboxChange(e.element)},bboxChange:function(e){if("Group"===e.nodeType)for(var t=0;t<e.children.length;t++)this.bboxChange(e.children[t]);else e._quadNode&&e._quadNode.remove(e),this._insertShape(e)},add:function(e){var t=l(e)?e.slice(0):[e];this.rootElements.push.apply(this.rootElements,t),this._insert(t)},childrenChange:function(e){if("remove"==e.action)for(var t=0;t<e.items.length;t++)this.remove(e.items[t]);else this._insert(Array.prototype.slice.call(e.items,0))},_insert:function(e){for(var t;e.length>0;)t=e.pop(),t.addObserver(this),"Group"==t.nodeType?e.push.apply(e,t.children):this._insertShape(t)},_insertShape:function(e){var t,n,i,r,o=e.bbox();o&&(t=this.ROOT_SIZE,n=this.getSectors(o),i=n[0][0],r=n[1][0],this.inRoot(n)?this.root.insert(e,o):(this.rootMap[i]||(this.rootMap[i]={}),this.rootMap[i][r]||(this.rootMap[i][r]=new p(new a([i*t,r*t],[t,t]))),this.rootMap[i][r].insert(e,o)))},remove:function(e){var t,n;if(e.removeObserver(this),"Group"==e.nodeType)for(t=e.children,n=0;n<t.length;n++)this.remove(t[n]);else e._quadNode&&(e._quadNode.remove(e),delete e._quadNode)},inRoot:function(e){return e[0].length>1||e[1].length>1},getSectors:function(e){var t,n,i=this.ROOT_SIZE,r=e.bottomRight(),o=c.floor(r.x/i),a=c.floor(r.y/i),s=[[],[]];for(t=c.floor(e.origin.x/i);t<=o;t++)s[0].push(t);for(n=c.floor(e.origin.y/i);n<=a;n++)s[1].push(n);return s}});s(i,{ShapesQuadTree:m,QuadNode:p})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/svg.min",["drawing/shapes.min","util/main.min"],e)}(function(){!function(e){function t(e){var t,n,i,r;try{t=e.getScreenCTM?e.getScreenCTM():null}catch(o){}t&&(n=-t.e%1,i=-t.f%1,r=e.style,0===n&&0===i||(r.left=n+"px",r.top=i+"px"))}function n(){var e=document.getElementsByTagName("base")[0],t="",n=document.location.href,i=n.indexOf("#");return e&&!c.support.browser.msie&&(i!==-1&&(n=n.substring(0,i)),t=n),t}function i(e){return"url("+n()+"#"+e+")"}function r(e){var t,n,i,r=new z,o=e.clippedBBox();return o&&(t=o.getOrigin(),n=new f.Group,n.transform(h.transform().translate(-t.x,-t.y)),n.children.push(e),e=n),r.load([e]),i="<?xml version='1.0' ?><svg xmlns='"+F+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>"+r.render()+"</svg>",r.destroy(),i}function o(t,n){var i=r(t);return n&&n.raw||(i="data:image/svg+xml;base64,"+m.encodeBase64(i)),e.Deferred().resolve(i).promise()}function a(e,t){return"clip"==e||"fill"==e&&(!t||t.nodeType==C)}function s(e){if(!e||!e.indexOf||e.indexOf("&")<0)return e;var t=s._element;return t.innerHTML=e,t.textContent||t.innerText}var l,d=document,c=window.kendo,u=c.deepExtend,h=c.geometry,f=c.drawing,p=f.BaseNode,m=c.util,g=m.defined,v=m.isTransparent,_=m.renderAttr,b=m.renderAllAttr,k=m.renderTemplate,w=e.inArray,y="butt",x=f.DASH_ARRAYS,C="gradient",T="none",S=".kendo",D="solid",E=" ",F="http://www.w3.org/2000/svg",R="transform",I="undefined",A=f.Surface.extend({init:function(e,n){f.Surface.fn.init.call(this,e,n),this._root=new z(this.options),Q(this.element[0],this._template(this)),this._rootElement=this.element[0].firstElementChild,t(this._rootElement),this._root.attachTo(this._rootElement),this.element.on("click"+S,this._click),this.element.on("mouseover"+S,this._mouseenter),this.element.on("mouseout"+S,this._mouseleave),this.element.on("mousemove"+S,this._mousemove),this.resize()},type:"svg",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this._rootElement=null,this.element.off(S)),f.Surface.fn.destroy.call(this)},translate:function(e){var t=c.format("{0} {1} {2} {3}",Math.round(e.x),Math.round(e.y),this._size.width,this._size.height);this._offset=e,this._rootElement.setAttribute("viewBox",t)},draw:function(e){f.Surface.fn.draw.call(this,e),this._root.load([e])},clear:function(){f.Surface.fn.clear.call(this),this._root.clear()},svg:function(){return"<?xml version='1.0' ?>"+this._template(this)},exportVisual:function(){var e,t=this._visual,n=this._offset;return n&&(e=new f.Group,e.children.push(t),e.transform(h.transform().translate(-n.x,-n.y)),t=e),t},_resize:function(){this._offset&&this.translate(this._offset)},_template:k("<svg style='width: 100%; height: 100%; overflow: hidden;' xmlns='"+F+"' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>#= d._root.render() #</svg>")}),M=p.extend({init:function(e){p.fn.init.call(this,e),this.definitions={}},destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null),this.clearDefinitions(),p.fn.destroy.call(this)},load:function(e,t){var n,i,r,o,a=this,s=a.element;for(o=0;o<e.length;o++)i=e[o],r=i.children,n=new K[i.nodeType](i),g(t)?a.insertAt(n,t):a.append(n),n.createDefinitions(),r&&r.length>0&&n.load(r),s&&n.attachTo(s,t)},root:function(){for(var e=this;e.parent;)e=e.parent;return e},attachTo:function(e,t){var n,i=d.createElement("div");Q(i,"<svg xmlns='"+F+"' version='1.1'>"+this.render()+"</svg>"),n=i.firstChild.firstChild,n&&(g(t)?e.insertBefore(n,e.childNodes[t]||null):e.appendChild(n),this.setElement(n))},setElement:function(e){var t,n,i=this.childNodes;for(this.element&&(this.element._kendoNode=null),this.element=e,this.element._kendoNode=this,n=0;n<i.length;n++)t=e.childNodes[n],i[n].setElement(t)},clear:function(){var e,t;for(this.clearDefinitions(),this.element&&(this.element.innerHTML=""),e=this.childNodes,t=0;t<e.length;t++)e[t].destroy();this.childNodes=[]},removeSelf:function(){if(this.element){var e=this.element.parentNode;e&&e.removeChild(this.element),this.element=null}p.fn.removeSelf.call(this)},template:k("#= d.renderChildren() #"),render:function(){return this.template(this)},renderChildren:function(){var e,t=this.childNodes,n="";for(e=0;e<t.length;e++)n+=t[e].render();return n},optionsChange:function(e){var t=e.field,n=e.value;"visible"===t?this.css("display",n?"":T):l[t]&&a(t,n)?this.updateDefinition(t,n):"opacity"===t&&this.attr("opacity",n),p.fn.optionsChange.call(this,e)},attr:function(e,t){this.element&&this.element.setAttribute(e,t)},allAttr:function(e){for(var t=0;t<e.length;t++)this.attr(e[t][0],e[t][1])},css:function(e,t){this.element&&(this.element.style[e]=t)},allCss:function(e){for(var t=0;t<e.length;t++)this.css(e[t][0],e[t][1])},removeAttr:function(e){this.element&&this.element.removeAttribute(e)},mapTransform:function(e){var t=[];return e&&t.push([R,"matrix("+e.matrix().toString(6)+")"]),t},renderTransform:function(){return b(this.mapTransform(this.srcElement.transform()))},transformChange:function(e){e?this.allAttr(this.mapTransform(e)):this.removeAttr(R)},mapStyle:function(){var e=this.srcElement.options,t=[["cursor",e.cursor]];return e.visible===!1&&t.push(["display",T]),t},renderStyle:function(){return _("style",m.renderStyle(this.mapStyle(!0)))},renderOpacity:function(){return _("opacity",this.srcElement.options.opacity)},createDefinitions:function(){var e,t,n,i,r=this.srcElement,o=this.definitions;if(r){n=r.options;for(t in l)e=n.get(t),e&&a(t,e)&&(o[t]=e,i=!0);i&&this.definitionChange({action:"add",definitions:o})}},definitionChange:function(e){this.parent&&this.parent.definitionChange(e)},updateDefinition:function(e,t){var n=this.definitions,r=n[e],o=l[e],a={};r&&(a[e]=r,this.definitionChange({action:"remove",definitions:a}),delete n[e]),t?(a[e]=t,this.definitionChange({action:"add",definitions:a}),n[e]=t,this.attr(o,i(t.id))):r&&this.removeAttr(o)},clearDefinitions:function(){var e,t=this.definitions;for(e in t){this.definitionChange({action:"remove",definitions:t}),this.definitions={};break}},renderDefinitions:function(){return b(this.mapDefinitions())},mapDefinitions:function(){var e,t=this.definitions,n=[];for(e in t)n.push([l[e],i(t[e].id)]);return n}}),z=M.extend({init:function(e){M.fn.init.call(this),this.options=e,this.defs=new H},attachTo:function(e){this.element=e,this.defs.attachTo(e.firstElementChild)},clear:function(){p.fn.clear.call(this)},template:k("#=d.defs.render()##= d.renderChildren() #"),definitionChange:function(e){this.defs.definitionChange(e)}}),H=M.extend({init:function(){M.fn.init.call(this),this.definitionMap={}},attachTo:function(e){this.element=e},template:k("<defs>#= d.renderChildren()#</defs>"),definitionChange:function(e){var t=e.definitions,n=e.action;"add"==n?this.addDefinitions(t):"remove"==n&&this.removeDefinitions(t)},createDefinition:function(e,t){var n;return"clip"==e?n=N:"fill"==e&&(t instanceof f.LinearGradient?n=$:t instanceof f.RadialGradient&&(n=G)),new n(t)},addDefinitions:function(e){for(var t in e)this.addDefinition(t,e[t])},addDefinition:function(e,t){var n,i=this.definitionMap,r=t.id,o=this.element,a=i[r];a?a.count++:(n=this.createDefinition(e,t),i[r]={element:n,count:1},this.append(n),o&&n.attachTo(this.element))},removeDefinitions:function(e){for(var t in e)this.removeDefinition(e[t])},removeDefinition:function(e){var t=this.definitionMap,n=e.id,i=t[n];i&&(i.count--,0===i.count&&(this.remove(w(i.element,this.childNodes),1),delete t[n]))}}),N=M.extend({init:function(e){M.fn.init.call(this),this.srcElement=e,this.id=e.id,this.load([e])},template:k("<clipPath id='#=d.id#'>#= d.renderChildren()#</clipPath>")}),P=M.extend({template:k("<g#= d.renderTransform() + d.renderStyle() + d.renderOpacity() + d.renderDefinitions()#>#= d.renderChildren() #</g>"),optionsChange:function(e){e.field==R&&this.transformChange(e.value),M.fn.optionsChange.call(this,e)}}),L=M.extend({geometryChange:function(){this.attr("d",this.renderData()),this.invalidate()},optionsChange:function(e){switch(e.field){case"fill":e.value?this.allAttr(this.mapFill(e.value)):this.removeAttr("fill");break;case"fill.color":this.allAttr(this.mapFill({color:e.value}));break;case"stroke":e.value?this.allAttr(this.mapStroke(e.value)):this.removeAttr("stroke");break;case R:this.transformChange(e.value);break;default:var t=this.attributeMap[e.field];t&&this.attr(t,e.value)}M.fn.optionsChange.call(this,e)},attributeMap:{"fill.opacity":"fill-opacity","stroke.color":"stroke","stroke.width":"stroke-width","stroke.opacity":"stroke-opacity"},content:function(){this.element&&(this.element.textContent=this.srcElement.content())},renderData:function(){return this.printPath(this.srcElement)},printPath:function(e){var t,n,i,r,o,a=e.segments,s=a.length;if(s>0){for(t=[],o=1;o<s;o++)i=this.segmentType(a[o-1],a[o]),i!==r&&(r=i,t.push(i)),t.push("L"===i?this.printPoints(a[o].anchor()):this.printPoints(a[o-1].controlOut(),a[o].controlIn(),a[o].anchor()));return n="M"+this.printPoints(a[0].anchor())+E+t.join(E),e.options.closed&&(n+="Z"),n}},printPoints:function(){var e,t=arguments,n=t.length,i=[];for(e=0;e<n;e++)i.push(t[e].toString(3));return i.join(E)},segmentType:function(e,t){return e.controlOut()&&t.controlIn()?"C":"L"},mapStroke:function(e){var t=[];return e&&!v(e.color)?(t.push(["stroke",e.color]),t.push(["stroke-width",e.width]),t.push(["stroke-linecap",this.renderLinecap(e)]),t.push(["stroke-linejoin",e.lineJoin]),g(e.opacity)&&t.push(["stroke-opacity",e.opacity]),g(e.dashType)&&t.push(["stroke-dasharray",this.renderDashType(e)])):t.push(["stroke",T]),t},renderStroke:function(){return b(this.mapStroke(this.srcElement.options.stroke))},renderDashType:function(e){var t,n,i,r=e.width||1,o=e.dashType;if(o&&o!=D){for(t=x[o.toLowerCase()],n=[],i=0;i<t.length;i++)n.push(t[i]*r);return n.join(" ")}},renderLinecap:function(e){var t=e.dashType,n=e.lineCap;return t&&t!=D?y:n},mapFill:function(e){var t=[];return e&&e.nodeType==C||(e&&!v(e.color)?(t.push(["fill",e.color]),g(e.opacity)&&t.push(["fill-opacity",e.opacity])):t.push(["fill",T])),t},renderFill:function(){return b(this.mapFill(this.srcElement.options.fill))},template:k("<path #= d.renderStyle() # #= d.renderOpacity() # #= kendo.util.renderAttr('d', d.renderData()) # #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() #></path>")}),B=L.extend({renderData:function(){return this.printPath(this.srcElement.toPath())}}),O=L.extend({renderData:function(){var e,t,n=this.srcElement.paths;if(n.length>0){for(e=[],t=0;t<n.length;t++)e.push(this.printPath(n[t]));return e.join(" ")}}}),V=L.extend({geometryChange:function(){var e=this.center();this.attr("cx",e.x),this.attr("cy",e.y),this.attr("r",this.radius()),this.invalidate()},center:function(){return this.srcElement.geometry().center},radius:function(){return this.srcElement.geometry().radius},template:k("<circle #= d.renderStyle() # #= d.renderOpacity() # cx='#= d.center().x #' cy='#= d.center().y #' r='#= d.radius() #' #= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() # ></circle>")}),W=L.extend({geometryChange:function(){var e=this.pos();this.attr("x",e.x),this.attr("y",e.y),this.invalidate()},optionsChange:function(e){"font"===e.field?(this.attr("style",m.renderStyle(this.mapStyle())),this.geometryChange()):"content"===e.field&&L.fn.content.call(this,this.srcElement.content()),L.fn.optionsChange.call(this,e)},mapStyle:function(e){var t=L.fn.mapStyle.call(this,e),n=this.srcElement.options.font;return e&&(n=c.htmlEncode(n)),t.push(["font",n]),t},pos:function(){var e=this.srcElement.position(),t=this.srcElement.measure();return e.clone().setY(e.y+t.baseline)},renderContent:function(){var e=this.srcElement.content();return e=s(e),e=c.htmlEncode(e)},template:k("<text #= d.renderStyle() # #= d.renderOpacity() # x='#= this.pos().x #' y='#= this.pos().y #' #= d.renderStroke() # #= d.renderTransform() # #= d.renderDefinitions() # #= d.renderFill() #>#= d.renderContent() #</text>")}),U=L.extend({geometryChange:function(){this.allAttr(this.mapPosition()),this.invalidate()},optionsChange:function(e){"src"===e.field&&this.allAttr(this.mapSource()),L.fn.optionsChange.call(this,e)},mapPosition:function(){var e=this.srcElement.rect(),t=e.topLeft();return[["x",t.x],["y",t.y],["width",e.width()+"px"],["height",e.height()+"px"]]},renderPosition:function(){return b(this.mapPosition())},mapSource:function(e){var t=this.srcElement.src();return e&&(t=c.htmlEncode(t)),[["xlink:href",t]]},renderSource:function(){return b(this.mapSource(!0))},template:k("<image preserveAspectRatio='none' #= d.renderStyle() # #= d.renderTransform()# #= d.renderOpacity() # #= d.renderPosition() # #= d.renderSource() # #= d.renderDefinitions()#></image>")}),q=M.extend({template:k("<stop #=d.renderOffset()# #=d.renderStyle()# />"),renderOffset:function(){return _("offset",this.srcElement.offset())},mapStyle:function(){var e=this.srcElement;return[["stop-color",e.color()],["stop-opacity",e.opacity()]]},optionsChange:function(e){"offset"==e.field?this.attr(e.field,e.value):"color"!=e.field&&"opacity"!=e.field||this.css("stop-"+e.field,e.value)}}),j=M.extend({init:function(e){M.fn.init.call(this,e),this.id=e.id,this.loadStops()},loadStops:function(){var e,t,n=this.srcElement,i=n.stops,r=this.element;for(t=0;t<i.length;t++)e=new q(i[t]),this.append(e),r&&e.attachTo(r)},optionsChange:function(e){"gradient.stops"==e.field?(p.fn.clear.call(this),this.loadStops()):e.field==C&&this.allAttr(this.mapCoordinates())},renderCoordinates:function(){return b(this.mapCoordinates())},mapSpace:function(){return["gradientUnits",this.srcElement.userSpace()?"userSpaceOnUse":"objectBoundingBox"]}}),$=j.extend({template:k("<linearGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#</linearGradient>"),mapCoordinates:function(){var e=this.srcElement,t=e.start(),n=e.end(),i=[["x1",t.x],["y1",t.y],["x2",n.x],["y2",n.y],this.mapSpace()];return i}}),G=j.extend({template:k("<radialGradient id='#=d.id#' #=d.renderCoordinates()#>#= d.renderChildren()#</radialGradient>"),mapCoordinates:function(){var e=this.srcElement,t=e.center(),n=e.radius(),i=[["cx",t.x],["cy",t.y],["r",n],this.mapSpace()];return i}}),Y=L.extend({geometryChange:function(){var e=this.srcElement.geometry();this.attr("x",e.origin.x),this.attr("y",e.origin.y),this.attr("width",e.size.width),this.attr("height",e.size.height),this.invalidate()},size:function(){return this.srcElement.geometry().size},origin:function(){return this.srcElement.geometry().origin},template:k("<rect #= d.renderStyle() # #= d.renderOpacity() # x='#= d.origin().x #' y='#= d.origin().y #' width='#= d.size().width #' height='#= d.size().height #'#= d.renderStroke() # #= d.renderFill() # #= d.renderDefinitions() # #= d.renderTransform() # />")}),K={Group:P,Text:W,Path:L,MultiPath:O,Circle:V,Arc:B,Image:U,Rect:Y},Q=function(e,t){e.innerHTML=t};!function(){var e="<svg xmlns='"+F+"'></svg>",t=d.createElement("div"),n=typeof DOMParser!=I;t.innerHTML=e,n&&t.firstChild.namespaceURI!=F&&(Q=function(e,t){var n=new DOMParser,i=n.parseFromString(t,"text/xml"),r=d.adoptNode(i.documentElement);e.innerHTML="",e.appendChild(r)})}(),s._element=document.createElement("span"),l={clip:"clip-path",fill:"fill"},c.support.svg=function(){return d.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}(),c.support.svg&&f.SurfaceFactory.current.register("svg",A,10),u(f,{exportSVG:o,svg:{ArcNode:B,CircleNode:V,ClipNode:N,DefinitionNode:H,GradientStopNode:q,GroupNode:P,ImageNode:U,LinearGradientNode:$,MultiPathNode:O,Node:M,PathNode:L,RadialGradientNode:G,RectNode:Y,RootNode:z,Surface:A,TextNode:W,_exportGroup:r}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/canvas.min",["drawing/search.min","kendo.color.min"],e)}(function(){!function(e){function t(t,n){var i,r,o,a,s,l,d={width:"800px",height:"600px",cors:"Anonymous"},c=t.clippedBBox();return c&&(i=c.getOrigin(),r=new w.Group,r.transform(k.transform().translate(-i.x,-i.y)),r.children.push(t),t=r,o=c.getSize(),d.width=o.width+"px",d.height=o.height+"px"),n=p(d,n),a=e("<div />").css({display:"none",width:n.width,height:n.height}).appendTo(document.body),s=new F(a,n),s.suspendTracking(),s.draw(t),l=s.image(),l.always(function(){s.destroy(),a.remove()}),l}function n(e,t){var n,i,r;for(r=0;r<t.length;r++)i=t[r],n=f.parseColor(i.color()),n.a*=i.opacity(),e.addColorStop(i.offset(),n.toCssRgba())}var i,r,o,a,s,l,d,c,u,h=document,f=window.kendo,p=f.deepExtend,m=f.util,g=m.defined,v=m.isTransparent,_=m.renderTemplate,b=m.valueOrDefault,k=f.geometry,w=f.drawing,y=w.BaseNode,x=e.proxy,C="butt",T=w.DASH_ARRAYS,S=1e3/60,D="solid",E=".kendo",F=w.Surface.extend({init:function(t,n){w.Surface.fn.init.call(this,t,n),this.element[0].innerHTML=this._template(this);var r=this.element[0].firstElementChild;r.width=e(t).width(),r.height=e(t).height(),this._rootElement=r,this._root=new i(r)},destroy:function(){w.Surface.fn.destroy.call(this),this._root&&(this._root.destroy(),this._root=null),this._searchTree&&(this._searchTree.clear(),delete this._searchTree),this.element.off(E)},type:"canvas",draw:function(e){w.Surface.fn.draw.call(this,e),this._root.load([e],void 0,this.options.cors),this._searchTree&&this._searchTree.add([e])},clear:function(){w.Surface.fn.clear.call(this),this._root.clear(),this._searchTree&&this._searchTree.clear()},eventTarget:function(e){var t,n;if(this._searchTree)return t=this._surfacePoint(e),n=this._searchTree.pointShape(t)},image:function(){var t,n=this._root,i=this._rootElement,r=[];return n.traverse(function(e){e.loading&&r.push(e.loading)}),t=e.Deferred(),e.when.apply(e,r).done(function(){n._invalidate();try{var e=i.toDataURL();t.resolve(e)}catch(r){t.reject(r)}}).fail(function(e){t.reject(e)}),t.promise()},suspendTracking:function(){w.Surface.fn.suspendTracking.call(this),this._searchTree&&(this._searchTree.clear(),delete this._searchTree)},resumeTracking:function(){var e,t,n;if(w.Surface.fn.resumeTracking.call(this),!this._searchTree){for(this._searchTree=new w.ShapesQuadTree,e=this._root.childNodes,t=[],n=0;n<e.length;n++)t.push(e[n].srcElement);this._searchTree.add(t)}},_resize:function(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.invalidate()},_template:_("<canvas style='width: 100%; height: 100%;'></canvas>"),_enableTracking:function(){this._searchTree=new w.ShapesQuadTree,this._mouseTrackHandler=x(this._trackMouse,this),this.element.on("click"+E,this._mouseTrackHandler),this.element.on("mousemove"+E,this._mouseTrackHandler),w.Surface.fn._enableTracking.call(this)},_trackMouse:function(e){var t,n;this._suspendedTracking||(t=this.eventTarget(e),"click"!=e.type?(n=this._currentShape,n&&n!==t&&this.trigger("mouseleave",{element:n,originalEvent:e,type:"mouseleave"}),t&&n!==t&&this.trigger("mouseenter",{element:t,originalEvent:e,type:"mouseenter"}),this.trigger("mousemove",{element:t,originalEvent:e,type:"mousemove"}),this._currentShape=t):t&&this.trigger("click",{element:t,originalEvent:e,type:"click"}))}}),R=y.extend({init:function(e){y.fn.init.call(this,e),e&&this.initClip()},initClip:function(){var e=this.srcElement.clip();e&&(this.clip=e,e.addObserver(this))},clear:function(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),y.fn.clear.call(this)},clearClip:function(){this.clip&&(this.clip.removeObserver(this),delete this.clip)},setClip:function(e){this.clip&&(e.beginPath(),r.fn.renderPoints(e,this.clip),e.clip())},optionsChange:function(e){"clip"==e.field&&(this.clearClip(),this.initClip()),y.fn.optionsChange.call(this,e)},setTransform:function(e){if(this.srcElement){var t=this.srcElement.transform();t&&e.transform.apply(e,t.matrix().toArray(6))}},loadElements:function(e,t,n){var i,r,o,a,s=this;for(a=0;a<e.length;a++)r=e[a],o=r.children,i=new u[r.nodeType](r,n),o&&o.length>0&&i.load(o,t,n),
g(t)?s.insertAt(i,t):s.append(i)},load:function(e,t,n){this.loadElements(e,t,n),this.invalidate()},setOpacity:function(e){if(this.srcElement){var t=this.srcElement.opacity();g(t)&&this.globalAlpha(e,t)}},globalAlpha:function(e,t){t&&e.globalAlpha&&(t*=e.globalAlpha),e.globalAlpha=t},visible:function(){var e=this.srcElement;return!e||e&&e.options.visible!==!1}}),I=R.extend({renderTo:function(e){var t,n,i;if(this.visible()){for(e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),t=this.childNodes,n=0;n<t.length;n++)i=t[n],i.visible()&&i.renderTo(e);e.restore()}}});w.mixins.Traversable.extend(I.fn,"childNodes"),i=I.extend({init:function(e){I.fn.init.call(this),this.canvas=e,this.ctx=e.getContext("2d");var t=x(this._invalidate,this);this.invalidate=f.throttle(function(){f.animationFrame(t)},S)},destroy:function(){I.fn.destroy.call(this),this.canvas=null,this.ctx=null},load:function(e,t,n){this.loadElements(e,t,n),this._invalidate()},_invalidate:function(){this.ctx&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx))}}),w.mixins.Traversable.extend(i.fn,"childNodes"),r=R.extend({renderTo:function(e){e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),this.renderPoints(e,this.srcElement),this.setLineDash(e),this.setLineCap(e),this.setLineJoin(e),this.setFill(e),this.setStroke(e),e.restore()},setFill:function(e){var t=this.srcElement.options.fill,n=!1;return t&&("gradient"==t.nodeType?(this.setGradientFill(e,t),n=!0):v(t.color)||(e.fillStyle=t.color,e.save(),this.globalAlpha(e,t.opacity),e.fill(),e.restore(),n=!0)),n},setGradientFill:function(e,t){var i,r,o,a,s=this.srcElement.rawBBox();t instanceof w.LinearGradient?(r=t.start(),o=t.end(),i=e.createLinearGradient(r.x,r.y,o.x,o.y)):t instanceof w.RadialGradient&&(a=t.center(),i=e.createRadialGradient(a.x,a.y,0,a.x,a.y,t.radius())),n(i,t.stops),e.save(),t.userSpace()||e.transform(s.width(),0,0,s.height(),s.origin.x,s.origin.y),e.fillStyle=i,e.fill(),e.restore()},setStroke:function(e){var t=this.srcElement.options.stroke;if(t&&!v(t.color)&&t.width>0)return e.strokeStyle=t.color,e.lineWidth=b(t.width,1),e.save(),this.globalAlpha(e,t.opacity),e.stroke(),e.restore(),!0},dashType:function(){var e=this.srcElement.options.stroke;if(e&&e.dashType)return e.dashType.toLowerCase()},setLineDash:function(e){var t,n=this.dashType();n&&n!=D&&(t=T[n],e.setLineDash?e.setLineDash(t):(e.mozDash=t,e.webkitLineDash=t))},setLineCap:function(e){var t=this.dashType(),n=this.srcElement.options.stroke;t&&t!==D?e.lineCap=C:n&&n.lineCap&&(e.lineCap=n.lineCap)},setLineJoin:function(e){var t=this.srcElement.options.stroke;t&&t.lineJoin&&(e.lineJoin=t.lineJoin)},renderPoints:function(e,t){var n,i,r,o,a,s,l=t.segments;if(0!==l.length){for(n=l[0],i=n.anchor(),e.moveTo(i.x,i.y),r=1;r<l.length;r++)n=l[r],i=n.anchor(),o=l[r-1],a=o.controlOut(),s=n.controlIn(),a&&s?e.bezierCurveTo(a.x,a.y,s.x,s.y,i.x,i.y):e.lineTo(i.x,i.y);t.options.closed&&e.closePath()}}}),o=r.extend({renderPoints:function(e){var t,n=this.srcElement.paths;for(t=0;t<n.length;t++)r.fn.renderPoints(e,n[t])}}),a=r.extend({renderPoints:function(e){var t=this.srcElement.geometry(),n=t.center,i=t.radius;e.arc(n.x,n.y,i,0,2*Math.PI)}}),s=r.extend({renderPoints:function(e){var t=this.srcElement.toPath();r.fn.renderPoints.call(this,e,t)}}),l=r.extend({renderTo:function(e){var t=this.srcElement,n=t.position(),i=t.measure();e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),e.font=t.options.font,this.setFill(e)&&e.fillText(t.content(),n.x,n.y+i.baseline),this.setStroke(e)&&(this.setLineDash(e),e.strokeText(t.content(),n.x,n.y+i.baseline)),e.restore()}}),d=r.extend({init:function(t,n){r.fn.init.call(this,t),this.onLoad=x(this.onLoad,this),this.onError=x(this.onError,this),this.loading=e.Deferred();var i=this.img=new Image;n&&!/^data:/i.test(t.src())&&(i.crossOrigin=n),i.src=t.src(),i.complete?this.onLoad():(i.onload=this.onLoad,i.onerror=this.onError)},renderTo:function(e){"resolved"===this.loading.state()&&(e.save(),this.setTransform(e),this.setClip(e),this.drawImage(e),e.restore())},optionsChange:function(t){"src"===t.field?(this.loading=e.Deferred(),this.img.src=this.srcElement.src()):r.fn.optionsChange.call(this,t)},onLoad:function(){this.loading.resolve(),this.invalidate()},onError:function(){this.loading.reject(Error("Unable to load image '"+this.img.src+"'. Check for connectivity and verify CORS headers."))},drawImage:function(e){var t=this.srcElement.rect(),n=t.topLeft();e.drawImage(this.img,n.x,n.y,t.width(),t.height())}}),c=r.extend({renderPoints:function(e){var t=this.srcElement.geometry(),n=t.origin,i=t.size;e.rect(n.x,n.y,i.width,i.height)}}),u={Group:I,Text:l,Path:r,MultiPath:o,Circle:a,Arc:s,Image:d,Rect:c},f.support.canvas=function(){return!!h.createElement("canvas").getContext}(),f.support.canvas&&w.SurfaceFactory.current.register("canvas",F,20),p(f.drawing,{exportImage:t,canvas:{ArcNode:s,CircleNode:a,GroupNode:I,ImageNode:d,MultiPathNode:o,Node:R,PathNode:r,RectNode:c,RootNode:i,Surface:F,TextNode:l}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/vml.min",["drawing/shapes.min","kendo.color.min"],e)}(function(){!function(e){function t(){if(u.namespaces&&!u.namespaces.kvml){u.namespaces.add("kvml","urn:schemas-microsoft-com:vml");var e=u.styleSheets.length>30?u.styleSheets[0]:u.createStyleSheet();e.addRule(".kvml","behavior:url(#default#VML)")}}function n(e){var t=u.createElement("kvml:"+e);return t.className="kvml",t}function i(e){var t,n=e.length,i=[];for(t=0;t<n;t++)i.push(e[t].scaleCopy(A).toString(0,","));return i.join(" ")}function r(e,t){var n,r,a,s,l,d=e.segments,c=d.length;if(c>0){for(n=[],l=1;l<c;l++)a=o(d[l-1],d[l]),a!==s&&(s=a,n.push(a)),n.push("l"===a?i([d[l].anchor()]):i([d[l-1].controlOut(),d[l].controlIn(),d[l].anchor()]));return r="m "+i([d[0].anchor()])+" "+n.join(" "),e.options.closed&&(r+=" x"),t!==!0&&(r+=" e"),r}}function o(e,t){return e.controlOut()&&t.controlIn()?"c":"l"}function a(e){return 0===e.indexOf("fill")||0===e.indexOf(z)}function s(e,t,n){var i,r=n*F(t.opacity(),1);return i=e?l(e,t.color(),r):l(t.color(),"#fff",1-r)}function l(e,t,n){var i=new x(e),r=new x(t),o=d(i.r,r.r,n),a=d(i.g,r.g,n),s=d(i.b,r.b,n);return new x(o,a,s).toHex()}function d(e,t,n){return h.round(n*t+(1-n)*e)}var c,u=document,h=Math,f=h.atan2,p=h.ceil,m=h.sqrt,g=window.kendo,v=g.deepExtend,_=e.noop,b=g.drawing,k=b.BaseNode,w=g.geometry,y=w.toMatrix,x=g.Color,C=g.util,T=C.isTransparent,S=C.defined,D=C.deg,E=C.round,F=C.valueOrDefault,R="none",I=".kendo",A=100,M=A*A,z="gradient",H=4,N=b.Surface.extend({init:function(e,n){b.Surface.fn.init.call(this,e,n),t(),this.element.empty(),this._root=new L,this._root.attachTo(this.element[0]),this.element.on("click"+I,this._click),this.element.on("mouseover"+I,this._mouseenter),this.element.on("mouseout"+I,this._mouseleave),this.element.on("mousemove"+I,this._mousemove)},type:"vml",destroy:function(){this._root&&(this._root.destroy(),this._root=null,this.element.off(I)),b.Surface.fn.destroy.call(this)},draw:function(e){b.Surface.fn.draw.call(this,e),this._root.load([e],void 0,null)},clear:function(){b.Surface.fn.clear.call(this),this._root.clear()}}),P=k.extend({init:function(e){k.fn.init.call(this,e),this.createElement(),this.attachReference()},observe:_,destroy:function(){this.element&&(this.element._kendoNode=null,this.element=null),k.fn.destroy.call(this)},clear:function(){var e,t;for(this.element&&(this.element.innerHTML=""),e=this.childNodes,t=0;t<e.length;t++)e[t].destroy();this.childNodes=[]},removeSelf:function(){this.element&&(this.element.parentNode.removeChild(this.element),this.element=null),k.fn.removeSelf.call(this)},createElement:function(){this.element=u.createElement("div")},attachReference:function(){this.element._kendoNode=this},load:function(e,t,n,i){var r,o,a,s,l,d;for(i=F(i,1),this.srcElement&&(i*=F(this.srcElement.options.opacity,1)),r=0;r<e.length;r++)o=e[r],a=o.children,s=o.currentTransform(n),l=i*F(o.options.opacity,1),d=new le[o.nodeType](o,s,l),a&&a.length>0&&d.load(a,t,s,i),S(t)?this.insertAt(d,t):this.append(d),d.attachTo(this.element,t)},attachTo:function(e,t){S(t)?e.insertBefore(this.element,e.children[t]||null):e.appendChild(this.element)},optionsChange:function(e){"visible"==e.field&&this.css("display",e.value!==!1?"":R)},setStyle:function(){this.allCss(this.mapStyle())},mapStyle:function(){var e=[];return this.srcElement&&this.srcElement.options.visible===!1&&e.push(["display",R]),e},mapOpacityTo:function(e,t){var n=F(this.opacity,1);n*=F(t,1),e.push(["opacity",n])},attr:function(e,t){this.element&&(this.element[e]=t)},allAttr:function(e){for(var t=0;t<e.length;t++)this.attr(e[t][0],e[t][1])},css:function(e,t){this.element&&(this.element.style[e]=t)},allCss:function(e){for(var t=0;t<e.length;t++)this.css(e[t][0],e[t][1])}}),L=P.extend({createElement:function(){P.fn.createElement.call(this),this.allCss([["width","100%"],["height","100%"],["position","relative"],["visibility","visible"]])},attachReference:_}),B=g.Class.extend({init:function(e,t){this.srcElement=e,this.observer=t,e.addObserver(this)},geometryChange:function(){this.observer.optionsChange({field:"clip",value:this.srcElement})},clear:function(){this.srcElement.removeObserver(this)}}),O=P.extend({init:function(e){P.fn.init.call(this,e),e&&this.initClip()},observe:function(){k.fn.observe.call(this)},mapStyle:function(){var e=P.fn.mapStyle.call(this);return this.srcElement&&this.srcElement.clip()&&e.push(["clip",this.clipRect()]),e},optionsChange:function(e){"clip"==e.field&&(this.clearClip(),this.initClip(),this.setClip()),P.fn.optionsChange.call(this,e)},clear:function(){this.clearClip(),P.fn.clear.call(this)},initClip:function(){this.srcElement.clip()&&(this.clip=new B(this.srcElement.clip(),this),this.clip.observer=this)},clearClip:function(){this.clip&&(this.clip.clear(),this.clip=null,this.css("clip",this.clipRect()))},setClip:function(){this.clip&&this.css("clip",this.clipRect())},clipRect:function(){var e,t,n,i=c,r=this.srcElement.clip();return r&&(e=this.clipBBox(r),t=e.topLeft(),n=e.bottomRight(),i=g.format("rect({0}px {1}px {2}px {3}px)",t.y,n.x,n.y,t.x)),i},clipBBox:function(e){var t=this.srcElement.rawBBox().topLeft(),n=e.rawBBox();return n.origin.translate(-t.x,-t.y),n}}),V=O.extend({createElement:function(){P.fn.createElement.call(this),this.setStyle()},attachTo:function(e,t){this.css("display",R),P.fn.attachTo.call(this,e,t),this.srcElement.options.visible!==!1&&this.css("display","")},_attachTo:function(e){var t=document.createDocumentFragment();t.appendChild(this.element),e.appendChild(t)},mapStyle:function(){var e=O.fn.mapStyle.call(this);return e.push(["position","absolute"]),e.push(["white-space","nowrap"]),e},optionsChange:function(e){"transform"===e.field&&this.refreshTransform(),"opacity"===e.field&&this.refreshOpacity(),O.fn.optionsChange.call(this,e)},refreshTransform:function(e){var t,n=this.srcElement.currentTransform(e),i=this.childNodes,r=i.length;for(this.setClip(),t=0;t<r;t++)i[t].refreshTransform(n)},currentOpacity:function(){var e=F(this.srcElement.options.opacity,1);return this.parent&&this.parent.currentOpacity&&(e*=this.parent.currentOpacity()),e},refreshOpacity:function(){var e,t=this.childNodes,n=t.length,i=this.currentOpacity();for(e=0;e<n;e++)t[e].refreshOpacity(i)},initClip:function(){if(O.fn.initClip.call(this),this.clip){var e=this.clip.srcElement.bbox(this.srcElement.currentTransform());e&&(this.css("width",e.width()+e.origin.x),this.css("height",e.height()+e.origin.y))}},clipBBox:function(e){return e.bbox(this.srcElement.currentTransform())},clearClip:function(){O.fn.clearClip.call(this)}}),W=P.extend({init:function(e,t){this.opacity=t,P.fn.init.call(this,e)},createElement:function(){this.element=n("stroke"),this.setOpacity()},optionsChange:function(e){0===e.field.indexOf("stroke")&&this.setStroke()},refreshOpacity:function(e){this.opacity=e,this.setStroke()},setStroke:function(){this.allAttr(this.mapStroke())},setOpacity:function(){this.setStroke()},mapStroke:function(){var e,t=this.srcElement.options.stroke,n=[];return t&&!T(t.color)&&0!==t.width?(n.push(["on","true"]),n.push(["color",t.color]),n.push(["weight",(t.width||1)+"px"]),this.mapOpacityTo(n,t.opacity),S(t.dashType)&&n.push(["dashstyle",t.dashType]),S(t.lineJoin)&&n.push(["joinstyle",t.lineJoin]),S(t.lineCap)&&(e=t.lineCap.toLowerCase(),"butt"===e&&(e="butt"===e?"flat":e),n.push(["endcap",e]))):n.push(["on","false"]),n}}),U=P.extend({init:function(e,t,n){this.opacity=n,P.fn.init.call(this,e)},createElement:function(){this.element=n("fill"),this.setFill()},optionsChange:function(e){a(e.field)&&this.setFill()},refreshOpacity:function(e){this.opacity=e,this.setOpacity()},setFill:function(){this.allAttr(this.mapFill())},setOpacity:function(){this.setFill()},attr:function(e,t){var n,i=this.element;if(i){for(n=e.split(".");n.length>1;)i=i[n.shift()];i[n[0]]=t}},mapFill:function(){var e=this.srcElement.fill(),t=[["on","false"]];return e&&(e.nodeType==z?t=this.mapGradient(e):T(e.color)||(t=this.mapFillColor(e))),t},mapFillColor:function(e){var t=[["on","true"],["color",e.color]];return this.mapOpacityTo(t,e.opacity),t},mapGradient:function(e){var t,n=this.srcElement.options,i=n.fallbackFill||e.fallbackFill&&e.fallbackFill();return t=e instanceof b.LinearGradient?this.mapLinearGradient(e):e instanceof b.RadialGradient&&e.supportVML?this.mapRadialGradient(e):i?this.mapFillColor(i):[["on","false"]]},mapLinearGradient:function(e){var t=e.start(),n=e.end(),i=C.deg(f(n.y-t.y,n.x-t.x)),r=[["on","true"],["type",z],["focus",0],["method","none"],["angle",270-i]];return this.addColors(r),r},mapRadialGradient:function(e){var t=this.srcElement.rawBBox(),n=e.center(),i=(n.x-t.origin.x)/t.width(),r=(n.y-t.origin.y)/t.height(),o=[["on","true"],["type","gradienttitle"],["focus","100%"],["focusposition",i+" "+r],["method","none"]];return this.addColors(o),o},addColors:function(e){var t,n,i=this.srcElement.options,r=F(this.opacity,1),o=[],a=i.fill.stops,l=i.baseColor,d=this.element.colors?"colors.value":"colors",c=s(l,a[0],r),u=s(l,a[a.length-1],r);for(n=0;n<a.length;n++)t=a[n],o.push(h.round(100*t.offset())+"% "+s(l,t,r));e.push([d,o.join(",")],["color",c],["color2",u])}}),q=P.extend({init:function(e,t){this.transform=t,P.fn.init.call(this,e)},createElement:function(){this.element=n("skew"),this.setTransform()},optionsChange:function(e){"transform"===e.field&&this.refresh(this.srcElement.currentTransform())},refresh:function(e){this.transform=e,this.setTransform()},transformOrigin:function(){return"-0.5,-0.5"},setTransform:function(){this.allAttr(this.mapTransform())},mapTransform:function(){var e=this.transform,t=[],n=y(e);return n?(n.round(H),t.push(["on","true"],["matrix",[n.a,n.c,n.b,n.d,0,0].join(",")],["offset",n.e+"px,"+n.f+"px"],["origin",this.transformOrigin()])):t.push(["on","false"]),t}}),j=O.extend({init:function(e,t,n){this.fill=this.createFillNode(e,t,n),this.stroke=new W(e,n),this.transform=this.createTransformNode(e,t),O.fn.init.call(this,e)},attachTo:function(e,t){this.fill.attachTo(this.element),this.stroke.attachTo(this.element),this.transform.attachTo(this.element),P.fn.attachTo.call(this,e,t)},createFillNode:function(e,t,n){return new U(e,t,n)},createTransformNode:function(e,t){return new q(e,t)},createElement:function(){this.element=n("shape"),this.setCoordsize(),this.setStyle()},optionsChange:function(e){a(e.field)?this.fill.optionsChange(e):0===e.field.indexOf("stroke")?this.stroke.optionsChange(e):"transform"===e.field?this.transform.optionsChange(e):"opacity"===e.field&&(this.fill.setOpacity(),this.stroke.setOpacity()),O.fn.optionsChange.call(this,e)},refreshTransform:function(e){this.transform.refresh(this.srcElement.currentTransform(e))},refreshOpacity:function(e){e*=F(this.srcElement.options.opacity,1),this.fill.refreshOpacity(e),this.stroke.refreshOpacity(e)},mapStyle:function(e,t){var n,i=O.fn.mapStyle.call(this);return e&&t||(e=t=A),i.push(["position","absolute"],["width",e+"px"],["height",t+"px"]),n=this.srcElement.options.cursor,n&&i.push(["cursor",n]),i},setCoordsize:function(){this.allAttr([["coordorigin","0 0"],["coordsize",M+" "+M]])}}),$=P.extend({createElement:function(){this.element=n("path"),this.setPathData()},geometryChange:function(){this.setPathData()},setPathData:function(){this.attr("v",this.renderData())},renderData:function(){return r(this.srcElement)}}),G=j.extend({init:function(e,t,n){this.pathData=this.createDataNode(e),j.fn.init.call(this,e,t,n)},attachTo:function(e,t){this.pathData.attachTo(this.element),j.fn.attachTo.call(this,e,t)},createDataNode:function(e){return new $(e)},geometryChange:function(){this.pathData.geometryChange(),j.fn.geometryChange.call(this)}}),Y=$.extend({renderData:function(){var e,t,n,i=this.srcElement.paths;if(i.length>0){for(e=[],t=0;t<i.length;t++)n=t<i.length-1,e.push(r(i[t],n));return e.join(" ")}}}),K=G.extend({createDataNode:function(e){return new Y(e)}}),Q=q.extend({transformOrigin:function(){var e=this.srcElement.geometry().bbox(),t=e.center(),n=-p(t.x)/p(e.width()),i=-p(t.y)/p(e.height());return n+","+i}}),X=j.extend({createElement:function(){this.element=n("oval"),this.setStyle()},createTransformNode:function(e,t){return new Q(e,t)},geometryChange:function(){j.fn.geometryChange.call(this),this.setStyle(),this.refreshTransform()},mapStyle:function(){var e=this.srcElement.geometry(),t=e.radius,n=e.center,i=p(2*t),r=j.fn.mapStyle.call(this,i,i);return r.push(["left",p(n.x-t)+"px"],["top",p(n.y-t)+"px"]),r}}),J=$.extend({renderData:function(){return r(this.srcElement.toPath())}}),Z=G.extend({createDataNode:function(e){return new J(e)}}),ee=$.extend({createElement:function(){$.fn.createElement.call(this),this.attr("textpathok",!0)},renderData:function(){var e=this.srcElement.rect(),t=e.center();return"m "+i([new w.Point(e.topLeft().x,t.y)])+" l "+i([new w.Point(e.bottomRight().x,t.y)])}}),te=P.extend({createElement:function(){this.element=n("textpath"),this.attr("on",!0),this.attr("fitpath",!1),this.setStyle(),this.setString()},optionsChange:function(e){"content"===e.field?this.setString():this.setStyle(),P.fn.optionsChange.call(this,e)},mapStyle:function(){return[["font",this.srcElement.options.font]]},setString:function(){this.attr("string",this.srcElement.content())}}),ne=G.extend({init:function(e,t,n){this.path=new te(e),G.fn.init.call(this,e,t,n)},createDataNode:function(e){return new ee(e)},attachTo:function(e,t){this.path.attachTo(this.element),G.fn.attachTo.call(this,e,t)},optionsChange:function(e){"font"!==e.field&&"content"!==e.field||(this.path.optionsChange(e),this.pathData.geometryChange(e)),G.fn.optionsChange.call(this,e)}}),ie=$.extend({renderData:function(){var e=this.srcElement.rect(),t=(new b.Path).moveTo(e.topLeft()).lineTo(e.topRight()).lineTo(e.bottomRight()).lineTo(e.bottomLeft()).close();return r(t)}}),re=q.extend({init:function(e,t,n){this.opacity=n,q.fn.init.call(this,e,t)},createElement:function(){this.element=n("fill"),this.attr("type","frame"),this.attr("rotate",!0),this.setOpacity(),this.setSrc(),this.setTransform()},optionsChange:function(e){"src"===e.field&&this.setSrc(),q.fn.optionsChange.call(this,e)},geometryChange:function(){this.refresh()},refreshOpacity:function(e){this.opacity=e,this.setOpacity()},setOpacity:function(){var e=[];this.mapOpacityTo(e,this.srcElement.options.opacity),this.allAttr(e)},setSrc:function(){this.attr("src",this.srcElement.src())},mapTransform:function(){var e,t,n,i,r,o,a,s,l=this.srcElement,d=l.rawBBox(),c=d.center(),u=A/2,h=A,p=d.width()/h,g=d.height()/h,v=0,_=this.transform;return _?(n=y(_),i=m(n.a*n.a+n.b*n.b),r=m(n.c*n.c+n.d*n.d),p*=i,g*=r,o=D(f(n.b,n.d)),a=D(f(-n.c,n.a)),v=(o+a)/2,0!==v?(s=l.bbox().center(),e=(s.x-u)/h,t=(s.y-u)/h):(e=(c.x*i+n.e-u)/h,t=(c.y*r+n.f-u)/h)):(e=(c.x-u)/h,t=(c.y-u)/h),p=E(p,H),g=E(g,H),e=E(e,H),t=E(t,H),v=E(v,H),[["size",p+","+g],["position",e+","+t],["angle",v]]}}),oe=G.extend({createFillNode:function(e,t,n){return new re(e,t,n)},createDataNode:function(e){return new ie(e)},optionsChange:function(e){"src"!==e.field&&"transform"!==e.field||this.fill.optionsChange(e),G.fn.optionsChange.call(this,e)},geometryChange:function(){this.fill.geometryChange(),G.fn.geometryChange.call(this)},refreshTransform:function(e){G.fn.refreshTransform.call(this,e),this.fill.refresh(this.srcElement.currentTransform(e))}}),ae=$.extend({renderData:function(){var e=this.srcElement.geometry(),t=["m",i([e.topLeft()]),"l",i([e.topRight(),e.bottomRight(),e.bottomLeft()]),"x e"];return t.join(" ")}}),se=G.extend({createDataNode:function(e){return new ae(e)}}),le={Group:V,Text:ne,Path:G,MultiPath:K,Circle:X,Arc:Z,Image:oe,Rect:se};g.support.vml=function(){var e=g.support.browser;return e.msie&&e.version<9}(),c="inherit",g.support.browser.msie&&g.support.browser.version<8&&(c="rect(auto auto auto auto)"),g.support.vml&&b.SurfaceFactory.current.register("vml",N,30),v(b,{vml:{ArcDataNode:J,ArcNode:Z,CircleTransformNode:Q,CircleNode:X,FillNode:U,GroupNode:V,ImageNode:oe,ImageFillNode:re,ImagePathDataNode:ie,MultiPathDataNode:Y,MultiPathNode:K,Node:P,PathDataNode:$,PathNode:G,RectDataNode:ae,RectNode:se,RootNode:L,StrokeNode:W,Surface:N,TextNode:ne,TextPathNode:te,TextPathDataNode:ee,TransformNode:q}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/html.min",["kendo.color.min","drawing/shapes.min","util/main.min","util/text-metrics.min"],e)}(function(){!function(e,t,n){"use strict";function i(e){return"number"==typeof e?{x:e,y:e}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}function r(n,r){function a(t){var n=new le.Group,i=t.getBoundingClientRect();return A(n,[u.x,0,0,u.y,-i.left*u.x,-i.top*u.y]),ge._clipbox=!1,ge._matrix=de.Matrix.unit(),ge._stackingContext={element:t,group:n},ge._avoidLinks=r.avoidLinks===!0?"a":r.avoidLinks,e(t).addClass("k-pdf-export"),te(t,n),e(t).removeClass("k-pdf-export"),n}function s(t){if(null!=t)return"string"==typeof t&&(t=kendo.template(t.replace(/^\s+|\s+$/g,""))),"function"==typeof t?function(n){var i=t(n);if(i)return"string"==typeof i&&(i=i.replace(/^\s+|\s+$/g,"")),e(i)[0]}:function(){return e(t).clone()[0]}}function l(t){var n,i,r,o,a=t.cloneNode(!1);if(1==t.nodeType){n=e(t),i=e(a),o=n.data();for(r in o)i.data(r,o[r]);if(/^canvas$/i.test(t.tagName))a.getContext("2d").drawImage(t,0,0);else if(/^input$/i.test(t.tagName))t.removeAttribute("name");else for(r=t.firstChild;r;r=r.nextSibling)a.appendChild(l(r))}return a}function d(n,i,r,o,a,d,c){function u(){function e(){f(T,function(){n({pages:T,container:D})})}var t,i;("-"!=r||a)&&m(S),t=_(),S.parentNode.insertBefore(t,S),t.appendChild(S),x?(i=T.length,T.forEach(function(t,n){var r=x({element:t,pageNum:n+1,totalPages:T.length});r&&(t.appendChild(r),p(r,function(){0===--i&&e()}))})):e()}function h(e){if(c.keepTogether&&e.is(c.keepTogether)&&e.height()<=a-E)return!0;var t=e[0].tagName;return!(/^h[1-6]$/i.test(t)&&e.height()>=a-E)&&(e.data("kendoChart")||/^(?:img|tr|thead|th|tfoot|iframe|svg|object|canvas|input|textarea|select|video|h[1-6])$/i.test(t))}function m(n){var i,o,s,l,d=w(n),c=t(y(d,"padding-bottom")),u=t(y(d,"border-bottom-width")),f=E;for(E+=c+u,i=!0,o=n.firstChild;o;o=o.nextSibling)if(1==o.nodeType){if(i=!1,s=e(o),s.is(r)){v(o);continue}if(!a){m(o);continue}if(!/^(?:static|relative)$/.test(y(w(o),"position")))continue;l=b(o),1==l?v(o):l&&h(s)?v(o):m(o)}else 3==o.nodeType&&a&&(k(o,i),i=!1);E=f}function g(e){var t=e.parentNode,n=t.firstChild;if(e===n)return!0;if(e===t.children[0]){if(7==n.nodeType||8==n.nodeType)return!0;if(3==n.nodeType)return!/\S/.test(n.data)}return!1}function v(t){var n,i,r,o,a,s,l;return 1==t.nodeType&&t!==S&&g(t)?v(t.parentNode):(n=e(t).closest("table"),i=n.find("colgroup:first"),c.repeatHeaders&&(r=n.find("thead:first"),o=e(t).closest('.k-grid[data-role="grid"]'),o[0]&&o[0].querySelector(".k-auto-scrollable")&&(a=o.find(".k-grid-header:first"))),s=_(),l=C.createRange(),l.setStartBefore(S),l.setEndBefore(t),s.appendChild(l.extractContents()),S.parentNode.insertBefore(s,S),n[0]&&(n=e(t).closest("table"),c.repeatHeaders&&r[0]&&r.clone().prependTo(n),i[0]&&i.clone().prependTo(n)),void(c.repeatHeaders&&a&&a[0]&&(o=e(t).closest('.k-grid[data-role="grid"]'),a[0]&&a.clone().prependTo(o))))}function _(){var t=C.createElement("KENDO-PDF-PAGE");return e(t).css({display:"block",boxSizing:"content-box",width:o||"auto",padding:d.top+"px "+d.right+"px "+d.bottom+"px "+d.left+"px",position:"relative",height:a||"auto",overflow:a||o?"hidden":"visible",clear:"both"}),c&&c.pageClassName&&(t.className=c.pageClassName),T.push(t),t}function b(e){var t,n,i=e.getBoundingClientRect();return 0===i.width||0===i.height?0:(t=S.getBoundingClientRect().top,n=a-E,i.height>n?3:i.top-t>n?1:i.bottom-t>n?2:0)}function k(e,t){var n,i,r,o,a;/\S/.test(e.data)&&(n=e.data.length,i=C.createRange(),i.selectNodeContents(e),r=b(i),r&&(o=e,1==r?v(t?e.parentNode:e):(!function s(t,n,r){return i.setEnd(e,n),t==n||n==r?n:b(i)?s(t,t+n>>1,n):s(n,n+r>>1,r)}(0,n>>1,n),!/\S/.test(""+i)&&t?v(e.parentNode):(o=e.splitText(i.endOffset),a=_(),i.setStartBefore(S),a.appendChild(i.extractContents()),S.parentNode.insertBefore(a,S))),k(o)))}var x=s(c.template),C=i.ownerDocument,T=[],S=c._destructive?i:l(i),D=C.createElement("KENDO-PDF-DOCUMENT"),E=0;e(S).find("tfoot").each(function(){this.parentNode.appendChild(this)}),e(S).find("ol").each(function(){e(this).children().each(function(e){this.setAttribute("kendo-split-index",e)})}),e(D).css({display:"block",position:"absolute",boxSizing:"content-box",left:"-10000px",top:"-10000px"}),o&&(e(D).css({width:o,paddingLeft:d.left,paddingRight:d.right}),e(S).css({overflow:"hidden"})),i.parentNode.insertBefore(D,i),D.appendChild(S),c.beforePageBreak?setTimeout(function(){c.beforePageBreak(D,u)},15):setTimeout(u,15)}var c,u;if(r||(r={}),c=e.Deferred(),n=e(n)[0],!n)return c.reject("No element to export");if("function"!=typeof window.getComputedStyle)throw Error("window.getComputedStyle is missing.  You are using an unsupported browser, or running in IE8 compatibility mode.  Drawing HTML is supported in Chrome, Firefox, Safari and IE9+.");return kendo.pdf&&kendo.pdf.defineFont(o(n.ownerDocument)),u=i(r.scale||1),p(n,function(){var e,t=r&&r.forcePageBreak,i=r&&r.paperSize&&"auto"!=r.paperSize,o=kendo.pdf.getPaperOptions(function(e,t){return"paperSize"==e?i?r[e]:"A4":e in r?r[e]:t}),s=i&&o.paperSize[0],l=i&&o.paperSize[1],h=r.margin&&o.margin,f=!!h;t||l?(h||(h={left:0,top:0,right:0,bottom:0}),s&&(s/=u.x),l&&(l/=u.y),h.left/=u.x,h.right/=u.x,h.top/=u.y,h.bottom/=u.y,e=new le.Group({pdf:{multiPage:!0,paperSize:i?o.paperSize:"auto",_ignoreMargin:f}}),d(function(t){if(r.progress){var n=!1,i=0;!function o(){if(i<t.pages.length){var s=a(t.pages[i]);e.append(s),r.progress({page:s,pageNum:++i,totalPages:t.pages.length,cancel:function(){n=!0}}),n?t.container.parentNode.removeChild(t.container):setTimeout(o)}else t.container.parentNode.removeChild(t.container),c.resolve(e)}()}else t.pages.forEach(function(t){e.append(a(t))}),t.container.parentNode.removeChild(t.container),c.resolve(e)},n,t,s?s-h.left-h.right:null,l?l-h.top-h.bottom:null,h,r)):c.resolve(a(n))}),c.promise()}function o(e){function t(e){if(e){var t=null;try{t=e.cssRules}catch(n){}t&&i(e,t)}}function n(e){var t,n=y(e.style,"src");return n?oe(n).reduce(function(e,t){var n=ae(t);return n&&e.push(n),e},[]):(t=ae(e.cssText),t?[t]:[])}function i(e,i){var o,a,s,l,d,c,u;for(o=0;o<i.length;++o)switch(a=i[o],a.type){case 3:t(a.styleSheet);break;case 5:s=a.style,l=oe(y(s,"font-family")),d=/^([56789]00|bold)$/i.test(y(s,"font-weight")),c="italic"==y(s,"font-style"),u=n(a),u.length>0&&r(e,l,d,c,u[0])}}function r(e,t,n,i,r){/^data:/i.test(r)||/^[^\/:]+:\/\//.test(r)||/^\//.test(r)||(r=(e.href+"").replace(/[^\/]*$/,"")+r),t.forEach(function(e){e=e.replace(/^(['"]?)(.*?)\1$/,"$2"),n&&(e+="|bold"),i&&(e+="|italic"),o[e]=r})}var o,a;for(null==e&&(e=document),o={},a=0;a<e.styleSheets.length;++a)t(e.styleSheets[a]);return o}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){return e="_counter_"+e,ge[e]}function l(e){var t=[],n=ge;for(e="_counter_"+e;n;)a(n,e)&&t.push(n[e]),n=Object.getPrototypeOf(n);return t.reverse()}function d(e,t){var n=ge;for(e="_counter_"+e;n&&!a(n,e);)n=Object.getPrototypeOf(n);n||(n=ge._root),n[e]=(n[e]||0)+(null==t?1:t)}function c(e,t){e="_counter_"+e,ge[e]=null==t?0:t}function u(e,n,i){var r,o,a;for(r=0;r<e.length;)o=e[r++],a=t(e[r]),isNaN(a)?n(o,i):(n(o,a),++r)}function h(e,t){var n=kendo.parseColor(e);return n&&(n=n.toRGB(),t?n=n.toCssRgba():0===n.a&&(n=null)),n}function f(e,t){function n(){--i<=0&&t()}var i=0;e.forEach(function(e){var t,r,o=e.querySelectorAll("img");for(t=0;t<o.length;++t)r=o[t],r.complete||(i++,r.onload=r.onerror=n)}),i||n()}function p(e,t){function n(e){me[e]||(me[e]=!0,o.push(e))}function i(){--r<=0&&t()}var r,o=[];!function a(e){/^img$/i.test(e.tagName)&&n(e.src),re(y(w(e),"background-image")).forEach(function(e){"url"==e.type&&n(e.url)}),e.children&&ce.call(e.children).forEach(a)}(e),r=o.length,0===r&&i(),o.forEach(function(e){var t=me[e]=new Image;/^data:/i.test(e)||(t.crossOrigin="Anonymous"),t.src=e,t.complete?i():(t.onload=i,t.onerror=function(){me[e]=null,i()})})}function m(e){var t,i="";do t=e%26,i=String.fromCharCode(97+t)+i,e=n.floor(e/26);while(e>0);return i}function g(e,t,n){var i,r;ge=Object.create(ge),ge[e.tagName.toLowerCase()]={element:e,style:t},i=y(t,"text-decoration"),i&&"none"!=i&&(r=y(t,"color"),i.split(/\s+/g).forEach(function(e){ge[e]||(ge[e]=r)})),k(t)&&(ge._stackingContext={element:e,group:n})}function v(){ge=Object.getPrototypeOf(ge)}function _(e){if(null!=ge._clipbox){var t=e.bbox(ge._matrix);ge._clipbox=ge._clipbox?de.Rect.intersect(ge._clipbox,t):t}}function b(){var e=ge._clipbox;return null==e||(e?0===e.width()||0===e.height():void 0)}function k(e){function t(t){return y(e,t)}if("none"!=t("transform")||"static"!=t("position")&&"auto"!=t("z-index")||t("opacity")<1)return!0}function w(e,t){return window.getComputedStyle(e,t||null)}function y(e,t){var n=e.getPropertyValue(t);return null!=n&&""!==n||(ue.webkit?n=e.getPropertyValue("-webkit-"+t):ue.mozilla?n=e.getPropertyValue("-moz-"+t):ue.opera?n=e.getPropertyValue("-o-"+t):ue.msie&&(n=e.getPropertyValue("-ms-"+t))),n}function x(e,t,n,i){e.setProperty(t,n,i),ue.webkit?e.setProperty("-webkit-"+t,n,i):ue.mozilla?e.setProperty("-moz-"+t,n,i):ue.opera?e.setProperty("-o-"+t,n,i):ue.msie&&(e.setProperty("-ms-"+t,n,i),t="ms"+t.replace(/(^|-)([a-z])/g,function(e,t,n){return t+n.toUpperCase()}),e[t]=n)}function C(e,n){return n="border-"+n,{width:t(y(e,n+"-width")),style:y(e,n+"-style"),color:h(y(e,n+"-color"),!0)}}function T(e,t){var n=e.style.cssText,i=t();return e.style.cssText=n,i}function S(e,n){var i=y(e,"border-"+n+"-radius").split(/\s+/g).map(t);return 1==i.length&&i.push(i[0]),H({x:i[0],y:i[1]})}function D(e){var t=e.getBoundingClientRect();return t=E(t,"border-*-width",e),t=E(t,"padding-*",e)}function E(e,n,i){var r,o,a,s,l;return"string"==typeof n?(r=w(i),o=t(y(r,n.replace("*","top"))),a=t(y(r,n.replace("*","right"))),s=t(y(r,n.replace("*","bottom"))),l=t(y(r,n.replace("*","left")))):"number"==typeof n&&(o=a=s=l=n),{top:e.top+o,right:e.right-a,bottom:e.bottom-s,left:e.left+l,width:e.right-e.left-a-l,height:e.bottom-e.top-s-o}}function F(e){var n,i,r=y(e,"transform");return"none"==r?null:(n=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(r),n?(i=y(e,"transform-origin"),n=n[1].split(/\s*,\s*/g).map(t),i=i.split(/\s+/g).map(t),{matrix:n,origin:i}):void 0)}function R(e){return 180*e/n.PI%360}function I(e){var i=t(e);return/grad$/.test(e)?n.PI*i/200:/rad$/.test(e)?i:/turn$/.test(e)?n.PI*i*2:/deg$/.test(e)?n.PI*i/180:void 0}function A(e,t){return t=new de.Matrix(t[0],t[1],t[2],t[3],t[4],t[5]),e.transform(t),t}function M(e,t){e.clip(t)}function z(e,t,n,i){for(var r=new de.Arc([t,n],i).curvePoints(),o=1;o<r.length;)e.curveTo(r[o++],r[o++],r[o++])}function H(e){return(e.x<=0||e.y<=0)&&(e.x=e.y=0),
e}function N(e,t,i,r,o){var a=n.max(0,t.x),s=n.max(0,t.y),l=n.max(0,i.x),d=n.max(0,i.y),c=n.max(0,r.x),u=n.max(0,r.y),h=n.max(0,o.x),f=n.max(0,o.y),p=n.min(e.width/(a+l),e.height/(d+u),e.width/(c+h),e.height/(f+s));return p<1&&(a*=p,s*=p,l*=p,d*=p,c*=p,u*=p,h*=p,f*=p),{tl:{x:a,y:s},tr:{x:l,y:d},br:{x:c,y:u},bl:{x:h,y:f}}}function P(e,n,i){var r,o,a,s,l,d,c,u,h=w(e),f=S(h,"top-left"),p=S(h,"top-right"),m=S(h,"bottom-left"),g=S(h,"bottom-right");return"padding"!=i&&"content"!=i||(r=C(h,"top"),o=C(h,"right"),a=C(h,"bottom"),s=C(h,"left"),f.x-=s.width,f.y-=r.width,p.x-=o.width,p.y-=r.width,g.x-=o.width,g.y-=a.width,m.x-=s.width,m.y-=a.width,"content"==i&&(l=t(y(h,"padding-top")),d=t(y(h,"padding-right")),c=t(y(h,"padding-bottom")),u=t(y(h,"padding-left")),f.x-=u,f.y-=l,p.x-=d,p.y-=l,g.x-=d,g.y-=c,m.x-=u,m.y-=c)),"number"==typeof i&&(f.x-=i,f.y-=i,p.x-=i,p.y-=i,g.x-=i,g.y-=i,m.x-=i,m.y-=i),L(n,f,p,g,m)}function L(e,t,n,i,r){var o=N(e,t,n,i,r),a=o.tl,s=o.tr,l=o.br,d=o.bl,c=new le.Path({fill:null,stroke:null});return c.moveTo(e.left,e.top+a.y),a.x&&z(c,e.left+a.x,e.top+a.y,{startAngle:-180,endAngle:-90,radiusX:a.x,radiusY:a.y}),c.lineTo(e.right-s.x,e.top),s.x&&z(c,e.right-s.x,e.top+s.y,{startAngle:-90,endAngle:0,radiusX:s.x,radiusY:s.y}),c.lineTo(e.right,e.bottom-l.y),l.x&&z(c,e.right-l.x,e.bottom-l.y,{startAngle:0,endAngle:90,radiusX:l.x,radiusY:l.y}),c.lineTo(e.left+d.x,e.bottom),d.x&&z(c,e.left+d.x,e.bottom-d.y,{startAngle:90,endAngle:180,radiusX:d.x,radiusY:d.y}),c.close()}function B(e,n){var i=t(e)+"";switch(n){case"decimal-leading-zero":return i.length<2&&(i="0"+i),i;case"lower-roman":return he(e).toLowerCase();case"upper-roman":return he(e).toUpperCase();case"lower-latin":case"lower-alpha":return m(e-1);case"upper-latin":case"upper-alpha":return m(e-1).toUpperCase();default:return i}}function O(e,t){function n(e,t,n){return n?(n=n.replace(/^\s*(["'])(.*)\1\s*$/,"$2"),l(e).map(function(e){return B(e,t)}).join(n)):B(s(e)||0,t)}var i,r=oe(t,/^\s+/),o=[];return r.forEach(function(t){var r;(i=/^\s*(["'])(.*)\1\s*$/.exec(t))?o.push(i[2].replace(/\\([0-9a-f]{4})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})):(i=/^\s*counter\((.*?)\)\s*$/.exec(t))?(r=oe(i[1]),o.push(n(r[0],r[1]))):(i=/^\s*counters\((.*?)\)\s*$/.exec(t))?(r=oe(i[1]),o.push(n(r[0],r[2],r[1]))):o.push((i=/^\s*attr\((.*?)\)\s*$/.exec(t))?e.getAttribute(i[1])||"":t)}),o.join("")}function V(e){var t,n;if(e.cssText)return e.cssText;for(t=[],n=0;n<e.length;++n)t.push(e[n]+": "+y(e,e[n]));return t.join(";\n")}function W(e,t){function n(t,n){var r,o=w(e,t);o.content&&"normal"!=o.content&&"none"!=o.content&&"0px"!=o.width&&(r=e.ownerDocument.createElement(pe),r.style.cssText=V(o),r.textContent=O(e,o.content),e.insertBefore(r,n),i.push(r))}var i,r;return e.tagName==pe?void U(e,t):(i=[],n(":before",e.firstChild),n(":after",null),r=e.className,e.className+=" kendo-pdf-hide-pseudo-elements",U(e,t),e.className=r,void i.forEach(function(t){e.removeChild(t)}))}function U(i,r){function o(e){var t,n,r,o,a,s;if(/^td$/i.test(i.tagName)&&(t=ge.table,t&&"collapse"==y(t.style,"border-collapse"))){if(n=C(t.style,"left").width,r=C(t.style,"top").width,0===n&&0===r)return e;if(o=t.element.getBoundingClientRect(),a=t.element.rows[0].cells[0],s=a.getBoundingClientRect(),s.top==o.top||s.left==o.left)return ce.call(e).map(function(e){return{left:e.left+n,top:e.top+r,right:e.right+n,bottom:e.bottom+r,height:e.height,width:e.width}})}return e}function a(e,t,i,o,a,s,l,d){function c(t,r,o){var a=n.PI/2*t/(t+i),s={x:r.x-t,y:r.y-i},l=new le.Path({fill:{color:e},stroke:null}).moveTo(0,0);A(l,o),z(l,0,r.y,{startAngle:-90,endAngle:-R(a),radiusX:r.x,radiusY:r.y}),s.x>0&&s.y>0?(l.lineTo(s.x*n.cos(a),r.y-s.y*n.sin(a)),z(l,0,r.y,{startAngle:-R(a),endAngle:-90,radiusX:s.x,radiusY:s.y,anticlockwise:!0})):s.x>0?l.lineTo(s.x,i).lineTo(0,i):l.lineTo(s.x,i).lineTo(s.x,0),h.append(l.close())}if(!(i<=0)){var u,h=new le.Group;A(h,d),r.append(h),H(s),H(l),u=new le.Path({fill:{color:e},stroke:null}),h.append(u),u.moveTo(s.x?n.max(s.x,o):0,0).lineTo(t-(l.x?n.max(l.x,a):0),0).lineTo(t-n.max(l.x,a),i).lineTo(n.max(s.x,o),i).close(),s.x&&c(o,s,[-1,0,0,1,s.x,0]),l.x&&c(a,l,[1,0,0,1,t-l.x,0])}}function s(t){var n,o,a=new le.Group;for(M(a,L(t,U,$,K,G)),r.append(a),"A"==i.tagName&&i.href&&!/^#?$/.test(e(i).attr("href"))&&(ge._avoidLinks&&e(i).is(ge._avoidLinks)||(a._pdfLink={url:i.href,top:t.top,right:t.right,bottom:t.bottom,left:t.left})),X&&(n=new le.Path({fill:{color:X.toCssRgba()},stroke:null}),n.moveTo(t.left,t.top).lineTo(t.right,t.top).lineTo(t.right,t.bottom).lineTo(t.left,t.bottom).close(),a.append(n)),o=u.length;--o>=0;)l(a,t,u[o],f[o%f.length],p[o%p.length],g[o%g.length],v[o%v.length])}function l(e,r,o,a,s,l,d){function c(e,r,o,c,u){function h(){for(;_.origin.x>r.left;)_.origin.x-=o}function f(){for(;_.origin.y>r.top;)_.origin.y-=c}function p(){for(;_.origin.x<r.right;)u(e,_.clone()),_.origin.x+=o}var m,g,v,_,b,k=o/c,w=r;if("content-box"==l?(w=E(w,"border-*-width",i),w=E(w,"padding-*",i)):"padding-box"==l&&(w=E(w,"border-*-width",i)),/^\s*auto(\s+auto)?\s*$/.test(d)||("contain"==d?(m=n.min(w.width/o,w.height/c),o*=m,c*=m):"cover"==d?(m=n.max(w.width/o,w.height/c),o*=m,c*=m):(g=d.split(/\s+/g),o=/%$/.test(g[0])?w.width*t(g[0])/100:t(g[0]),c=1==g.length||"auto"==g[1]?o/k:/%$/.test(g[1])?w.height*t(g[1])/100:t(g[1]))),v=(s+"").split(/\s+/),1==v.length&&(v[1]="50%"),v[0]=/%$/.test(v[0])?t(v[0])/100*(w.width-o):t(v[0]),v[1]=/%$/.test(v[1])?t(v[1])/100*(w.height-c):t(v[1]),_=new de.Rect([w.left+v[0],w.top+v[1]],[o,c]),"no-repeat"==a)u(e,_);else if("repeat-x"==a)h(),p();else if("repeat-y"==a)for(f();_.origin.y<r.bottom;)u(e,_.clone()),_.origin.y+=c;else if("repeat"==a)for(h(),f(),b=_.origin.clone();_.origin.y<r.bottom;)_.origin.x=b.x,p(),_.origin.y+=c}if(o&&"none"!=o)if("url"==o.type){if(/^url\(\"data:image\/svg/i.test(o.url))return;var u=me[o.url];u&&u.width>0&&u.height>0&&c(e,r,u.width,u.height,function(e,t){e.append(new le.Image(o.url,t))})}else{if("linear"!=o.type)return;c(e,r,r.width,r.height,q(o))}}function d(){function e(e){T(i,function(){i.style.position="relative";var t=i.ownerDocument.createElement(pe);t.style.position="absolute",t.style.boxSizing="border-box","outside"==n?(t.style.width="6em",t.style.left="-6.8em",t.style.textAlign="right"):t.style.left="0px",e(t),i.insertBefore(t,i.firstChild),te(t,r),i.removeChild(t)})}function t(e){var t,n=i.parentNode.children,r=i.getAttribute("kendo-split-index");if(null!=r)return e(0|r,n.length);for(t=0;t<n.length;++t)if(n[t]===i)return e(t,n.length)}var n,o=y(I,"list-style-type");if("none"!=o)switch(n=y(I,"list-style-position"),o){case"circle":case"disc":case"square":e(function(e){e.style.fontSize="60%",e.style.lineHeight="200%",e.style.paddingRight="0.5em",e.style.fontFamily="DejaVu Serif",e.innerHTML={disc:"●",circle:"◯",square:"■"}[o]});break;case"decimal":case"decimal-leading-zero":e(function(e){t(function(t){++t,"decimal-leading-zero"==o&&(t+"").length<2&&(t="0"+t),e.innerHTML=t+"."})});break;case"lower-roman":case"upper-roman":e(function(e){t(function(t){t=he(t+1),"upper-roman"==o&&(t=t.toUpperCase()),e.innerHTML=t+"."})});break;case"lower-latin":case"lower-alpha":case"upper-latin":case"upper-alpha":e(function(e){t(function(t){t=m(t),/^upper/i.test(o)&&(t=t.toUpperCase()),e.innerHTML=t+"."})})}}function c(e,t,n){function o(e){return{x:e.y,y:e.x}}var l,d,c,u,h,f,p,m;if(0!==e.width&&0!==e.height&&(s(e),l=W.width>0&&(t&&"ltr"==Q||n&&"rtl"==Q),d=O.width>0&&(n&&"ltr"==Q||t&&"rtl"==Q),0!==B.width||0!==W.width||0!==O.width||0!==V.width)){if(B.color==O.color&&B.color==V.color&&B.color==W.color&&B.width==O.width&&B.width==V.width&&B.width==W.width&&l&&d)return e=E(e,B.width/2),c=P(i,e,B.width/2),c.options.stroke={color:B.color,width:B.width},void r.append(c);if(0===U.x&&0===$.x&&0===K.x&&0===G.x&&B.width<2&&W.width<2&&O.width<2&&V.width<2)return B.width>0&&r.append(new le.Path({stroke:{width:B.width,color:B.color}}).moveTo(e.left,e.top+B.width/2).lineTo(e.right,e.top+B.width/2)),V.width>0&&r.append(new le.Path({stroke:{width:V.width,color:V.color}}).moveTo(e.left,e.bottom-V.width/2).lineTo(e.right,e.bottom-V.width/2)),l&&r.append(new le.Path({stroke:{width:W.width,color:W.color}}).moveTo(e.left+W.width/2,e.top).lineTo(e.left+W.width/2,e.bottom)),void(d&&r.append(new le.Path({stroke:{width:O.width,color:O.color}}).moveTo(e.right-O.width/2,e.top).lineTo(e.right-O.width/2,e.bottom)));u=N(e,U,$,K,G),h=u.tl,f=u.tr,p=u.br,m=u.bl,a(B.color,e.width,B.width,W.width,O.width,h,f,[1,0,0,1,e.left,e.top]),a(V.color,e.width,V.width,O.width,W.width,p,m,[-1,0,0,-1,e.right,e.bottom]),a(W.color,e.height,W.width,V.width,B.width,o(m),o(h),[0,-1,1,0,e.left,e.bottom]),a(O.color,e.height,O.width,B.width,V.width,o(f),o(p),[0,1,-1,0,e.right,e.top])}}var u,f,p,g,v,b,k,x,D,F,I=w(i),B=C(I,"top"),O=C(I,"right"),V=C(I,"bottom"),W=C(I,"left"),U=S(I,"top-left"),$=S(I,"top-right"),G=S(I,"bottom-left"),K=S(I,"bottom-right"),Q=y(I,"direction"),X=y(I,"background-color");if(X=h(X),u=re(y(I,"background-image")),f=oe(y(I,"background-repeat")),p=oe(y(I,"background-position")),g=oe(y(I,"background-origin")),v=oe(y(I,"background-size")),ue.msie&&ue.version<10&&(p=oe(i.currentStyle.backgroundPosition)),b=E(i.getBoundingClientRect(),"border-*-width",i),function(){var e,n,i,o,a,s,l,d=y(I,"clip"),c=/^\s*rect\((.*)\)\s*$/.exec(d);c&&(e=c[1].split(/[ ,]+/g),n="auto"==e[0]?b.top:t(e[0])+b.top,i="auto"==e[1]?b.right:t(e[1])+b.left,o="auto"==e[2]?b.bottom:t(e[2])+b.top,a="auto"==e[3]?b.left:t(e[3])+b.left,s=new le.Group,l=(new le.Path).moveTo(a,n).lineTo(i,n).lineTo(i,o).lineTo(a,o).close(),M(s,l),r.append(s),r=s,_(l))}(),F=y(I,"display"),"table-row"==F)for(k=[],x=0,D=i.children;x<D.length;++x)k.push(D[x].getBoundingClientRect());else k=i.getClientRects(),1==k.length&&(k=[i.getBoundingClientRect()]);for(k=o(k),x=0;x<k.length;++x)c(k[x],0===x,x==k.length-1);return k.length>0&&"list-item"==F&&d(k[0]),function(){function e(){var e=P(i,b,"padding"),t=new le.Group;M(t,e),r.append(t),r=t,_(e)}Y(i)?e():/^(hidden|auto|scroll)/.test(y(I,"overflow"))?e():/^(hidden|auto|scroll)/.test(y(I,"overflow-x"))?e():/^(hidden|auto|scroll)/.test(y(I,"overflow-y"))&&e()}(),j(i,r)||J(i,r),r}function q(e){return function(i,r){var o,a,s,l,d,c,u,h,f,p,m,g,v,_=r.width(),b=r.height();switch(e.type){case"linear":switch(o=null!=e.angle?e.angle:n.PI,e.to){case"top":o=0;break;case"left":o=-n.PI/2;break;case"bottom":o=n.PI;break;case"right":o=n.PI/2;break;case"top left":case"left top":o=-n.atan2(b,_);break;case"top right":case"right top":o=n.atan2(b,_);break;case"bottom left":case"left bottom":o=n.PI+n.atan2(b,_);break;case"bottom right":case"right bottom":o=n.PI-n.atan2(b,_)}e.reverse&&(o-=n.PI),o%=2*n.PI,o<0&&(o+=2*n.PI),a=n.abs(_*n.sin(o))+n.abs(b*n.cos(o)),s=n.atan(_*n.tan(o)/b),l=n.sin(s),d=n.cos(s),c=n.abs(l)+n.abs(d),u=c/2*l,h=c/2*d,o>n.PI/2&&o<=3*n.PI/2&&(u=-u,h=-h),f=[],p=0,m=e.stops.map(function(n,i){var r,o=n.percent;return o?o=t(o)/100:n.length?o=t(n.length)/a:0===i?o=0:i==e.stops.length-1&&(o=1),r={color:n.color.toCssRgba(),offset:o},null!=o?(p=o,f.forEach(function(e,t){var n=e.stop;n.offset=e.left+(p-e.left)*(t+1)/(f.length+1)}),f=[]):f.push({left:p,stop:r}),r}),g=[.5-u,.5+h],v=[.5+u,.5-h],i.append(le.Path.fromRect(r).stroke(null).fill(new le.LinearGradient({start:g,end:v,stops:m,userSpace:!1})));break;case"radial":window.console&&window.console.log&&window.console.log("Radial gradients are not yet supported in HTML renderer")}}}function j(t,n){var i,r,o,a;if(t.getAttribute(kendo.attr("role"))&&(i=kendo.widgetInstance(e(t)),i&&(i.exportDOMVisual||i.exportVisual)))return!!(r=i.exportDOMVisual?i.exportDOMVisual():i.exportVisual())&&(o=new le.Group,o.children.push(r),a=t.getBoundingClientRect(),o.transform(de.transform().translate(a.left,a.top)),n.append(o),!0)}function $(e,t,n){var i=D(e),r=new de.Rect([i.left,i.top],[i.width,i.height]),o=new le.Image(t,r);M(o,P(e,i,"content")),n.append(o)}function G(e,n){var i=w(e),r=w(n),o=t(y(i,"z-index")),a=t(y(r,"z-index")),s=y(i,"position"),l=y(r,"position");return isNaN(o)&&isNaN(a)?/static|absolute/.test(s)&&/static|absolute/.test(l)?0:"static"==s?-1:"static"==l?1:0:isNaN(o)?0===a?0:a>0?-1:1:isNaN(a)?0===o?0:o>0?1:-1:t(o)-t(a)}function Y(e){return/^(?:textarea|select|input)$/i.test(e.tagName)}function K(e){return e.selectedOptions&&e.selectedOptions.length>0?e.selectedOptions[0]:e.options[e.selectedIndex]}function Q(e,t){var i=w(e),r=y(i,"color"),o=e.getBoundingClientRect();"checkbox"==e.type?(t.append(le.Path.fromRect(new de.Rect([o.left+1,o.top+1],[o.width-2,o.height-2])).stroke(r,1)),e.checked&&t.append((new le.Path).stroke(r,1.2).moveTo(o.left+.22*o.width,o.top+.55*o.height).lineTo(o.left+.45*o.width,o.top+.75*o.height).lineTo(o.left+.78*o.width,o.top+.22*o.width))):(t.append(new le.Circle(new de.Circle([(o.left+o.right)/2,(o.top+o.bottom)/2],n.min(o.width-2,o.height-2)/2)).stroke(r,1)),e.checked&&t.append(new le.Circle(new de.Circle([(o.left+o.right)/2,(o.top+o.bottom)/2],n.min(o.width-8,o.height-8)/2)).fill(r).stroke(null)))}function X(e,t){var n,i,r,o,a,s=e.tagName.toLowerCase();if("input"==s&&("checkbox"==e.type||"radio"==e.type))return Q(e,t);if(n=e.parentNode,i=e.ownerDocument,r=i.createElement(pe),r.style.cssText=V(w(e)),"input"==s&&(r.style.whiteSpace="pre"),"select"!=s&&"textarea"!=s||(r.style.overflow="auto"),"select"==s)if(e.multiple)for(a=0;a<e.options.length;++a)o=i.createElement(pe),o.style.cssText=V(w(e.options[a])),o.style.display="block",o.textContent=e.options[a].textContent,r.appendChild(o);else o=K(e),o&&(r.textContent=o.textContent);else r.textContent=e.value;n.insertBefore(r,e),r.scrollLeft=e.scrollLeft,r.scrollTop=e.scrollTop,e.style.display="none",J(r,t),e.style.display="",n.removeChild(r)}function J(e,t){var n,i,r,o,a,s,l,d,c;switch(ge._stackingContext.element===e&&(ge._stackingContext.group=t),e.tagName.toLowerCase()){case"img":$(e,e.src,t);break;case"canvas":try{$(e,e.toDataURL("image/png"),t)}catch(u){}break;case"textarea":case"input":case"select":X(e,t);break;default:for(n=[],i=[],r=[],o=[],a=e.firstChild;a;a=a.nextSibling)switch(a.nodeType){case 3:/\S/.test(a.data)&&Z(e,a,t);break;case 1:s=w(a),l=y(s,"display"),d=y(s,"float"),c=y(s,"position"),"static"!=c?o.push(a):"inline"!=l?"none"!=d?i.push(a):n.push(a):r.push(a)}fe(n,G).forEach(function(e){te(e,t)}),fe(i,G).forEach(function(e){te(e,t)}),fe(r,G).forEach(function(e){te(e,t)}),fe(o,G).forEach(function(e){te(e,t)})}}function Z(e,i,r){function o(e){var t,i,r,o;if(ue.msie||ue.chrome){for(t=e.getClientRects(),i={top:+(1/0),right:-(1/0),bottom:-(1/0),left:+(1/0)},r=0;r<t.length;++r)o=t[r],o.width<=1||o.bottom===D||(i.left=n.min(o.left,i.left),i.top=n.min(o.top,i.top),i.right=n.max(o.right,i.right),i.bottom=n.max(o.bottom,i.bottom));return i.width=i.right-i.left,i.height=i.bottom-i.top,i}return e.getBoundingClientRect()}function a(){var e,t,r,a,l,d,f,p=u,m=c.substr(u).search(/\S/);if(u+=m,m<0||u>=h)return!0;if(v.setStart(i,u),v.setEnd(i,u+1),e=o(v),t=!1,k&&(m=c.substr(u).search(/\s/),m>=0&&(v.setEnd(i,u+m),r=o(v),r.bottom==e.bottom&&(e=r,t=!0,u+=m))),!t){if(m=function g(t,n,r){v.setEnd(i,n);var a=o(v);return a.bottom!=e.bottom&&t<n?g(t,t+n>>1,n):a.right!=e.right?(e=a,n<r?g(n,n+r>>1,r):n):n}(u,n.min(h,u+S),h),m==u)return!0;if(u=m,m=(""+v).search(/\s+$/),0===m)return;m>0&&(v.setEnd(i,v.startOffset+m),e=o(v))}if(ue.msie&&(e=v.getClientRects()[0]),a=""+v,/^(?:pre|pre-wrap)$/i.test(x)){if(/\t/.test(a)){for(l=0,m=p;m<v.startOffset;++m)d=c.charCodeAt(m),9==d?l+=8-l%8:10==d||13==d?l=0:l++;for(;(m=a.search("\t"))>=0;)f="        ".substr(0,8-(l+m)%8),a=a.substr(0,m)+f+a.substr(m+1)}}else a=a.replace(/\s+/g," ");t||(D=e.bottom),s(a,e)}function s(e,t){var n,i,o;ue.msie&&!isNaN(p)&&(n=se(m),i=(t.top+t.bottom-n)/2,t={top:i,right:t.right,bottom:i+n,left:t.left,height:n,width:t.right-t.left}),o=new ie(e,new de.Rect([t.left,t.top],[t.width,t.height]),{font:m,fill:{color:g}}),r.append(o),l(t)}function l(e){function t(t,n){var i,o;t&&(i=f/12,o=new le.Path({stroke:{width:i,color:t}}),n-=i,o.moveTo(e.left,n).lineTo(e.right,n),r.append(o))}t(ge.underline,e.bottom),t(ge["line-through"],e.bottom-e.height/2.7),t(ge.overline,e.top)}var d,c,u,h,f,p,m,g,v,_,k,x,C,T,S,D;if(!b()&&(d=w(e),!(t(y(d,"text-indent"))<-500)&&(c=i.data,u=0,h=c.search(/\S\s*$/)+1,h&&(f=y(d,"font-size"),p=y(d,"line-height"),m=[y(d,"font-style"),y(d,"font-variant"),y(d,"font-weight"),f,y(d,"font-family")].join(" "),f=t(f),p=t(p),0!==f)))){for(g=y(d,"color"),v=e.ownerDocument.createRange(),_=y(d,"text-align"),k="justify"==_,x=y(d,"white-space"),ue.msie&&(C=d.textOverflow,"ellipsis"==C&&(T=e.style.textOverflow,e.style.textOverflow="clip")),S=e.getBoundingClientRect().width/f*5,0===S&&(S=500),D=null;!a(););ue.msie&&"ellipsis"==C&&(e.style.textOverflow=T)}}function ee(e,n,i){var r,o,a,s,l,d;for("auto"!=i?(r=ge._stackingContext.group,i=t(i)):(r=n,i=0),o=r.children,a=0;a<o.length&&!(null!=o[a]._dom_zIndex&&o[a]._dom_zIndex>i);++a);return s=new le.Group,r.insertAt(s,a),s._dom_zIndex=i,r!==n&&ge._clipbox&&(l=ge._matrix.invert(),d=ge._clipbox.transformCopy(l),M(s,le.Path.fromRect(d))),s}function te(e,n){var i,r,o,a,s,l,h,f=w(e),p=y(f,"counter-reset");p&&u(oe(p,/^\s+/),c,0),i=y(f,"counter-increment"),i&&u(oe(i,/^\s+/),d,1),/^(style|script|link|meta|iframe|svg|col|colgroup)$/i.test(e.tagName)||null!=ge._clipbox&&(r=t(y(f,"opacity")),o=y(f,"visibility"),a=y(f,"display"),0!==r&&"hidden"!=o&&"none"!=a&&(s=F(f),h=y(f,"z-index"),(s||r<1)&&"auto"==h&&(h=0),l=ee(e,n,h),r<1&&l.opacity(r*l.opacity()),g(e,f,l),s?T(e,function(){var t,n,i,r;x(e.style,"transform","none","important"),x(e.style,"transition","none","important"),"static"==y(f,"position")&&x(e.style,"position","relative","important"),t=e.getBoundingClientRect(),n=t.left+s.origin[0],i=t.top+s.origin[1],r=[1,0,0,1,-n,-i],r=ne(r,s.matrix),r=ne(r,[1,0,0,1,n,i]),r=A(l,r),ge._matrix=ge._matrix.multiplyCopy(r),W(e,l)}):W(e,l),v()))}function ne(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=t[0],d=t[1],c=t[2],u=t[3],h=t[4],f=t[5];return[n*l+i*c,n*d+i*u,r*l+o*c,r*d+o*u,a*l+s*c+h,a*d+s*u+f]}var ie,re,oe,ae,se,le=kendo.drawing,de=kendo.geometry,ce=Array.prototype.slice,ue=kendo.support.browser,he=kendo.util.arabicToRoman,fe=kendo.util.mergeSort,pe="KENDO-PSEUDO-ELEMENT",me={},ge={};ge._root=ge,ie=le.Text.extend({nodeType:"Text",init:function(e,t,n){le.Text.fn.init.call(this,e,t.getOrigin(),n),this._pdfRect=t},rect:function(){return this._pdfRect},rawBBox:function(){return this._pdfRect}}),le.drawDOM=r,r.getFontFaces=o,re=function(){function e(e){function p(){var t=s.exec(e);t&&(e=e.substr(t[1].length))}function m(t){p();var n=t.exec(e);if(n)return e=e.substr(n[1].length),n[1]}function g(){var t,r,o=kendo.parseColor(e,!0);if(o)return e=e.substr(o.match[0].length),o=o.toRGB(),(t=m(i))||(r=m(n)),{color:o,length:t,percent:r}}function v(t){var i,a,s,u,h,f,p=[],v=!1;if(m(l)){for(i=m(o),i?(i=I(i),m(c)):(a=m(r),"to"==a?a=m(r):a&&/^-/.test(t)&&(v=!0),s=m(r),m(c)),/-moz-/.test(t)&&null==i&&null==a&&(u=m(n),h=m(n),v=!0,"0%"==u?a="left":"100%"==u&&(a="right"),"0%"==h?s="top":"100%"==h&&(s="bottom"),m(c));e&&!m(d)&&(f=g());)p.push(f),m(c);return{type:"linear",angle:i,to:a&&s?a+" "+s:a?a:s?s:null,stops:p,reverse:v}}}function _(){if(m(l)){var e=m(h);return e=e.replace(/^['"]+|["']+$/g,""),m(d),{type:"url",url:e}}}var b,k=e;return a(f,k)?f[k]:((b=m(t))?b=v(b):(b=m(u))&&(b=_()),f[k]=b||{type:"none"})}var t=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,n=/^([-0-9.]+%)/,i=/^([-0-9.]+px)/,r=/^(left|right|top|bottom|to|center)\W/,o=/^([-0-9.]+(deg|grad|rad|turn))/,s=/^(\s+)/,l=/^(\()/,d=/^(\))/,c=/^(,)/,u=/^(url)\(/,h=/^(.*?)\)/,f={},p={};return function(t){return a(p,t)?p[t]:p[t]=oe(t).map(e)}}(),oe=function(){var e={};return function(t,n){function i(e){return h=e.exec(t.substr(d))}function r(e){return e.replace(/^\s+|\s+$/g,"")}var o,s,l,d,c,u,h;if(n||(n=/^\s*,\s*/),o=t+n,a(e,o))return e[o];for(s=[],l=0,d=0,c=0,u=!1;d<t.length;)!u&&i(/^[\(\[\{]/)?(c++,d++):!u&&i(/^[\)\]\}]/)?(c--,d++):!u&&i(/^[\"\']/)?(u=h[0],d++):"'"==u&&i(/^\\\'/)?d+=2:'"'==u&&i(/^\\\"/)?d+=2:"'"==u&&i(/^\'/)?(u=!1,d++):'"'==u&&i(/^\"/)?(u=!1,d++):i(n)?(!u&&!c&&d>l&&(s.push(r(t.substring(l,d))),l=d+h[0].length),d+=h[0].length):d++;return l<d&&s.push(r(t.substring(l,d))),e[o]=s}}(),ae=function(e){return function(t){var n,i=e[t];return i||((n=/url\((['"]?)([^'")]*?)\1\)\s+format\((['"]?)truetype\3\)/.exec(t))?i=e[t]=n[2]:(n=/url\((['"]?)([^'")]*?\.ttf)\1\)/.exec(t))&&(i=e[t]=n[2])),i}}(Object.create(null)),se=function(e){return function(t){var n=e[t];return null==n&&(n=e[t]=kendo.util.measureText("Mapq",{font:t}).height),n}}(Object.create(null))}(window.kendo.jQuery,parseFloat,Math)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("drawing/animation.min",["drawing/geometry.min","drawing/core.min"],e)}(function(){!function(e){var t=e.noop,n=window.kendo,i=n.Class,r=n.util,o=n.animationFrame,a=n.deepExtend,s=i.extend({init:function(e,t){var n=this;n.options=a({},n.options,t),n.element=e},options:{duration:500,easing:"swing"},setup:t,step:t,play:function(){var t=this,n=t.options,i=e.easing[n.easing],a=n.duration,s=n.delay||0,l=r.now()+s,d=l+a;0===a?(t.step(1),t.abort()):setTimeout(function(){var e=function(){var n,s,c,u;t._stopped||(n=r.now(),s=r.limitValue(n-l,0,a),c=s/a,u=i(c,s,0,1,a),t.step(u),n<d?o(e):t.abort())};e()},s)},abort:function(){this._stopped=!0},destroy:function(){this.abort()}}),l=function(){this._items=[]};l.prototype={register:function(e,t){this._items.push({name:e,type:t})},create:function(e,t){var n,i,r,o=this._items;if(t&&t.type)for(i=t.type.toLowerCase(),r=0;r<o.length;r++)if(o[r].name.toLowerCase()===i){n=o[r];break}if(n)return new n.type(e,t)}},l.current=new l,s.create=function(e,t,n){return l.current.create(e,t,n)},a(n.drawing,{Animation:s,AnimationFactory:l})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.drawing.min",["kendo.color.min","util/main.min","util/text-metrics.min","util/base64.min","mixins/observers.min","drawing/geometry.min","drawing/core.min","drawing/mixins.min","drawing/shapes.min","drawing/parser.min","drawing/search.min","drawing/svg.min","drawing/canvas.min","drawing/vml.min","drawing/html.min","drawing/animation.min"],e)}(function(){},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.validator.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(t){var n,i=l.ui.validator.ruleResolvers||{},r={};for(n in i)e.extend(!0,r,i[n].resolve(t));return r}function i(e){return e.replace(/&amp/g,"&amp;").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function r(e){return e=(e+"").split("."),e.length>1?e[1].length:0}function o(t){return e(e.parseHTML?e.parseHTML(t):t)}function a(t,n){var i,r,o,a,s=e();for(o=0,a=t.length;o<a;o++)i=t[o],h.test(i.className)&&(r=i.getAttribute(l.attr("for")),r===n&&(s=s.add(i)));return s}var s,l=window.kendo,d=l.ui.Widget,c=".kendoValidator",u="k-invalid-msg",h=RegExp(u,"i"),f="k-invalid",p="k-valid",m=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/i,g=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,v=":input:not(:button,[type=submit],[type=reset],[disabled],[readonly])",_=":checkbox:not([disabled],[readonly])",b="[type=number],[type=range]",k="blur",w="name",y="form",x="novalidate",C=e.proxy,T=function(e,t){return"string"==typeof t&&(t=RegExp("^(?:"+t+")$")),t.test(e)},S=function(e,t,n){var i=e.val();return!e.filter(t).length||""===i||T(i,n)},D=function(e,t){return!!e.length&&null!=e[0].attributes[t]};l.ui.validator||(l.ui.validator={rules:{},messages:{}}),s=d.extend({init:function(t,i){var r=this,o=n(t),a="["+l.attr("validate")+"!=false]";i=i||{},i.rules=e.extend({},l.ui.validator.rules,o.rules,i.rules),i.messages=e.extend({},l.ui.validator.messages,o.messages,i.messages),d.fn.init.call(r,t,i),r._errorTemplate=l.template(r.options.errorTemplate),r.element.is(y)&&r.element.attr(x,x),r._inputSelector=v+a,r._checkboxSelector=_+a,r._errors={},r._attachEvents(),r._isValidated=!1},events:["validate","change"],options:{name:"Validator",errorTemplate:'<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-i-warning"> </span> #=message#</span>',messages:{required:"{0} is required",pattern:"{0} is not valid",min:"{0} should be greater than or equal to {1}",max:"{0} should be smaller than or equal to {1}",step:"{0} is not valid",email:"{0} is not valid email",url:"{0} is not valid URL",date:"{0} is not valid date",dateCompare:"End date should be greater than or equal to the start date"},rules:{required:function(e){var t=e.filter("[type=checkbox]").length&&!e.is(":checked"),n=e.val();return!(D(e,"required")&&(!n||""===n||0===n.length||t))},pattern:function(e){return!e.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length||""===e.val()||T(e.val(),e.attr("pattern"))},min:function(e){if(e.filter(b+",["+l.attr("type")+"=number]").filter("[min]").length&&""!==e.val()){var t=parseFloat(e.attr("min"))||0,n=l.parseFloat(e.val());return t<=n}return!0},max:function(e){if(e.filter(b+",["+l.attr("type")+"=number]").filter("[max]").length&&""!==e.val()){var t=parseFloat(e.attr("max"))||0,n=l.parseFloat(e.val());return t>=n}return!0},step:function(e){if(e.filter(b+",["+l.attr("type")+"=number]").filter("[step]").length&&""!==e.val()){var t,n=parseFloat(e.attr("min"))||0,i=parseFloat(e.attr("step"))||1,o=parseFloat(e.val()),a=r(i);return a?(t=Math.pow(10,a),Math.floor((o-n)*t)%(i*t)/Math.pow(100,a)===0):(o-n)%i===0}return!0},email:function(e){return S(e,"[type=email],["+l.attr("type")+"=email]",m)},url:function(e){return S(e,"[type=url],["+l.attr("type")+"=url]",g)},date:function(e){return!e.filter("[type^=date],["+l.attr("type")+"=date]").length||""===e.val()||null!==l.parseDate(e.val(),e.attr(l.attr("format")))}},validateOnBlur:!0},destroy:function(){d.fn.destroy.call(this),this.element.off(c)},value:function(){return!!this._isValidated&&0===this.errors().length},_submit:function(e){return!!this.validate()||(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),!1)},_checkElement:function(e){var t=this.value();this.validateInput(e),this.value()!==t&&this.trigger("change")},_attachEvents:function(){var t=this;t.element.is(y)&&t.element.on("submit"+c,C(t._submit,t)),t.options.validateOnBlur&&(t.element.is(v)?(t.element.on(k+c,function(){t._checkElement(t.element)}),t.element.is(_)&&t.element.on("click"+c,function(){t._checkElement(t.element)})):(t.element.on(k+c,t._inputSelector,function(){t._checkElement(e(this))}),t.element.on("click"+c,t._checkboxSelector,function(){t._checkElement(e(this))})))},validate:function(){var e,t,n,i,r=!1,o=this.value();if(this._errors={},this.element.is(v))r=this.validateInput(this.element);else{for(i=!1,e=this.element.find(this._inputSelector),t=0,n=e.length;t<n;t++)this.validateInput(e.eq(t))||(i=!0);r=!i}return this.trigger("validate",{valid:r}),o!==r&&this.trigger("change"),r},validateInput:function(t){var n,r,a,s,d,c,h,m,g,v;return t=e(t),this._isValidated=!0,n=this,r=n._errorTemplate,a=n._checkValidity(t),s=a.valid,d="."+u,c=t.attr(w)||"",h=n._findMessageContainer(c).add(t.next(d).filter(function(){var t=e(this);return!t.filter("["+l.attr("for")+"]").length||t.attr(l.attr("for"))===c})).hide(),t.removeAttr("aria-invalid"),s?delete n._errors[c]:(m=n._extractMessage(t,a.key),n._errors[c]=m,g=o(r({message:i(m)})),v=h.attr("id"),n._decorateMessageContainer(g,c),v&&g.attr("id",v),h.replaceWith(g).length||g.insertAfter(t),g.show(),t.attr("aria-invalid",!0)),t.toggleClass(f,!s),t.toggleClass(p,s),s},hideMessages:function(){var e=this,t="."+u,n=e.element;n.is(v)?n.next(t).hide():n.find(t).hide()},_findMessageContainer:function(t){var n,i,r,o=l.ui.validator.messageLocators,s=e();for(i=0,r=this.element.length;i<r;i++)s=s.add(a(this.element[i].getElementsByTagName("*"),t));for(n in o)s=s.add(o[n].locate(this.element,t));return s},_decorateMessageContainer:function(e,t){var n,i=l.ui.validator.messageLocators;e.addClass(u).attr(l.attr("for"),t||"");for(n in i)i[n].decorate(e,t);e.attr("role","alert")},_extractMessage:function(e,t){var n=this,i=n.options.messages[t],r=e.attr(w);return i=l.isFunction(i)?i(e):i,l.format(e.attr(l.attr(t+"-msg"))||e.attr("validationMessage")||e.attr("title")||i||"",r,e.attr(t)||e.attr(l.attr(t)))},_checkValidity:function(e){var t,n=this.options.rules;for(t in n)if(!n[t].call(this,e))return{valid:!1,key:t};return{valid:!0}},errors:function(){var e,t=[],n=this._errors;for(e in n)t.push(n[e]);return t}}),l.ui.plugin(s)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.userevents.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(e,t){var n=e.x.location,i=e.y.location,r=t.x.location,o=t.y.location,a=n-r,s=i-o;return{center:{x:(n+r)/2,y:(i+o)/2},distance:Math.sqrt(a*a+s*s)}}function i(e){var t,n,i,r=[],o=e.originalEvent,s=e.currentTarget,l=0;if(e.api)r.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e,type:"api"});else if(e.type.match(/touch/))for(n=o?o.changedTouches:[],t=n.length;l<t;l++)i=n[l],r.push({location:i,event:e,target:i.target,currentTarget:s,id:i.identifier,type:"touch"});else r.push(a.pointers||a.msPointers?{location:o,event:e,target:e.target,currentTarget:s,id:o.pointerId,type:"pointer"}:{id:1,event:e,target:e.target,currentTarget:s,location:e,type:"mouse"});return r}function r(e){for(var t=o.eventMap.up.split(" "),n=0,i=t.length;n<i;n++)e(t[n])}var o=window.kendo,a=o.support,s=o.Class,l=o.Observable,d=e.now,c=e.extend,u=a.mobileOS,h=u&&u.android,f=800,p=a.browser.msie?5:0,m="press",g="hold",v="select",_="start",b="move",k="end",w="cancel",y="tap",x="release",C="gesturestart",T="gesturechange",S="gestureend",D="gesturetap",E={api:0,touch:0,mouse:9,pointer:9},F=!a.touch||a.mouseAndTouchPresent,R=s.extend({init:function(e,t){var n=this;n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=d()},move:function(e){var t=this,n=e["page"+t.axis],i=d(),r=i-t.timeStamp||1;!n&&h||(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/r,t.timeStamp=i)},_updateLocationData:function(e){var t=this,n=t.axis;t.location=e["page"+n],t.client=e["client"+n],t.screen=e["screen"+n]}}),I=s.extend({init:function(e,t,n){c(this,{x:new R("X",n.location),y:new R("Y",n.location),type:n.type,useClickAsTap:e.useClickAsTap,threshold:e.threshold||E[n.type],userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_moved:!1,_finished:!1})},press:function(){this._holdTimeout=setTimeout(e.proxy(this,"_hold"),this.userEvents.minHold),this._trigger(m,this.pressEvent)},_hold:function(){this._trigger(g,this.pressEvent);
},move:function(e){var t=this;if(!t._finished){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(A.current&&A.current!==t.userEvents)return t.dispose();t._start(e)}t._finished||t._trigger(b,e)}},end:function(e){this.endTime=d(),this._finished||(this._finished=!0,this._trigger(x,e),this._moved?this._trigger(k,e):this.useClickAsTap||this._trigger(y,e),clearTimeout(this._holdTimeout),this.dispose())},dispose:function(){var t=this.userEvents,n=t.touches;this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout),n.splice(e.inArray(this,n),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(e){clearTimeout(this._holdTimeout),this.startTime=d(),this._moved=!0,this._trigger(_,e)},_trigger:function(e,t){var n=this,i=t.event,r={touch:n,x:n.x,y:n.y,target:n.target,event:i};n.userEvents.notify(e,r)&&i.preventDefault()},_withinIgnoreThreshold:function(){var e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.threshold}}),A=l.extend({init:function(t,n){var i,s,d,u=this,h=o.guid();n=n||{},i=u.filter=n.filter,u.threshold=n.threshold||p,u.minHold=n.minHold||f,u.touches=[],u._maxTouches=n.multiTouch?2:1,u.allowSelection=n.allowSelection,u.captureUpIfMoved=n.captureUpIfMoved,u.useClickAsTap=!n.fastTap&&!a.delayedClick(),u.eventNS=h,t=e(t).handler(u),l.fn.init.call(u),c(u,{element:t,surface:e(n.global&&F?t[0].ownerDocument.documentElement:n.surface||t),stopPropagation:n.stopPropagation,pressed:!1}),u.surface.handler(u).on(o.applyEventMap("move",h),"_move").on(o.applyEventMap("up cancel",h),"_end"),t.on(o.applyEventMap("down",h),i,"_start"),u.useClickAsTap&&t.on(o.applyEventMap("click",h),i,"_click"),(a.pointers||a.msPointers)&&(a.browser.version<11?t.css("-ms-touch-action","pinch-zoom double-tap-zoom"):t.css("touch-action",n.touchAction||"none")),n.preventDragEvent&&t.on(o.applyEventMap("dragstart",h),o.preventDefault),t.on(o.applyEventMap("mousedown",h),i,{root:t},"_select"),u.captureUpIfMoved&&a.eventCapture&&(s=u.surface[0],d=e.proxy(u.preventIfMoving,u),r(function(e){s.addEventListener(e,d,!0)})),u.bind([m,g,y,_,b,k,x,w,C,T,S,D,v],n)},preventIfMoving:function(e){this._isMoved()&&e.preventDefault()},destroy:function(){var e,t=this;t._destroyed||(t._destroyed=!0,t.captureUpIfMoved&&a.eventCapture&&(e=t.surface[0],r(function(n){e.removeEventListener(n,t.preventIfMoving)})),t.element.kendoDestroy(t.eventNS),t.surface.kendoDestroy(t.eventNS),t.element.removeData("handler"),t.surface.removeData("handler"),t._disposeAll(),t.unbind(),delete t.surface,delete t.element,delete t.currentTarget)},capture:function(){A.current=this},cancel:function(){this._disposeAll(),this.trigger(w)},notify:function(e,t){var i=this,r=i.touches;if(this._isMultiTouch()){switch(e){case b:e=T;break;case k:e=S;break;case y:e=D}c(t,{touches:r},n(r[0],r[1]))}return this.trigger(e,c(t,{type:e}))},press:function(e,t,n){this._apiCall("_start",e,t,n)},move:function(e,t){this._apiCall("_move",e,t)},end:function(e,t){this._apiCall("_end",e,t)},_isMultiTouch:function(){return this.touches.length>1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){for(var e=this.touches;e.length>0;)e.pop().dispose()},_isMoved:function(){return e.grep(this.touches,function(e){return e.isMoved()}).length},_select:function(e){this.allowSelection&&!this.trigger(v,{event:e})||e.preventDefault()},_start:function(t){var n,r,o=this,a=0,s=o.filter,l=i(t),d=l.length,c=t.which;if(!(c&&c>1||o._maxTouchesReached()))for(A.current=null,o.currentTarget=t.currentTarget,o.stopPropagation&&t.stopPropagation();a<d&&!o._maxTouchesReached();a++)r=l[a],n=s?e(r.currentTarget):o.element,n.length&&(r=new I(o,n,r),o.touches.push(r),r.press(),o._isMultiTouch()&&o.notify("gesturestart",{}))},_move:function(e){this._eachTouch("move",e)},_end:function(e){this._eachTouch("end",e)},_click:function(t){var n={touch:{initialTouch:t.target,target:e(t.currentTarget),endTime:d(),x:{location:t.pageX,client:t.clientX},y:{location:t.pageY,client:t.clientY}},x:t.pageX,y:t.pageY,target:e(t.currentTarget),event:t,type:"tap"};this.trigger("tap",n)&&t.preventDefault()},_eachTouch:function(e,t){var n,r,o,a,s=this,l={},d=i(t),c=s.touches;for(n=0;n<c.length;n++)r=c[n],l[r.id]=r;for(n=0;n<d.length;n++)o=d[n],a=l[o.id],a&&a[e](o)},_apiCall:function(t,n,i,r){this[t]({api:!0,pageX:n,pageY:i,clientX:n,clientY:i,target:e(r||this.element)[0],stopPropagation:e.noop,preventDefault:e.noop})}});A.defaultThreshold=function(e){p=e},A.minHold=function(e){f=e},o.getTouches=i,o.touchDelta=n,o.UserEvents=A}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.draganddrop.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e,t){return parseInt(e.css(t),10)||0}function r(e,t){return Math.min(Math.max(e,t.min),t.max)}function o(e,t){var n=E(e),r=_._outerWidth,o=_._outerHeight,a=n.left+i(e,"borderLeftWidth")+i(e,"paddingLeft"),s=n.top+i(e,"borderTopWidth")+i(e,"paddingTop"),l=a+e.width()-r(t,!0),d=s+e.height()-o(t,!0);return{x:{min:a,max:l},y:{min:s,max:d}}}function a(n,i,r){for(var o,a,s=0,l=i&&i.length,d=r&&r.length;n&&n.parentNode;){for(s=0;s<l;s++)if(o=i[s],o.element[0]===n)return{target:o,targetElement:n};for(s=0;s<d;s++)if(a=r[s],e.contains(a.element[0],n)&&b.matchesSelector.call(n,a.options.filter))return{target:a,targetElement:n};n=n.parentNode}return t}function s(e,t){var n,i=t.options.group,r=e[i];if(x.fn.destroy.call(t),r.length>1){for(n=0;n<r.length;n++)if(r[n]==t){r.splice(n,1);break}}else r.length=0,delete e[i]}function l(e){var t,n,i,r=d()[0];return e[0]===r?(n=r.scrollTop,i=r.scrollLeft,{top:n,left:i,bottom:n+w.height(),right:i+w.width()}):(t=e.offset(),t.bottom=t.top+e.height(),t.right=t.left+e.width(),t)}function d(){return e(_.support.browser.chrome?k.body:k.documentElement)}function c(t){var n,i=d();if(!t||t===k.body||t===k.documentElement)return i;for(n=e(t)[0];n&&!_.isScrollable(n)&&n!==k.body;)n=n.parentNode;return n===k.body?i:e(n)}function u(e,t,n){var i={x:0,y:0},r=50;return e-n.left<r?i.x=-(r-(e-n.left)):n.right-e<r&&(i.x=r-(n.right-e)),t-n.top<r?i.y=-(r-(t-n.top)):n.bottom-t<r&&(i.y=r-(n.bottom-t)),i}var h,f,p,m,g,v,_=window.kendo,b=_.support,k=window.document,w=e(window),y=_.Class,x=_.ui.Widget,C=_.Observable,T=_.UserEvents,S=e.proxy,D=e.extend,E=_.getOffset,F={},R={},I={},A=_.elementUnderCursor,M="keyup",z="change",H="dragstart",N="hold",P="drag",L="dragend",B="dragcancel",O="hintDestroyed",V="dragenter",W="dragleave",U="drop",q=C.extend({init:function(t,n){var i=this,r=t[0];i.capture=!1,r.addEventListener?(e.each(_.eventMap.down.split(" "),function(){r.addEventListener(this,S(i._press,i),!0)}),e.each(_.eventMap.up.split(" "),function(){r.addEventListener(this,S(i._release,i),!0)})):(e.each(_.eventMap.down.split(" "),function(){r.attachEvent(this,S(i._press,i))}),e.each(_.eventMap.up.split(" "),function(){r.attachEvent(this,S(i._release,i))})),C.fn.init.call(i),i.bind(["press","release"],n||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(e){var t=this;t.trigger("press"),t.capture&&e.preventDefault()},_release:function(e){var t=this;t.trigger("release"),t.capture&&(e.preventDefault(),t.cancelCapture())}}),j=C.extend({init:function(t){var n=this;C.fn.init.call(n),n.forcedEnabled=!1,e.extend(n,t),n.scale=1,n.horizontal?(n.measure="offsetWidth",n.scrollSize="scrollWidth",n.axis="x"):(n.measure="offsetHeight",n.scrollSize="scrollHeight",n.axis="y")},makeVirtual:function(){e.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})},virtualSize:function(e,t){this._virtualMin===e&&this._virtualMax===t||(this._virtualMin=e,this._virtualMax=t,this.update())},outOfBounds:function(e){return e>this.max||e<this.min},forceEnabled:function(){this.forcedEnabled=!0},getSize:function(){return this.container[0][this.measure]},getTotal:function(){return this.element[0][this.scrollSize]},rescale:function(e){this.scale=e},update:function(e){var t=this,n=t.virtual?t._virtualMax:t.getTotal(),i=n*t.scale,r=t.getSize();(0!==n||t.forcedEnabled)&&(t.max=t.virtual?-t._virtualMin:0,t.size=r,t.total=i,t.min=Math.min(t.max,r-i),t.minScale=r/n,t.centerOffset=(i-r)/2,t.enabled=t.forcedEnabled||i>r,e||t.trigger(z,t))}}),$=C.extend({init:function(e){var t=this;C.fn.init.call(t),t.x=new j(D({horizontal:!0},e)),t.y=new j(D({horizontal:!1},e)),t.container=e.container,t.forcedMinScale=e.minScale,t.maxScale=e.maxScale||100,t.bind(z,e)},rescale:function(e){this.x.rescale(e),this.y.rescale(e),this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var e=this;e.x.update(),e.y.update(),e.enabled=e.x.enabled||e.y.enabled,e.minScale=e.forcedMinScale||Math.min(e.x.minScale,e.y.minScale),e.fitScale=Math.max(e.x.minScale,e.y.minScale),e.trigger(z)}}),G=C.extend({init:function(e){var t=this;D(t,e),C.fn.init.call(t)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(e){var t=this,n=t.dimension,i=t.axis,r=t.movable,o=r[i]+e;n.enabled&&((o<n.min&&e<0||o>n.max&&e>0)&&(e*=t.resistance),r.translateAxis(i,e),t.trigger(z,t))}}),Y=y.extend({init:function(t){var n,i,r,o,a=this;D(a,{elastic:!0},t),r=a.elastic?.5:0,o=a.movable,a.x=n=new G({axis:"x",dimension:a.dimensions.x,resistance:r,movable:o}),a.y=i=new G({axis:"y",dimension:a.dimensions.y,resistance:r,movable:o}),a.userEvents.bind(["press","move","end","gesturestart","gesturechange"],{gesturestart:function(e){a.gesture=e,a.offset=a.dimensions.container.offset()},press:function(t){e(t.event.target).closest("a").is("[data-navigate-on-press=true]")&&t.sender.cancel()},gesturechange:function(e){var t,r,s,l=a.gesture,d=l.center,c=e.center,u=e.distance/l.distance,h=a.dimensions.minScale,f=a.dimensions.maxScale;o.scale<=h&&u<1&&(u+=.8*(1-u)),o.scale*u>=f&&(u=f/o.scale),r=o.x+a.offset.left,s=o.y+a.offset.top,t={x:(r-d.x)*u+c.x-r,y:(s-d.y)*u+c.y-s},o.scaleWith(u),n.dragMove(t.x),i.dragMove(t.y),a.dimensions.rescale(o.scale),a.gesture=e,e.preventDefault()},move:function(e){e.event.target.tagName.match(/textarea|input/i)||(n.dimension.enabled||i.dimension.enabled?(n.dragMove(e.x.delta),i.dragMove(e.y.delta),e.preventDefault()):e.touch.skip())},end:function(e){e.preventDefault()}})}}),K=b.transitions.prefix+"Transform";f=b.hasHW3D?function(e,t,n){return"translate3d("+e+"px,"+t+"px,0) scale("+n+")"}:function(e,t,n){return"translate("+e+"px,"+t+"px) scale("+n+")"},p=C.extend({init:function(t){var n=this;C.fn.init.call(n),n.element=e(t),n.element[0].style.webkitTransformOrigin="left top",n.x=0,n.y=0,n.scale=1,n._saveCoordinates(f(n.x,n.y,n.scale))},translateAxis:function(e,t){this[e]+=t,this.refresh()},scaleTo:function(e){this.scale=e,this.refresh()},scaleWith:function(e){this.scale*=e,this.refresh()},translate:function(e){this.x+=e.x,this.y+=e.y,this.refresh()},moveAxis:function(e,t){this[e]=t,this.refresh()},moveTo:function(e){D(this,e),this.refresh()},refresh:function(){var e,t=this,n=t.x,i=t.y;t.round&&(n=Math.round(n),i=Math.round(i)),e=f(n,i,t.scale),e!=t.coordinates&&(_.support.browser.msie&&_.support.browser.version<10?(t.element[0].style.position="absolute",t.element[0].style.left=t.x+"px",t.element[0].style.top=t.y+"px"):t.element[0].style[K]=e,t._saveCoordinates(e),t.trigger(z))},_saveCoordinates:function(e){this.coordinates=e}}),m=x.extend({init:function(e,t){var n,i=this;x.fn.init.call(i,e,t),n=i.options.group,n in R?R[n].push(i):R[n]=[i]},events:[V,W,U],options:{name:"DropTarget",group:"default"},destroy:function(){s(R,this)},_trigger:function(e,t){var n=this,i=F[n.options.group];if(i)return n.trigger(e,D({},t.event,{draggable:i,dropTarget:t.dropTarget}))},_over:function(e){this._trigger(V,e)},_out:function(e){this._trigger(W,e)},_drop:function(e){var t=this,n=F[t.options.group];n&&(n.dropped=!t._trigger(U,e))}}),m.destroyGroup=function(e){var t,n=R[e]||I[e];if(n){for(t=0;t<n.length;t++)x.fn.destroy.call(n[t]);n.length=0,delete R[e],delete I[e]}},m._cache=R,g=m.extend({init:function(e,t){var n,i=this;x.fn.init.call(i,e,t),n=i.options.group,n in I?I[n].push(i):I[n]=[i]},destroy:function(){s(I,this)},options:{name:"DropTargetArea",group:"default",filter:null}}),v=x.extend({init:function(e,t){var n=this;x.fn.init.call(n,e,t),n._activated=!1,n.userEvents=new T(n.element,{global:!0,allowSelection:!0,filter:n.options.filter,threshold:n.options.distance,start:S(n._start,n),hold:S(n._hold,n),move:S(n._drag,n),end:S(n._end,n),cancel:S(n._cancel,n),select:S(n._select,n)}),n._afterEndHandler=S(n._afterEnd,n),n._captureEscape=S(n._captureEscape,n)},events:[N,H,P,L,B,O],options:{name:"Draggable",distance:_.support.touch?0:5,group:"default",cursorOffset:null,axis:null,container:null,filter:null,ignore:null,holdToDrag:!1,autoScroll:!1,dropped:!1},cancelHold:function(){this._activated=!1},_captureEscape:function(e){var t=this;e.keyCode===_.keys.ESC&&(t._trigger(B,{event:e}),t.userEvents.cancel())},_updateHint:function(t){var n,i=this,o=i.options,a=i.boundaries,s=o.axis,l=i.options.cursorOffset;l?n={left:t.x.location+l.left,top:t.y.location+l.top}:(i.hintOffset.left+=t.x.delta,i.hintOffset.top+=t.y.delta,n=e.extend({},i.hintOffset)),a&&(n.top=r(n.top,a.y),n.left=r(n.left,a.x)),"x"===s?delete n.top:"y"===s&&delete n.left,i.hint.css(n)},_shouldIgnoreTarget:function(t){var n=this.options.ignore;return n&&e(t).is(n)},_select:function(e){this._shouldIgnoreTarget(e.event.target)||e.preventDefault()},_start:function(n){var i,r=this,a=r.options,s=a.container,l=a.hint;return this._shouldIgnoreTarget(n.touch.initialTouch)||a.holdToDrag&&!r._activated?(r.userEvents.cancel(),t):(r.currentTarget=n.target,r.currentTargetOffset=E(r.currentTarget),l&&(r.hint&&r.hint.stop(!0,!0).remove(),r.hint=_.isFunction(l)?e(l.call(r,r.currentTarget)):l,i=E(r.currentTarget),r.hintOffset=i,r.hint.css({position:"absolute",zIndex:2e4,left:i.left,top:i.top}).appendTo(k.body),r.angular("compile",function(){r.hint.removeAttr("ng-repeat");for(var t=e(n.target);!t.data("$$kendoScope")&&t.length;)t=t.parent();return{elements:r.hint.get(),scopeFrom:t.data("$$kendoScope")}})),F[a.group]=r,r.dropped=!1,s&&(r.boundaries=o(s,r.hint)),e(k).on(M,r._captureEscape),r._trigger(H,n)&&(r.userEvents.cancel(),r._afterEnd()),r.userEvents.capture(),t)},_hold:function(e){this.currentTarget=e.target,this._trigger(N,e)?this.userEvents.cancel():this._activated=!0},_drag:function(t){var n,i;t.preventDefault(),n=this._elementUnderCursor(t),this.options.autoScroll&&this._cursorElement!==n&&(this._scrollableParent=c(n),this._cursorElement=n),this._lastEvent=t,this._processMovement(t,n),this.options.autoScroll&&this._scrollableParent[0]&&(i=u(t.x.location,t.y.location,l(this._scrollableParent)),this._scrollCompenstation=e.extend({},this.hintOffset),this._scrollVelocity=i,0===i.y&&0===i.x?(clearInterval(this._scrollInterval),this._scrollInterval=null):this._scrollInterval||(this._scrollInterval=setInterval(e.proxy(this,"_autoScroll"),50))),this.hint&&this._updateHint(t)},_processMovement:function(n,i){this._withDropTarget(i,function(i,r){if(!i)return h&&(h._trigger(W,D(n,{dropTarget:e(h.targetElement)})),h=null),t;if(h){if(r===h.targetElement)return;h._trigger(W,D(n,{dropTarget:e(h.targetElement)}))}i._trigger(V,D(n,{dropTarget:e(r)})),h=D(i,{targetElement:r})}),this._trigger(P,D(n,{dropTarget:h,elementUnderCursor:i}))},_autoScroll:function(){var e,t,n,i,r,o,a,s,l=this._scrollableParent[0],c=this._scrollVelocity,u=this._scrollCompenstation;l&&(e=this._elementUnderCursor(this._lastEvent),this._processMovement(this._lastEvent,e),i=l===d()[0],i?(t=k.body.scrollHeight>w.height(),n=k.body.scrollWidth>w.width()):(t=l.offsetHeight<=l.scrollHeight,n=l.offsetWidth<=l.scrollWidth),r=l.scrollTop+c.y,o=t&&r>0&&r<l.scrollHeight,a=l.scrollLeft+c.x,s=n&&a>0&&a<l.scrollWidth,o&&(l.scrollTop+=c.y),s&&(l.scrollLeft+=c.x),i&&(s||o)&&(o&&(u.top+=c.y),s&&(u.left+=c.x),this.hint.css(u)))},_end:function(t){this._withDropTarget(this._elementUnderCursor(t),function(n,i){n&&(n._drop(D({},t,{dropTarget:e(i)})),h=null)}),this._cancel(this._trigger(L,t))},_cancel:function(e){var t=this;t._scrollableParent=null,this._cursorElement=null,clearInterval(this._scrollInterval),t._activated=!1,t.hint&&!t.dropped?setTimeout(function(){t.hint.stop(!0,!0),e?t._afterEndHandler():t.hint.animate(t.currentTargetOffset,"fast",t._afterEndHandler)},0):t._afterEnd()},_trigger:function(e,t){var n=this;return n.trigger(e,D({},t.event,{x:t.x,y:t.y,currentTarget:n.currentTarget,initialTarget:t.touch?t.touch.initialTouch:null,dropTarget:t.dropTarget,elementUnderCursor:t.elementUnderCursor}))},_elementUnderCursor:function(e){var t=A(e),i=this.hint;return i&&n(i[0],t)&&(i.hide(),t=A(e),t||(t=A(e)),i.show()),t},_withDropTarget:function(e,t){var n,i=this.options.group,r=R[i],o=I[i];(r&&r.length||o&&o.length)&&(n=a(e,r,o),n?t(n.target,n.targetElement):t())},destroy:function(){var e=this;x.fn.destroy.call(e),e._afterEnd(),e.userEvents.destroy(),this._scrollableParent=null,this._cursorElement=null,clearInterval(this._scrollInterval),e.currentTarget=null},_afterEnd:function(){var t=this;t.hint&&t.hint.remove(),delete F[t.options.group],t.trigger("destroy"),t.trigger(O),e(k).off(M,t._captureEscape)}}),_.ui.plugin(m),_.ui.plugin(g),_.ui.plugin(v),_.TapCapture=q,_.containerBoundaries=o,D(_.ui,{Pane:Y,PaneDimensions:$,Movable:p}),_.ui.Draggable.utils={autoScrollVelocity:u,scrollableViewPort:l,findScrollableParent:c}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.mobile.scroller.min",["kendo.fx.min","kendo.draganddrop.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.mobile,r=n.effects,o=i.ui,a=e.proxy,s=e.extend,l=o.Widget,d=n.Class,c=n.ui.Movable,u=n.ui.Pane,h=n.ui.PaneDimensions,f=r.Transition,p=r.Animation,m=Math.abs,g=500,v=.7,_=.96,b=10,k=55,w=.5,y=5,x="km-scroller-release",C="km-scroller-refresh",T="pull",S="change",D="resize",E="scroll",F=2,R=p.extend({init:function(e){var t=this;p.fn.init.call(t),s(t,e),t.userEvents.bind("gestureend",a(t.start,t)),t.tapCapture.bind("press",a(t.cancel,t))},enabled:function(){return this.movable.scale<this.dimensions.minScale},done:function(){return this.dimensions.minScale-this.movable.scale<.01},tick:function(){var e=this.movable;e.scaleWith(1.1),this.dimensions.rescale(e.scale)},onEnd:function(){var e=this.movable;e.scaleTo(this.dimensions.minScale),this.dimensions.rescale(e.scale)}}),I=p.extend({init:function(e){var t=this;p.fn.init.call(t),s(t,e,{transition:new f({axis:e.axis,movable:e.movable,onEnd:function(){t._end()}})}),t.tapCapture.bind("press",function(){t.cancel()}),t.userEvents.bind("end",a(t.start,t)),t.userEvents.bind("gestureend",a(t.start,t)),t.userEvents.bind("tap",a(t.onEnd,t))},onCancel:function(){this.transition.cancel()},freeze:function(e){var t=this;t.cancel(),t._moveTo(e)},onEnd:function(){var e=this;e.paneAxis.outOfBounds()?e._snapBack():e._end()},done:function(){return m(this.velocity)<1},start:function(e){var t,n=this;n.dimension.enabled&&(n.paneAxis.outOfBounds()?n._snapBack():(t=e.touch.id===F?0:e.touch[n.axis].velocity,n.velocity=Math.max(Math.min(t*n.velocityMultiplier,k),-k),n.tapCapture.captureNext(),p.fn.start.call(n)))},tick:function(){var e=this,t=e.dimension,n=e.paneAxis.outOfBounds()?w:e.friction,i=e.velocity*=n,r=e.movable[e.axis]+i;!e.elastic&&t.outOfBounds(r)&&(r=Math.max(Math.min(r,t.max),t.min),e.velocity=0),e.movable.moveAxis(e.axis,r)},_end:function(){this.tapCapture.cancelCapture(),this.end()},_snapBack:function(){var e=this,t=e.dimension,n=e.movable[e.axis]>t.max?t.max:t.min;e._moveTo(n)},_moveTo:function(e){this.transition.moveTo({location:e,duration:g,ease:f.easeOutExpo})}}),A=p.extend({init:function(e){var t=this;n.effects.Animation.fn.init.call(this),s(t,e,{origin:{},destination:{},offset:{}})},tick:function(){this._updateCoordinates(),this.moveTo(this.origin)},done:function(){return m(this.offset.y)<y&&m(this.offset.x)<y},onEnd:function(){this.moveTo(this.destination),this.callback&&this.callback.call()},setCoordinates:function(e,t){this.offset={},this.origin=e,this.destination=t},setCallback:function(e){e&&n.isFunction(e)?this.callback=e:e=t},_updateCoordinates:function(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4},this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}}),M=d.extend({init:function(t){var n=this,i="x"===t.axis,r=e('<div class="km-touch-scrollbar km-'+(i?"horizontal":"vertical")+'-scrollbar" />');s(n,t,{element:r,elementSize:0,movable:new c(r),scrollMovable:t.movable,alwaysVisible:t.alwaysVisible,size:i?"width":"height"}),n.scrollMovable.bind(S,a(n.refresh,n)),n.container.append(r),t.alwaysVisible&&n.show()},refresh:function(){var e=this,t=e.axis,n=e.dimension,i=n.size,r=e.scrollMovable,o=i/n.total,a=Math.round(-r[t]*o),s=Math.round(i*o);o>=1?this.element.css("display","none"):this.element.css("display",""),a+s>i?s=i-a:a<0&&(s+=a,a=0),e.elementSize!=s&&(e.element.css(e.size,s+"px"),e.elementSize=s),e.movable.moveAxis(t,a)},show:function(){this.element.css({opacity:v,visibility:"visible"})},hide:function(){this.alwaysVisible||this.element.css({opacity:0})}}),z=l.extend({init:function(i,r){var o,d,f,p,g,v,_,b,k,w=this;return l.fn.init.call(w,i,r),i=w.element,(w._native=w.options.useNative&&n.support.hasNativeScrolling)?(i.addClass("km-native-scroller").prepend('<div class="km-scroll-header"/>'),s(w,{scrollElement:i,fixedContainer:i.children().first()}),t):(i.css("overflow","hidden").addClass("km-scroll-wrapper").wrapInner('<div class="km-scroll-container"/>').prepend('<div class="km-scroll-header"/>'),o=i.children().eq(1),d=new n.TapCapture(i),f=new c(o),p=new h({element:o,container:i,forcedEnabled:w.options.zoom}),g=this.options.avoidScrolling,v=new n.UserEvents(i,{touchAction:"pan-y",fastTap:!0,allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:w.options.zoom,start:function(t){p.refresh();var n=m(t.x.velocity),i=m(t.y.velocity),r=2*n>=i,o=e.contains(w.fixedContainer[0],t.event.target),a=2*i>=n;!o&&!g(t)&&w.enabled&&(p.x.enabled&&r||p.y.enabled&&a)?v.capture():v.cancel()}}),_=new u({movable:f,dimensions:p,userEvents:v,elastic:w.options.elastic}),b=new R({movable:f,dimensions:p,userEvents:v,tapCapture:d}),k=new A({moveTo:function(e){w.scrollTo(e.x,e.y)}}),f.bind(S,function(){w.scrollTop=-f.y,w.scrollLeft=-f.x,w.trigger(E,{scrollTop:w.scrollTop,scrollLeft:w.scrollLeft})}),w.options.mousewheelScrolling&&i.on("DOMMouseScroll mousewheel",a(this,"_wheelScroll")),s(w,{movable:f,dimensions:p,zoomSnapBack:b,animatedScroller:k,userEvents:v,pane:_,tapCapture:d,pulled:!1,enabled:!0,scrollElement:o,scrollTop:0,scrollLeft:0,fixedContainer:i.children().first()}),w._initAxis("x"),w._initAxis("y"),w._wheelEnd=function(){w._wheel=!1,w.userEvents.end(0,w._wheelY)},p.refresh(),w.options.pullToRefresh&&w._initPullToRefresh(),t)},_wheelScroll:function(e){this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);var t=n.wheelDeltaY(e);t&&(this._wheelY+=t,this.userEvents.move(0,this._wheelY)),e.preventDefault()},makeVirtual:function(){this.dimensions.y.makeVirtual()},virtualSize:function(e,t){this.dimensions.y.virtualSize(e,t)},height:function(){return this.dimensions.y.size},scrollHeight:function(){return this.scrollElement[0].scrollHeight},scrollWidth:function(){return this.scrollElement[0].scrollWidth},options:{name:"Scroller",zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling:function(){return!1},pullToRefresh:!1,messages:{pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"}},events:[T,E,D],_resize:function(){this._native||this.contentResized()},setOptions:function(e){var t=this;l.fn.setOptions.call(t,e),e.pullToRefresh&&t._initPullToRefresh()},reset:function(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))},contentResized:function(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis("x",this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis("y",this.dimensions.y.min)},zoomOut:function(){var e=this.dimensions;e.refresh(),this._scale(e.fitScale),this.movable.moveTo(e.centerCoordinates())},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},scrollTo:function(e,t){this._native?(this.scrollElement.scrollLeft(m(e)),this.scrollElement.scrollTop(m(t))):(this.dimensions.refresh(),this.movable.moveTo({x:e,y:t}))},animatedScrollTo:function(e,t,n){var i,r;this._native?this.scrollTo(e,t):(i={x:this.movable.x,y:this.movable.y},r={x:e,y:t},this.animatedScroller.setCoordinates(i,r),this.animatedScroller.setCallback(n),this.animatedScroller.start())},pullHandled:function(){var e=this;e.refreshHint.removeClass(C),e.hintContainer.html(e.pullTemplate({})),e.yinertia.onEnd(),e.xinertia.onEnd(),e.userEvents.cancel()},destroy:function(){l.fn.destroy.call(this),this.userEvents&&this.userEvents.destroy()},_scale:function(e){this.dimensions.rescale(e),this.movable.scaleTo(e)},_initPullToRefresh:function(){var e=this;e.dimensions.y.forceEnabled(),e.pullTemplate=n.template(e.options.messages.pullTemplate),e.releaseTemplate=n.template(e.options.messages.releaseTemplate),e.refreshTemplate=n.template(e.options.messages.refreshTemplate),e.scrollElement.prepend('<span class="km-scroller-pull"><span class="km-icon"></span><span class="km-loading-left"></span><span class="km-loading-right"></span><span class="km-template">'+e.pullTemplate({})+"</span></span>"),e.refreshHint=e.scrollElement.children().first(),e.hintContainer=e.refreshHint.children(".km-template"),e.pane.y.bind("change",a(e._paneChange,e)),e.userEvents.bind("end",a(e._dragEnd,e))},_dragEnd:function(){var e=this;e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(x).addClass(C),e.hintContainer.html(e.refreshTemplate({})),e.yinertia.freeze(e.options.pullOffset/2),e.trigger("pull"))},_paneChange:function(){var e=this;e.movable.y/w>e.options.pullOffset?e.pulled||(e.pulled=!0,e.refreshHint.removeClass(C).addClass(x),e.hintContainer.html(e.releaseTemplate({}))):e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(x),e.hintContainer.html(e.pullTemplate({})))},_initAxis:function(e){var t=this,n=t.movable,i=t.dimensions[e],r=t.tapCapture,o=t.pane[e],a=new M({axis:e,movable:n,dimension:i,container:t.element,alwaysVisible:t.options.visibleScrollHints});i.bind(S,function(){a.refresh()}),o.bind(S,function(){a.show()}),t[e+"inertia"]=new I({axis:e,paneAxis:o,movable:n,tapCapture:r,userEvents:t.userEvents,dimension:i,elastic:t.options.elastic,friction:t.options.friction||_,velocityMultiplier:t.options.velocityMultiplier||b,end:function(){a.hide(),t.trigger("scrollEnd",{axis:e,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}})}});o.plugin(z)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.groupable.min",["kendo.core.min","kendo.draganddrop.min"],e)}(function(){return function(e,t){function n(e){return e.position().top+3}var i=window.kendo,r=i.ui.Widget,o=i._outerWidth,a=e.proxy,s=!1,l=".kendoGroupable",d="change",c=i.template('<div class="k-group-indicator" data-#=data.ns#field="${data.field}" data-#=data.ns#title="${data.title || ""}" data-#=data.ns#dir="${data.dir || "asc"}"><a href="\\#" class="k-link"><span class="k-icon k-i-sarrow-${(data.dir || "asc") == "asc" ? "n" : "s"}">(sorted ${(data.dir || "asc") == "asc" ? "ascending": "descending"})</span>${data.title ? data.title: data.field}</a><a class="k-button k-button-icon k-button-bare"><span class="k-icon k-i-group-delete"></span></a></div>',{useWithBlock:!1}),u=function(t){var n=t.attr(i.attr("title"));return n&&(n=i.htmlEncode(n)),e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(n||t.attr(i.attr("field"))).prepend('<span class="k-icon k-drag-status k-i-denied" />')},h=e('<div class="k-grouping-dropclue"/>'),f=r.extend({init:function(c,f){var p,m,g=this,v=i.guid(),_=a(g._intializePositions,g),b=g._dropCuePositions=[];r.fn.init.call(g,c,f),s=i.support.isRtl(c),m=s?"right":"left",g.draggable=p=g.options.draggable||new i.ui.Draggable(g.element,{filter:g.options.draggableElements,hint:u,group:v}),g.groupContainer=e(g.options.groupContainer,g.element).kendoDropTarget({group:p.options.group,dragenter:function(e){g._canDrag(e.draggable.currentTarget)&&(e.draggable.hint.find(".k-drag-status").removeClass("k-i-denied").addClass("k-i-add"),h.css("top",n(g.groupContainer)).css(m,0).appendTo(g.groupContainer))},dragleave:function(e){e.draggable.hint.find(".k-drag-status").removeClass("k-i-add").addClass("k-i-denied"),h.remove()},drop:function(t){var n,r=t.draggable.currentTarget,o=r.attr(i.attr("field")),a=r.attr(i.attr("title")),l=g.indicator(o),d=g._dropCuePositions,c=d[d.length-1];(r.hasClass("k-group-indicator")||g._canDrag(r))&&(c?(n=g._dropCuePosition(i.getOffset(h).left+parseInt(c.element.css("marginLeft"),10)*(s?-1:1)+parseInt(c.element.css("marginRight"),10)),n&&g._canDrop(e(l),n.element,n.left)&&(n.before?n.element.before(l||g.buildIndicator(o,a)):n.element.after(l||g.buildIndicator(o,a)),g._change())):(g.groupContainer.append(g.buildIndicator(o,a)),g._change()))}}).kendoDraggable({filter:"div.k-group-indicator",hint:u,group:p.options.group,dragcancel:a(g._dragCancel,g),dragstart:function(e){var t=e.currentTarget,i=parseInt(t.css("marginLeft"),10),r=t.position(),a=s?r.left-i:r.left+o(t);_(),h.css({top:n(g.groupContainer),left:a}).appendTo(g.groupContainer),this.hint.find(".k-drag-status").removeClass("k-i-denied").addClass("k-i-add")},dragend:function(){g._dragEnd(this)},drag:a(g._drag,g)}).on("click"+l,".k-button",function(t){t.preventDefault(),g._removeIndicator(e(this).parent())}).on("click"+l,".k-link",function(t){var n=e(this).parent(),r=g.buildIndicator(n.attr(i.attr("field")),n.attr(i.attr("title")),"asc"==n.attr(i.attr("dir"))?"desc":"asc");n.before(r).remove(),g._change(),t.preventDefault()}),p.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){g._dragEnd(this)},dragcancel:a(g._dragCancel,g),dragstart:function(e){var n,i,r;return g.options.allowDrag||g._canDrag(e.currentTarget)?(_(),b.length?(n=b[b.length-1].element,i=parseInt(n.css("marginRight"),10),r=n.position().left+o(n)+i):r=0,t):(e.preventDefault(),t)},drag:a(g._drag,g)}),g.dataSource=g.options.dataSource,g.dataSource&&g._refreshHandler?g.dataSource.unbind(d,g._refreshHandler):g._refreshHandler=a(g.refresh,g),g.dataSource&&(g.dataSource.bind("change",g._refreshHandler),g.refresh())},refresh:function(){var t=this,n=t.dataSource;t.groupContainer&&t.groupContainer.empty().append(e.map(n.group()||[],function(n){var r=n.field,o=i.attr("field"),a=t.element.find(t.options.filter).filter(function(){return e(this).attr(o)===r});return t.buildIndicator(n.field,a.attr(i.attr("title")),n.dir)}).join("")),t._invalidateGroupContainer()},destroy:function(){var e=this;r.fn.destroy.call(e),e.groupContainer.off(l),e.groupContainer.data("kendoDropTarget")&&e.groupContainer.data("kendoDropTarget").destroy(),e.groupContainer.data("kendoDraggable")&&e.groupContainer.data("kendoDraggable").destroy(),e.options.draggable||e.draggable.destroy(),e.dataSource&&e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=null),e.groupContainer=e.element=e.draggable=null},events:["change"],options:{name:"Groupable",filter:"th",draggableElements:"th",messages:{empty:"Drag a column header and drop it here to group by that column"
}},indicator:function(t){var n=e(".k-group-indicator",this.groupContainer);return e.grep(n,function(n){return e(n).attr(i.attr("field"))===t})[0]},buildIndicator:function(e,t,n){return c({field:e.replace(/"/g,"'"),dir:n,title:t,ns:i.ns})},descriptors:function(){var t,n,r,o,a,s=this,l=e(".k-group-indicator",s.groupContainer);return t=s.element.find(s.options.filter).map(function(){var t=e(this),r=t.attr(i.attr("aggregates")),s=t.attr(i.attr("field"));if(r&&""!==r)for(n=r.split(","),r=[],o=0,a=n.length;o<a;o++)r.push({field:s,aggregate:n[o]});return r}).toArray(),e.map(l,function(n){return n=e(n),r=n.attr(i.attr("field")),{field:r,dir:n.attr(i.attr("dir")),aggregates:t||[]}})},_removeIndicator:function(e){var t=this;e.remove(),t._invalidateGroupContainer(),t._change()},_change:function(){var e,n=this;if(n.dataSource){if(e=n.descriptors(),n.trigger("change",{groups:e}))return n.refresh(),t;n.dataSource.group(e)}},_dropCuePosition:function(t){var n,i,r,a,l,d=this._dropCuePositions;if(h.is(":visible")&&0!==d.length)return t=Math.ceil(t),n=d[d.length-1],i=n.left,r=n.right,a=parseInt(n.element.css("marginLeft"),10),l=parseInt(n.element.css("marginRight"),10),t>=r&&!s||t<i&&s?t={left:n.element.position().left+(s?-a:o(n.element)+l),element:n.element,before:!1}:(t=e.grep(d,function(e){return e.left<=t&&t<=e.right||s&&t>e.right})[0],t&&(t={left:s?t.element.position().left+o(t.element)+l:t.element.position().left-a,element:t.element,before:!0})),t},_drag:function(e){var t=this._dropCuePosition(e.x.location);t&&h.css({left:t.left,right:"auto"})},_canDrag:function(e){var t=e.attr(i.attr("field"));return"false"!=e.attr(i.attr("groupable"))&&t&&(e.hasClass("k-group-indicator")||!this.indicator(t))},_canDrop:function(e,t,n){var i=e.next(),r=e[0]!==t[0]&&(!i[0]||t[0]!==i[0]||!s&&n>i.position().left||s&&n<i.position().left);return r},_dragEnd:function(t){var n=this,r=t.currentTarget.attr(i.attr("field")),o=n.indicator(r);t!==n.options.draggable&&!t.dropped&&o&&n._removeIndicator(e(o)),n._dragCancel()},_dragCancel:function(){h.remove(),this._dropCuePositions=[]},_intializePositions:function(){var t,n=this,r=e(".k-group-indicator",n.groupContainer);n._dropCuePositions=e.map(r,function(n){return n=e(n),t=i.getOffset(n).left,{left:parseInt(t,10),right:parseInt(t+o(n),10),element:n}})},_invalidateGroupContainer:function(){var e=this.groupContainer;e&&e.is(":empty")&&e.html(this.options.messages.empty)}});i.ui.plugin(f)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.reorderable.min",["kendo.core.min","kendo.draganddrop.min"],e)}(function(){return function(e,t){function n(t,n){t=e(t),n?t.find(".k-drag-status").removeClass("k-i-add").addClass("k-i-denied"):t.find(".k-drag-status").removeClass("k-i-denied").addClass("k-i-add")}var i=window.kendo,r=i._outerWidth,o=i._outerHeight,a=i.getOffset,s=i.ui.Widget,l="change",d="k-reorderable",c=s.extend({init:function(t,c){var u,h=this,f=i.guid()+"-reorderable";s.fn.init.call(h,t,c),t=h.element.addClass(d),c=h.options,h.draggable=u=c.draggable||new i.ui.Draggable(t,{group:f,autoScroll:!0,filter:c.filter,hint:c.hint}),h.reorderDropCue=e('<div class="k-reorder-cue"><div class="k-icon k-i-arrow-s"></div><div class="k-icon k-i-arrow-n"></div></div>'),t.find(u.options.filter).kendoDropTarget({group:u.options.group,dragenter:function(e){var t,i,s,l;h._draggable&&(t=this.element,s=!h._dropTargetAllowed(t)||h._isLastDraggable(),n(e.draggable.hint,s),s||(i=a(t),l=i.left,c.inSameContainer&&!c.inSameContainer({source:t,target:h._draggable,sourceIndex:h._index(t),targetIndex:h._index(h._draggable)})?h._dropTarget=t:h._index(t)>h._index(h._draggable)&&(l+=r(t)),h.reorderDropCue.css({height:o(t),top:i.top,left:l}).appendTo(document.body)))},dragleave:function(e){n(e.draggable.hint,!0),h.reorderDropCue.remove(),h._dropTarget=null},drop:function(){var e,t;h._dropTarget=null,h._draggable&&(e=this.element,t=h._draggable,h._dropTargetAllowed(e)&&!h._isLastDraggable()&&h.trigger(l,{element:h._draggable,target:e,oldIndex:h._index(t),newIndex:h._index(e),position:a(h.reorderDropCue).left>a(e).left?"after":"before"}))}}),u.bind(["dragcancel","dragend","dragstart","drag"],{dragcancel:function(){h.reorderDropCue.remove(),h._draggable=null,h._elements=null},dragend:function(){h.reorderDropCue.remove(),h._draggable=null,h._elements=null},dragstart:function(e){h._draggable=e.currentTarget,h._elements=h.element.find(h.draggable.options.filter)},drag:function(e){var t,n;h._dropTarget&&!this.hint.find(".k-drag-status").hasClass("k-i-denied")&&(t=a(h._dropTarget).left,n=r(h._dropTarget),h.reorderDropCue.css(e.pageX>t+n/2?{left:t+n}:{left:t}))}})},options:{name:"Reorderable",filter:"*"},events:[l],_isLastDraggable:function(){var e,t=this.options.inSameContainer,n=this._draggable[0],i=this._elements.get(),r=!1;if(!t)return!1;for(;!r&&i.length>0;)e=i.pop(),r=n!==e&&t({source:n,target:e,sourceIndex:this._index(n),targetIndex:this._index(e)});return!r},_dropTargetAllowed:function(e){var t=this.options.inSameContainer,n=this.options.dragOverContainers,i=this._draggable;return i[0]!==e[0]&&(!t||!n||(!!t({source:i,target:e,sourceIndex:this._index(i),targetIndex:this._index(e)})||n(this._index(i),this._index(e))))},_index:function(e){return this._elements.index(e)},destroy:function(){var t=this;s.fn.destroy.call(t),t.element.find(t.draggable.options.filter).each(function(){var t=e(this);t.data("kendoDropTarget")&&t.data("kendoDropTarget").destroy()}),t.draggable&&(t.draggable.destroy(),t.draggable.element=t.draggable=null),t.elements=t.reorderDropCue=t._elements=t._draggable=null}});i.ui.plugin(c)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.resizable.min",["kendo.core.min","kendo.draganddrop.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o=e.proxy,a=n.isFunction,s=e.extend,l="horizontal",d="vertical",c="start",u="resize",h="resizeend",f=r.extend({init:function(e,t){var n=this;r.fn.init.call(n,e,t),n.orientation=n.options.orientation.toLowerCase()!=d?l:d,n._positionMouse=n.orientation==l?"x":"y",n._position=n.orientation==l?"left":"top",n._sizingDom=n.orientation==l?"outerWidth":"outerHeight",n.draggable=new i.Draggable(t.draggableElement||e,{distance:1,filter:t.handle,drag:o(n._resize,n),dragcancel:o(n._cancel,n),dragstart:o(n._start,n),dragend:o(n._stop,n)}),n.userEvents=n.draggable.userEvents},events:[u,h,c],options:{name:"Resizable",orientation:l},resize:function(){},_max:function(e){var n=this,i=n.hint?n.hint[n._sizingDom]():0,r=n.options.max;return a(r)?r(e):r!==t?n._initialElementPosition+r-i:r},_min:function(e){var n=this,i=n.options.min;return a(i)?i(e):i!==t?n._initialElementPosition+i:i},_start:function(t){var n=this,i=n.options.hint,r=e(t.currentTarget);n._initialElementPosition=r.position()[n._position],n._initialMousePosition=t[n._positionMouse].startLocation,i&&(n.hint=a(i)?e(i(r)):i,n.hint.css({position:"absolute"}).css(n._position,n._initialElementPosition).appendTo(n.element)),n.trigger(c,t),n._maxPosition=n._max(t),n._minPosition=n._min(t),e(document.body).css("cursor",r.css("cursor"))},_resize:function(e){var n,i=this,r=i._maxPosition,o=i._minPosition,a=i._initialElementPosition+(e[i._positionMouse].location-i._initialMousePosition);n=o!==t?Math.max(o,a):a,i.position=n=r!==t?Math.min(r,n):n,i.hint&&i.hint.toggleClass(i.options.invalidClass||"",n==r||n==o).css(i._position,n),i.resizing=!0,i.trigger(u,s(e,{position:n}))},_stop:function(t){var n=this;n.hint&&n.hint.remove(),n.resizing=!1,n.trigger(h,s(t,{position:n.position})),e(document.body).css("cursor","")},_cancel:function(e){var n=this;n.hint&&(n.position=t,n.hint.css(n._position,n._initialElementPosition),n._stop(e))},destroy:function(){var e=this;r.fn.destroy.call(e),e.draggable&&e.draggable.destroy()},press:function(e){if(e){var t=e.position(),n=this;n.userEvents.press(t.left,t.top,e[0]),n.targetPosition=t,n.target=e}},move:function(e){var n=this,i=n._position,r=n.targetPosition,o=n.position;o===t&&(o=r[i]),r[i]=o+e,n.userEvents.move(r.left,r.top)},end:function(){this.userEvents.end(),this.target=this.position=t}});n.ui.plugin(f)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.sortable.min",["kendo.draganddrop.min"],e)}(function(){return function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e){return e.clone()}function r(e){return e.clone().removeAttr("id").css("visibility","hidden")}var o=window.kendo,a=o.ui.Widget,s=o._outerWidth,l=o._outerHeight,d="start",c="beforeMove",u="move",h="end",f="change",p="cancel",m="sort",g="remove",v="receive",_=">*",b=-1,k=a.extend({init:function(e,t){var n=this;a.fn.init.call(n,e,t),n.options.placeholder||(n.options.placeholder=r),n.options.hint||(n.options.hint=i),n.draggable=n._createDraggable()},events:[d,c,u,h,f,p],options:{name:"Sortable",hint:null,placeholder:null,filter:_,holdToDrag:!1,disabled:null,container:null,connectWith:null,handler:null,cursorOffset:null,axis:null,ignore:null,autoScroll:!1,cursor:"auto",moveOnDragEnter:!1},destroy:function(){this.draggable.destroy(),a.fn.destroy.call(this)},_createDraggable:function(){var t=this,n=t.element,i=t.options;return new o.ui.Draggable(n,{filter:i.filter,hint:o.isFunction(i.hint)?i.hint:e(i.hint),holdToDrag:i.holdToDrag,container:i.container?e(i.container):null,cursorOffset:i.cursorOffset,axis:i.axis,ignore:i.ignore,autoScroll:i.autoScroll,dragstart:e.proxy(t._dragstart,t),dragcancel:e.proxy(t._dragcancel,t),drag:e.proxy(t._drag,t),dragend:e.proxy(t._dragend,t)})},_dragstart:function(t){var n=this.draggedElement=t.currentTarget,i=this.options.disabled,r=this.options.handler,a=this.options.placeholder,s=this.placeholder=e(o.isFunction(a)?a.call(this,n):a);i&&n.is(i)?t.preventDefault():r&&!e(t.initialTarget).is(r)?t.preventDefault():this.trigger(d,{item:n,draggableEvent:t})?t.preventDefault():(n.css("display","none"),n.before(s),this._setCursor())},_dragcancel:function(){this._cancel(),this.trigger(p,{item:this.draggedElement}),this._resetCursor()},_drag:function(n){var i,r,o,a,s,l=this.draggedElement,d=this._findTarget(n),c={left:n.x.location,top:n.y.location},u={x:n.x.delta,y:n.y.delta},h=this.options.axis,f=this.options.moveOnDragEnter,p={item:l,list:this,draggableEvent:n};if("x"===h||"y"===h)return this._movementByAxis(h,c,u[h],p),t;if(d){if(i=this._getElementCenter(d.element),r={left:Math.round(c.left-i.left),top:Math.round(c.top-i.top)},e.extend(p,{target:d.element}),d.appendToBottom)return this._movePlaceholder(d,null,p),t;if(d.appendAfterHidden&&this._movePlaceholder(d,"next",p),this._isFloating(d.element)?u.x<0&&(f||r.left<0)?o="prev":u.x>0&&(f||r.left>0)&&(o="next"):u.y<0&&(f||r.top<0)?o="prev":u.y>0&&(f||r.top>0)&&(o="next"),o){for(s="prev"===o?jQuery.fn.prev:jQuery.fn.next,a=s.call(d.element);a.length&&!a.is(":visible");)a=s.call(a);a[0]!=this.placeholder[0]&&this._movePlaceholder(d,o,p)}}},_dragend:function(n){var i,r,o,a,s=this.placeholder,l=this.draggedElement,d=this.indexOf(l),c=this.indexOf(s),u=this.options.connectWith;return this._resetCursor(),o={action:m,item:l,oldIndex:d,newIndex:c,draggableEvent:n},c>=0?r=this.trigger(h,o):(i=s.parents(u).getKendoSortable(),o.action=g,a=e.extend({},o,{action:v,oldIndex:b,newIndex:i.indexOf(s)}),r=!(!this.trigger(h,o)&&!i.trigger(h,a))),r||c===d?(this._cancel(),t):(s.replaceWith(l),l.show(),this.draggable.dropped=!0,o={action:this.indexOf(l)!=b?m:g,item:l,oldIndex:d,newIndex:this.indexOf(l),draggableEvent:n},this.trigger(f,o),i&&(a=e.extend({},o,{action:v,oldIndex:b,newIndex:i.indexOf(l)}),i.trigger(f,a)),t)},_findTarget:function(n){var i,r,o=this._findElementUnderCursor(n),a=this.options.connectWith;return e.contains(this.element[0],o)?(i=this.items(),r=i.filter(o)[0]||i.has(o)[0],r?{element:e(r),sortable:this}:null):this.element[0]==o&&this._isEmpty()?{element:this.element,sortable:this,appendToBottom:!0}:this.element[0]==o&&this._isLastHidden()?(r=this.items().eq(0),{element:r,sortable:this,appendAfterHidden:!0}):a?this._searchConnectedTargets(o,n):t},_findElementUnderCursor:function(e){var t=o.elementUnderCursor(e),i=e.sender;return n(i.hint[0],t)&&(i.hint.hide(),t=o.elementUnderCursor(e),t||(t=o.elementUnderCursor(e)),i.hint.show()),t},_searchConnectedTargets:function(t,n){var i,r,o,a,s=e(this.options.connectWith);for(a=0;a<s.length;a++)if(i=s.eq(a).getKendoSortable(),e.contains(s[a],t)){if(i)return r=i.items(),o=r.filter(t)[0]||r.has(t)[0],o?(i.placeholder=this.placeholder,{element:e(o),sortable:i}):null}else if(s[a]==t){if(i&&i._isEmpty())return{element:s.eq(a),sortable:i,appendToBottom:!0};if(this._isCursorAfterLast(i,n))return o=i.items().last(),{element:o,sortable:i}}},_isCursorAfterLast:function(e,t){var n,i,r=e.items().last(),a={left:t.x.location,top:t.y.location};return n=o.getOffset(r),n.top+=l(r),n.left+=s(r),i=this._isFloating(r)?n.left-a.left:n.top-a.top,i<0},_movementByAxis:function(t,n,i,r){var o,a="x"===t?n.left:n.top,s=i<0?this.placeholder.prev():this.placeholder.next();s.length&&!s.is(":visible")&&(s=i<0?s.prev():s.next()),e.extend(r,{target:s}),o=this._getElementCenter(s),o&&(o="x"===t?o.left:o.top),s.length&&i<0&&a-o<0?this._movePlaceholder({element:s,sortable:this},"prev",r):s.length&&i>0&&a-o>0&&this._movePlaceholder({element:s,sortable:this},"next",r)},_movePlaceholder:function(e,t,n){var i=this.placeholder;e.sortable.trigger(c,n)||(t?"prev"===t?e.element.before(i):"next"===t&&e.element.after(i):e.element.append(i),e.sortable.trigger(u,n))},_setCursor:function(){var t,n=this.options.cursor;n&&"auto"!==n&&(t=e(document.body),this._originalCursorType=t.css("cursor"),t.css({cursor:n}),this._cursorStylesheet||(this._cursorStylesheet=e("<style>* { cursor: "+n+" !important; }</style>")),this._cursorStylesheet.appendTo(t))},_resetCursor:function(){this._originalCursorType&&(e(document.body).css("cursor",this._originalCursorType),this._originalCursorType=null,this._cursorStylesheet.remove())},_getElementCenter:function(e){var t=e.length?o.getOffset(e):null;return t&&(t.top+=l(e)/2,t.left+=s(e)/2),t},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_cancel:function(){this.draggedElement.show(),this.placeholder.remove()},_items:function(){var e,t=this.options.filter;return e=t?this.element.find(t):this.element.children()},indexOf:function(e){var t=this._items(),n=this.placeholder,i=this.draggedElement;return n&&e[0]==n[0]?t.not(i).index(e):t.not(n).index(e)},items:function(){var e=this.placeholder,t=this._items();return e&&(t=t.not(e)),t},_isEmpty:function(){return!this.items().length},_isLastHidden:function(){return 1===this.items().length&&this.items().is(":hidden")}});o.ui.plugin(k)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.selectable.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){function n(e,t){if(!e.is(":visible"))return!1;var n=r.getOffset(e),i=t.left+t.width,o=t.top+t.height;return n.right=n.left+r._outerWidth(e),n.bottom=n.top+r._outerHeight(e),!(n.left>i||n.right<t.left||n.top>o||n.bottom<t.top)}var i,r=window.kendo,o=r.ui.Widget,a=e.proxy,s=Math.abs,l="aria-selected",d="k-state-selected",c="k-state-selecting",u="k-selectable",h="change",f=".kendoSelectable",p="k-state-unselecting",m="input,a,textarea,.k-multiselect-wrap,select,button,.k-button>span,.k-button>img,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",g=r.support.browser.msie,v=!1;!function(e){!function(){e('<div class="parent"><span /></div>').on("click",">*",function(){v=!0}).find("span").click().end().off()}()}(e),i=o.extend({init:function(t,n){var i,s=this;o.fn.init.call(s,t,n),s._marquee=e("<div class='k-marquee'><div class='k-marquee-color'></div></div>"),s._lastActive=null,s.element.addClass(u),s.relatedTarget=s.options.relatedTarget,i=s.options.multiple,this.options.aria&&i&&s.element.attr("aria-multiselectable",!0),s.userEvents=new r.UserEvents(s.element,{global:!0,allowSelection:!0,filter:(v?"":"."+u+" ")+s.options.filter,tap:a(s._tap,s)}),i&&s.userEvents.bind("start",a(s._start,s)).bind("move",a(s._move,s)).bind("end",a(s._end,s)).bind("select",a(s._select,s))},events:[h],options:{name:"Selectable",filter:">*",multiple:!1,relatedTarget:e.noop},_isElement:function(e){var t,n=this.element,i=n.length,r=!1;for(e=e[0],t=0;t<i;t++)if(n[t]===e){r=!0;break}return r},_tap:function(t){var n,i=e(t.target),r=this,o=t.event.ctrlKey||t.event.metaKey,a=r.options.multiple,s=a&&t.event.shiftKey,l=t.event.which,c=t.event.button;!r._isElement(i.closest("."+u))||l&&3==l||c&&2==c||this._allowSelection(t.event.target)&&(n=i.hasClass(d),a&&o||r.clear(),i=i.add(r.relatedTarget(i)),s?r.selectRange(r._firstSelectee(),i):(n&&o?(r._unselect(i),r._notify(h)):r.value(i),r._lastActive=r._downTarget=i))},_start:function(n){var i,r=this,o=e(n.target),a=o.hasClass(d),s=n.event.ctrlKey||n.event.metaKey;if(this._allowSelection(n.event.target)){if(r._downTarget=o,!r._isElement(o.closest("."+u)))return r.userEvents.cancel(),t;r.options.useAllItems?r._items=r.element.find(r.options.filter):(i=o.closest(r.element),r._items=i.find(r.options.filter)),n.sender.capture(),r._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}),s||r.clear(),o=o.add(r.relatedTarget(o)),a&&(r._selectElement(o,!0),s&&o.addClass(p))}},_move:function(e){var t=this,n={left:e.x.startLocation>e.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:s(e.x.initialDelta),height:s(e.y.initialDelta)};t._marquee.css(n),t._invalidateSelectables(n,e.event.ctrlKey||e.event.metaKey),e.preventDefault()},_end:function(){var e,t=this;t._marquee.remove(),t._unselect(t.element.find(t.options.filter+"."+p)).removeClass(p),e=t.element.find(t.options.filter+"."+c),e=e.add(t.relatedTarget(e)),t.value(e),t._lastActive=t._downTarget,t._items=null},_invalidateSelectables:function(e,t){var i,r,o,a,s=this._downTarget[0],l=this._items;for(i=0,r=l.length;i<r;i++)a=l.eq(i),o=a.add(this.relatedTarget(a)),n(a,e)?a.hasClass(d)?t&&s!==a[0]&&o.removeClass(d).addClass(p):a.hasClass(c)||a.hasClass(p)||o.addClass(c):a.hasClass(c)?o.removeClass(c):t&&a.hasClass(p)&&o.removeClass(p).addClass(d)},value:function(e){var n=this,i=a(n._selectElement,n);return e?(e.each(function(){i(this)}),n._notify(h),t):n.element.find(n.options.filter+"."+d)},_firstSelectee:function(){var e,t=this;return null!==t._lastActive?t._lastActive:(e=t.value(),e.length>0?e[0]:t.element.find(t.options.filter)[0])},_selectElement:function(t,n){var i=e(t),r=!n&&this._notify("select",{element:t});i.removeClass(c),r||(i.addClass(d),this.options.aria&&i.attr(l,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){return e.removeClass(d),this.options.aria&&e.attr(l,!1),e},_select:function(t){this._allowSelection(t.event.target)&&(!g||g&&!e(r._activeElement()).is(m))&&t.preventDefault()},_allowSelection:function(t){return!e(t).is(m)||(this.userEvents.cancel(),this._downTarget=null,!1)},resetTouchEvents:function(){this.userEvents.cancel()},clear:function(){var e=this.element.find(this.options.filter+"."+d);this._unselect(e)},selectRange:function(t,n){var i,r,o,a=this;for(a.clear(),a.element.length>1&&(o=a.options.continuousItems()),o&&o.length||(o=a.element.find(a.options.filter)),t=e.inArray(e(t)[0],o),n=e.inArray(e(n)[0],o),t>n&&(r=t,t=n,n=r),a.options.useAllItems||(n+=a.element.length-1),i=t;i<=n;i++)a._selectElement(o[i]);a._notify(h)},destroy:function(){var e=this;o.fn.destroy.call(e),e.element.off(f),e.userEvents.destroy(),e._marquee=e._lastActive=e.element=e.userEvents=null}}),i.parseOptions=function(e){var t="string"==typeof e&&e.toLowerCase();return{multiple:t&&t.indexOf("multiple")>-1,cell:t&&t.indexOf("cell")>-1}},r.ui.plugin(i)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.button.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=n.keys,a="click",s="k-button",l="k-button-icon",d="k-button-icontext",c=".kendoButton",u="disabled",h="k-state-disabled",f="k-state-focused",p="k-state-selected",m=i.extend({init:function(e,t){var o=this;i.fn.init.call(o,e,t),e=o.wrapper=o.element,t=o.options,e.addClass(s).attr("role","button"),t.enable=t.enable&&!e.attr(u),o.enable(t.enable),o._tabindex(),o._graphics(),e.on(a+c,r(o._click,o)).on("focus"+c,r(o._focus,o)).on("blur"+c,r(o._blur,o)).on("keydown"+c,r(o._keydown,o)).on("keyup"+c,r(o._keyup,o)),n.notify(o)},destroy:function(){var e=this;e.wrapper.off(c),i.fn.destroy.call(e)},events:[a],options:{name:"Button",icon:"",spriteCssClass:"",imageUrl:"",enable:!0},_isNativeButton:function(){return"button"==this.element.prop("tagName").toLowerCase()},_click:function(e){this.options.enable&&this.trigger(a,{event:e})&&e.preventDefault()},_focus:function(){this.options.enable&&this.element.addClass(f)},_blur:function(){this.element.removeClass(f)},_keydown:function(e){var t=this;t._isNativeButton()||e.keyCode!=o.ENTER&&e.keyCode!=o.SPACEBAR||(e.keyCode==o.SPACEBAR&&(e.preventDefault(),t.options.enable&&t.element.addClass(p)),t._click(e))},_keyup:function(){this.element.removeClass(p)},_graphics:function(){var t,n,i,r=this,o=r.element,a=r.options,s=a.icon,c=a.spriteCssClass,u=a.imageUrl;(c||u||s)&&(i=!0,o.contents().filter(function(){return!e(this).hasClass("k-sprite")&&!e(this).hasClass("k-icon")&&!e(this).hasClass("k-image")}).each(function(t,n){(1==n.nodeType||3==n.nodeType&&e.trim(n.nodeValue).length>0)&&(i=!1)}),o.addClass(i?l:d)),s?(t=o.children("span.k-icon").first(),t[0]||(t=e('<span class="k-icon"></span>').prependTo(o)),t.addClass("k-i-"+s)):c?(t=o.children("span.k-sprite").first(),t[0]||(t=e('<span class="k-sprite"></span>').prependTo(o)),t.addClass(c)):u&&(n=o.children("img.k-image").first(),n[0]||(n=e('<img alt="icon" class="k-image" />').prependTo(o)),n.attr("src",u))},enable:function(e){var n=this,i=n.element;e===t&&(e=!0),e=!!e,n.options.enable=e,i.toggleClass(h,!e).attr("aria-disabled",!e).attr(u,!e);try{i.blur()}catch(r){}}});n.ui.plugin(m)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.pager.min",["kendo.data.min"],e)}(function(){return function(e,t){function n(e,t,n,i,r){return e({idx:t,text:n,ns:d.ns,numeric:i,title:r||""})}function i(e,t,n){return y({className:e.substring(1),text:t,wrapClassName:n||""})}function r(e,t,n,i){e.find(t).parent().attr(d.attr("page"),n).attr("tabindex",-1).toggleClass("k-state-disabled",i)}function o(e,t){r(e,f,1,t<=1)}function a(e,t){r(e,m,Math.max(1,t-1),t<=1)}function s(e,t,n){r(e,g,Math.min(n,t+1),t>=n)}function l(e,t,n){r(e,p,n,t>=n)}var d=window.kendo,c=d.ui,u=c.Widget,h=e.proxy,f=".k-i-seek-w",p=".k-i-seek-e",m=".k-i-arrow-w",g=".k-i-arrow-e",v="change",_=".kendoPager",b="click",k="keydown",w="disabled",y=d.template('<a href="\\#" aria-label="#=text#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #"></span></a>'),x=u.extend({init:function(t,n){var r,c,w,y,x=this;u.fn.init.call(x,t,n),n=x.options,x.dataSource=d.data.DataSource.create(n.dataSource),x.linkTemplate=d.template(x.options.linkTemplate),x.selectTemplate=d.template(x.options.selectTemplate),x.currentPageTemplate=d.template(x.options.currentPageTemplate),r=x.page(),c=x.totalPages(),x._refreshHandler=h(x.refresh,x),x.dataSource.bind(v,x._refreshHandler),n.previousNext&&(x.element.find(f).length||(x.element.append(i(f,n.messages.first,"k-pager-first")),o(x.element,r,c)),x.element.find(m).length||(x.element.append(i(m,n.messages.previous)),a(x.element,r,c))),n.numeric&&(x.list=x.element.find(".k-pager-numbers"),x.list.length||(x.list=e('<ul class="k-pager-numbers k-reset" />').appendTo(x.element))),n.input&&(x.element.find(".k-pager-input").length||x.element.append('<span class="k-pager-input k-label">'+n.messages.page+'<input class="k-textbox">'+d.format(n.messages.of,c)+"</span>"),x.element.on(k+_,".k-pager-input input",h(x._keydown,x))),n.previousNext&&(x.element.find(g).length||(x.element.append(i(g,n.messages.next)),s(x.element,r,c)),x.element.find(p).length||(x.element.append(i(p,n.messages.last,"k-pager-last")),l(x.element,r,c))),n.pageSizes&&(x.element.find(".k-pager-sizes").length||(w=n.pageSizes.length?n.pageSizes:["all",5,10,20],y=e.map(w,function(e){return e.toLowerCase&&"all"===e.toLowerCase()?"<option value='all'>"+n.messages.allPages+"</option>":"<option>"+e+"</option>"}),e('<span class="k-pager-sizes k-label"><select/>'+n.messages.itemsPerPage+"</span>").appendTo(x.element).find("select").html(y.join("")).end().appendTo(x.element)),x.element.find(".k-pager-sizes select").val(x.pageSize()),d.ui.DropDownList&&x.element.find(".k-pager-sizes select").show().kendoDropDownList(),x.element.on(v+_,".k-pager-sizes select",h(x._change,x))),n.refresh&&(x.element.find(".k-pager-refresh").length||x.element.append('<a href="#" class="k-pager-refresh k-link" title="'+n.messages.refresh+'"><span class="k-icon k-i-refresh">'+n.messages.refresh+"</span></a>"),x.element.on(b+_,".k-pager-refresh",h(x._refreshClick,x))),n.info&&(x.element.find(".k-pager-info").length||x.element.append('<span class="k-pager-info k-label" />')),x.element.on(b+_,"a",h(x._click,x)).addClass("k-pager-wrap k-widget k-floatwrap"),x.element.on(b+_,".k-current-page",h(x._toggleActive,x)),n.autoBind&&x.refresh(),d.notify(x)},destroy:function(){var e=this;u.fn.destroy.call(e),e.element.off(_),e.dataSource.unbind(v,e._refreshHandler),e._refreshHandler=null,d.destroy(e.element),e.element=e.list=null},events:[v],options:{name:"Pager",selectTemplate:'<li><span class="k-state-selected">#=text#</span></li>',currentPageTemplate:'<li class="k-current-page"><span class="k-link k-pager-nav">#=text#</span></li>',linkTemplate:'<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#</a></li>',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{allPages:"All",display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh",morePages:"More pages"}},setDataSource:function(e){var t=this;t.dataSource.unbind(v,t._refreshHandler),t.dataSource=t.options.dataSource=e,e.bind(v,t._refreshHandler),t.options.autoBind&&e.fetch()},refresh:function(e){var t,i,r,c,u,h,f=this,p=1,m=f.page(),g="",v=f.options,_=f.pageSize(),b=f.dataSource.total(),k=f.totalPages(),y=f.linkTemplate,x=v.buttonCount;if(!e||"itemchange"!=e.action){if(v.numeric){for(m>x&&(r=m%x,p=0===r?m-x+1:m-r+1),i=Math.min(p+x-1,k),p>1&&(g+=n(y,p-1,"...",!1,v.messages.morePages)),t=p;t<=i;t++)g+=n(t==m?f.selectTemplate:y,t,t,!0);i<k&&(g+=n(y,t,"...",!1,v.messages.morePages)),""===g&&(g=f.selectTemplate({text:0})),g=this.currentPageTemplate({text:m})+g,f.list.removeClass("k-state-expanded").html(g)}v.info&&(g=b>0?d.format(v.messages.display,Math.min((m-1)*_+1,b),Math.min(m*_,b),b):v.messages.empty,f.element.find(".k-pager-info").html(g)),v.input&&f.element.find(".k-pager-input").html(f.options.messages.page+'<input class="k-textbox">'+d.format(v.messages.of,k)).find("input").val(m).attr(w,b<1).toggleClass("k-state-disabled",b<1),v.previousNext&&(o(f.element,m,k),a(f.element,m,k),s(f.element,m,k),l(f.element,m,k)),v.pageSizes&&(c=f.element.find(".k-pager-sizes option[value='all']").length>0,u=c&&_===this.dataSource.total(),h=_,u&&(_="all",h=v.messages.allPages),f.element.find(".k-pager-sizes select").val(_).filter("["+d.attr("role")+"=dropdownlist]").kendoDropDownList("value",_).kendoDropDownList("text",h))}},_keydown:function(e){if(e.keyCode===d.keys.ENTER){var t=this.element.find(".k-pager-input").find("input"),n=parseInt(t.val(),10);(isNaN(n)||n<1||n>this.totalPages())&&(n=this.page()),t.val(n),this.page(n)}},_refreshClick:function(e){e.preventDefault(),this.dataSource.read()},_change:function(e){var t=e.currentTarget.value,n=parseInt(t,10),i=this.dataSource;isNaN(n)?"all"==(t+"").toLowerCase()&&i.pageSize(i.total()):i.pageSize(n)},_toggleActive:function(){this.list.toggleClass("k-state-expanded")},_click:function(t){var n=e(t.currentTarget);t.preventDefault(),n.is(".k-state-disabled")||this.page(n.attr(d.attr("page")))},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/(this.pageSize()||1))},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(e){return e===t?this.dataSource.total()>0?this.dataSource.page():0:(this.trigger("pageChange",{index:e})||(this.dataSource.page(e),this.trigger(v,{index:e})),t)}});c.plugin(x)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.notification.min",["kendo.core.min","kendo.popup.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=e.extend,a=window.setTimeout,s="click",l="show",d="hide",c="k-notification",u=".k-notification-wrap .k-i-close",h="k-hiding",f="info",p="success",m="warning",g="error",v="top",_="left",b="bottom",k="right",w="up",y=".kendoNotification",x='<div class="k-widget k-notification"></div>',C='<div class="k-notification-wrap"><span class="k-icon k-i-#=typeIcon#">#=typeIcon#</span>#=content#<span class="k-icon k-i-close">Hide</span></div>',T=C.replace("#=content#","#:content#"),S=i.extend({init:function(t,r){var o=this;i.fn.init.call(o,t,r),r=o.options,r.appendTo&&e(r.appendTo).is(t)||o.element.hide(),o._compileTemplates(r.templates),o._guid="_"+n.guid(),o._isRtl=n.support.isRtl(t),o._compileStacking(r.stacking,r.position.top,r.position.left),n.notify(o)},events:[l,d],options:{name:"Notification",position:{pinned:!0,top:null,left:null,bottom:20,right:20},stacking:"default",hideOnClick:!0,button:!1,allowHideAfter:0,autoHideAfter:5e3,appendTo:null,width:null,height:null,templates:[],animation:{open:{effects:"fade:in",duration:300},close:{effects:"fade:out",duration:600,hide:!0}}},_compileTemplates:function(t){var i=this,r=n.template;i._compiled={},e.each(t,function(t,n){i._compiled[n.type]=r(n.template||e("#"+n.templateId).html())}),i._defaultCompiled=r(C),i._safeCompiled=r(T)},_getCompiled:function(e,t){var n=t?this._safeCompiled:this._defaultCompiled;return e?this._compiled[e]||n:n},_compileStacking:function(e,t,n){var i,r,o=this,a={paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},s=null!==n?_:k;switch(e){case"down":i=b+" "+s,r=v+" "+s,delete a.paddingBottom;break;case k:i=v+" "+k,r=v+" "+_,delete a.paddingRight;break;case _:i=v+" "+_,r=v+" "+k,delete a.paddingLeft;break;case w:i=v+" "+s,r=b+" "+s,delete a.paddingTop;break;default:null!==t?(i=b+" "+s,r=v+" "+s,delete a.paddingBottom):(i=v+" "+s,r=b+" "+s,delete a.paddingTop)}o._popupOrigin=i,o._popupPosition=r,o._popupPaddings=a},_attachPopupEvents:function(e,t){function i(e){e.on(s+y,function(){o._hidePopup(t)})}var r,o=this,l=e.allowHideAfter,d=!isNaN(l)&&l>0;t.options.anchor!==document.body&&t.options.origin.indexOf(k)>0&&t.bind("open",function(){var e=n.getShadows(t.element);a(function(){t.wrapper.css("left",parseFloat(t.wrapper.css("left"))+e.left+e.right)})}),e.hideOnClick?t.bind("activate",function(){d?a(function(){i(t.element)},l):i(t.element)}):e.button&&(r=t.element.find(u),d?a(function(){i(r)},l):i(r))},_showPopup:function(t,i){var r,s,l=this,d=i.autoHideAfter,c=i.position.left,f=i.position.top;s=e("."+l._guid+":not(."+h+")").last(),r=new n.ui.Popup(t,{anchor:s[0]?s:document.body,origin:l._popupOrigin,position:l._popupPosition,animation:i.animation,modal:!0,collision:"",isRtl:l._isRtl,close:function(){l._triggerHide(this.element);
},deactivate:function(e){e.sender.element.off(y),e.sender.element.find(u).off(y),e.sender.destroy()}}),l._attachPopupEvents(i,r),s[0]?r.open():(null===c&&(c=e(window).width()-t.width()-i.position.right),null===f&&(f=e(window).height()-t.height()-i.position.bottom),r.open(c,f)),r.wrapper.addClass(l._guid).css(o({margin:0},l._popupPaddings)),i.position.pinned?(r.wrapper.css("position","fixed"),s[0]&&l._togglePin(r.wrapper,!0)):s[0]||l._togglePin(r.wrapper,!1),d>0&&a(function(){l._hidePopup(r)},d)},_hidePopup:function(e){e.wrapper.addClass(h),e.close()},_togglePin:function(t,n){var i=e(window),r=n?-1:1;t.css({top:parseInt(t.css(v),10)+r*i.scrollTop(),left:parseInt(t.css(_),10)+r*i.scrollLeft()})},_attachStaticEvents:function(e,t){function n(e){e.on(s+y,r(i._hideStatic,i,t))}var i=this,o=e.allowHideAfter,l=!isNaN(o)&&o>0;e.hideOnClick?l?a(function(){n(t)},o):n(t):e.button&&(l?a(function(){n(t.find(u))},o):n(t.find(u)))},_showStatic:function(e,t){var n=this,i=t.autoHideAfter,r=t.animation,o=t.stacking==w||t.stacking==_?"prependTo":"appendTo";e.addClass(n._guid)[o](t.appendTo).hide().kendoAnimate(r.open||!1),n._attachStaticEvents(t,e),i>0&&a(function(){n._hideStatic(e)},i)},_hideStatic:function(e){e.kendoAnimate(o(this.options.animation.close||!1,{complete:function(){e.off(y).find(u).off(y),e.remove()}})),this._triggerHide(e)},_triggerHide:function(e){this.trigger(d,{element:e}),this.angular("cleanup",function(){return{elements:e}})},show:function(i,r,a){var s,d,u=this,h=u.options,p=e(x);return r||(r=f),null!==i&&i!==t&&""!==i&&(n.isFunction(i)&&(i=i()),d={typeIcon:r,content:""},s=e.isPlainObject(i)?o(d,i):o(d,{content:i}),p.addClass(c+"-"+r).toggleClass(c+"-button",h.button).attr("data-role","alert").css({width:h.width,height:h.height}).append(u._getCompiled(r,a)(s)),u.angular("compile",function(){return{elements:p,data:[{dataItem:s}]}}),e(h.appendTo)[0]?u._showStatic(p,h):u._showPopup(p,h),u.trigger(l,{element:p})),u},showText:function(e,t){this.show(e,t,!0)},info:function(e){return this.show(e,f)},success:function(e){return this.show(e,p)},warning:function(e){return this.show(e,m)},error:function(e){return this.show(e,g)},hide:function(){var t=this,n=t.getNotifications();return n.each(t.options.appendTo?function(n,i){t._hideStatic(e(i))}:function(n,i){var r=e(i).data("kendoPopup");r&&t._hidePopup(r)}),t},getNotifications:function(){var t=this,n=e("."+t._guid+":not(."+h+")");return t.options.appendTo?n:n.children("."+c)},setOptions:function(e){var n,r=this;i.fn.setOptions.call(r,e),n=r.options,e.templates!==t&&r._compileTemplates(n.templates),e.stacking===t&&e.position===t||r._compileStacking(n.stacking,n.position.top,n.position.left)},destroy:function(){i.fn.destroy.call(this),this.getNotifications().off(y).find(u).off(y)}});n.ui.plugin(S)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.tooltip.min",["kendo.core.min","kendo.popup.min"],e)}(function(){return function(e,t){function n(e){for(;e.length;)i(e),e=e.parent()}function i(e){var t=e.data(a.ns+"title");t&&(e.attr("title",t),e.removeData(a.ns+"title"))}function r(e){var t=e.attr("title");t&&(e.data(a.ns+"title",t),e.attr("title",""))}function o(e){for(;e.length&&!e.is("body");)r(e),e=e.parent()}var a=window.kendo,s=a.ui.Widget,l=a.ui.Popup,d=a.isFunction,c=e.isPlainObject,u=e.extend,h=e.proxy,f=e(document),p=a.isLocalUrl,m="_tt_active",g="aria-describedby",v="show",_="hide",b="error",k="contentLoad",w="requestStart",y="k-content-frame",x='<div role="tooltip" class="k-widget k-tooltip#if (!autoHide) {# k-tooltip-closable#}#">#if (!autoHide) {# <div class="k-tooltip-button"><a href="\\#" class="k-icon k-i-close">close</a></div> #}#<div class="k-tooltip-content"></div>#if (callout){ #<div class="k-callout k-callout-#=dir#"></div>#}#</div>',C=a.template("<iframe frameborder='0' class='"+y+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),T=".kendoTooltip",S={bottom:{origin:"bottom center",position:"top center"},top:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"},center:{position:"center center",origin:"center center"}},D={top:"bottom",bottom:"top",left:"right",right:"left",center:"center"},E={bottom:"n",top:"s",left:"e",right:"w",center:"n"},F={horizontal:{offset:"top",size:"outerHeight"},vertical:{offset:"left",size:"outerWidth"}},R=function(e){return e.target.data(a.ns+"title")},I=s.extend({init:function(e,t){var n,i=this;s.fn.init.call(i,e,t),n=i.options.position.match(/left|right/)?"horizontal":"vertical",i.dimensions=F[n],i._documentKeyDownHandler=h(i._documentKeyDown,i),i.element.on(i.options.showOn+T,i.options.filter,h(i._showOn,i)).on("mouseenter"+T,i.options.filter,h(i._mouseenter,i)),this.options.autoHide&&i.element.on("mouseleave"+T,i.options.filter,h(i._mouseleave,i))},options:{name:"Tooltip",filter:"",content:R,showAfter:100,callout:!0,position:"bottom",showOn:"mouseenter",autoHide:!0,width:null,height:null,animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:40,hide:!0}}},events:[v,_,k,b,w],_mouseenter:function(t){o(e(t.currentTarget))},_showOn:function(t){var n=this,i=e(t.currentTarget);n.options.showOn&&n.options.showOn.match(/click|focus/)?n._show(i):(clearTimeout(n.timeout),n.timeout=setTimeout(function(){n._show(i)},n.options.showAfter))},_appendContent:function(e){var t,n=this,i=n.options.content,r=n.content,o=n.options.iframe;c(i)&&i.url?("iframe"in n.options||(o=!p(i.url)),n.trigger(w,{options:i,target:e}),o?(r.hide(),t=r.find("."+y)[0],t?t.src=i.url||t.src:r.html(C({content:i})),r.find("."+y).off("load"+T).on("load"+T,function(){n.trigger(k),r.show()})):(r.empty(),a.ui.progress(r,!0),n._ajaxRequest(i))):i&&d(i)?(i=i({sender:this,target:e}),r.html(i||"")):r.html(i),n.angular("compile",function(){return{elements:r}})},_ajaxRequest:function(e){var t=this;jQuery.ajax(u({type:"GET",dataType:"html",cache:!1,error:function(e,n){a.ui.progress(t.content,!1),t.trigger(b,{status:n,xhr:e})},success:h(function(e){a.ui.progress(t.content,!1),t.content.html(e),t.trigger(k)},t)},e))},_documentKeyDown:function(e){e.keyCode===a.keys.ESC&&this.hide()},refresh:function(){var e=this,t=e.popup;t&&t.options.anchor&&e._appendContent(t.options.anchor)},hide:function(){this.popup&&this.popup.close()},show:function(e){e=e||this.element,o(e),this._show(e)},_show:function(e){var t=this,i=t.target();t.popup||t._initPopup(),i&&i[0]!=e[0]&&(t.popup.close(),t.popup.element.kendoStop(!0,!0)),i&&i[0]==e[0]||(t._appendContent(e),t.popup.options.anchor=e),t.popup.one("deactivate",function(){n(e),e.removeAttr(g),this.element.removeAttr("id").attr("aria-hidden",!0),f.off("keydown"+T,t._documentKeyDownHandler)}),t.popup.open()},_initPopup:function(){var t=this,n=t.options,i=e(a.template(x)({callout:n.callout&&"center"!==n.position,dir:E[n.position],autoHide:n.autoHide}));t.popup=new l(i,u({activate:function(){var e=this.options.anchor,i=e[0].id||t.element[0].id;i&&(e.attr(g,i+m),this.element.attr("id",i+m)),n.callout&&t._positionCallout(),this.element.removeAttr("aria-hidden"),f.on("keydown"+T,t._documentKeyDownHandler),t.trigger(v)},close:function(){t.trigger(_)},copyAnchorStyles:!1,animation:n.animation},S[n.position])),i.css({width:n.width,height:n.height}),t.content=i.find(".k-tooltip-content"),t.arrow=i.find(".k-callout"),n.autoHide?i.on("mouseleave"+T,h(t._mouseleave,t)):i.on("click"+T,".k-tooltip-button",h(t._closeButtonClick,t))},_closeButtonClick:function(e){e.preventDefault(),this.hide()},_mouseleave:function(t){if(this.popup){var i=e(t.currentTarget),r=i.offset(),o=t.pageX,s=t.pageY;if(r.right=r.left+a._outerWidth(i),r.bottom=r.top+a._outerHeight(i),o>r.left&&o<r.right&&s>r.top&&s<r.bottom)return;this.popup.close()}else n(e(t.currentTarget));clearTimeout(this.timeout)},_positionCallout:function(){var t=this,n=t.options.position,i=t.dimensions,r=i.offset,o=t.popup,a=o.options.anchor,s=e(a).offset(),l=parseInt(t.arrow.css("border-top-width"),10),d=e(o.element).offset(),c=E[o.flipped?D[n]:n],u=s[r]-d[r]+e(a)[i.size]()/2-l;t.arrow.removeClass("k-callout-n k-callout-s k-callout-w k-callout-e").addClass("k-callout-"+c).css(r,u)},target:function(){return this.popup?this.popup.options.anchor:null},destroy:function(){var e=this.popup;e&&(e.element.off(T),e.destroy()),clearTimeout(this.timeout),this.element.off(T),f.off("keydown"+T,this._documentKeyDownHandler),s.fn.destroy.call(this)}});a.ui.plugin(I)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.list.min",["kendo.data.min","kendo.popup.min"],e)}(function(){return function(e,t){function n(e,n){return e!==t&&""!==e&&null!==e&&("boolean"===n?e=!!e:"number"===n?e=+e:"string"===n&&(e=""+e)),e}function i(e){return e[e.length-1]}function r(e){var t=e.selectedIndex;return t>-1?e.options[t]:{}}function o(e,t){var n,i,r,o,a=t.length,s=e.length,l=[],d=[];if(s)for(r=0;r<s;r++){for(n=e[r],i=!1,o=0;o<a;o++)if(n===t[o]){i=!0,l.push({index:r,item:n});break}i||d.push(n)}return{changed:l,unchanged:d}}function a(t,n){var i,r=!1;return t.filters&&(i=e.grep(t.filters,function(e){return r=a(e,n),e.filters?e.filters.length:e.field!=n}),r||t.filters.length===i.length||(r=!0),t.filters=i),r}var s,l,d=window.kendo,c=d.ui,u=d._outerWidth,h=d._outerHeight,f=c.Widget,p=d.keys,m=d.support,g=d.htmlEncode,v=d._activeElement,_=d.data.ObservableArray,b="id",k="change",w="k-state-focused",y="k-state-hover",x="k-i-loading",C="k-loading-hidden",T="open",S="close",D="cascade",E="select",F="selected",R="requestStart",I="requestEnd",A="width",M=e.extend,z=e.proxy,H=e.isArray,N=m.browser,P=N.msie,L=P&&N.version<9,B=/"/g,O={ComboBox:"DropDownList",DropDownList:"ComboBox"},V=d.ui.DataBoundWidget.extend({init:function(t,n){var i,r=this,o=r.ns;f.fn.init.call(r,t,n),t=r.element,n=r.options,r._isSelect=t.is(E),r._isSelect&&r.element[0].length&&(n.dataSource||(n.dataTextField=n.dataTextField||"text",n.dataValueField=n.dataValueField||"value")),r.ul=e('<ul unselectable="on" class="k-list k-reset"/>').attr({tabIndex:-1,"aria-hidden":!0}),r.list=e("<div class='k-list-container'/>").append(r.ul).on("mousedown"+o,z(r._listMousedown,r)),i=t.attr(b),i&&(r.list.attr(b,i+"-list"),r.ul.attr(b,i+"_listbox")),r._header(),r._noData(),r._footer(),r._accessors(),r._initValue()},options:{valuePrimitive:!1,footerTemplate:"",headerTemplate:"",noDataTemplate:"No data found."},setOptions:function(e){f.fn.setOptions.call(this,e),e&&e.enable!==t&&(e.enabled=e.enable),this._header(),this._noData(),this._footer(),this._renderFooter(),this._renderNoData()},focus:function(){this._focused.focus()},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},_listOptions:function(t){var n=this,i=n.options,r=i.virtual,o=z(n._listBound,n);return r="object"==typeof r?r:{},t=e.extend({autoBind:!1,selectable:!0,dataSource:n.dataSource,click:z(n._click,n),change:z(n._listChange,n),activate:z(n._activateItem,n),deactivate:z(n._deactivateItem,n),dataBinding:function(){n.trigger("dataBinding")},dataBound:o,height:i.height,dataValueField:i.dataValueField,dataTextField:i.dataTextField,groupTemplate:i.groupTemplate,fixedGroupTemplate:i.fixedGroupTemplate,template:i.template},t,r),t.template||(t.template="#:"+d.expr(t.dataTextField,"data")+"#"),i.$angular&&(t.$angular=i.$angular),t},_initList:function(){var e=this,t=e._listOptions({selectedItemChange:z(e._listChange,e)});e.listView=e.options.virtual?new d.ui.VirtualList(e.ul,t):new d.ui.StaticList(e.ul,t),e.listView.bind("listBound",z(e._listBound,e)),e._setListValue()},_setListValue:function(e){e=e||this.options.value,e!==t&&this.listView.value(e).done(z(this._updateSelectionState,this))},_updateSelectionState:e.noop,_listMousedown:function(e){this.filterInput&&this.filterInput[0]===e.target||e.preventDefault()},_isFilterEnabled:function(){var e=this.options.filter;return e&&"none"!==e},_hideClear:function(){var e=this;e._clear&&this._clear.addClass(C)},_showClear:function(){var e=this;e._clear&&this._clear.removeClass(C)},_clearValue:function(){this.listView.value([]),this._clearText(),this._accessor(""),this._isFilterEnabled()&&this._filter({word:"",open:!1}),this._change()},_clearText:function(){this.text("")},_clearFilter:function(){this.options.virtual||this.listView.bound(!1),this._filterSource()},_filterSource:function(e,t){var n,i=this,r=i.options,o=i.dataSource,s=M({},o.filter()||{}),l=e||s.filters&&s.filters.length&&!e,d=a(s,r.dataTextField);(e||d)&&i.trigger("filtering",{filter:e})||(s={filters:s.filters||[],logic:"and"},e&&s.filters.push(e),i._cascading&&this.listView.setDSFilter(s),n=M({},{page:l?1:o.page(),pageSize:l?o.options.pageSize:o.pageSize(),sort:o.sort(),filter:o.filter(),group:o.group(),aggregate:o.aggregate()},{filter:s}),o[t?"read":"query"](o._mergeState(n)))},_angularElement:function(e,t){e&&this.angular(t,function(){return{elements:e}})},_noData:function(){var n=e(this.noData),i=this.options.noDataTemplate;return this.angular("cleanup",function(){return{elements:n}}),d.destroy(n),n.remove(),i?(this.noData=e('<div class="k-nodata" style="display:none"><div></div></div>').appendTo(this.list),this.noDataTemplate="function"!=typeof i?d.template(i):i,t):(this.noData=null,t)},_renderNoData:function(){var e=this.noData;e&&(this._angularElement(e,"cleanup"),e.children(":first").html(this.noDataTemplate({instance:this})),this._angularElement(e,"compile"))},_toggleNoData:function(t){e(this.noData).toggle(t)},_footer:function(){var n=e(this.footer),i=this.options.footerTemplate;return this._angularElement(n,"cleanup"),d.destroy(n),n.remove(),i?(this.footer=e('<div class="k-footer"></div>').appendTo(this.list),this.footerTemplate="function"!=typeof i?d.template(i):i,t):(this.footer=null,t)},_renderFooter:function(){var e=this.footer;e&&(this._angularElement(e,"cleanup"),e.html(this.footerTemplate({instance:this})),this._angularElement(e,"compile"))},_header:function(){var n,i=e(this.header),r=this.options.headerTemplate;return this._angularElement(i,"cleanup"),d.destroy(i),i.remove(),r?(n="function"!=typeof r?d.template(r):r,i=e(n({})),this.header=i[0]?i:null,this.list.prepend(i),this._angularElement(this.header,"compile"),t):(this.header=null,t)},_allowOpening:function(){return this.options.noDataTemplate||this.dataSource.flatView().length},_initValue:function(){var e=this,t=e.options.value;null!==t?e.element.val(t):(t=e._accessor(),e.options.value=t),e._old=t},_ignoreCase:function(){var e,t=this,n=t.dataSource.reader.model;n&&n.fields&&(e=n.fields[t.options.dataTextField],e&&e.type&&"string"!==e.type&&(t.options.ignoreCase=!1))},_focus:function(e){return this.listView.focus(e)},_filter:function(e){var t=this,n=t.options,i=n.ignoreCase,r=n.dataTextField,o={value:i?e.word.toLowerCase():e.word,field:r,operator:n.filter,ignoreCase:i};t._open=e.open,t._filterSource(o)},search:function(e){var t=this.options;e="string"==typeof e?e:this._inputValue(),clearTimeout(this._typingTimeout),(!t.enforceMinLength&&!e.length||e.length>=t.minLength)&&(this._state="filter",this._isFilterEnabled()?this._filter({word:e,open:!0}):this._searchByWord(e))},current:function(e){return this._focus(e)},items:function(){return this.ul[0].children},destroy:function(){var e=this,t=e.ns;f.fn.destroy.call(e),e._unbindDataSource(),e.listView.destroy(),e.list.off(t),e.popup.destroy(),e._form&&e._form.off("reset",e._resetHandler)},dataItem:function(n){var i=this;if(n===t)return i.listView.selectedDataItems()[0];if("number"!=typeof n){if(i.options.virtual)return i.dataSource.getByUid(e(n).data("uid"));n=e(i.items()).index(n)}return i.dataSource.flatView()[n]},_activateItem:function(){var e=this.listView.focus();e&&this._focused.add(this.filterInput).attr("aria-activedescendant",e.attr("id"))},_deactivateItem:function(){this._focused.add(this.filterInput).removeAttr("aria-activedescendant")},_accessors:function(){var e=this,t=e.element,n=e.options,i=d.getter,r=t.attr(d.attr("text-field")),o=t.attr(d.attr("value-field"));!n.dataTextField&&r&&(n.dataTextField=r),!n.dataValueField&&o&&(n.dataValueField=o),e._text=i(n.dataTextField),e._value=i(n.dataValueField)},_aria:function(e){var n=this,i=n.options,r=n._focused.add(n.filterInput);i.suggest!==t&&r.attr("aria-autocomplete",i.suggest?"both":"list"),e=e?e+" "+n.ul[0].id:n.ul[0].id,r.attr("aria-owns",e),n.ul.attr("aria-live",n._isFilterEnabled()?"polite":"off")},_blur:function(){var e=this;e._change(),e.close()},_change:function(){var e,i=this,r=i.selectedIndex,o=i.options.value,a=i.value();i._isSelect&&!i.listView.bound()&&o&&(a=o),a!==n(i._old,typeof a)?e=!0:r!==t&&r!==i._oldIndex&&(e=!0),e&&(i._old=a,i._oldIndex=r,i._typing||i.element.trigger(k),i.trigger(k)),i.typing=!1},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,n=e.options,i=e.element.is("[disabled]");n.enable!==t&&(n.enabled=n.enable),!n.enabled||i?e.enable(!1):e.readonly(e.element.is("[readonly]"))},_dataValue:function(e){var n=this._value(e);return n===t&&(n=this._text(e)),n},_offsetHeight:function(){var t=0,n=this.listView.content.prevAll(":visible");return n.each(function(){var n=e(this);t+=h(n.hasClass("k-list-filter")?n.children():n)}),t},_height:function(n){var i,r,o,a=this,s=a.list,l=a.options.height,d=a.popup.visible();if(n||a.options.noDataTemplate){if(r=s.add(s.parent(".k-animation-container")).show(),!s.is(":visible"))return r.hide(),t;l=a.listView.content[0].scrollHeight>l?l:"auto",r.height(l),"auto"!==l&&(i=a._offsetHeight(),o=h(e(a.footer))||0,l=l-i-o),a.listView.content.height(l),d||r.hide()}return l},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.wrapper;if(n.data(A)||!i)return e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=parseFloat(e&&e.width)||u(r),e&&N.msie&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i="border-box"!==n.css("box-sizing")?t-(u(n)-n.width()):t,n.css({fontFamily:r.css("font-family"),width:this.options.autoWidth?"auto":i,minWidth:i}).data(A,i),!0},_openHandler:function(e){this._adjustListWidth(),this.trigger(T)?e.preventDefault():(this._focused.attr("aria-expanded",!0),this.ul.attr("aria-hidden",!1))},_closeHandler:function(e){this.trigger(S)?e.preventDefault():(this._focused.attr("aria-expanded",!1),this.ul.attr("aria-hidden",!0))},_focusItem:function(){var e=this.listView,n=!e.focus(),r=i(e.select());r===t&&this.options.highlightFirst&&n&&(r=0),r!==t?e.focus(r):n&&e.scrollToIndex(0)},_calculateGroupPadding:function(e){var t=this.ul.children(".k-first:first"),n=this.listView.content.prev(".k-group-header"),i=0;n[0]&&"none"!==n[0].style.display&&("auto"!==e&&(i=d.support.scrollbar()),i+=parseFloat(t.css("border-right-width"),10)+parseFloat(t.children(".k-group").css("padding-right"),10),n.css("padding-right",i))},_calculatePopupHeight:function(e){var t=this._height(this.dataSource.flatView().length||e);this._calculateGroupPadding(t)},_resizePopup:function(e){this.options.virtual||(this.popup.element.is(":visible")?this._calculatePopupHeight(e):this.popup.one("open",function(e){return z(function(){this._calculatePopupHeight(e)},this)}.call(this,e)))},_popup:function(){var e=this;e.popup=new c.Popup(e.list,M({},e.options.popup,{anchor:e.wrapper,open:z(e._openHandler,e),close:z(e._closeHandler,e),animation:e.options.animation,isRtl:m.isRtl(e.wrapper)}))},_makeUnselectable:function(){L&&this.list.find("*").not(".k-textbox").attr("unselectable","on")},_toggleHover:function(t){e(t.currentTarget).toggleClass(y,"mouseenter"===t.type)},_toggle:function(e,n){var i=this,r=m.mobileOS&&(m.touch||m.MSPointers||m.pointers);e=e!==t?e:!i.popup.visible(),n||r||i._focused[0]===v()||(i._prevent=!0,i._focused.focus(),i._prevent=!1),i[e?T:S]()},_triggerCascade:function(){var e=this;e._cascadeTriggered&&e._old===e.value()&&e._oldIndex===e.selectedIndex||(e._cascadeTriggered=!0,e.trigger(D,{userTriggered:e._userTriggered}))},_triggerChange:function(){this._valueBeforeCascade!==this.value()&&this.trigger(k)},_unbindDataSource:function(){var e=this;e.dataSource.unbind(R,e._requestStartHandler).unbind(I,e._requestEndHandler).unbind("error",e._errorHandler)},requireValueMapper:function(e,t){var n=(e.value instanceof Array?e.value.length:e.value)||(t instanceof Array?t.length:t);if(n&&e.virtual&&"function"!=typeof e.virtual.valueMapper)throw Error("ValueMapper is not provided while the value is being set. See http://docs.telerik.com/kendo-ui/controls/editors/combobox/virtualization#the-valuemapper-function")}});M(V,{inArray:function(e,t){var n,i,r=t.children;if(!e||e.parentNode!==t)return-1;for(n=0,i=r.length;n<i;n++)if(e===r[n])return n;return-1},unifyType:n}),d.ui.List=V,c.Select=V.extend({init:function(e,t){V.fn.init.call(this,e,t),this._initial=this.element.val()},setDataSource:function(e){var t,n=this;n.options.dataSource=e,n._dataSource(),n.listView.bound()&&(n._initialIndex=null),n.listView.setDataSource(n.dataSource),n.options.autoBind&&n.dataSource.fetch(),t=n._parentWidget(),t&&n._cascadeSelect(t)},close:function(){this.popup.close()},select:function(e){var n=this;return e===t?n.selectedIndex:n._select(e).done(function(){n._old=n._accessor(),n._oldIndex=n.selectedIndex})},_accessor:function(e,t){return this[this._isSelect?"_accessorSelect":"_accessorInput"](e,t)},_accessorInput:function(e){var n=this.element[0];return e===t?n.value:(null===e&&(e=""),n.value=e,t)},_accessorSelect:function(e,n){var i,o=this.element[0];return e===t?r(o).value||"":(r(o).selected=!1,n===t&&(n=-1),i=null!==e&&""!==e,i&&n==-1?this._custom(e):e?o.value=e:o.selectedIndex=n,t)},_custom:function(t){var n=this,i=n.element,r=n._customOption;r||(r=e("<option/>"),n._customOption=r,i.append(r)),r.text(t),r[0].selected=!0},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._arrow.removeClass(x),e._focused.attr("aria-busy",!1),e._busy=null,e._showClear()},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(function(){e._arrow&&(e._focused.attr("aria-busy",!0),e._arrow.addClass(x),e._hideClear())},100))},_requestEnd:function(){this._request=!1,this._hideBusy()},_dataSource:function(){var t,n=this,i=n.element,r=n.options,o=r.dataSource||{};o=e.isArray(o)?{data:o}:o,n._isSelect&&(t=i[0].selectedIndex,t>-1&&(r.index=t),o.select=i,o.fields=[{field:r.dataTextField},{field:r.dataValueField}]),n.dataSource?n._unbindDataSource():(n._requestStartHandler=z(n._showBusy,n),n._requestEndHandler=z(n._requestEnd,n),n._errorHandler=z(n._hideBusy,n)),n.dataSource=d.data.DataSource.create(o).bind(R,n._requestStartHandler).bind(I,n._requestEndHandler).bind("error",n._errorHandler)},_firstItem:function(){this.listView.focusFirst()},_lastItem:function(){this.listView.focusLast()},_nextItem:function(){this.listView.focusNext()},_prevItem:function(){this.listView.focusPrev()},_move:function(e){var n,i,r,o,a,s=this,l=s.listView,d=e.keyCode,c=d===p.DOWN;if(d===p.UP||c){if(e.altKey)s.toggle(c);else{if(!l.bound())return s._fetch||(s.dataSource.one(k,function(){s._fetch=!1,s._move(e)}),s._fetch=!0,s._filterSource()),e.preventDefault(),!0;if(r=s._focus(),s._fetch||r&&!r.hasClass("k-state-selected")||(c?(s._nextItem(),s._focus()||s._lastItem()):(s._prevItem(),s._focus()||s._firstItem())),n=l.dataItemByIndex(l.getElementIndex(s._focus())),s.trigger(E,{dataItem:n,item:s._focus()}))return s._focus(r),t;s._select(s._focus(),!0).done(function(){s.popup.visible()||s._blur()})}e.preventDefault(),i=!0}else if(d===p.ENTER||d===p.TAB){if(s.popup.visible()&&e.preventDefault(),r=s._focus(),n=s.dataItem(),s.popup.visible()||n&&s.text()===s._text(n)||(r=null),o=s.filterInput&&s.filterInput[0]===v(),r){if(n=l.dataItemByIndex(l.getElementIndex(r)),s.trigger(E,{dataItem:n,item:r}))return;s._select(r)}else s.input&&(s._accessor(s.input.val()),s.listView.value(s.input.val()));s._focusElement&&s._focusElement(s.wrapper),o&&d===p.TAB?s.wrapper.focusout():s._blur(),s.close(),i=!0}else d===p.ESC?(s.popup.visible()&&e.preventDefault(),s.close(),i=!0):!s.popup.visible()||d!==p.PAGEDOWN&&d!==p.PAGEUP||(e.preventDefault(),a=d===p.PAGEDOWN?1:-1,l.scrollWith(a*l.screenHeight()),i=!0);return i},_fetchData:function(){var e=this,t=!!e.dataSource.view().length;e._request||e.options.cascadeFrom||e.listView.bound()||e._fetch||t||(e._fetch=!0,e.dataSource.fetch().done(function(){e._fetch=!1}))},_options:function(e,n,i){var o,a,s,l,d=this,c=d.element,u=c[0],h=e.length,f="",p=0;for(n&&(f=n);p<h;p++)o="<option",a=e[p],s=d._text(a),l=d._value(a),l!==t&&(l+="",l.indexOf('"')!==-1&&(l=l.replace(B,"&quot;")),o+=' value="'+l+'"'),o+=">",s!==t&&(o+=g(s)),o+="</option>",f+=o;c.html(f),i!==t&&(u.value=i,u.value&&!i&&(u.selectedIndex=-1)),u.selectedIndex!==-1&&(o=r(u),o&&o.setAttribute(F,F))},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=r.on("reset",t._resetHandler))},_parentWidget:function(){var t,n,i=this.options.name;if(this.options.cascadeFrom)return t=e("#"+this.options.cascadeFrom),n=t.data("kendo"+i),n||(n=t.data("kendo"+O[i])),n},_cascade:function(){var e,t=this,n=t.options,i=n.cascadeFrom;if(i){if(e=t._parentWidget(),!e)return;t._cascadeHandlerProxy=z(t._cascadeHandler,t),t._cascadeFilterRequests=[],n.autoBind=!1,e.bind("set",function(){t.one("set",function(e){t._selectedValue=e.value})}),e.first(D,t._cascadeHandlerProxy),e.listView.bound()?(t._toggleCascadeOnFocus(),t._cascadeSelect(e)):(e.one("dataBound",function(){t._toggleCascadeOnFocus()}),e.value()||t.enable(!1))}},_toggleCascadeOnFocus:function(){var e=this,t=e._parentWidget(),n=P?"blur":"focusout";t._focused.add(t.filterInput).bind("focus",function(){t.unbind(D,e._cascadeHandlerProxy),t.first(k,e._cascadeHandlerProxy)}),t._focused.add(t.filterInput).bind(n,function(){t.unbind(k,e._cascadeHandlerProxy),t.first(D,e._cascadeHandlerProxy)})},_cascadeHandler:function(e){var t=this._parentWidget(),n=this.value();this._userTriggered=e.userTriggered,this.listView.bound()&&this._clearSelection(t,!0),this._cascadeSelect(t,n)},_cascadeChange:function(e){var t=this,n=t._accessor()||t._selectedValue;t._cascadeFilterRequests.length||(t._selectedValue=null),t._userTriggered?t._clearSelection(e,!0):n?(n!==t.listView.value()[0]&&t.value(n),t.dataSource.view()[0]&&t.selectedIndex!==-1||t._clearSelection(e,!0)):t.dataSource.flatView().length&&t.select(t.options.index),t.enable(),t._triggerCascade(),t._triggerChange(),t._userTriggered=!1},_cascadeSelect:function(e,n){var i,r,o=this,s=e.dataItem(),l=s?e._value(s):null,d=o.options.cascadeFromField||e.options.dataValueField;o._valueBeforeCascade=n!==t?n:o.value(),l||0===l?(i=o.dataSource.filter()||{},a(i,d),r=function(){var t=o._cascadeFilterRequests.shift();t&&o.unbind("dataBound",t),t=o._cascadeFilterRequests[0],t&&o.first("dataBound",t),o._cascadeChange(e)},o._cascadeFilterRequests.push(r),1===o._cascadeFilterRequests.length&&o.first("dataBound",r),o._cascading=!0,o._filterSource({field:d,operator:"eq",value:l}),o._cascading=!1):(o.enable(!1),o._clearSelection(e),o._triggerCascade(),o._triggerChange(),o._userTriggered=!1)}}),s=".StaticList",l=d.ui.DataBoundWidget.extend({init:function(t,n){f.fn.init.call(this,t,n),this.element.attr("role","listbox").on("click"+s,"li",z(this._click,this)).on("mouseenter"+s,"li",function(){e(this).addClass(y)}).on("mouseleave"+s,"li",function(){e(this).removeClass(y)}),this.content=this.element.wrap("<div class='k-list-scroller' unselectable='on'></div>").parent(),this.header=this.content.before('<div class="k-group-header" style="display:none"></div>').prev(),this.bound(!1),this._optionID=d.guid(),this._selectedIndices=[],this._view=[],this._dataItems=[],this._values=[];var i=this.options.value;i&&(this._values=e.isArray(i)?i.slice(0):[i]),this._getter(),this._templates(),this.setDataSource(this.options.dataSource),this._onScroll=z(function(){var e=this;clearTimeout(e._scrollId),e._scrollId=setTimeout(function(){e._renderHeader()},50)},this)},options:{name:"StaticList",dataValueField:null,valuePrimitive:!1,selectable:!0,template:null,groupTemplate:null,fixedGroupTemplate:null},events:["click",k,"activate","deactivate","dataBinding","dataBound","selectedItemChange"],setDataSource:function(t){var n,i=this,r=t||{};r=e.isArray(r)?{data:r}:r,r=d.data.DataSource.create(r),i.dataSource?(i.dataSource.unbind(k,i._refreshHandler),n=i.value(),i.value([]),i.bound(!1),i.value(n)):i._refreshHandler=z(i.refresh,i),i.setDSFilter(r.filter()),i.dataSource=r.bind(k,i._refreshHandler),i._fixedHeader()},skip:function(){return this.dataSource.skip()},setOptions:function(e){f.fn.setOptions.call(this,e),this._getter(),this._templates(),this._render()},destroy:function(){this.element.off(s),this._refreshHandler&&this.dataSource.unbind(k,this._refreshHandler),clearTimeout(this._scrollId),f.fn.destroy.call(this)},dataItemByIndex:function(e){return this.dataSource.flatView()[e]},screenHeight:function(){return this.content[0].clientHeight},scrollToIndex:function(e){var t=this.element[0].children[e];t&&this.scroll(t)},scrollWith:function(e){this.content.scrollTop(this.content.scrollTop()+e)},scroll:function(e){if(e){e[0]&&(e=e[0]);var t=this.content[0],n=e.offsetTop,i=e.offsetHeight,r=t.scrollTop,o=t.clientHeight,a=n+i;r>n?r=n:a>r+o&&(r=a-o),t.scrollTop=r}},selectedDataItems:function(e){return e===t?this._dataItems.slice():(this._dataItems=e,this._values=this._getValues(e),t)},_getValues:function(t){var n=this._valueGetter;return e.map(t,function(e){return n(e)})},focusNext:function(){var e=this.focus();e=e?e.next():0,this.focus(e)},focusPrev:function(){var e=this.focus();e=e?e.prev():this.element[0].children.length-1,this.focus(e)},focusFirst:function(){this.focus(this.element[0].children[0])},focusLast:function(){this.focus(i(this.element[0].children))},focus:function(n){var r,o=this,a=o._optionID;return n===t?o._current:(n=i(o._get(n)),n=e(this.element[0].children[n]),o._current&&(o._current.removeClass(w).removeAttr("aria-selected").removeAttr(b),o.trigger("deactivate")),r=!!n[0],r&&(n.addClass(w),o.scroll(n),n.attr("id",a)),o._current=r?n:null,o.trigger("activate"),t)},focusIndex:function(){return this.focus()?this.focus().index():t},skipUpdate:function(e){this._skipUpdate=e},select:function(n){var r,o,a,s=this,l=s.options.selectable,d="multiple"!==l&&l!==!1,c=s._selectedIndices,u=[],h=[];return n===t?c.slice():(n=s._get(n),1===n.length&&n[0]===-1&&(n=[]),o=e.Deferred().resolve(),a=s.isFiltered(),a&&!d&&s._deselectFiltered(n)?o:d&&!a&&e.inArray(i(n),c)!==-1?(s._dataItems.length&&s._view.length&&(s._dataItems=[s._view[c[0]].item]),o):(r=s._deselect(n),h=r.removed,n=r.indices,n.length&&(d&&(n=[i(n)]),u=s._select(n)),(u.length||h.length)&&(s._valueComparer=null,s.trigger(k,{added:u,removed:h})),o))},removeAt:function(e){return this._selectedIndices.splice(e,1),this._values.splice(e,1),this._valueComparer=null,{position:e,dataItem:this._dataItems.splice(e,1)[0]}},setValue:function(t){t=e.isArray(t)||t instanceof _?t.slice(0):[t],this._values=t,this._valueComparer=null},value:function(n){var i,r=this,o=r._valueDeferred;return n===t?r._values.slice():(r.setValue(n),o&&"resolved"!==o.state()||(r._valueDeferred=o=e.Deferred()),r.bound()&&(i=r._valueIndices(r._values),"multiple"===r.options.selectable&&r.select(-1),r.select(i),o.resolve()),r._skipUpdate=!1,o)},items:function(){return this.element.children(".k-item")},_click:function(t){t.isDefaultPrevented()||this.trigger("click",{item:e(t.currentTarget)})||this.select(t.currentTarget)},_valueExpr:function(e,t){var i,r,o=this,a=0,s=[];if(!o._valueComparer||o._valueType!==e){for(o._valueType=e;a<t.length;a++)s.push(n(t[a],e));i="for (var idx = 0; idx < "+s.length+"; idx++) { if (current === values[idx]) {   return idx; }} return -1;",r=Function("current","values",i),
o._valueComparer=function(e){return r(e,s)}}return o._valueComparer},_dataItemPosition:function(e,t){var n=this._valueGetter(e),i=this._valueExpr(typeof n,t);return i(n)},_getter:function(){this._valueGetter=d.getter(this.options.dataValueField)},_deselect:function(t){var n,i,r,o=this,a=o.element[0].children,s=o.options.selectable,l=o._selectedIndices,d=o._dataItems,c=o._values,u=[],h=0,f=0;if(t=t.slice(),s!==!0&&t.length){if("multiple"===s)for(;h<t.length;h++)if(i=t[h],e(a[i]).hasClass("k-state-selected"))for(n=0;n<l.length;n++)if(r=l[n],r===i){e(a[r]).removeClass("k-state-selected"),u.push({position:n+f,dataItem:d.splice(n,1)[0]}),l.splice(n,1),t.splice(h,1),c.splice(n,1),f+=1,h-=1,n-=1;break}}else{for(;h<l.length;h++)e(a[l[h]]).removeClass("k-state-selected"),u.push({position:h,dataItem:d[h]});o._values=[],o._dataItems=[],o._selectedIndices=[]}return{indices:t,removed:u}},_deselectFiltered:function(t){for(var n,i,r,o=this.element[0].children,a=[],s=0;s<t.length;s++)i=t[s],n=this._view[i].item,r=this._dataItemPosition(n,this._values),r>-1&&(a.push(this.removeAt(r)),e(o[i]).removeClass("k-state-selected"));return!!a.length&&(this.trigger(k,{added:[],removed:a}),!0)},_select:function(t){var n,r,o=this,a=o.element[0].children,s=o._view,l=[],d=0;for(i(t)!==-1&&o.focus(t);d<t.length;d++)r=t[d],n=s[r],r!==-1&&n&&(n=n.item,o._selectedIndices.push(r),o._dataItems.push(n),o._values.push(o._valueGetter(n)),e(a[r]).addClass("k-state-selected").attr("aria-selected",!0),l.push({dataItem:n}));return l},getElementIndex:function(t){return e(t).data("offset-index")},_get:function(e){return"number"==typeof e?e=[e]:H(e)||(e=this.getElementIndex(e),e=[e!==t?e:-1]),e},_template:function(){var e=this,t=e.options,n=t.template;return n?(n=d.template(n),n=function(e){return'<li tabindex="-1" role="option" unselectable="on" class="k-item">'+n(e)+"</li>"}):n=d.template('<li tabindex="-1" role="option" unselectable="on" class="k-item">${'+d.expr(t.dataTextField,"data")+"}</li>",{useWithBlock:!1}),n},_templates:function(){var e,t,n=this.options,i={template:n.template,groupTemplate:n.groupTemplate,fixedGroupTemplate:n.fixedGroupTemplate};for(t in i)e=i[t],e&&"function"!=typeof e&&(i[t]=d.template(e));this.templates=i},_normalizeIndices:function(e){for(var n=[],i=0;i<e.length;i++)e[i]!==t&&n.push(e[i]);return n},_valueIndices:function(e,t){var n,i=this._view,r=0;if(t=t?t.slice():[],!e.length)return[];for(;r<i.length;r++)n=this._dataItemPosition(i[r].item,e),n!==-1&&(t[n]=r);return this._normalizeIndices(t)},_firstVisibleItem:function(){for(var t=this.element[0],n=this.content[0],i=n.scrollTop,r=e(t.children[0]).height(),o=Math.floor(i/r)||0,a=t.children[o]||t.lastChild,s=a.offsetTop<i;a;)if(s){if(a.offsetTop+r>i||!a.nextSibling)break;a=a.nextSibling}else{if(a.offsetTop<=i||!a.previousSibling)break;a=a.previousSibling}return this._view[e(a).data("offset-index")]},_fixedHeader:function(){this.isGrouped()&&this.templates.fixedGroupTemplate?(this.header.show(),this.content.scroll(this._onScroll)):(this.header.hide(),this.content.off("scroll",this._onScroll))},_renderHeader:function(){var e,t=this.templates.fixedGroupTemplate;t&&(e=this._firstVisibleItem(),e&&this.header.html(t(e.group)))},_renderItem:function(e){var t='<li tabindex="-1" role="option" unselectable="on" class="k-item',n=e.item,i=0!==e.index,r=e.selected;return i&&e.newGroup&&(t+=" k-first"),r&&(t+=" k-state-selected"),t+='"'+(r?' aria-selected="true"':"")+' data-offset-index="'+e.index+'">',t+=this.templates.template(n),i&&e.newGroup&&(t+='<div class="k-group">'+this.templates.groupTemplate(e.group)+"</div>"),t+"</li>"},_render:function(){var e,t,n,i,r="",o=0,a=0,s=[],l=this.dataSource.view(),d=this.value(),c=this.isGrouped();if(c)for(o=0;o<l.length;o++)for(t=l[o],n=!0,i=0;i<t.items.length;i++)e={selected:this._selected(t.items[i],d),item:t.items[i],group:t.value,newGroup:n,index:a},s[a]=e,a+=1,r+=this._renderItem(e),n=!1;else for(o=0;o<l.length;o++)e={selected:this._selected(l[o],d),item:l[o],index:o},s[o]=e,r+=this._renderItem(e);this._view=s,this.element[0].innerHTML=r,c&&s.length&&this._renderHeader()},_selected:function(e,t){var n=!this.isFiltered()||"multiple"===this.options.selectable;return n&&this._dataItemPosition(e,t)!==-1},setDSFilter:function(e){this._lastDSFilter=M({},e)},isFiltered:function(){return this._lastDSFilter||this.setDSFilter(this.dataSource.filter()),!d.data.Query.compareFilters(this.dataSource.filter(),this._lastDSFilter)},refresh:function(e){var t,n=this,i=e&&e.action,r=n.options.skipUpdateOnBind,a="itemchange"===i;n.trigger("dataBinding"),n._angularItems("cleanup"),n._fixedHeader(),n._render(),n.bound(!0),a||"remove"===i?(t=o(n._dataItems,e.items),t.changed.length&&(a?n.trigger("selectedItemChange",{items:t.changed}):n.value(n._getValues(t.unchanged)))):n.isFiltered()||n._skipUpdate?(n.focus(0),n._skipUpdate&&(n._skipUpdate=!1,n._selectedIndices=n._valueIndices(n._values,n._selectedIndices))):r||i&&"add"!==i||n.value(n._values),n._valueDeferred&&n._valueDeferred.resolve(),n._angularItems("compile"),n.trigger("dataBound")},bound:function(e){return e===t?this._bound:(this._bound=e,t)},isGrouped:function(){return(this.dataSource.group()||[]).length}}),c.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.calendar.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(e,t,n,i){var r,o=e.getFullYear(),a=t.getFullYear(),s=n.getFullYear();return o-=o%i,r=o+(i-1),o<a&&(o=a),r>s&&(r=s),o+"-"+r}function i(e){for(var t,n=0,i=e.min,r=e.max,o=e.start,a=e.setter,l=e.build,d=e.cells||12,c=e.perRow||4,u=e.content||H,h=e.empty||N,f=e.html||'<table tabindex="0" role="grid" class="k-content k-meta-view" cellspacing="0"><tbody><tr role="row">';n<d;n++)n>0&&n%c===0&&(f+='</tr><tr role="row">'),o=new ke(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0),F(o,0),t=l(o,n,e.disableDates),f+=s(o,i,r)?u(t):h(t),a(o,1);return f+"</tr></tbody></table>"}function r(e,t,n){var i=e.getFullYear(),r=t.getFullYear(),o=r,a=0;return n&&(r-=r%n,o=r-r%n+n-1),i>o?a=1:i<r&&(a=-1),a}function o(){var e=new ke;return new ke(e.getFullYear(),e.getMonth(),e.getDate())}function a(e,t,n){var i=o();return e&&(i=new ke((+e))),t>i?i=new ke((+t)):n<i&&(i=new ke((+n))),i}function s(e,t,n){return+e>=+t&&+e<=+n}function l(e,t){return e.slice(t).concat(e.slice(0,t))}function d(e,t,n){t=t instanceof ke?t.getFullYear():e.getFullYear()+n*t,e.setFullYear(t)}function c(t){var n=e(this).hasClass("k-state-disabled");n||e(this).toggleClass(Z,de.indexOf(t.type)>-1||t.type==se)}function u(e){e.preventDefault()}function h(e){return A(e).calendars.standard}function f(e){var n=we[e.start],i=we[e.depth],r=A(e.culture);e.format=R(e.format||r.calendars.standard.patterns.d),isNaN(n)&&(n=0,e.start=Y),(i===t||i>n)&&(e.depth=Y),null===e.dates&&(e.dates=[])}function p(e){L&&e.find("*").attr("unselectable","on")}function m(e,t){for(var n=0,i=t.length;n<i;n++)if(e===+t[n])return!0;return!1}function g(e,t){return!!e&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())}function v(e,t){return!!e&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}function _(t){return x.isFunction(t)?t:e.isArray(t)?k(t):e.noop}function b(e){var t,n=[];for(t=0;t<e.length;t++)n.push(e[t].setHours(0,0,0,0));return n}function k(t){var n,i,r,o,a,s=[],l=["su","mo","tu","we","th","fr","sa"],d="if (found) { return true } else {return false}";if(t[0]instanceof ke)s=b(t),n="var found = date && $.inArray(date.setHours(0, 0, 0, 0),["+s+"]) > -1;"+d;else{for(r=0;r<t.length;r++)o=t[r].slice(0,2).toLowerCase(),a=e.inArray(o,l),a>-1&&s.push(a);n="var found = date && $.inArray(date.getDay(),["+s+"]) > -1;"+d}return i=Function("date",n)}function w(e,t){return e instanceof Date&&t instanceof Date&&(e=e.getTime(),t=t.getTime()),e===t}var y,x=window.kendo,C=x.support,T=x.ui,S=T.Widget,D=x.keys,E=x.parseDate,F=x.date.adjustDST,R=x._extractFormat,I=x.template,A=x.getCulture,M=x.support.transitions,z=M?M.css+"transform-origin":"",H=I('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link" href="\\#" data-#=data.ns#value="#=data.dateString#">#=data.value#</a></td>',{useWithBlock:!1}),N=I('<td role="gridcell">&nbsp;</td>',{useWithBlock:!1}),P=x.support.browser,L=P.msie&&P.version<9,B=x._outerHeight,O=x._outerWidth,V=".kendoCalendar",W="click"+V,U="keydown"+V,q="id",j="min",$="left",G="slideIn",Y="month",K="century",Q="change",X="navigate",J="value",Z="k-state-hover",ee="k-state-disabled",te="k-state-focused",ne="k-other-month",ie=' class="'+ne+'"',re="k-nav-today",oe="td:has(.k-link)",ae="blur"+V,se="focus",le=se+V,de=C.touch?"touchstart":"mouseenter",ce=C.touch?"touchstart"+V:"mouseenter"+V,ue=C.touch?"touchend"+V+" touchmove"+V:"mouseleave"+V,he=6e4,fe=864e5,pe="_prevArrow",me="_nextArrow",ge="aria-disabled",ve="aria-selected",_e=e.proxy,be=e.extend,ke=Date,we={month:0,year:1,decade:2,century:3},ye=S.extend({init:function(t,n){var i,r,s=this;S.fn.init.call(s,t,n),t=s.wrapper=s.element,n=s.options,n.url=window.unescape(n.url),s.options.disableDates=_(s.options.disableDates),s._templates(),s._header(),s._footer(s.footer),r=t.addClass("k-widget k-calendar").on(ce+" "+ue,oe,c).on(U,"table.k-content",_e(s._move,s)).on(W,oe,function(t){var n=t.currentTarget.firstChild,i=s._toDateObject(n);n.href.indexOf("#")!=-1&&t.preventDefault(),"month"==s._view.name&&s.options.disableDates(i)||s._click(e(n))}).on("mouseup"+V,"table.k-content, .k-footer",function(){s._focusView(s.options.focusOnNav!==!1)}).attr(q),r&&(s._cellID=r+"_cell_selected"),f(n),i=E(n.value,n.format,n.culture),s._index=we[n.start],s._current=new ke((+a(i,n.min,n.max))),s._addClassProxy=function(){if(s._active=!0,s._cell.hasClass(ee)){var e=s._view.toDateString(o());s._cell=s._cellByDate(e)}s._cell.addClass(te)},s._removeClassProxy=function(){s._active=!1,s._cell.removeClass(te)},s.value(i),x.notify(s)},options:{name:"Calendar",value:null,min:new ke(1900,0,1),max:new ke(2099,11,31),dates:[],url:"",culture:"",footer:"",format:"",month:{},start:Y,depth:Y,animation:{horizontal:{effects:G,reverse:!0,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}}},events:[Q,X],setOptions:function(e){var t=this;f(e),e.disableDates=_(e.disableDates),S.fn.setOptions.call(t,e),t._templates(),t._footer(t.footer),t._index=we[t.options.start],t.navigate()},destroy:function(){var e=this,t=e._today;e.element.off(V),e._title.off(V),e[pe].off(V),e[me].off(V),x.destroy(e._table),t&&x.destroy(t.off(V)),S.fn.destroy.call(e)},current:function(){return this._current},view:function(){return this._view},focus:function(e){e=e||this._table,this._bindTable(e),e.focus()},min:function(e){return this._option(j,e)},max:function(e){return this._option("max",e)},navigateToPast:function(){this._navigate(pe,-1)},navigateToFuture:function(){this._navigate(me,1)},navigateUp:function(){var e=this,t=e._index;e._title.hasClass(ee)||e.navigate(e._current,++t)},navigateDown:function(e){var n=this,i=n._index,r=n.options.depth;if(e)return i===we[r]?(w(n._value,n._current)&&w(n._value,e)||(n.value(e),n.trigger(Q)),t):(n.navigate(e,--i),t)},navigate:function(n,i){var r,o,s,l,d,c,u,h,f,m,g,v,_,b,k,w,x;i=isNaN(i)?we[i]:i,r=this,o=r.options,s=o.culture,l=o.min,d=o.max,c=r._title,u=r._table,h=r._oldTable,f=r._value,m=r._current,g=n&&+n>+m,v=i!==t&&i!==r._index,n||(n=m),r._current=n=new ke((+a(n,l,d))),i===t?i=r._index:r._index=i,r._view=b=y.views[i],k=b.compare,w=i===we[K],c.toggleClass(ee,w).attr(ge,w),w=k(n,l)<1,r[pe].toggleClass(ee,w).attr(ge,w),w=k(n,d)>-1,r[me].toggleClass(ee,w).attr(ge,w),u&&h&&h.data("animating")&&(h.kendoStop(!0,!0),u.kendoStop(!0,!0)),r._oldTable=u,u&&!r._changeView||(c.html(b.title(n,l,d,s)),r._table=_=e(b.content(be({min:l,max:d,date:n,url:o.url,dates:o.dates,format:o.format,culture:s,disableDates:o.disableDates},r[b.name]))),p(_),x=u&&u.data("start")===_.data("start"),r._animate({from:u,to:_,vertical:v,future:g,replace:x}),r.trigger(X),r._focus(n)),i===we[o.depth]&&f&&!r.options.disableDates(f)&&r._class("k-state-selected",f),r._class(te,n),!u&&r._cell&&r._cell.removeClass(te),r._changeView=!0},value:function(e){var n=this,i=n._view,r=n.options,o=n._view,a=r.min,l=r.max;return e===t?n._value:(null===e&&(n._current=new Date(n._current.getFullYear(),n._current.getMonth(),n._current.getDate())),e=E(e,r.format,r.culture),null!==e&&(e=new ke((+e)),s(e,a,l)||(e=null)),null!==e&&n.options.disableDates(e)?n._value===t&&(n._value=null):n._value=e,o&&null===e&&n._cell?n._cell.removeClass("k-state-selected"):(n._changeView=!e||i&&0!==i.compare(e,n._current),n.navigate(e)),t)},_move:function(t){var n,i,r,o,l=this,d=l.options,c=t.keyCode,u=l._view,h=l._index,f=l.options.min,p=l.options.max,m=new ke((+l._current)),g=x.support.isRtl(l.wrapper),v=l.options.disableDates;return t.target===l._table[0]&&(l._active=!0),t.ctrlKey?c==D.RIGHT&&!g||c==D.LEFT&&g?(l.navigateToFuture(),i=!0):c==D.LEFT&&!g||c==D.RIGHT&&g?(l.navigateToPast(),i=!0):c==D.UP?(l.navigateUp(),i=!0):c==D.DOWN&&(l._click(e(l._cell[0].firstChild)),i=!0):(c==D.RIGHT&&!g||c==D.LEFT&&g?(n=1,i=!0):c==D.LEFT&&!g||c==D.RIGHT&&g?(n=-1,i=!0):c==D.UP?(n=0===h?-7:-4,i=!0):c==D.DOWN?(n=0===h?7:4,i=!0):c==D.ENTER?(l._click(e(l._cell[0].firstChild)),i=!0):c==D.HOME||c==D.END?(r=c==D.HOME?"first":"last",o=u[r](m),m=new ke(o.getFullYear(),o.getMonth(),o.getDate(),m.getHours(),m.getMinutes(),m.getSeconds(),m.getMilliseconds()),i=!0):c==D.PAGEUP?(i=!0,l.navigateToPast()):c==D.PAGEDOWN&&(i=!0,l.navigateToFuture()),(n||r)&&(r||u.setDate(m,n),v(m)&&(m=l._nextNavigatable(m,n)),s(m,f,p)&&l._focus(a(m,d.min,d.max)))),i&&t.preventDefault(),l._current},_nextNavigatable:function(e,t){var n=this,i=!0,r=n._view,o=n.options.min,a=n.options.max,l=n.options.disableDates,d=new Date(e.getTime());for(r.setDate(d,-t);i;){if(r.setDate(e,t),!s(e,o,a)){e=d;break}i=l(e)}return e},_animate:function(e){var t=this,n=e.from,i=e.to,r=t._active;n?n.parent().data("animating")?(n.off(V),n.parent().kendoStop(!0,!0).remove(),n.remove(),i.insertAfter(t.element[0].firstChild),t._focusView(r)):!n.is(":visible")||t.options.animation===!1||e.replace?(i.insertAfter(n),n.off(V).remove(),t._focusView(r)):t[e.vertical?"_vertical":"_horizontal"](n,i,e.future):(i.insertAfter(t.element[0].firstChild),t._bindTable(i))},_horizontal:function(e,t,n){var i=this,r=i._active,o=i.options.animation.horizontal,a=o.effects,s=O(e);a&&a.indexOf(G)!=-1&&(e.add(t).css({width:s}),e.wrap("<div/>"),i._focusView(r,e),e.parent().css({position:"relative",width:2*s,"float":$,"margin-left":n?0:-s}),t[n?"insertAfter":"insertBefore"](e),be(o,{effects:G+":"+(n?"right":$),complete:function(){e.off(V).remove(),i._oldTable=null,t.unwrap(),i._focusView(r)}}),e.parent().kendoStop(!0,!0).kendoAnimate(o))},_vertical:function(e,t){var n,i,r=this,o=r.options.animation.vertical,a=o.effects,s=r._active;a&&a.indexOf("zoom")!=-1&&(t.css({position:"absolute",top:B(e.prev()),left:0}).insertBefore(e),z&&(n=r._cellByDate(r._view.toDateString(r._current)),i=n.position(),i=i.left+parseInt(n.width()/2,10)+"px "+(i.top+parseInt(n.height()/2,10)+"px"),t.css(z,i)),e.kendoStop(!0,!0).kendoAnimate({effects:"fadeOut",duration:600,complete:function(){e.off(V).remove(),r._oldTable=null,t.css({position:"static",top:0,left:0}),r._focusView(s)}}),t.kendoStop(!0,!0).kendoAnimate(o))},_cellByDate:function(t){return this._table.find("td:not(."+ne+")").filter(function(){return e(this.firstChild).attr(x.attr(J))===t})},_class:function(t,n){var i,r=this,o=r._cellID,a=r._cell,s=r._view.toDateString(n);a&&a.removeAttr(ve).removeAttr("aria-label").removeAttr(q),n&&"month"==r._view.name&&(i=r.options.disableDates(n)),a=r._table.find("td:not(."+ne+")").removeClass(t).filter(function(){return e(this.firstChild).attr(x.attr(J))===s}).attr(ve,!0),(t===te&&!r._active&&r.options.focusOnNav!==!1||i)&&(t=""),a.addClass(t),a[0]&&(r._cell=a),o&&(a.attr(q,o),r._table.removeAttr("aria-activedescendant").attr("aria-activedescendant",o))},_bindTable:function(e){e.on(le,this._addClassProxy).on(ae,this._removeClassProxy)},_click:function(e){var t=this,n=t.options,i=new Date((+t._current)),r=t._toDateObject(e);F(r,0),"month"==t._view.name&&t.options.disableDates(r)&&(r=t._value),t._view.setDate(i,r),t.navigateDown(a(i,n.min,n.max))},_focus:function(e){var t=this,n=t._view;0!==n.compare(e,t._current)?t.navigate(e):(t._current=e,t._class(te,e))},_focusView:function(e,t){e&&this.focus(t)},_footer:function(n){var i=this,r=o(),a=i.element,s=a.find(".k-footer");return n?(s[0]||(s=e('<div class="k-footer"><a href="#" class="k-link k-nav-today"></a></div>').appendTo(a)),i._today=s.show().find(".k-link").html(n(r)).attr("title",x.toString(r,"D",i.options.culture)),i._toggle(),t):(i._toggle(!1),s.hide(),t)},_header:function(){var e,t=this,n=t.element;n.find(".k-header")[0]||n.html('<div class="k-header"><a href="#" role="button" class="k-link k-nav-prev"><span class="k-icon k-i-arrow-w"></span></a><a href="#" role="button" aria-live="assertive" aria-atomic="true" class="k-link k-nav-fast"></a><a href="#" role="button" class="k-link k-nav-next"><span class="k-icon k-i-arrow-e"></span></a></div>'),e=n.find(".k-link").on(ce+" "+ue+" "+le+" "+ae,c).click(!1),t._title=e.eq(1).on(W,function(){t._active=t.options.focusOnNav!==!1,t.navigateUp()}),t[pe]=e.eq(0).on(W,function(){t._active=t.options.focusOnNav!==!1,t.navigateToPast()}),t[me]=e.eq(2).on(W,function(){t._active=t.options.focusOnNav!==!1,t.navigateToFuture()})},_navigate:function(e,t){var n=this,i=n._index+1,r=new ke((+n._current));e=n[e],e.hasClass(ee)||(i>3?r.setFullYear(r.getFullYear()+100*t):y.views[i].setDate(r,t),n.navigate(r))},_option:function(e,n){var i,r=this,o=r.options,a=r._value||r._current;return n===t?o[e]:(n=E(n,o.format,o.culture),n&&(o[e]=new ke((+n)),i=e===j?n>a:a>n,(i||v(a,n))&&(i&&(r._value=null),r._changeView=!0),r._changeView||(r._changeView=!(!o.month.content&&!o.month.empty)),r.navigate(r._value),r._toggle()),t)},_toggle:function(e){var n=this,i=n.options,r=n.options.disableDates(o()),a=n._today;e===t&&(e=s(o(),i.min,i.max)),a&&(a.off(W),e&&!r?a.addClass(re).removeClass(ee).on(W,_e(n._todayClick,n)):a.removeClass(re).addClass(ee).on(W,u))},_todayClick:function(e){var t=this,n=we[t.options.depth],i=t.options.disableDates,r=o();e.preventDefault(),i(r)||(0===t._view.compare(t._current,r)&&t._index==n&&(t._changeView=!1),t._value=r,t.navigate(r,n),t.trigger(Q))},_toDateObject:function(t){var n=e(t).attr(x.attr(J)).split("/");return n=new ke(n[0],n[1],n[2])},_templates:function(){var e=this,t=e.options,n=t.footer,i=t.month,r=i.content,o=i.empty;e.month={content:I('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link#=data.linkClass#" href="#=data.url#" '+x.attr("value")+'="#=data.dateString#" title="#=data.title#">'+(r||"#=data.value#")+"</a></td>",{useWithBlock:!!r}),empty:I('<td role="gridcell">'+(o||"&nbsp;")+"</td>",{useWithBlock:!!o})},e.footer=n!==!1?I(n||'#= kendo.toString(data,"D","'+t.culture+'") #',{useWithBlock:!1}):null}});T.plugin(ye),y={firstDayOfMonth:function(e){return new ke(e.getFullYear(),e.getMonth(),1)},firstVisibleDay:function(e,t){t=t||x.culture().calendar;for(var n=t.firstDay,i=new ke(e.getFullYear(),e.getMonth(),0,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());i.getDay()!=n;)y.setTime(i,-1*fe);return i},setTime:function(e,t){var n=e.getTimezoneOffset(),i=new ke(e.getTime()+t),r=i.getTimezoneOffset()-n;e.setTime(i.getTime()+r*he)},views:[{name:Y,title:function(e,t,n,i){return h(i).months.names[e.getMonth()]+" "+e.getFullYear()},content:function(e){for(var t=this,n=0,r=e.min,o=e.max,a=e.date,s=e.dates,d=e.format,c=e.culture,u=e.url,f=u&&s[0],p=h(c),g=p.firstDay,v=p.days,_=l(v.names,g),b=l(v.namesShort,g),k=y.firstVisibleDay(a,p),w=t.first(a),C=t.last(a),T=t.toDateString,S=new ke,D='<table tabindex="0" role="grid" class="k-content" cellspacing="0" data-start="'+T(k)+'"><thead><tr role="row">';n<7;n++)D+='<th scope="col" title="'+_[n]+'">'+b[n]+"</th>";return S=new ke(S.getFullYear(),S.getMonth(),S.getDate()),F(S,0),S=+S,i({cells:42,perRow:7,html:D+='</tr></thead><tbody><tr role="row">',start:k,min:new ke(r.getFullYear(),r.getMonth(),r.getDate()),max:new ke(o.getFullYear(),o.getMonth(),o.getDate()),content:e.content,empty:e.empty,setter:t.setDate,disableDates:e.disableDates,build:function(e,t,n){var i=[],r=e.getDay(),o="",a="#";return(e<w||e>C)&&i.push(ne),n(e)&&i.push(ee),+e===S&&i.push("k-today"),0!==r&&6!==r||i.push("k-weekend"),f&&m(+e,s)&&(a=u.replace("{0}",x.toString(e,d,c)),o=" k-action-link"),{date:e,dates:s,ns:x.ns,title:x.toString(e,"D",c),value:e.getDate(),dateString:T(e),cssClass:i[0]?' class="'+i.join(" ")+'"':"",linkClass:o,url:a}}})},first:function(e){return y.firstDayOfMonth(e)},last:function(e){var t=new ke(e.getFullYear(),e.getMonth()+1,0),n=y.firstDayOfMonth(e),i=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return i&&t.setHours(n.getHours()+i/60),t},compare:function(e,t){var n,i=e.getMonth(),r=e.getFullYear(),o=t.getMonth(),a=t.getFullYear();return n=r>a?1:r<a?-1:i==o?0:i>o?1:-1},setDate:function(e,t){var n=e.getHours();t instanceof ke?e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()):y.setTime(e,t*fe),F(e,n)},toDateString:function(e){return e.getFullYear()+"/"+e.getMonth()+"/"+e.getDate()}},{name:"year",title:function(e){return e.getFullYear()},content:function(e){var t=h(e.culture).months.namesAbbr,n=this.toDateString,r=e.min,o=e.max;return i({min:new ke(r.getFullYear(),r.getMonth(),1),max:new ke(o.getFullYear(),o.getMonth(),1),start:new ke(e.date.getFullYear(),0,1),setter:this.setDate,build:function(e){return{value:t[e.getMonth()],ns:x.ns,dateString:n(e),cssClass:""}}})},first:function(e){return new ke(e.getFullYear(),0,e.getDate())},last:function(e){return new ke(e.getFullYear(),11,e.getDate())},compare:function(e,t){return r(e,t)},setDate:function(e,t){var n,i=e.getHours();t instanceof ke?(n=t.getMonth(),e.setFullYear(t.getFullYear(),n,e.getDate()),n!==e.getMonth()&&e.setDate(0)):(n=e.getMonth()+t,e.setMonth(n),n>11&&(n-=12),n>0&&e.getMonth()!=n&&e.setDate(0)),F(e,i)},toDateString:function(e){return e.getFullYear()+"/"+e.getMonth()+"/1"}},{name:"decade",title:function(e,t,i){return n(e,t,i,10)},content:function(e){var t=e.date.getFullYear(),n=this.toDateString;return i({start:new ke(t-t%10-1,0,1),min:new ke(e.min.getFullYear(),0,1),max:new ke(e.max.getFullYear(),0,1),setter:this.setDate,build:function(e,t){return{value:e.getFullYear(),ns:x.ns,dateString:n(e),cssClass:0===t||11==t?ie:""}}})},first:function(e){var t=e.getFullYear();return new ke(t-t%10,e.getMonth(),e.getDate())},last:function(e){var t=e.getFullYear();return new ke(t-t%10+9,e.getMonth(),e.getDate())},compare:function(e,t){return r(e,t,10)},setDate:function(e,t){d(e,t,1)},toDateString:function(e){return e.getFullYear()+"/0/1"}},{name:K,title:function(e,t,i){return n(e,t,i,100)},content:function(e){var t=e.date.getFullYear(),n=e.min.getFullYear(),r=e.max.getFullYear(),o=this.toDateString,a=n,s=r;return a-=a%10,s-=s%10,s-a<10&&(s=a+9),i({start:new ke(t-t%100-10,0,1),min:new ke(a,0,1),max:new ke(s,0,1),setter:this.setDate,build:function(e,t){var i=e.getFullYear(),a=i+9;return i<n&&(i=n),a>r&&(a=r),{ns:x.ns,value:i+" - "+a,dateString:o(e),cssClass:0===t||11==t?ie:""}}})},first:function(e){var t=e.getFullYear();return new ke(t-t%100,e.getMonth(),e.getDate())},last:function(e){var t=e.getFullYear();return new ke(t-t%100+99,e.getMonth(),e.getDate())},compare:function(e,t){return r(e,t,100)},setDate:function(e,t){d(e,t,10)},toDateString:function(e){var t=e.getFullYear();return t-t%10+"/0/1"}}]},y.isEqualDatePart=g,y.isEqualDate=w,y.makeUnselectable=p,y.restrictValue=a,y.isInRange=s,y.normalize=f,y.viewsEnum=we,y.disabled=_,x.calendar=y}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.datepicker.min",["kendo.calendar.min","kendo.popup.min"],e)}(function(){return function(e,t){function n(t){var n=t.parseFormats,i=t.format;H.normalize(t),n=e.isArray(n)?n:[n],n.length||n.push("yyyy-MM-dd"),e.inArray(i,n)===-1&&n.splice(0,0,t.format),t.parseFormats=n}function i(e){e.preventDefault()}var r,o=window.kendo,a=o.ui,s=a.Widget,l=o.parseDate,d=o.keys,c=o.template,u=o._activeElement,h="<div />",f="<span />",p=".kendoDatePicker",m="click"+p,g="open",v="close",_="change",b="disabled",k="readonly",w="k-state-default",y="k-state-focused",x="k-state-selected",C="k-state-disabled",T="k-state-hover",S="mouseenter"+p+" mouseleave"+p,D="mousedown"+p,E="id",F="min",R="max",I="month",A="aria-disabled",M="aria-expanded",z="aria-hidden",H=o.calendar,N=H.isInRange,P=H.restrictValue,L=H.isEqualDatePart,B=e.extend,O=e.proxy,V=Date,W=function(t){var n,i=this,r=document.body,s=e(h).attr(z,"true").addClass("k-calendar-container").appendTo(r);i.options=t=t||{},n=t.id,n&&(n+="_dateview",s.attr(E,n),i._dateViewID=n),i.popup=new a.Popup(s,B(t.popup,t,{name:"Popup",isRtl:o.support.isRtl(t.anchor)})),i.div=s,i.value(t.value)};W.prototype={_calendar:function(){var t,n=this,r=n.calendar,s=n.options;r||(t=e(h).attr(E,o.guid()).appendTo(n.popup.element).on(D,i).on(m,"td:has(.k-link)",O(n._click,n)),n.calendar=r=new a.Calendar(t),n._setOptions(s),o.calendar.makeUnselectable(r.element),r.navigate(n._value||n._current,s.start),n.value(n._value))},_setOptions:function(e){this.calendar.setOptions({focusOnNav:!1,change:e.change,culture:e.culture,dates:e.dates,depth:e.depth,footer:e.footer,format:e.format,max:e.max,min:e.min,month:e.month,start:e.start,disableDates:e.disableDates})},setOptions:function(e){var t=this.options,n=e.disableDates;n&&(e.disableDates=H.disabled(n)),this.options=B(t,e,{change:t.change,close:t.close,open:t.open}),this.calendar&&this._setOptions(this.options)},destroy:function(){this.popup.destroy()},open:function(){var e=this;e._calendar(),e.popup.open()},close:function(){this.popup.close()},min:function(e){this._option(F,e)},max:function(e){this._option(R,e)},toggle:function(){var e=this;e[e.popup.visible()?v:g]()},move:function(e){var t=this,n=e.keyCode,i=t.calendar,r=e.ctrlKey&&n==d.DOWN||n==d.ENTER,o=!1;if(e.altKey)n==d.DOWN?(t.open(),e.preventDefault(),o=!0):n==d.UP&&(t.close(),e.preventDefault(),o=!0);else if(t.popup.visible()){if(n==d.ESC||r&&i._cell.hasClass(x))return t.close(),e.preventDefault(),!0;t._current=i._move(e),o=!0}return o},current:function(e){this._current=e,this.calendar._focus(e)},value:function(e){var t=this,n=t.calendar,i=t.options,r=i.disableDates;r&&r(e)&&(e=null),t._value=e,t._current=new V((+P(e,i.min,i.max))),n&&n.value(e)},_click:function(e){e.currentTarget.className.indexOf(x)!==-1&&this.close()},_option:function(e,t){var n=this,i=n.calendar;n.options[e]=t,i&&i[e](t)}},W.normalize=n,o.DateView=W,r=s.extend({init:function(t,i){var r,a,d=this;s.fn.init.call(d,t,i),t=d.element,i=d.options,i.disableDates=o.calendar.disabled(i.disableDates),i.min=l(t.attr("min"))||l(i.min),i.max=l(t.attr("max"))||l(i.max),n(i),d._initialOptions=B({},i),d._wrapper(),d.dateView=new W(B({},i,{id:t.attr(E),anchor:d.wrapper,change:function(){d._change(this.value()),d.close()},close:function(e){d.trigger(v)?e.preventDefault():(t.attr(M,!1),a.attr(z,!0))},open:function(e){var n,i=d.options;d.trigger(g)?e.preventDefault():(d.element.val()!==d._oldText&&(n=l(t.val(),i.parseFormats,i.culture),d.dateView[n?"current":"value"](n)),t.attr(M,!0),a.attr(z,!1),d._updateARIA(n))}})),a=d.dateView.div,d._icon();try{t[0].setAttribute("type","text")}catch(c){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":d.dateView._dateViewID}),d._reset(),d._template(),r=t.is("[disabled]")||e(d.element).parents("fieldset").is(":disabled"),r?d.enable(!1):d.readonly(t.is("[readonly]")),d._old=d._update(i.value||d.element.val()),d._oldText=t.val(),o.notify(d)},events:[g,v,_],options:{name:"DatePicker",value:null,footer:"",format:"",culture:"",parseFormats:[],min:new Date(1900,0,1),max:new Date(2099,11,31),start:I,depth:I,animation:{},month:{},dates:[],ARIATemplate:'Current focused date is #=kendo.toString(data.current, "D")#'},setOptions:function(e){var t=this,i=t._value;s.fn.setOptions.call(t,e),e=t.options,e.min=l(e.min),e.max=l(e.max),n(e),t.dateView.setOptions(e),i&&(t.element.val(o.toString(i,e.format,e.culture)),t._updateARIA(i))},_editable:function(e){var t=this,n=t._dateIcon.off(p),r=t.element.off(p),o=t._inputWrapper.off(p),a=e.readonly,s=e.disable;a||s?(o.addClass(s?C:w).removeClass(s?w:C),r.attr(b,s).attr(k,a).attr(A,s)):(o.addClass(w).removeClass(C).on(S,t._toggleHover),r.removeAttr(b).removeAttr(k).attr(A,!1).on("keydown"+p,O(t._keydown,t)).on("focusout"+p,O(t._blur,t)).on("focus"+p,function(){t._inputWrapper.addClass(y)}),n.on(m,O(t._click,t)).on(D,i))},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},destroy:function(){var e=this;s.fn.destroy.call(e),e.dateView.destroy(),e.element.off(p),e._dateIcon.off(p),e._inputWrapper.off(p),e._form&&e._form.off("reset",e._resetHandler)},open:function(){this.dateView.open()},close:function(){this.dateView.close()},min:function(e){return this._option(F,e)},max:function(e){return this._option(R,e)},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(T,"mouseenter"===t.type)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(y)},_click:function(){var e=this,t=e.element;e.dateView.toggle(),o.support.touch||t[0]===u()||t.focus()},_change:function(e){var t,n,i,r=this,a=r.element.val();e=r._update(e),t=!o.calendar.isEqualDate(r._old,e),n=t&&!r._typing,i=a!==r.element.val(),(n||i)&&r.element.trigger(_),t&&(r._old=e,r._oldText=r.element.val(),r.trigger(_)),r._typing=!1},_keydown:function(e){var t=this,n=t.dateView,i=t.element.val(),r=!1;n.popup.visible()||e.keyCode!=d.ENTER||i===t._oldText?(r=n.move(e),t._updateARIA(n._current),r||(t._typing=!0)):t._change(i)},_icon:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-calendar"></span></span>').insertAfter(i)),n._dateIcon=t.attr({role:"button","aria-controls":n.dateView._dateViewID})},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=l(n,r.parseFormats,r.culture),n&&(r[e]=new V((+n)),i.dateView[e](n)),t)},_update:function(e){var t,n=this,i=n.options,r=i.min,a=i.max,s=n._value,d=l(e,i.parseFormats,i.culture),c=null===d&&null===s||d instanceof Date&&s instanceof Date;return i.disableDates(d)&&(d=null,n._old||n.element.val()||(e=null)),+d===+s&&c?(t=o.toString(d,i.format,i.culture),t!==e&&n.element.val(null===d?e:t),d):(null!==d&&L(d,r)?d=P(d,r,a):N(d,r,a)||(d=null),n._value=d,n.dateView.value(d),n.element.val(o.toString(d||e,i.format,i.culture)),n._updateARIA(d),d)},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-datepicker"),t[0]||(t=i.wrap(f).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(f).parent()),t[0].style.cssText=i[0].style.cssText,i.css({width:"100%",height:i[0].style.height}),n.wrapper=t.addClass("k-widget k-datepicker k-header").addClass(i[0].className),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue),t.max(t._initialOptions.max),t.min(t._initialOptions.min)},t._form=r.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=c(this.options.ARIATemplate)},_updateARIA:function(e){var t,n=this,i=n.dateView.calendar;n.element.removeAttr("aria-activedescendant"),i&&(t=i._cell,t.attr("aria-label",n._ariaTemplate({current:e||i.current()})),n.element.attr("aria-activedescendant",t.attr("id")))}}),a.plugin(r)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){
(n||t)()}),function(e,define){define("kendo.autocomplete.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function n(e,t,n){return n?t.substring(0,e).split(n).length-1:0}function i(e,t,i){return t.split(i)[n(e,t,i)]}function r(e,t,i,r,o){var a=t.split(r);return a.splice(n(e,t,r),1,i),r&&""!==a[a.length-1]&&a.push(""),a.join(o)}var o=window.kendo,a=o.support,s=o.caret,l=o._activeElement,d=a.placeholder,c=o.ui,u=c.List,h=o.keys,f=o.data.DataSource,p="aria-disabled",m="aria-readonly",g="change",v="k-state-default",_="disabled",b="readonly",k="k-state-focused",w="k-state-selected",y="k-state-disabled",x="k-state-hover",C=".kendoAutoComplete",T="mouseenter"+C+" mouseleave"+C,S=e.proxy,D=u.extend({init:function(t,n){var i,r,a=this;a.ns=C,n=e.isArray(n)?{dataSource:n}:n,u.fn.init.call(a,t,n),t=a.element,n=a.options,n.placeholder=n.placeholder||t.attr("placeholder"),d&&t.attr("placeholder",n.placeholder),a._wrapper(),a._loader(),a._clearButton(),a._dataSource(),a._ignoreCase(),t[0].type="text",i=a.wrapper,a._popup(),t.addClass("k-input").on("keydown"+C,S(a._keydown,a)).on("keypress"+C,S(a._keypress,a)).on("paste"+C,S(a._search,a)).on("focus"+C,function(){a._prev=a._accessor(),a._oldText=a._prev,a._placeholder(!1),i.addClass(k)}).on("focusout"+C,function(){a._change(),a._placeholder(),i.removeClass(k)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":!0}),a._clear.on("click"+C,S(a._clearValue,a)),a._enable(),a._old=a._accessor(),t[0].id&&t.attr("aria-owns",a.ul[0].id),a._aria(),a._placeholder(),a._initList(),r=e(a.element).parents("fieldset").is(":disabled"),r&&a.enable(!1),a.listView.bind("click",function(e){e.preventDefault()}),a._resetFocusItemHandler=e.proxy(a._resetFocusItem,a),o.notify(a)},options:{name:"AutoComplete",enabled:!0,suggest:!1,template:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",dataTextField:"",minLength:1,enforceMinLength:!1,delay:200,height:200,filter:"startswith",ignoreCase:!0,highlightFirst:!1,separator:null,placeholder:"",animation:{},virtual:!1,value:null,clearButton:!0},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._progressHandler=S(e._showBusy,e),e._errorHandler=S(e._hideBusy,e)),e.dataSource=f.create(e.options.dataSource).bind("progress",e._progressHandler).bind("error",e._errorHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.listView.setDataSource(this.dataSource)},events:["open","close",g,"select","filtering","dataBinding","dataBound"],setOptions:function(e){var t=this._listOptions(e);u.fn.setOptions.call(this,e),this.listView.setOptions(t),this._accessors(),this._aria()},_listOptions:function(t){var n=u.fn._listOptions.call(this,e.extend(t,{skipUpdateOnBind:!0}));return n.dataValueField=n.dataTextField,n.selectedItemChange=null,n},_editable:function(e){var t=this,n=t.element,i=t.wrapper.off(C),r=e.readonly,o=e.disable;r||o?(i.addClass(o?y:v).removeClass(o?v:y),n.attr(_,o).attr(b,r).attr(p,o).attr(m,r)):(i.addClass(v).removeClass(y).on(T,t._toggleHover),n.removeAttr(_).removeAttr(b).attr(p,!1).attr(m,!1))},close:function(){var e=this,t=e.listView.focus();t&&t.removeClass(w),e.popup.close()},destroy:function(){var e=this;e.element.off(C),e._clear.off(C),e.wrapper.off(C),u.fn.destroy.call(e)},refresh:function(){this.listView.refresh()},select:function(e){this._select(e)},search:function(t){var n,r=this,o=r.options,a=o.ignoreCase,l=r._separator();t=t||r._accessor(),clearTimeout(r._typingTimeout),l&&(t=i(s(r.element)[0],t,l)),n=t.length,(!o.enforceMinLength&&!n||n>=o.minLength)&&(r._open=!0,r._mute(function(){this.listView.value([])}),r._filterSource({value:a?t.toLowerCase():t,operator:o.filter,field:o.dataTextField,ignoreCase:a}),r.one("close",e.proxy(r._unifySeparators,r)))},suggest:function(e){var i,r=this,o=r._last,a=r._accessor(),d=r.element[0],c=s(d)[0],f=r._separator(),p=a.split(f),m=n(c,a,f),g=c;return o==h.BACKSPACE||o==h.DELETE?(r._last=t,t):(e=e||"","string"!=typeof e&&(e[0]&&(e=r.dataSource.view()[u.inArray(e[0],r.ul[0])]),e=e?r._text(e):""),c<=0&&(c=a.toLowerCase().indexOf(e.toLowerCase())+1),i=a.substring(0,c).lastIndexOf(f),i=i>-1?c-(i+f.length):c,a=p[m].substring(0,i),e&&(e=""+e,i=e.toLowerCase().indexOf(a.toLowerCase()),i>-1&&(e=e.substring(i+a.length),g=c+e.length,a+=e),f&&""!==p[p.length-1]&&p.push("")),p[m]=a,r._accessor(p.join(f||"")),d===l()&&s(d,c,g),t)},value:function(e){return e===t?this._accessor():(this.listView.value(e),this._accessor(e),this._old=this._accessor(),this._oldText=this._accessor(),t)},_click:function(e){var n=e.item,i=this,r=i.element,o=i.listView.dataItemByIndex(i.listView.getElementIndex(n));return e.preventDefault(),i._active=!0,i.trigger("select",{dataItem:o,item:n})?(i.close(),t):(i._oldText=r.val(),i._select(n).done(function(){i._blur(),s(r,r.val().length)}),t)},_clearText:e.noop,_resetFocusItem:function(){var e=this.options.highlightFirst?0:-1;this.options.virtual&&this.listView.scrollTo(0),this.listView.focus(e)},_listBound:function(){var e,n=this,i=n.popup,r=n.options,o=n.dataSource.flatView(),a=o.length,s=n.element[0]===l();n._renderFooter(),n._renderNoData(),n._toggleNoData(!o.length),n._resizePopup(),i.position(),a&&r.suggest&&s&&n.suggest(o[0]),n._open&&(n._open=!1,e=n._allowOpening()?"open":"close",n._typingTimeout&&!s&&(e="close"),a&&(n._resetFocusItem(),r.virtual&&n.popup.unbind("activate",n._resetFocusItemHandler).one("activate",n._resetFocusItemHandler)),i[e](),n._typingTimeout=t),n._touchScroller&&n._touchScroller.reset(),n._hideBusy(),n._makeUnselectable(),n.trigger("dataBound")},_mute:function(e){this._muted=!0,e.call(this),this._muted=!1},_listChange:function(){var e=this._active||this.element[0]===l();e&&!this._muted&&this._selectValue(this.listView.selectedDataItems()[0])},_selectValue:function(e){var t=this._separator(),n="";e&&(n=this._text(e)),null===n&&(n=""),t&&(n=r(s(this.element)[0],this._accessor(),n,t,this._defaultSeparator())),this._prev=n,this._accessor(n),this._placeholder()},_unifySeparators:function(){return this._accessor(this.value().split(this._separator()).join(this._defaultSeparator())),this},_change:function(){var e=this,t=e._unifySeparators().value(),n=t!==u.unifyType(e._old,typeof t),i=n&&!e._typing,r=e._oldText!==t;e._old=t,e._oldText=t,(i||r)&&e.element.trigger(g),n&&e.trigger(g),e.typing=!1},_accessor:function(e){var n=this,i=n.element[0];return e===t?(e=i.value,i.className.indexOf("k-readonly")>-1&&e===n.options.placeholder?"":e):(i.value=null===e?"":e,n._placeholder(),t)},_keydown:function(e){var t,n,i=this,r=e.keyCode,o=i.listView,a=i.popup.visible(),s=o.focus();if(i._last=r,r===h.DOWN)a&&this._move(s?"focusNext":"focusFirst"),e.preventDefault();else if(r===h.UP)a&&this._move(s?"focusPrev":"focusLast"),e.preventDefault();else if(r===h.ENTER||r===h.TAB){if(r===h.ENTER&&a&&e.preventDefault(),a&&s){if(t=o.dataItemByIndex(o.getElementIndex(s)),i.trigger("select",{dataItem:t,item:s}))return;this._select(s)}this._blur()}else r===h.ESC?(a&&e.preventDefault(),i.close()):!i.popup.visible()||r!==h.PAGEDOWN&&r!==h.PAGEUP?i._search():(e.preventDefault(),n=r===h.PAGEDOWN?1:-1,o.scrollWith(n*o.screenHeight()))},_keypress:function(){this._oldText=this.element.val(),this._typing=!0},_move:function(e){this.listView[e](),this.options.suggest&&this.suggest(this.listView.focus())},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._loading.hide(),e.element.attr("aria-busy",!1),e._busy=null,e._showClear()},_showBusy:function(){var e=this;e._busy||(e._busy=setTimeout(function(){e.element.attr("aria-busy",!0),e._loading.show(),e._hideClear()},100))},_placeholder:function(e){if(!d){var n,i=this,r=i.element,o=i.options.placeholder;if(o){if(n=r.val(),e===t&&(e=!n),e||(o=n!==o?n:""),n===i._old&&!e)return;r.toggleClass("k-readonly",e).val(o),o||r[0]!==document.activeElement||s(r[0],0,0)}}},_separator:function(){var e=this.options.separator;return e instanceof Array?RegExp(e.join("|"),"gi"):e},_defaultSeparator:function(){var e=this.options.separator;return e instanceof Array?e[0]:e},_inputValue:function(){return this.element.val()},_search:function(){var e=this;clearTimeout(e._typingTimeout),e._typingTimeout=setTimeout(function(){e._prev!==e._accessor()&&(e._prev=e._accessor(),e.search())},e.options.delay)},_select:function(e){var t=this;return t._active=!0,t.listView.select(e).done(function(){t._active=!1})},_loader:function(){this._loading=e('<span class="k-icon k-i-loading" style="display:none"></span>').insertAfter(this.element)},_clearButton:function(){this._clear=e('<span unselectable="on" class="k-icon k-i-close" title="clear"></span>').attr({role:"button",tabIndex:-1}),this.options.clearButton&&this._clear.insertAfter(this.element)},_toggleHover:function(t){e(t.currentTarget).toggleClass(x,"mouseenter"===t.type)},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent()),e.attr("tabindex",-1),e.attr("role","presentation"),e[0].style.cssText=i.style.cssText,n.css({width:"100%",height:i.style.height}),t._focused=t.element,t.wrapper=e.addClass("k-widget k-autocomplete k-header").addClass(i.className)}});c.plugin(D)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.dropdownlist.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function n(e,t,n){for(var i,r=0,o=t.length-1;r<o;++r)i=t[r],i in e||(e[i]={}),e=e[i];e[t[o]]=n}function i(e,t){return e>=t&&(e-=t),e}function r(e,t){for(var n=0;n<e.length;n++)if(e.charAt(n)!==t)return!1;return!0}var o=window.kendo,a=o.ui,s=a.List,l=a.Select,d=o.support,c=o._activeElement,u=o.data.ObservableObject,h=o.keys,f=".kendoDropDownList",p="disabled",m="readonly",g="change",v="k-state-focused",_="k-state-default",b="k-state-disabled",k="aria-disabled",w="mouseenter"+f+" mouseleave"+f,y="tabindex",x="filter",C="accept",T="The `optionLabel` option is not valid due to missing fields. Define a custom optionLabel as shown here http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#configuration-optionLabel",S=e.proxy,D=l.extend({init:function(n,i){var r,a,s,d=this,c=i&&i.index;d.ns=f,i=e.isArray(i)?{dataSource:i}:i,l.fn.init.call(d,n,i),i=d.options,n=d.element.on("focus"+f,S(d._focusHandler,d)),d._focusInputHandler=e.proxy(d._focusInput,d),d.optionLabel=e(),d._optionLabel(),d._inputTemplate(),d._reset(),d._prev="",d._word="",d._wrapper(),d._tabindex(),d.wrapper.data(y,d.wrapper.attr(y)),d._span(),d._popup(),d._mobile(),d._dataSource(),d._ignoreCase(),d._filterHeader(),d._aria(),d._enable(),d._oldIndex=d.selectedIndex=-1,c!==t&&(i.index=c),d._initialIndex=i.index,d.requireValueMapper(d.options),d._initList(),d._cascade(),i.autoBind?d.dataSource.fetch():d.selectedIndex===-1&&(a=i.text||"",a||(r=i.optionLabel,r&&0===i.index?a=r:d._isSelect&&(a=n.children(":selected").text())),d._textAccessor(a)),s=e(d.element).parents("fieldset").is(":disabled"),s&&d.enable(!1),d.listView.bind("click",function(e){e.preventDefault()}),o.notify(d)},options:{name:"DropDownList",enabled:!0,autoBind:!0,index:0,text:null,value:null,delay:500,height:200,dataTextField:"",dataValueField:"",optionLabel:"",cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},filter:"none",minLength:1,enforceMinLength:!1,virtual:!1,template:null,valueTemplate:null,optionLabelTemplate:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#"},events:["open","close",g,"select","filtering","dataBinding","dataBound","cascade","set"],setOptions:function(e){l.fn.setOptions.call(this,e),this.listView.setOptions(this._listOptions(e)),this._optionLabel(),this._inputTemplate(),this._accessors(),this._filterHeader(),this._enable(),this._aria(),!this.value()&&this.hasOptionLabel()&&this.select(0)},destroy:function(){var e=this;l.fn.destroy.call(e),e.wrapper.off(f),e.element.off(f),e._inputWrapper.off(f),e._arrow.off(),e._arrow=null,e.optionLabel.off()},open:function(){var e=this;e.popup.visible()||(e.listView.bound()&&e._state!==C?e._allowOpening()&&(e.popup.one("activate",e._focusInputHandler),e.popup.open(),e._resizeFilterInput(),e._focusItem()):(e._open=!0,e._state="rebind",e.filterInput&&(e.filterInput.val(""),e._prev=""),e.filterInput&&1!==e.options.minLength?(e.refresh(),e.popup.one("activate",e._focusInputHandler),e.popup.open(),e._resizeFilterInput()):e._filterSource()))},_focusInput:function(){this._focusElement(this.filterInput)},_resizeFilterInput:function(){var e,t,n=this.filterInput,i=this._prevent;n&&(e=this.filterInput[0]===c(),t=o.caret(this.filterInput[0])[0],this._prevent=!0,n.css("display","none").css("width",this.popup.element.css("width")).css("display","inline-block"),e&&(n.focus(),o.caret(n[0],t)),this._prevent=i)},_allowOpening:function(){return this.hasOptionLabel()||this.filterInput||l.fn._allowOpening.call(this)},toggle:function(e){this._toggle(e,!0)},current:function(e){var n;return e===t?(n=this.listView.focus(),!n&&0===this.selectedIndex&&this.hasOptionLabel()?this.optionLabel:n):(this._focus(e),t)},dataItem:function(n){var i=this,r=null;if(null===n)return n;if(n===t)r=i.listView.selectedDataItems()[0];else{if("number"!=typeof n){if(i.options.virtual)return i.dataSource.getByUid(e(n).data("uid"));n=n.hasClass("k-list-optionlabel")?-1:e(i.items()).index(n)}else i.hasOptionLabel()&&(n-=1);r=i.dataSource.flatView()[n]}return r||(r=i._optionLabelDataItem()),r},refresh:function(){this.listView.refresh()},text:function(e){var n,i=this,r=i.options.ignoreCase;return e=null===e?"":e,e===t?i._textAccessor():"string"!=typeof e?(i._textAccessor(e),t):(n=r?e.toLowerCase():e,i._select(function(e){return e=i._text(e),r&&(e=(e+"").toLowerCase()),e===n}).done(function(){i._textAccessor(i.dataItem()||e)}),t)},_clearFilter:function(){e(this.filterInput).val(""),l.fn._clearFilter.call(this)},value:function(e){var n=this,i=n.listView,r=n.dataSource;return e===t?(e=n._accessor()||n.listView.value()[0],e===t||null===e?"":e):(n.requireValueMapper(n.options,e),!e&&n.hasOptionLabel()||(n._initialIndex=null),this.trigger("set",{value:e}),n._request&&n.options.cascadeFrom&&n.listView.bound()?(n._valueSetter&&r.unbind(g,n._valueSetter),n._valueSetter=S(function(){n.value(e)},n),r.one(g,n._valueSetter),t):(n._isFilterEnabled()&&i.bound()&&i.isFiltered()?n._clearFilter():n._fetchData(),i.value(e).done(function(){n.selectedIndex===-1&&n.text()&&(n.text(""),n._accessor("",-1)),n._old=n._accessor(),n._oldIndex=n.selectedIndex}),t))},hasOptionLabel:function(){return this.optionLabel&&!!this.optionLabel[0]},_optionLabel:function(){var n=this,i=n.options,r=i.optionLabel,a=i.optionLabelTemplate;return r?(a||(a="#:",a+="string"==typeof r?"data":o.expr(i.dataTextField,"data"),a+="#"),"function"!=typeof a&&(a=o.template(a)),n.optionLabelTemplate=a,n.hasOptionLabel()||(n.optionLabel=e('<div class="k-list-optionlabel"></div>').prependTo(n.list)),n.optionLabel.html(a(r)).off().click(S(n._click,n)).on(w,n._toggleHover),n.angular("compile",function(){return{elements:n.optionLabel,data:[{dataItem:n._optionLabelDataItem()}]}}),t):(n.optionLabel.off().remove(),n.optionLabel=e(),t)},_optionLabelText:function(){var e=this.options.optionLabel;return"string"==typeof e?e:this._text(e)},_optionLabelDataItem:function(){var t=this,n=t.options.optionLabel;return t.hasOptionLabel()?e.isPlainObject(n)?new u(n):t._assignInstance(t._optionLabelText(),""):null},_buildOptions:function(e){var n,i,r,o=this;o._isSelect&&(n=o.listView.value()[0],i=o._optionLabelDataItem(),r=i&&o._value(i),n!==t&&null!==n||(n=""),i&&(r!==t&&null!==r||(r=""),i='<option value="'+r+'">'+o._text(i)+"</option>"),o._options(e,i,n),n!==s.unifyType(o._accessor(),typeof n)&&(o._customOption=null,o._custom(n)))},_listBound:function(){var e,t=this,n=t._initialIndex,i=t._state===x,r=t.dataSource.flatView();t._presetValue=!1,t._renderFooter(),t._renderNoData(),t._toggleNoData(!r.length),t._resizePopup(!0),t.popup.position(),t._buildOptions(r),t._makeUnselectable(),i||(t._open&&t.toggle(t._allowOpening()),t._open=!1,t._fetch||(r.length?(!t.listView.value().length&&n>-1&&null!==n&&t.select(n),t._initialIndex=null,e=t.listView.selectedDataItems()[0],e&&t.text()!==t._text(e)&&t._selectValue(e)):t._textAccessor()!==t._optionLabelText()&&(t.listView.value(""),t._selectValue(null),t._oldIndex=t.selectedIndex))),t._hideBusy(),t.trigger("dataBound")},_listChange:function(){this._selectValue(this.listView.selectedDataItems()[0]),(this._presetValue||this._old&&this._oldIndex===-1)&&(this._oldIndex=this.selectedIndex)},_filterPaste:function(){this._search()},_focusHandler:function(){this.wrapper.focus()},_focusinHandler:function(){this._inputWrapper.addClass(v),this._prevent=!1},_focusoutHandler:function(){var e,t,n=this,i=n._state===x,r=window.self!==window.top,o=n._focus(),a=n._getElementDataItem(o);n._prevent||(clearTimeout(n._typingTimeout),t=function(){d.mobileOS.ios&&r?n._change():n._blur(),n._inputWrapper.removeClass(v),n._prevent=!0,n._open=!1,n.element.blur()},e=!i&&o&&n._value(a)!==n.value(),e&&!n.trigger("select",{dataItem:a,item:o})?n._select(o,!n.dataSource.view().length).done(t):t())},_wrapperMousedown:function(){this._prevent=!!this.filterInput},_wrapperClick:function(e){e.preventDefault(),this.popup.unbind("activate",this._focusInputHandler),this._focused=this.wrapper,this._toggle()},_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly,o=t.wrapper.add(t.filterInput).off(f),a=t._inputWrapper.off(w);r||i?i?(o.removeAttr(y),a.addClass(b).removeClass(_)):(a.addClass(_).removeClass(b),o.on("focusin"+f,S(t._focusinHandler,t)).on("focusout"+f,S(t._focusoutHandler,t))):(n.removeAttr(p).removeAttr(m),a.addClass(_).removeClass(b).on(w,t._toggleHover),o.attr(y,o.data(y)).attr(k,!1).on("keydown"+f,S(t._keydown,t)).on("focusin"+f,S(t._focusinHandler,t)).on("focusout"+f,S(t._focusoutHandler,t)).on("mousedown"+f,S(t._wrapperMousedown,t)).on("paste"+f,S(t._filterPaste,t)),t.wrapper.on("click"+f,S(t._wrapperClick,t)),t.filterInput||o.on("keypress"+f,S(t._keypress,t))),n.attr(p,i).attr(m,r),o.attr(k,i)},_keydown:function(e){var n,i,r,o=this,a=e.keyCode,s=e.altKey,l=o.popup.visible();if(o.filterInput&&(n=o.filterInput[0]===c()),a===h.LEFT?(a=h.UP,i=!0):a===h.RIGHT&&(a=h.DOWN,i=!0),!i||!n){if(e.keyCode=a,(s&&a===h.UP||a===h.ESC)&&o._focusElement(o.wrapper),o._state===x&&a===h.ESC&&o._clearFilter(),a===h.ENTER&&o._typingTimeout&&o.filterInput&&l)return e.preventDefault(),t;if(i=o._move(e),!i){if((!l||!o.filterInput)&&(r=o._focus(),a===h.HOME?(i=!0,o._firstItem()):a===h.END&&(i=!0,o._lastItem()),i)){if(o.trigger("select",{dataItem:o._getElementDataItem(o._focus()),item:o._focus()}))return o._focus(r),t;o._select(o._focus(),!0).done(function(){l||o._blur()})}s||i||!o.filterInput||o._search()}}},_matchText:function(e,n){var i=this.options.ignoreCase;return e!==t&&null!==e&&(e+="",i&&(e=e.toLowerCase()),0===e.indexOf(n))},_shuffleData:function(e,t){var n=this._optionLabelDataItem();return n&&(e=[n].concat(e)),e.slice(t).concat(e.slice(0,t))},_selectNext:function(){var e,t,n,o=this,a=o.dataSource.flatView(),s=a.length+(o.hasOptionLabel()?1:0),l=r(o._word,o._last),d=o.selectedIndex;for(d===-1?d=0:(d+=l?1:0,d=i(d,s)),a=a.toJSON?a.toJSON():a.slice(),a=o._shuffleData(a,d),n=0;n<s&&(t=o._text(a[n]),!l||!o._matchText(t,o._last))&&!o._matchText(t,o._word);n++);n!==s&&(e=o._focus(),o._select(i(d+n,s)).done(function(){var t=function(){o.popup.visible()||o._change()};o.trigger("select",{dataItem:o._getElementDataItem(o._focus()),item:o._focus()})?o._select(e).done(t):t()}))},_keypress:function(e){var t,n=this;0!==e.which&&e.keyCode!==o.keys.ENTER&&(t=String.fromCharCode(e.charCode||e.keyCode),n.options.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),n._word+=t,n._last=t,n._search())},_popupOpen:function(){var e=this.popup;e.wrapper=o.wrap(e.element),e.element.closest(".km-root")[0]&&(e.wrapper.addClass("km-popup km-widget"),this.wrapper.addClass("km-widget"))},_popup:function(){l.fn._popup.call(this),this.popup.one("open",S(this._popupOpen,this))},_getElementDataItem:function(e){return e&&e[0]?e[0]===this.optionLabel[0]?this._optionLabelDataItem():this.listView.dataItemByIndex(this.listView.getElementIndex(e)):null},_click:function(n){var i=this,r=n.item||e(n.currentTarget);return n.preventDefault(),i.trigger("select",{dataItem:i._getElementDataItem(r),item:r})?(i.close(),t):(i._userTriggered=!0,i._select(r).done(function(){i._focusElement(i.wrapper),i._blur()}),t)},_focusElement:function(e){var t=c(),n=this.wrapper,i=this.filterInput,r=e===i?n:i,o=d.mobileOS&&(d.touch||d.MSPointers||d.pointers);i&&i[0]===e[0]&&o||i&&r[0]===t&&(this._prevent=!0,this._focused=e.focus())},_searchByWord:function(e){var t,n;e&&(t=this,n=t.options.ignoreCase,n&&(e=e.toLowerCase()),t._select(function(n){return t._matchText(t._text(n),e)}))},_inputValue:function(){return this.text()},_search:function(){var e=this,n=e.dataSource;if(clearTimeout(e._typingTimeout),e._isFilterEnabled())e._typingTimeout=setTimeout(function(){var t=e.filterInput.val();e._prev!==t&&(e._prev=t,e.search(t),e._resizeFilterInput()),e._typingTimeout=null},e.options.delay);else{if(e._typingTimeout=setTimeout(function(){e._word=""},e.options.delay),!e.listView.bound())return n.fetch().done(function(){e._selectNext()}),t;e._selectNext()}},_get:function(t){var n,i,r,o="function"==typeof t,a=o?e():e(t);if(this.hasOptionLabel()&&("number"==typeof t?t>-1&&(t-=1):a.hasClass("k-list-optionlabel")&&(t=-1)),o){for(n=this.dataSource.flatView(),r=0;r<n.length;r++)if(t(n[r])){t=r,i=!0;break}i||(t=-1)}return t},_firstItem:function(){this.hasOptionLabel()?this._focus(this.optionLabel):this.listView.focusFirst()},_lastItem:function(){this._resetOptionLabel(),this.listView.focusLast()},_nextItem:function(){this.optionLabel.hasClass("k-state-focused")?(this._resetOptionLabel(),this.listView.focusFirst()):this.listView.focusNext()},_prevItem:function(){this.optionLabel.hasClass("k-state-focused")||(this.listView.focusPrev(),this.listView.focus()||this._focus(this.optionLabel))},_focusItem:function(){var e=this.listView,n=e.focus(),i=e.select();i=i[i.length-1],i===t&&this.options.highlightFirst&&!n&&(i=0),i!==t?e.focus(i):this.options.optionLabel?(this._focus(this.optionLabel),this._select(this.optionLabel)):e.scrollToIndex(0)},_resetOptionLabel:function(e){this.optionLabel.removeClass("k-state-focused"+(e||"")).removeAttr("id")},_focus:function(e){var n=this.listView,i=this.optionLabel;return e===t?(e=n.focus(),!e&&i.hasClass("k-state-focused")&&(e=i),e):(this._resetOptionLabel(),e=this._get(e),n.focus(e),e===-1&&(i.addClass("k-state-focused").attr("id",n._optionID),this._focused.add(this.filterInput).removeAttr("aria-activedescendant").attr("aria-activedescendant",n._optionID)),t)},_select:function(e,t){var n=this;return e=n._get(e),n.listView.select(e).done(function(){t||n._state!==x||(n._state=C),e===-1&&n._selectValue(null)})},_selectValue:function(e){var n=this,i=n.options.optionLabel,r=n.listView.select(),o="",a="";r=r[r.length-1],r===t&&(r=-1),this._resetOptionLabel(" k-state-selected"),e?(a=e,o=n._dataValue(e),i&&(r+=1)):i&&(n._focus(n.optionLabel.addClass("k-state-selected")),a=n._optionLabelText(),o="string"==typeof i?"":n._value(i),r=0),n.selectedIndex=r,null===o&&(o=""),n._textAccessor(a),n._accessor(o,r),n._triggerCascade()},_mobile:function(){var e=this,t=e.popup,n=d.mobileOS,i=t.element.parents(".km-root").eq(0);i.length&&n&&(t.options.animation.open.effects=n.android||n.meego?"fadeIn":n.ios||n.wp?"slideIn:up":t.options.animation.open.effects)},_filterHeader:function(){var t;this.filterInput&&(this.filterInput.off(f).parent().remove(),this.filterInput=null),this._isFilterEnabled()&&(t='<span class="k-icon k-i-search"></span>',this.filterInput=e('<input class="k-textbox"/>').attr({placeholder:this.element.attr("placeholder"),title:this.element.attr("title"),role:"listbox","aria-haspopup":!0,"aria-expanded":!1}),this.list.prepend(e('<span class="k-list-filter" />').append(this.filterInput.add(t))))},_span:function(){var t,n=this,i=n.wrapper,r="span.k-input";t=i.find(r),t[0]||(i.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">&nbsp;</span><span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-arrow-s"></span></span></span>').append(n.element),t=i.find(r)),n.span=t,n._inputWrapper=e(i[0].firstChild),n._arrow=i.find(".k-icon")},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent(),e[0].style.cssText=i.style.cssText,e[0].title=i.title),t._focused=t.wrapper=e.addClass("k-widget k-dropdown k-header").addClass(i.className).css("display","").attr({accesskey:n.attr("accesskey"),unselectable:"on",role:"listbox","aria-haspopup":!0,"aria-expanded":!1}),n.hide().removeAttr("accesskey")},_clearSelection:function(e){this.select(e.value()?0:-1)},_inputTemplate:function(){var t=this,n=t.options.valueTemplate;if(n=n?o.template(n):e.proxy(o.template("#:this._text(data)#",{useWithBlock:!1}),t),t.valueTemplate=n,t.hasOptionLabel()&&!t.options.optionLabelTemplate)try{t.valueTemplate(t._optionLabelDataItem())}catch(i){throw Error(T)}},_textAccessor:function(n){var i,r=null,o=this.valueTemplate,a=this._optionLabelText(),s=this.span;if(n===t)return s.text();e.isPlainObject(n)||n instanceof u?r=n:a&&a===n&&(r=this.options.optionLabel),r||(r=this._assignInstance(n,this._accessor())),this.hasOptionLabel()&&(r!==a&&this._text(r)!==a||(o=this.optionLabelTemplate,"string"!=typeof this.options.optionLabel||this.options.optionLabelTemplate||(r=a))),i=function(){return{elements:s.get(),data:[{dataItem:r}]}},this.angular("cleanup",i);try{s.html(o(r))}catch(l){s.html("")}this.angular("compile",i)},_preselect:function(e,t){e||t||(t=this._optionLabelText()),this._accessor(e),this._textAccessor(t),this._old=this._accessor(),this._oldIndex=this.selectedIndex,this.listView.setValue(e),this._initialIndex=null,this._presetValue=!0},_assignInstance:function(e,t){var i=this.options.dataTextField,r={};return i?(n(r,i.split("."),e),n(r,this.options.dataValueField.split("."),t),r=new u(r)):r=e,r}});a.plugin(D)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.combobox.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui,r=i.List,o=i.Select,a=n.caret,s=n.support,l=s.placeholder,d=n._activeElement,c=n.keys,u=".kendoComboBox",h="click"+u,f="mousedown"+u,p="disabled",m="readonly",g="change",v="k-state-default",_="k-state-focused",b="k-state-disabled",k="aria-disabled",w="filter",y="accept",x="rebind",C="mouseenter"+u+" mouseleave"+u,T=e.proxy,S=o.extend({init:function(t,i){var r,a,s=this;s.ns=u,i=e.isArray(i)?{dataSource:i}:i,o.fn.init.call(s,t,i),i=s.options,t=s.element.on("focus"+u,T(s._focusHandler,s)),i.placeholder=i.placeholder||t.attr("placeholder"),s._reset(),s._wrapper(),s._input(),s._clearButton(),s._tabindex(s.input),s._popup(),s._dataSource(),s._ignoreCase(),s._enable(),s._oldIndex=s.selectedIndex=-1,s._aria(),s._initialIndex=i.index,s.requireValueMapper(s.options),s._initList(),s._cascade(),i.autoBind?s._filterSource():(r=i.text,!r&&s._isSelect&&(r=t.children(":selected").text()),r&&s._setText(r)),r||s._placeholder(),a=e(s.element).parents("fieldset").is(":disabled"),a&&s.enable(!1),n.notify(s)},options:{name:"ComboBox",enabled:!0,index:-1,text:null,value:null,autoBind:!0,delay:200,dataTextField:"",dataValueField:"",minLength:1,enforceMinLength:!1,height:200,highlightFirst:!0,filter:"none",placeholder:"",suggest:!1,cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{},virtual:!1,template:null,groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",clearButton:!0},events:["open","close",g,"select","filtering","dataBinding","dataBound","cascade","set"],setOptions:function(e){o.fn.setOptions.call(this,e),this.listView.setOptions(e),this._accessors(),this._aria()},destroy:function(){var e=this;e.input.off(u),e.element.off(u),e._inputWrapper.off(u),clearTimeout(e._pasteTimeout),e._arrow.off(h+" "+f),e._clear.off(h+" "+f),o.fn.destroy.call(e)},_focusHandler:function(){this.input.focus()},_arrowClick:function(){this._toggle()},_inputFocus:function(){this._inputWrapper.addClass(_),this._placeholder(!1)},_inputFocusout:function(){var e,n,i=this,r=i.value();return i._inputWrapper.removeClass(_),clearTimeout(i._typingTimeout),i._typingTimeout=null,i.text(i.text()),e=i._focus(),n=this.listView.dataItemByIndex(this.listView.getElementIndex(e)),r!==i.value()&&i.trigger("select",{dataItem:n,item:e})?(i.value(r),t):(i._placeholder(),i._blur(),i.element.blur(),t)},_inputPaste:function(){var e=this;clearTimeout(e._pasteTimeout),e._pasteTimeout=null,e._pasteTimeout=setTimeout(function(){e.search()})},_editable:function(e){var t=this,n=e.disable,i=e.readonly,r=t._inputWrapper.off(u),o=t.element.add(t.input.off(u)),a=t._arrow.off(h+" "+f),s=t._clear;i||n?(r.addClass(n?b:v).removeClass(n?v:b),o.attr(p,n).attr(m,i).attr(k,n)):(r.addClass(v).removeClass(b).on(C,t._toggleHover),o.removeAttr(p).removeAttr(m).attr(k,!1),a.on(h,T(t._arrowClick,t)).on(f,function(e){e.preventDefault()}),s.on(h,T(t._clearValue,t)).on(f,function(e){e.preventDefault()}),t.input.on("keydown"+u,T(t._keydown,t)).on("focus"+u,T(t._inputFocus,t)).on("focusout"+u,T(t._inputFocusout,t)).on("paste"+u,T(t._inputPaste,t)))},open:function(){var e=this,t=e._state;e.popup.visible()||(!e.listView.bound()&&t!==w||t===y?(e._open=!0,e._state=x,1!==e.options.minLength?(e.refresh(),e._openPopup()):e._filterSource()):e._allowOpening()&&(e._openPopup(),e._focusItem()))},_scrollToFocusedItem:function(){var e=this.listView;e.scrollToIndex(e.getElementIndex(e.focus()))},_openPopup:function(){this.popup.one("activate",T(this._scrollToFocusedItem,this)),this.popup.open()},_updateSelectionState:function(){var e=this,n=e.options.text,i=e.options.value;e.listView.isFiltered()||(e.selectedIndex===-1?(n!==t&&null!==n||(n=i),e._accessor(i),e.input.val(n||e.input.val()),e._placeholder()):e._oldIndex===-1&&(e._oldIndex=e.selectedIndex))},_buildOptions:function(e){var n,i=this;i._isSelect&&(n=i._customOption,i._state===x&&(i._state=""),i._customOption=t,i._options(e,"",i.value()),n&&n[0].selected&&i._custom(n.val()))},_updateSelection:function(){var n,i=this,r=i.listView,o=i._initialIndex,a=null!==o&&o>-1,s=i._state===w;return s?(e(r.focus()).removeClass("k-state-selected"),t):(i._fetch||(r.value().length||(a?i.select(o):i._accessor()&&r.value(i._accessor())),i._initialIndex=null,n=r.selectedDataItems()[0],n&&(i._value(n)!==i.value()&&i._custom(i._value(n)),i.text()&&i.text()!==i._text(n)&&i._selectValue(n))),t)},_updateItemFocus:function(){var e=this.listView;this.options.highlightFirst?e.focus()||e.focusIndex()||e.focus(0):e.focus(-1)},_listBound:function(){var e=this,n=e.input[0]===d(),i=e.dataSource.flatView(),r=e.listView.skip(),o=r===t||0===r;e._presetValue=!1,e._renderFooter(),e._renderNoData(),e._toggleNoData(!i.length),e._resizePopup(),e.popup.position(),e._buildOptions(i),e._makeUnselectable(),e._updateSelection(),i.length&&o&&(e._updateItemFocus(),e.options.suggest&&n&&e.input.val()&&e.suggest(i[0])),e._open&&(e._open=!1,e._typingTimeout&&!n?e.popup.close():e.toggle(e._allowOpening()),e._typingTimeout=null),e._hideBusy(),e.trigger("dataBound")},_listChange:function(){this._selectValue(this.listView.selectedDataItems()[0]),this._presetValue&&(this._oldIndex=this.selectedIndex)},_get:function(e){var t,n,i;if("function"==typeof e){for(t=this.dataSource.flatView(),i=0;i<t.length;i++)if(e(t[i])){e=i,n=!0;break}n||(e=-1)}return e},_select:function(e,t){var n=this;return e=n._get(e),e===-1&&(n.input[0].value="",n._accessor("")),n.listView.select(e).done(function(){t||n._state!==w||(n._state=y)})},_selectValue:function(e){var n=this.listView.select(),i="",r="";n=n[n.length-1],n===t&&(n=-1),this.selectedIndex=n,n!==-1||e?(e&&(i=this._dataValue(e),r=this._text(e)),
null===i&&(i="")):(i=r=this.input[0].value,this.listView.focus(-1)),this._prev=this.input[0].value=r,this._accessor(i!==t?i:r,n),this._placeholder(),this._triggerCascade()},refresh:function(){this.listView.refresh()},suggest:function(e){var n,i=this,o=i.input[0],s=i.text(),l=a(o)[0],u=i._last;return u==c.BACKSPACE||u==c.DELETE?(i._last=t,t):(e=e||"","string"!=typeof e&&(e[0]&&(e=i.dataSource.view()[r.inArray(e[0],i.ul[0])]),e=e?i._text(e):""),l<=0&&(l=s.toLowerCase().indexOf(e.toLowerCase())+1),e?(e=""+e,n=e.toLowerCase().indexOf(s.toLowerCase()),n>-1&&(s+=e.substring(n+s.length))):s=s.substring(0,l),s.length===l&&e||(o.value=s,o===d()&&a(o,l,s.length)),t)},text:function(e){var n,i,o,a,s,l;return e=null===e?"":e,n=this,i=n.input[0],o=n.options.ignoreCase,a=e,e===t?i.value:n.options.autoBind!==!1||n.listView.bound()?(s=n.dataItem(),s&&n._text(s)===e&&(l=n._value(s),l===r.unifyType(n._old,typeof l))?(n._triggerCascade(),t):(o&&(a=a.toLowerCase()),n._select(function(e){return e=n._text(e),o&&(e=(e+"").toLowerCase()),e===a}).done(function(){n.selectedIndex<0&&(n._accessor(e),i.value=e,n._triggerCascade()),n._prev=i.value}),t)):(n._setText(e),t)},toggle:function(e){this._toggle(e,!0)},value:function(e){var n=this,i=n.options,r=n.listView;return e===t?(e=n._accessor()||n.listView.value()[0],e===t||null===e?"":e):(n.requireValueMapper(n.options,e),n.trigger("set",{value:e}),e===i.value&&n.input.val()===i.text||(n._accessor(e),n._isFilterEnabled()&&r.bound()&&r.isFiltered()?n._clearFilter():n._fetchData(),r.value(e).done(function(){n.selectedIndex===-1&&(n._accessor(e),n.input.val(e),n._placeholder(!0)),n._old=n._accessor(),n._oldIndex=n.selectedIndex,n._prev=n.input.val(),n._state===w&&(n._state=y)})),t)},_click:function(e){var n=this,i=e.item,r=n.listView.dataItemByIndex(n.listView.getElementIndex(i));return e.preventDefault(),n.trigger("select",{dataItem:r,item:i})?(n.close(),t):(n._userTriggered=!0,n._select(i).done(function(){n._blur()}),t)},_inputValue:function(){return this.text()},_searchByWord:function(e){var n,i=this,r=i.options,o=i.dataSource,a=r.ignoreCase,s=function(n){var r=i._text(n);if(r!==t)return r+="",(""===r||""!==e)&&(a&&(r=r.toLowerCase()),0===r.indexOf(e))};return a&&(e=e.toLowerCase()),i.ul[0].firstChild?(this.listView.focus(this._get(s)),n=this.listView.focus(),n&&(r.suggest&&i.suggest(n),this.open()),this.options.highlightFirst&&!e&&this.listView.focusFirst(),t):(o.one(g,function(){o.view()[0]&&i.search(e)}).fetch(),t)},_input:function(){var t,n,i=this,r=i.element.removeClass("k-input")[0],o=r.accessKey,a=i.wrapper,s="input.k-input",d=r.name||"";d&&(d='name="'+d+'_input" '),t=a.find(s),t[0]||(a.append('<span tabindex="-1" unselectable="on" class="k-dropdown-wrap k-state-default"><input '+d+'class="k-input" type="text" autocomplete="off"/><span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-arrow-s"></span></span></span>').append(i.element),t=a.find(s)),t[0].style.cssText=r.style.cssText,t[0].title=r.title,n=parseInt(this.element.prop("maxlength")||this.element.attr("maxlength"),10),n>-1&&(t[0].maxLength=n),t.addClass(r.className).css({width:"100%",height:r.style.height}).attr({role:"combobox","aria-expanded":!1}).show(),l&&t.attr("placeholder",i.options.placeholder),o&&(r.accessKey="",t[0].accessKey=o),i._focused=i.input=t,i._inputWrapper=e(a[0].firstChild),i._arrow=a.find(".k-select").attr({role:"button",tabIndex:-1}),r.id&&i._arrow.attr("aria-controls",i.ul[0].id)},_clearButton:function(){this._clear=e('<span unselectable="on" class="k-icon k-i-close" title="clear"></span>').attr({role:"button",tabIndex:-1}),this.options.clearButton&&(this._clear.insertAfter(this.input),this.wrapper.addClass("k-combobox-clearable"))},_keydown:function(e){var t=this,n=e.keyCode;t._last=n,clearTimeout(t._typingTimeout),t._typingTimeout=null,n==c.TAB||t._move(e)||t._search()},_placeholder:function(e){if(!l){var n,i=this,r=i.input,o=i.options.placeholder;if(o){if(n=i.value(),e===t&&(e=!n),r.toggleClass("k-readonly",e),!e){if(n)return;o=""}r.val(o),o||r[0]!==d()||a(r[0],0,0)}}},_search:function(){var e=this;e._typingTimeout=setTimeout(function(){var t=e.text();e._prev!==t&&(e._prev=t,"none"===e.options.filter&&e.listView.select(-1),e.search(t)),e._typingTimeout=null},e.options.delay)},_setText:function(e){this.input.val(e),this._prev=e},_wrapper:function(){var e=this,t=e.element,n=t.parent();n.is("span.k-widget")||(n=t.hide().wrap("<span />").parent(),n[0].style.cssText=t[0].style.cssText),e.wrapper=n.addClass("k-widget k-combobox k-header").addClass(t[0].className).css("display","")},_clearSelection:function(e,t){var n=this,i=e.value(),r=i&&e.selectedIndex===-1;this.selectedIndex==-1&&this.value()||(t||!i||r)&&(n.options.value="",n.value(""))},_preselect:function(e,t){this.input.val(t),this._accessor(e),this._old=this._accessor(),this._oldIndex=this.selectedIndex,this.listView.setValue(e),this._placeholder(),this._initialIndex=null,this._presetValue=!0}});i.plugin(S)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.multiselect.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function n(e,t){var n;if(null===e&&null!==t||null!==e&&null===t)return!1;if(n=e.length,n!==t.length)return!1;for(;n--;)if(e[n]!==t[n])return!1;return!0}var i=window.kendo,r=i.ui,o=r.List,a=i.keys,s=i._activeElement,l=i.data.ObservableArray,d=e.proxy,c="id",u="li",h="accept",f="filter",p="rebind",m="open",g="close",v="change",_="progress",b="select",k="deselect",w="aria-disabled",y="k-state-focused",x="k-loading-hidden",C="k-state-hover",T="k-state-disabled",S="disabled",D="readonly",E=".kendoMultiSelect",F="click"+E,R="keydown"+E,I="mouseenter"+E,A="mouseleave"+E,M=I+" "+A,z=/"/g,H=e.isArray,N=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],P=o.extend({init:function(t,n){var r,a,s=this;s.ns=E,o.fn.init.call(s,t,n),s._optionsMap={},s._customOptions={},s._wrapper(),s._tagList(),s._input(),s._textContainer(),s._loader(),s._clearButton(),s._tabindex(s.input),t=s.element.attr("multiple","multiple").hide(),n=s.options,n.placeholder||(n.placeholder=t.data("placeholder")),r=t.attr(c),r&&(s._tagID=r+"_tag_active",r+="_taglist",s.tagList.attr(c,r)),s._aria(r),s._dataSource(),s._ignoreCase(),s._popup(),s._tagTemplate(),s.requireValueMapper(s.options),s._initList(),s._reset(),s._enable(),s._placeholder(),n.autoBind?s.dataSource.fetch():n.value&&s._preselect(n.value),a=e(s.element).parents("fieldset").is(":disabled"),a&&s.enable(!1),i.notify(s)},options:{name:"MultiSelect",tagMode:"multiple",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:1,enforceMinLength:!1,delay:100,value:null,maxSelectedItems:null,placeholder:"",height:200,animation:{},virtual:!1,itemTemplate:"",tagTemplate:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",clearButton:!0},events:[m,g,v,b,k,"filtering","dataBinding","dataBound"],setDataSource:function(e){this.options.dataSource=e,this._state="",this._dataSource(),this.listView.setDataSource(this.dataSource),this.options.autoBind&&this.dataSource.fetch()},setOptions:function(e){var t=this._listOptions(e);o.fn.setOptions.call(this,e),this.listView.setOptions(t),this._accessors(),this._aria(this.tagList.attr(c)),this._tagTemplate()},currentTag:function(e){var n=this;return e===t?n._currentTag:(n._currentTag&&(n._currentTag.removeClass(y).removeAttr(c),n.input.removeAttr("aria-activedescendant")),e&&(e.addClass(y).attr(c,n._tagID),n.input.attr("aria-activedescendant",n._tagID)),n._currentTag=e,t)},dataItems:function(){return this.listView.selectedDataItems()},destroy:function(){var e=this,t=e.ns;clearTimeout(e._busy),clearTimeout(e._typingTimeout),e.wrapper.off(t),e.tagList.off(t),e.input.off(t),e._clear.off(t),o.fn.destroy.call(e)},_activateItem:function(){o.fn._activateItem.call(this),this.currentTag(null)},_listOptions:function(t){var n=this,r=o.fn._listOptions.call(n,e.extend(t,{selectedItemChange:d(n._selectedItemChange,n),selectable:"multiple"})),a=this.options.itemTemplate||this.options.template,s=r.itemTemplate||a||r.template;return s||(s="#:"+i.expr(r.dataTextField,"data")+"#"),r.template=s,r},_setListValue:function(){o.fn._setListValue.call(this,this._initialValues.slice(0))},_listChange:function(e){var n,i=this.dataSource.flatView(),r=this._optionsMap,o=this._value;for(this._state===p&&(this._state=""),n=0;n<e.added.length;n++)if(r[o(e.added[n].dataItem)]===t){this._render(i);break}this._selectValue(e.added,e.removed)},_selectedItemChange:function(e){var t,n,i=e.items;for(n=0;n<i.length;n++)t=i[n],this.tagList.children().eq(t.index).children("span:first").html(this.tagTextTemplate(t.item))},_wrapperMousedown:function(t){var n=this,r="input"!==t.target.nodeName.toLowerCase(),o=e(t.target),a=o.hasClass("k-select")||o.hasClass("k-icon");a&&(a=!o.closest(".k-select").children(".k-i-arrow-s").length),!r||a&&i.support.mobileOS||t.preventDefault(),a||(n.input[0]!==s()&&r&&n.input.focus(),1===n.options.minLength&&n.open())},_inputFocus:function(){this._placeholder(!1),this.wrapper.addClass(y)},_inputFocusout:function(){var e=this;clearTimeout(e._typingTimeout),e.wrapper.removeClass(y),e._placeholder(!e.listView.selectedDataItems()[0],!0),e.close(),e._state===f&&(e._state=h,e.listView.skipUpdate(!0)),e.element.blur()},_removeTag:function(e){var n,i,r=this,o=r._state,a=e.index(),s=r.listView,l=s.value()[a],d=r.listView.selectedDataItems()[a],c=r._customOptions[l];return r.trigger(k,{dataItem:d,item:e})?(r._close(),t):(c!==t||o!==h&&o!==f||(c=r._optionsMap[l]),i=function(){r.currentTag(null),r._change(),r._close()},c===t?s.select(s.select()[a]).done(i):(n=r.element[0].children[c],n.selected=!1,s.removeAt(a),e.remove(),i()),t)},_tagListClick:function(t){var n=e(t.currentTarget);n.children(".k-i-arrow-s").length||this._removeTag(n.closest(u))},_clearClick:function(){this.value(null),this.trigger("change")},_editable:function(t){var n=this,i=t.disable,r=t.readonly,o=n.wrapper.off(E),a=n.tagList.off(E),s=n.element.add(n.input.off(E));r||i?(i?o.addClass(T):o.removeClass(T),s.attr(S,i).attr(D,r).attr(w,i)):(o.removeClass(T).on(M,n._toggleHover).on("mousedown"+E+" touchend"+E,d(n._wrapperMousedown,n)),n.input.on(R,d(n._keydown,n)).on("paste"+E,d(n._search,n)).on("focus"+E,d(n._inputFocus,n)).on("focusout"+E,d(n._inputFocusout,n)),n._clear.on("click"+E,d(n._clearClick,n)),s.removeAttr(S).removeAttr(D).attr(w,!1),a.on(I,u,function(){e(this).addClass(C)}).on(A,u,function(){e(this).removeClass(C)}).on(F,"li.k-button .k-select",d(n._tagListClick,n)))},_close:function(){var e=this;e.options.autoClose?e.close():e.popup.position()},_filterSource:function(e,t){t||(t=this._retrieveData),this._retrieveData=!1,o.fn._filterSource.call(this,e,t)},close:function(){this.popup.close()},open:function(){var e=this;e._request&&(e._retrieveData=!1),e._retrieveData||!e.listView.bound()||e._state===h?(e._open=!0,e._state=p,e.listView.skipUpdate(!0),e._filterSource()):e._allowOpening()&&(e.popup.open(),e._focusItem())},toggle:function(e){e=e!==t?e:!this.popup.visible(),this[e?m:g]()},refresh:function(){this.listView.refresh()},_listBound:function(){var e=this,n=e.dataSource.flatView(),i=e.listView.skip();e._render(n),e._renderFooter(),e._renderNoData(),e._toggleNoData(!n.length),e._resizePopup(),e._open&&(e._open=!1,e.toggle(e._allowOpening())),e.popup.position(),!e.options.highlightFirst||i!==t&&0!==i||e.listView.focusFirst(),e._touchScroller&&e._touchScroller.reset(),e._hideBusy(),e._makeUnselectable(),e.trigger("dataBound")},_inputValue:function(){var e=this,t=e.input.val();return e.options.placeholder===t&&(t=""),t},value:function(e){var n=this,i=n.listView,r=i.value().slice(),o=n.options.maxSelectedItems,a=i.bound()&&i.isFiltered();return e===t?r:(n.requireValueMapper(n.options,e),e=n._normalizeValues(e),null!==o&&e.length>o&&(e=e.slice(0,o)),a&&n._clearFilter(),i.value(e),n._old=i.value(),a||n._fetchData(),t)},_preselect:function(t,n){var r=this;H(t)||t instanceof i.data.ObservableArray||(t=[t]),(e.isPlainObject(t[0])||t[0]instanceof i.data.ObservableObject||!r.options.dataValueField)&&(r.dataSource.data(t),r.value(n||r._initialValues),r._retrieveData=!0)},_setOption:function(e,t){var n=this.element[0].children[this._optionsMap[e]];n&&(n.selected=t)},_fetchData:function(){var e=this,t=!!e.dataSource.view().length,n=0===e.listView.value().length;n||e._request||(e._retrieveData||!e._fetch&&!t)&&(e._fetch=!0,e._retrieveData=!1,e.dataSource.read().done(function(){e._fetch=!1}))},_isBound:function(){return this.listView.bound()&&!this._retrieveData},_dataSource:function(){var e=this,t=e.element,n=e.options,r=n.dataSource||{};r=H(r)?{data:r}:r,r.select=t,r.fields=[{field:n.dataTextField},{field:n.dataValueField}],e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._progressHandler=d(e._showBusy,e),e._errorHandler=d(e._hideBusy,e)),e.dataSource=i.data.DataSource.create(r).bind(_,e._progressHandler).bind("error",e._errorHandler)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initialValues),t._placeholder()})},t._form=r.on("reset",t._resetHandler))},_initValue:function(){var e=this.options.value||this.element.val();this._old=this._initialValues=this._normalizeValues(e)},_normalizeValues:function(t){var n=this;return null===t?t=[]:t&&e.isPlainObject(t)?t=[n._value(t)]:t&&e.isPlainObject(t[0])?t=e.map(t,function(e){return n._value(e)}):H(t)||t instanceof l?H(t)&&(t=t.slice()):t=[t],t},_change:function(){var e=this,t=e.value();n(t,e._old)||(e._old=t.slice(),e.trigger(v),e.element.trigger(v))},_click:function(e){var t=this,n=e.item;e.preventDefault(),t._select(n).done(function(){t._change(),t._close()})},_keydown:function(n){var r,o=this,s=n.keyCode,l=o._currentTag,d=o.listView,c=d.focus(),u=o.input.val(),h=i.support.isRtl(o.wrapper),f=o.popup.visible();if(s===a.DOWN){if(n.preventDefault(),!f)return o.open(),c||d.focusFirst(),t;c?(d.focusNext(),d.focus()||d.focusLast()):d.focusFirst()}else if(s===a.UP)f&&(c&&d.focusPrev(),d.focus()||o.close()),n.preventDefault();else if(s===a.LEFT&&!h||s===a.RIGHT&&h)u||(l=l?l.prev():e(o.tagList[0].lastChild),l[0]&&o.currentTag(l));else if(s===a.RIGHT&&!h||s===a.LEFT&&h)!u&&l&&(l=l.next(),o.currentTag(l[0]?l:null));else if(s===a.ENTER&&f)o._select(c).done(function(){o._change(),o._close()}),n.preventDefault();else if(s===a.ESC)f?n.preventDefault():o.currentTag(null),o.close();else if(s===a.HOME)f?d.focusFirst():u||(l=o.tagList[0].firstChild,l&&o.currentTag(e(l)));else if(s===a.END)f?d.focusLast():u||(l=o.tagList[0].lastChild,l&&o.currentTag(e(l)));else if(s!==a.DELETE&&s!==a.BACKSPACE||u)!o.popup.visible()||s!==a.PAGEDOWN&&s!==a.PAGEUP?(clearTimeout(o._typingTimeout),setTimeout(function(){o._scale()}),o._search()):(n.preventDefault(),r=s===a.PAGEDOWN?1:-1,d.scrollWith(r*d.screenHeight()));else{if("single"===o.options.tagMode)return d.value([]),o._change(),o._close(),t;s!==a.BACKSPACE||l||(l=e(o.tagList[0].lastChild)),l&&l[0]&&o._removeTag(l)}},_hideBusy:function(){var e=this;clearTimeout(e._busy),e.input.attr("aria-busy",!1),e._loading.addClass(x),e._request=!1,e._busy=null,e._showClear()},_showBusyHandler:function(){this.input.attr("aria-busy",!0),this._loading.removeClass(x),this._hideClear()},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(d(e._showBusyHandler,e),100))},_placeholder:function(e,n){var r=this,o=r.input,a=s(),l=r.options.placeholder,d=o.val(),c=o[0]===a,u=d.length;c&&!r.options.autoClose&&d!==l||(u=0,d=""),e===t&&(e=!1,o[0]!==a&&(e=!r.listView.selectedDataItems()[0])),r._prev=d,o.toggleClass("k-readonly",e).val(e?l:d),c&&!n&&i.caret(o[0],u,u),r._scale()},_scale:function(){var e,t=this,n=t.wrapper,i=n.width(),r=t._span.text(t.input.val());n.is(":visible")?e=r.width()+25:(r.appendTo(document.documentElement),i=e=r.width()+25,r.appendTo(n)),t.input.width(e>i?i:e)},_option:function(e,n,r){var o="<option";return e!==t&&(e+="",e.indexOf('"')!==-1&&(e=e.replace(z,"&quot;")),o+=' value="'+e+'"'),r&&(o+=" selected"),o+=">",n!==t&&(o+=i.htmlEncode(n)),o+="</option>"},_render:function(e){var t,n,i,r,o,a,s=this.listView.selectedDataItems(),l=this.listView.value(),d=e.length,c="";for(l.length!==s.length&&(s=this._buildSelectedItems(l)),o={},a={},r=0;r<d;r++)n=e[r],i=this._value(n),t=this._selectedItemIndex(i,s),t!==-1&&s.splice(t,1),a[i]=r,c+=this._option(i,this._text(n),t!==-1);if(s.length)for(r=0;r<s.length;r++)n=s[r],i=this._value(n),o[i]=d,a[i]=d,d+=1,c+=this._option(i,this._text(n),!0);this._customOptions=o,this._optionsMap=a,this.element.html(c)},_buildSelectedItems:function(e){var t,n,i=this.options.dataValueField,r=this.options.dataTextField,o=[];for(n=0;n<e.length;n++)t={},t[i]=e[n],t[r]=e[n],o.push(t);return o},_selectedItemIndex:function(e,t){for(var n=this._value,i=0;i<t.length;i++)if(e===n(t[i]))return i;return-1},_search:function(){var e=this;e._typingTimeout=setTimeout(function(){var t=e.input.val();e._prev!==t&&(e._prev=t,e.search(t))},e.options.delay)},_allowOpening:function(){return this._allowSelection()&&o.fn._allowOpening.call(this)},_allowSelection:function(){var e=this.options.maxSelectedItems;return null===e||e>this.listView.value().length},_angularTagItems:function(t){var n=this;n.angular(t,function(){return{elements:n.tagList[0].children,data:e.map(n.dataItems(),function(e){return{dataItem:e}})}})},_selectValue:function(e,t){var n,i,r,o=this,a=o.value(),s=o.dataSource.total(),l=o.tagList,d=o._value;if(o._angularTagItems("cleanup"),"multiple"===o.options.tagMode){for(r=t.length-1;r>-1;r--)n=t[r],l[0].removeChild(l[0].children[n.position]),o._setOption(d(n.dataItem),!1);for(r=0;r<e.length;r++)i=e[r],l.append(o.tagTemplate(i.dataItem)),o._setOption(d(i.dataItem),!0)}else{for((!o._maxTotal||o._maxTotal<s)&&(o._maxTotal=s),l.html(""),a.length&&l.append(o.tagTemplate({values:a,dataItems:o.dataItems(),maxTotal:o._maxTotal,currentTotal:s})),r=t.length-1;r>-1;r--)o._setOption(d(t[r].dataItem),!1);for(r=0;r<e.length;r++)o._setOption(d(e[r].dataItem),!0)}o._angularTagItems("compile"),o._placeholder()},_select:function(t){var n,i,r,o,a=e.Deferred().resolve();return t?(n=this,i=n.listView,r=i.dataItemByIndex(i.getElementIndex(t)),o=t.hasClass("k-state-selected"),n._state===p&&(n._state=""),n._allowSelection()?n.trigger(o?k:b,{dataItem:r,item:t})?(n._close(),a):i.select(t).done(function(){n._placeholder(),n._state===f&&(n._state=h,i.skipUpdate(!0))}):a):a},_input:function(){var t=this,n=t.element,i=n[0].accessKey,r=t._innerWrapper.children("input.k-input");r[0]||(r=e('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper)),n.removeAttr("accesskey"),t._focused=t.input=r.attr({accesskey:i,autocomplete:"off",role:"listbox",title:n[0].title,"aria-expanded":!1})},_tagList:function(){var t=this,n=t._innerWrapper.children("ul");n[0]||(n=e('<ul role="listbox" deselectable="on" class="k-reset"/>').appendTo(t._innerWrapper)),t.tagList=n},_tagTemplate:function(){var e,t=this,n=t.options,r=n.tagTemplate,o=n.dataSource,a="multiple"===n.tagMode;t.element[0].length&&!o&&(n.dataTextField=n.dataTextField||"text",n.dataValueField=n.dataValueField||"value"),e=a?i.template("#:"+i.expr(n.dataTextField,"data")+"#",{useWithBlock:!1}):i.template("#:values.length# item(s) selected"),t.tagTextTemplate=r=r?i.template(r):e,t.tagTemplate=function(e){return'<li class="k-button" deselectable="on"><span deselectable="on">'+r(e)+'</span><span unselectable="on" aria-label="'+(a?"delete":"open")+'" class="k-select"><span class="k-icon '+(a?"k-i-close":"k-i-arrow-s")+'"></span></span></li>'}},_loader:function(){this._loading=e('<span class="k-icon k-i-loading '+x+'"></span>').insertAfter(this.input)},_clearButton:function(){this._clear=e('<span deselectable="on" class="k-icon k-i-close" title="clear"></span>').attr({role:"button",tabIndex:-1}),this.options.clearButton&&this._clear.insertAfter(this.input)},_textContainer:function(){var t=i.getComputedStyles(this.input[0],N);t.position="absolute",t.visibility="hidden",t.top=-3333,t.left=-3333,this._span=e("<span/>").css(t).appendTo(this.wrapper)},_wrapper:function(){var t=this,n=t.element,i=n.parent("span.k-multiselect");i[0]||(i=n.wrap('<div class="k-widget k-multiselect k-header" deselectable="on" />').parent(),i[0].style.cssText=n[0].style.cssText,i[0].title=n[0].title,e('<div class="k-multiselect-wrap k-floatwrap" deselectable="on" />').insertBefore(n)),t.wrapper=i.addClass(n[0].className).css("display",""),t._innerWrapper=e(i[0].firstChild)}});r.plugin(P)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.slider.min",["kendo.draganddrop.min"],e)}(function(){return function(e,t){function n(e,t,n){var i=n?" k-slider-horizontal":" k-slider-vertical",r=e.style?e.style:t.attr("style"),o=t.attr("class")?" "+t.attr("class"):"",a="";return"bottomRight"==e.tickPlacement?a=" k-slider-bottomright":"topLeft"==e.tickPlacement&&(a=" k-slider-topleft"),r=r?" style='"+r+"'":"","<div class='k-widget k-slider"+i+o+"'"+r+"><div class='k-slider-wrap"+(e.showButtons?" k-slider-buttons":"")+a+"'></div></div>"}function i(e,t,n){var i="";return i="increase"==t?n?"k-i-arrow-e":"k-i-arrow-n":n?"k-i-arrow-w":"k-i-arrow-s","<a class='k-button k-button-"+t+"' title='"+e[t+"ButtonTitle"]+"' aria-label='"+e[t+"ButtonTitle"]+"'><span class='k-icon "+i+"'></span></a>"}function r(e,t){var n,i="<ul class='k-reset k-slider-items'>",r=T.floor(c(t/e.smallStep))+1;for(n=0;n<r;n++)i+="<li class='k-tick' role='presentation'>&nbsp;</li>";return i+="</ul>"}function o(e,t){var n=t.is("input")?1:2,i=2==n?e.leftDragHandleTitle:e.dragHandleTitle;return"<div class='k-slider-track'><div class='k-slider-selection'><!-- --></div><a href='#' class='k-draghandle' title='"+i+"' role='slider' aria-valuemin='"+e.min+"' aria-valuemax='"+e.max+"' aria-valuenow='"+(n>1?e.selectionStart||e.min:e.value||e.min)+"'>Drag</a>"+(n>1?"<a href='#' class='k-draghandle' title='"+e.rightDragHandleTitle+"'role='slider' aria-valuemin='"+e.min+"' aria-valuemax='"+e.max+"' aria-valuenow='"+(e.selectionEnd||e.max)+"'>Drag</a>":"")+"</div>"}function a(e){return function(t){return t+e}}function s(e){return function(){return e}}function l(e){return(e+"").replace(".",m.cultures.current.numberFormat["."])}function d(e){var t=""+e,n=0;return t=t.split("."),t[1]&&(n=t[1].length),n=n>10?10:n}function c(e){var t,n;return e=parseFloat(e,10),t=d(e),n=T.pow(10,t||0),T.round(e*n)/n}function u(e,n){var i=y(e.getAttribute(n));return null===i&&(i=t),i}function h(e){return typeof e!==Q}function f(e){return 1e4*e}var p,m=window.kendo,g=m.ui.Widget,v=m.ui.Draggable,_=m._outerWidth,b=m._outerHeight,k=e.extend,w=m.format,y=m.parseFloat,x=e.proxy,C=e.isArray,T=Math,S=m.support,D=S.pointers,E=S.msPointers,F="change",R="slide",I=".slider",A="touchstart"+I+" mousedown"+I,M=D?"pointerdown"+I:E?"MSPointerDown"+I:A,z="touchend"+I+" mouseup"+I,H=D?"pointerup":E?"MSPointerUp"+I:z,N="moveSelection",P="keydown"+I,L="click"+I,B="mouseover"+I,O="focus"+I,V="blur"+I,W=".k-draghandle",U=".k-slider-track",q=".k-tick",j="k-state-selected",$="k-state-focused",G="k-state-default",Y="k-state-disabled",K="disabled",Q="undefined",X="tabindex",J=m.getTouches,Z=g.extend({init:function(e,t){var n,i=this;if(g.fn.init.call(i,e,t),t=i.options,i._distance=c(t.max-t.min),i._isHorizontal="horizontal"==t.orientation,i._isRtl=i._isHorizontal&&m.support.isRtl(e),i._position=i._isHorizontal?"left":"bottom",i._sizeFn=i._isHorizontal?"width":"height",i._outerSize=i._isHorizontal?_:b,t.tooltip.format=t.tooltip.enabled?t.tooltip.format||"{0}":"{0}",t.smallStep<=0)throw Error("Kendo UI Slider smallStep must be a positive number.");i._createHtml(),i.wrapper=i.element.closest(".k-slider"),i._trackDiv=i.wrapper.find(U),i._setTrackDivWidth(),i._maxSelection=i._trackDiv[i._sizeFn](),i._sliderItemsInit(),i._reset(),i._tabindex(i.wrapper.find(W)),i[t.enabled?"enable":"disable"](),n=m.support.isRtl(i.wrapper)?-1:1,i._keyMap={37:a(-1*n*t.smallStep),40:a(-t.smallStep),39:a(1*n*t.smallStep),38:a(+t.smallStep),35:s(t.max),36:s(t.min),33:a(+t.largeStep),34:a(-t.largeStep)},m.notify(i)},events:[F,R],options:{enabled:!0,min:0,max:10,smallStep:1,largeStep:5,orientation:"horizontal",tickPlacement:"both",tooltip:{enabled:!0,format:"{0}"}},_resize:function(){this._setTrackDivWidth(),this.wrapper.find(".k-slider-items").remove(),this._maxSelection=this._trackDiv[this._sizeFn](),this._sliderItemsInit(),this._refresh(),this.options.enabled&&this.enable(!0)},_sliderItemsInit:function(){var e=this,t=e.options,n=e._maxSelection/((t.max-t.min)/t.smallStep),i=e._calculateItemsWidth(T.floor(e._distance/t.smallStep));"none"!=t.tickPlacement&&n>=2&&(e._trackDiv.before(r(t,e._distance)),e._setItemsWidth(i),e._setItemsTitle()),e._calculateSteps(i),"none"!=t.tickPlacement&&n>=2&&t.largeStep>=t.smallStep&&e._setItemsLargeTick()},getSize:function(){return m.dimensions(this.wrapper)},_setTrackDivWidth:function(){var e=this,t=2*parseFloat(e._trackDiv.css(e._isRtl?"right":e._position),10);e._trackDiv[e._sizeFn](e.wrapper[e._sizeFn]()-2-t)},_setItemsWidth:function(t){var n,i=this,r=i.options,o=0,a=t.length-1,s=i.wrapper.find(q),l=0,d=2,c=s.length,u=0;for(n=0;n<c-2;n++)e(s[n+1])[i._sizeFn](t[n]);if(i._isHorizontal?(e(s[o]).addClass("k-first")[i._sizeFn](t[a-1]),e(s[a]).addClass("k-last")[i._sizeFn](t[a])):(e(s[a]).addClass("k-first")[i._sizeFn](t[a]),e(s[o]).addClass("k-last")[i._sizeFn](t[a-1])),i._distance%r.smallStep!==0&&!i._isHorizontal){for(n=0;n<t.length;n++)u+=t[n];l=i._maxSelection-u,l+=parseFloat(i._trackDiv.css(i._position),10)+d,i.wrapper.find(".k-slider-items").css("padding-top",l)}},_setItemsTitle:function(){for(var t=this,n=t.options,i=t.wrapper.find(q),r=n.min,o=i.length,a=t._isHorizontal&&!t._isRtl?0:o-1,s=t._isHorizontal&&!t._isRtl?o:-1,l=t._isHorizontal&&!t._isRtl?1:-1;a-s!==0;a+=l)e(i[a]).attr("title",w(n.tooltip.format,c(r))),r+=n.smallStep},_setItemsLargeTick:function(){var t,n,i,r=this,o=r.options,a=r.wrapper.find(q),s=0;if(f(o.largeStep)%f(o.smallStep)===0||r._distance/o.largeStep>=3)for(r._isHorizontal||r._isRtl||(a=e.makeArray(a).reverse()),s=0;s<a.length;s++)t=e(a[s]),n=r._values[s],i=c(f(n-this.options.min)),i%f(o.smallStep)===0&&i%f(o.largeStep)===0&&(t.addClass("k-tick-large").html("<span class='k-label'>"+t.attr("title")+"</span>"),0!==s&&s!==a.length-1&&t.css("line-height",t[r._sizeFn]()+"px"))},_calculateItemsWidth:function(e){var t,n,i,r=this,o=r.options,a=parseFloat(r._trackDiv.css(r._sizeFn))+1,s=a/r._distance;for(r._distance/o.smallStep-T.floor(r._distance/o.smallStep)>0&&(a-=r._distance%o.smallStep*s),t=a/e,n=[],i=0;i<e-1;i++)n[i]=t;return n[e-1]=n[e]=t/2,r._roundWidths(n)},_roundWidths:function(e){var t,n=0,i=e.length;for(t=0;t<i;t++)n+=e[t]-T.floor(e[t]),e[t]=T.floor(e[t]);return n=T.round(n),this._addAdditionalSize(n,e)},_addAdditionalSize:function(e,t){if(0===e)return t;var n,i=parseFloat(t.length-1)/parseFloat(1==e?e:e-1);for(n=0;n<e;n++)t[parseInt(T.round(i*n),10)]+=1;return t},_calculateSteps:function(e){var t,n=this,i=n.options,r=i.min,o=0,a=T.ceil(n._distance/i.smallStep),s=1;if(a+=n._distance/i.smallStep%1===0?1:0,e.splice(0,0,2*e[a-2]),e.splice(a-1,1,2*e.pop()),n._pixelSteps=[o],n._values=[r],0!==a){for(;s<a;)o+=(e[s-1]+e[s])/2,n._pixelSteps[s]=o,r+=i.smallStep,n._values[s]=c(r),s++;t=n._distance%i.smallStep===0?a-1:a,n._pixelSteps[t]=n._maxSelection,n._values[t]=i.max,n._isRtl&&(n._pixelSteps.reverse(),n._values.reverse())}},_getValueFromPosition:function(e,t){var n,i=this,r=i.options,o=T.max(r.smallStep*(i._maxSelection/i._distance),0),a=0,s=o/2;if(i._isHorizontal?(a=e-t.startPoint,i._isRtl&&(a=i._maxSelection-a)):a=t.startPoint-e,i._maxSelection-(parseInt(i._maxSelection%o,10)-3)/2<a)return r.max;for(n=0;n<i._pixelSteps.length;n++)if(T.abs(i._pixelSteps[n]-a)-1<=s)return c(i._values[n])},_getFormattedValue:function(e,t){var n,i,r,o=this,a="",s=o.options.tooltip;return C(e)?(i=e[0],r=e[1]):t&&t.type&&(i=t.selectionStart,r=t.selectionEnd),t&&(n=t.tooltipTemplate),!n&&s.template&&(n=m.template(s.template)),C(e)||t&&t.type?n?a=n({selectionStart:i,selectionEnd:r}):(i=w(s.format,i),r=w(s.format,r),a=i+" - "+r):(t&&(t.val=e),a=n?n({value:e}):w(s.format,e)),a},_getDraggableArea:function(){var e=this,t=m.getOffset(e._trackDiv);return{startPoint:e._isHorizontal?t.left:t.top+e._maxSelection,endPoint:e._isHorizontal?t.left+e._maxSelection:t.top}},_createHtml:function(){var e=this,t=e.element,r=e.options,a=t.find("input");2==a.length?(a.eq(0).prop("value",l(r.selectionStart)),a.eq(1).prop("value",l(r.selectionEnd))):t.prop("value",l(r.value)),t.wrap(n(r,t,e._isHorizontal)).hide(),r.showButtons&&t.before(i(r,"increase",e._isHorizontal)).before(i(r,"decrease",e._isHorizontal)),t.before(o(r,t))},_focus:function(t){var n=this,i=t.target,r=n.value(),o=n._drag;o||(i==n.wrapper.find(W).eq(0)[0]?(o=n._firstHandleDrag,n._activeHandle=0):(o=n._lastHandleDrag,n._activeHandle=1),r=r[n._activeHandle]),e(i).addClass($+" "+j),o&&(n._activeHandleDrag=o,o.selectionStart=n.options.selectionStart,o.selectionEnd=n.options.selectionEnd,o._updateTooltip(r))},_focusWithMouse:function(t){t=e(t);var n=this,i=t.is(W)?t.index():0;window.setTimeout(function(){n.wrapper.find(W)[2==i?1:0].focus()},1),n._setTooltipTimeout()},_blur:function(t){var n=this,i=n._activeHandleDrag;e(t.target).removeClass($+" "+j),i&&(i._removeTooltip(),delete n._activeHandleDrag,delete n._activeHandle)},_setTooltipTimeout:function(){var e=this;e._tooltipTimeout=window.setTimeout(function(){var t=e._drag||e._activeHandleDrag;t&&t._removeTooltip()},300)},_clearTooltipTimeout:function(){var e,t=this;window.clearTimeout(this._tooltipTimeout),e=t._drag||t._activeHandleDrag,e&&e.tooltipDiv&&e.tooltipDiv.stop(!0,!1).css("opacity",1)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._form=r.on("reset",x(t._formResetHandler,t)))},destroy:function(){this._form&&this._form.off("reset",this._formResetHandler),g.fn.destroy.call(this)}}),ee=Z.extend({init:function(n,i){var r,o=this;n.type="text",i=k({},{value:u(n,"value"),min:u(n,"min"),max:u(n,"max"),smallStep:u(n,"step")},i),n=e(n),i&&i.enabled===t&&(i.enabled=!n.is("[disabled]")),Z.fn.init.call(o,n,i),i=o.options,h(i.value)&&null!==i.value||(i.value=i.min,n.prop("value",l(i.min))),i.value=T.max(T.min(i.value,i.max),i.min),r=o.wrapper.find(W),this._selection=new ee.Selection(r,o,i),o._drag=new ee.Drag(r,"",o,i)},options:{name:"Slider",showButtons:!0,increaseButtonTitle:"Increase",decreaseButtonTitle:"Decrease",dragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},value:null},enable:function(n){var i,r,o,a=this,s=a.options;a.disable(),n!==!1&&(a.wrapper.removeClass(Y).addClass(G),a.wrapper.find("input").removeAttr(K),i=function(n){var i,r,o,s=J(n)[0];if(s){if(i=a._isHorizontal?s.location.pageX:s.location.pageY,r=a._getDraggableArea(),o=e(n.target),o.hasClass("k-draghandle"))return o.addClass($+" "+j),t;a._update(a._getValueFromPosition(i,r)),a._focusWithMouse(n.target),a._drag.dragstart(n),n.preventDefault()}},a.wrapper.find(q+", "+U).on(M,i).end().on(M,function(){e(document.documentElement).one("selectstart",m.preventDefault)}).on(H,function(){a._drag._end()}),a.wrapper.find(W).attr(X,0).on(z,function(){a._setTooltipTimeout()}).on(L,function(e){a._focusWithMouse(e.target),e.preventDefault()}).on(O,x(a._focus,a)).on(V,x(a._blur,a)),r=x(function(e){var t=a._nextValueByIndex(a._valueIndex+1*e);a._setValueInRange(t),a._drag._updateTooltip(t)},a),s.showButtons&&(o=x(function(e,t){this._clearTooltipTimeout(),(1===e.which||S.touch&&0===e.which)&&(r(t),this.timeout=setTimeout(x(function(){this.timer=setInterval(function(){r(t)},60)},this),200))},a),a.wrapper.find(".k-button").on(z,x(function(e){this._clearTimer(),a._focusWithMouse(e.target)},a)).on(B,function(t){
e(t.currentTarget).addClass("k-state-hover")}).on("mouseout"+I,x(function(t){e(t.currentTarget).removeClass("k-state-hover"),this._clearTimer()},a)).eq(0).on(A,x(function(e){o(e,1)},a)).click(!1).end().eq(1).on(A,x(function(e){o(e,-1)},a)).click(m.preventDefault)),a.wrapper.find(W).off(P,!1).on(P,x(this._keydown,a)),s.enabled=!0)},disable:function(){var t=this;t.wrapper.removeClass(G).addClass(Y),e(t.element).prop(K,K),t.wrapper.find(".k-button").off(A).on(A,m.preventDefault).off(z).on(z,m.preventDefault).off("mouseleave"+I).on("mouseleave"+I,m.preventDefault).off(B).on(B,m.preventDefault),t.wrapper.find(q+", "+U).off(M).off(H),t.wrapper.find(W).attr(X,-1).off(z).off(P).off(L).off(O).off(V),t.options.enabled=!1},_update:function(e){var t=this,n=t.value()!=e;t.value(e),n&&t.trigger(F,{value:t.options.value})},value:function(e){var n=this,i=n.options;return e=c(e),isNaN(e)?i.value:(e>=i.min&&e<=i.max&&i.value!=e&&(n.element.prop("value",l(e)),i.value=e,n._refreshAriaAttr(e),n._refresh()),t)},_refresh:function(){this.trigger(N,{value:this.options.value})},_refreshAriaAttr:function(e){var t,n=this,i=n._drag;t=i&&i._tooltipDiv?i._tooltipDiv.text():n._getFormattedValue(e,null),this.wrapper.find(W).attr("aria-valuenow",e).attr("aria-valuetext",t)},_clearTimer:function(){clearTimeout(this.timeout),clearInterval(this.timer)},_keydown:function(e){var t=this;e.keyCode in t._keyMap&&(t._clearTooltipTimeout(),t._setValueInRange(t._keyMap[e.keyCode](t.options.value)),t._drag._updateTooltip(t.value()),e.preventDefault())},_setValueInRange:function(e){var n=this,i=n.options;return e=c(e),isNaN(e)?(n._update(i.min),t):(e=T.max(T.min(e,i.max),i.min),n._update(e),t)},_nextValueByIndex:function(e){var t=this._values.length;return this._isRtl&&(e=t-1-e),this._values[T.max(0,T.min(e,t-1))]},_formResetHandler:function(){var e=this,t=e.options.min;setTimeout(function(){var n=e.element[0].value;e.value(""===n||isNaN(n)?t:n)})},destroy:function(){var e=this;Z.fn.destroy.call(e),e.wrapper.off(I).find(".k-button").off(I).end().find(W).off(I).end().find(q+", "+U).off(I).end(),e._drag.draggable.destroy(),e._drag._removeTooltip(!0)}});ee.Selection=function(e,t,n){function i(i){var r=i-n.min,o=t._valueIndex=T.ceil(c(r/n.smallStep)),a=parseInt(t._pixelSteps[o],10),s=t._trackDiv.find(".k-slider-selection"),l=parseInt(t._outerSize(e)/2,10),d=t._isRtl?2:0;s[t._sizeFn](t._isRtl?t._maxSelection-a:a),e.css(t._position,a-l-d)}i(n.value),t.bind([F,R,N],function(e){i(parseFloat(e.value,10))})},ee.Drag=function(e,t,n,i){var r=this;r.owner=n,r.options=i,r.element=e,r.type=t,r.draggable=new v(e,{distance:0,dragstart:x(r._dragstart,r),drag:x(r.drag,r),dragend:x(r.dragend,r),dragcancel:x(r.dragcancel,r)}),e.click(!1)},ee.Drag.prototype={dragstart:function(e){this.owner._activeDragHandle=this,this.draggable.userEvents.cancel(),this._dragstart(e),this.dragend()},_dragstart:function(n){var i=this,r=i.owner,o=i.options;return o.enabled?(this.owner._activeDragHandle=this,r.element.off(B),r.wrapper.find("."+$).removeClass($+" "+j),i.element.addClass($+" "+j),e(document.documentElement).css("cursor","pointer"),i.dragableArea=r._getDraggableArea(),i.step=T.max(o.smallStep*(r._maxSelection/r._distance),0),i.type?(i.selectionStart=o.selectionStart,i.selectionEnd=o.selectionEnd,r._setZIndex(i.type)):i.oldVal=i.val=o.value,i._removeTooltip(!0),i._createTooltip(),t):(n.preventDefault(),t)},_createTooltip:function(){var t,n,i=this,r=i.owner,o=i.options.tooltip,a="",s=e(window);o.enabled&&(o.template&&(t=i.tooltipTemplate=m.template(o.template)),e(".k-slider-tooltip").remove(),i.tooltipDiv=e("<div class='k-widget k-tooltip k-slider-tooltip'><!-- --></div>").appendTo(document.body),a=r._getFormattedValue(i.val||r.value(),i),i.type||(n="k-callout-"+(r._isHorizontal?"s":"e"),i.tooltipInnerDiv="<div class='k-callout "+n+"'><!-- --></div>",a+=i.tooltipInnerDiv),i.tooltipDiv.html(a),i._scrollOffset={top:s.scrollTop(),left:s.scrollLeft()},i.moveTooltip())},drag:function(e){var t,n=this,i=n.owner,r=e.x.location,o=e.y.location,a=n.dragableArea.startPoint,s=n.dragableArea.endPoint;e.preventDefault(),n.val=i._isHorizontal?i._isRtl?n.constrainValue(r,a,s,r<s):n.constrainValue(r,a,s,r>=s):n.constrainValue(o,s,a,o<=s),n.oldVal!=n.val&&(n.oldVal=n.val,n.type?("firstHandle"==n.type?n.selectionStart=n.val<n.selectionEnd?n.val:n.selectionEnd=n.val:n.val>n.selectionStart?n.selectionEnd=n.val:n.selectionStart=n.selectionEnd=n.val,t={values:[n.selectionStart,n.selectionEnd],value:[n.selectionStart,n.selectionEnd]}):t={value:n.val},i.trigger(R,t)),n._updateTooltip(n.val)},_updateTooltip:function(e){var t=this,n=t.options,i=n.tooltip,r="";i.enabled&&(t.tooltipDiv||t._createTooltip(),r=t.owner._getFormattedValue(c(e),t),t.type||(r+=t.tooltipInnerDiv),t.tooltipDiv.html(r),t.moveTooltip())},dragcancel:function(){return this.owner._refresh(),e(document.documentElement).css("cursor",""),this._end()},dragend:function(){var t=this,n=t.owner;return e(document.documentElement).css("cursor",""),t.type?n._update(t.selectionStart,t.selectionEnd):(n._update(t.val),t.draggable.userEvents._disposeAll()),t.draggable.userEvents.cancel(),t._end()},_end:function(){var e=this,t=e.owner;return t._focusWithMouse(e.element),t.element.on(B),!1},_removeTooltip:function(t){var n=this,i=n.owner;n.tooltipDiv&&i.options.tooltip.enabled&&i.options.enabled&&(t?(n.tooltipDiv.remove(),n.tooltipDiv=null):n.tooltipDiv.fadeOut("slow",function(){e(this).remove(),n.tooltipDiv=null}))},moveTooltip:function(){var t,n,i,r,o=this,a=o.owner,s=0,l=0,d=o.element,c=m.getOffset(d),u=8,h=e(window),f=o.tooltipDiv.find(".k-callout"),p=_(o.tooltipDiv),g=b(o.tooltipDiv);o.type?(t=a.wrapper.find(W),c=m.getOffset(t.eq(0)),n=m.getOffset(t.eq(1)),a._isHorizontal?(s=n.top,l=c.left+(n.left-c.left)/2):(s=c.top+(n.top-c.top)/2,l=n.left),r=_(t.eq(0))+2*u):(s=c.top,l=c.left,r=_(d)+2*u),a._isHorizontal?(l-=parseInt((p-a._outerSize(d))/2,10),s-=g+f.height()+u):(s-=parseInt((g-a._outerSize(d))/2,10),l-=p+f.width()+u),a._isHorizontal?(i=o._flip(s,g,r,b(h)+o._scrollOffset.top),s+=i,l+=o._fit(l,p,_(h)+o._scrollOffset.left)):(i=o._flip(l,p,r,_(h)+o._scrollOffset.left),s+=o._fit(s,g,b(h)+o._scrollOffset.top),l+=i),i>0&&f&&(f.removeClass(),f.addClass("k-callout k-callout-"+(a._isHorizontal?"n":"w"))),o.tooltipDiv.css({top:s,left:l})},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),e<0&&(i=-e),i},_flip:function(e,t,n,i){var r=0;return e+t>i&&(r+=-(n+t)),e+r<0&&(r+=n+t),r},constrainValue:function(e,t,n,i){var r=this,o=0;return o=t<e&&e<n?r.owner._getValueFromPosition(e,r.dragableArea):i?r.options.max:r.options.min}},m.ui.plugin(ee),p=Z.extend({init:function(n,i){var r,o=this,a=e(n).find("input"),s=a.eq(0)[0],d=a.eq(1)[0];s.type="text",d.type="text",i&&i.showButtons&&(window.console&&window.console.warn("showbuttons option is not supported for the range slider, ignoring"),i.showButtons=!1),i=k({},{selectionStart:u(s,"value"),min:u(s,"min"),max:u(s,"max"),smallStep:u(s,"step")},{selectionEnd:u(d,"value"),min:u(d,"min"),max:u(d,"max"),smallStep:u(d,"step")},i),i&&i.enabled===t&&(i.enabled=!a.is("[disabled]")),Z.fn.init.call(o,n,i),i=o.options,h(i.selectionStart)&&null!==i.selectionStart||(i.selectionStart=i.min,a.eq(0).prop("value",l(i.min))),h(i.selectionEnd)&&null!==i.selectionEnd||(i.selectionEnd=i.max,a.eq(1).prop("value",l(i.max))),r=o.wrapper.find(W),this._selection=new p.Selection(r,o,i),o._firstHandleDrag=new ee.Drag(r.eq(0),"firstHandle",o,i),o._lastHandleDrag=new ee.Drag(r.eq(1),"lastHandle",o,i)},options:{name:"RangeSlider",leftDragHandleTitle:"drag",rightDragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},selectionStart:null,selectionEnd:null},enable:function(n){var i,r=this,o=r.options;r.disable(),n!==!1&&(r.wrapper.removeClass(Y).addClass(G),r.wrapper.find("input").removeAttr(K),i=function(n){var i,a,s,l,d,c,u,h=J(n)[0];if(h){if(i=r._isHorizontal?h.location.pageX:h.location.pageY,a=r._getDraggableArea(),s=r._getValueFromPosition(i,a),l=e(n.target),l.hasClass("k-draghandle"))return r.wrapper.find("."+$).removeClass($+" "+j),l.addClass($+" "+j),t;s<o.selectionStart?(d=s,c=o.selectionEnd,u=r._firstHandleDrag):s>r.selectionEnd?(d=o.selectionStart,c=s,u=r._lastHandleDrag):s-o.selectionStart<=o.selectionEnd-s?(d=s,c=o.selectionEnd,u=r._firstHandleDrag):(d=o.selectionStart,c=s,u=r._lastHandleDrag),u.dragstart(n),r._setValueInRange(d,c),r._focusWithMouse(u.element)}},r.wrapper.find(q+", "+U).on(M,i).end().on(M,function(){e(document.documentElement).one("selectstart",m.preventDefault)}).on(H,function(){r._activeDragHandle&&r._activeDragHandle._end()}),r.wrapper.find(W).attr(X,0).on(z,function(){r._setTooltipTimeout()}).on(L,function(e){r._focusWithMouse(e.target),e.preventDefault()}).on(O,x(r._focus,r)).on(V,x(r._blur,r)),r.wrapper.find(W).off(P,m.preventDefault).eq(0).on(P,x(function(e){this._keydown(e,"firstHandle")},r)).end().eq(1).on(P,x(function(e){this._keydown(e,"lastHandle")},r)),r.options.enabled=!0)},disable:function(){var e=this;e.wrapper.removeClass(G).addClass(Y),e.wrapper.find("input").prop(K,K),e.wrapper.find(q+", "+U).off(M).off(H),e.wrapper.find(W).attr(X,-1).off(z).off(P).off(L).off(O).off(V),e.options.enabled=!1},_keydown:function(e,t){var n,i,r,o=this,a=o.options.selectionStart,s=o.options.selectionEnd;e.keyCode in o._keyMap&&(o._clearTooltipTimeout(),"firstHandle"==t?(r=o._activeHandleDrag=o._firstHandleDrag,a=o._keyMap[e.keyCode](a),a>s&&(s=a)):(r=o._activeHandleDrag=o._lastHandleDrag,s=o._keyMap[e.keyCode](s),a>s&&(a=s)),o._setValueInRange(c(a),c(s)),n=Math.max(a,o.options.selectionStart),i=Math.min(s,o.options.selectionEnd),r.selectionEnd=Math.max(i,o.options.selectionStart),r.selectionStart=Math.min(n,o.options.selectionEnd),r._updateTooltip(o.value()[o._activeHandle]),e.preventDefault())},_update:function(e,t){var n=this,i=n.value(),r=i[0]!=e||i[1]!=t;n.value([e,t]),r&&n.trigger(F,{values:[e,t],value:[e,t]})},value:function(e){return e&&e.length?this._value(e[0],e[1]):this._value()},_value:function(e,n){var i=this,r=i.options,o=r.selectionStart,a=r.selectionEnd;return isNaN(e)&&isNaN(n)?[o,a]:(e=c(e),n=c(n),e>=r.min&&e<=r.max&&n>=r.min&&n<=r.max&&e<=n&&(o==e&&a==n||(i.element.find("input").eq(0).prop("value",l(e)).end().eq(1).prop("value",l(n)),r.selectionStart=e,r.selectionEnd=n,i._refresh(),i._refreshAriaAttr(e,n))),t)},values:function(e,t){return C(e)?this._value(e[0],e[1]):this._value(e,t)},_refresh:function(){var e=this,t=e.options;e.trigger(N,{values:[t.selectionStart,t.selectionEnd],value:[t.selectionStart,t.selectionEnd]}),t.selectionStart==t.max&&t.selectionEnd==t.max&&e._setZIndex("firstHandle")},_refreshAriaAttr:function(e,t){var n,i=this,r=i.wrapper.find(W),o=i._activeHandleDrag;n=i._getFormattedValue([e,t],o),r.eq(0).attr("aria-valuenow",e),r.eq(1).attr("aria-valuenow",t),r.attr("aria-valuetext",n)},_setValueInRange:function(e,t){var n=this.options;e=T.max(T.min(e,n.max),n.min),t=T.max(T.min(t,n.max),n.min),e==n.max&&t==n.max&&this._setZIndex("firstHandle"),this._update(T.min(e,t),T.max(e,t))},_setZIndex:function(t){this.wrapper.find(W).each(function(n){e(this).css("z-index","firstHandle"==t?1-n:n)})},_formResetHandler:function(){var e=this,t=e.options;setTimeout(function(){var n=e.element.find("input"),i=n[0].value,r=n[1].value;e.values(""===i||isNaN(i)?t.min:i,""===r||isNaN(r)?t.max:r)})},destroy:function(){var e=this;Z.fn.destroy.call(e),e.wrapper.off(I).find(q+", "+U).off(I).end().find(W).off(I),e._firstHandleDrag.draggable.destroy(),e._lastHandleDrag.draggable.destroy()}}),p.Selection=function(e,t,n){function i(i){i=i||[];var o=i[0]-n.min,a=i[1]-n.min,s=T.ceil(c(o/n.smallStep)),l=T.ceil(c(a/n.smallStep)),d=t._pixelSteps[s],u=t._pixelSteps[l],h=parseInt(t._outerSize(e.eq(0))/2,10),f=t._isRtl?2:0;e.eq(0).css(t._position,d-h-f).end().eq(1).css(t._position,u-h-f),r(d,u)}function r(e,n){var i,r,o=t._trackDiv.find(".k-slider-selection");i=T.abs(e-n),o[t._sizeFn](i),t._isRtl?(r=T.max(e,n),o.css("right",t._maxSelection-r-1)):(r=T.min(e,n),o.css(t._position,r-1))}i(t.value()),t.bind([F,R,N],function(e){i(e.values)})},m.ui.plugin(p)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.colorpicker.min",["kendo.core.min","kendo.color.min","kendo.popup.min","kendo.slider.min","kendo.userevents.min"],e)}(function(){return function(e,t,n){function i(e,t,n){n=c(n),n&&!n.equals(e.color())&&("change"==t&&(e._value=n),n=1!=n.a?n.toCssRgba():n.toCss(),e.trigger(t,{value:n}))}function r(e,t,n){var i,r;return e=Array.prototype.slice.call(e),i=e.length,r=e.indexOf(t),r<0?n<0?e[i-1]:e[0]:(r+=n,r<0?r+=i:r%=i,e[r])}function o(e){e.preventDefault()}function a(e,t){return function(){return e.apply(t,arguments)}}var s=window.kendo,l=s.ui,d=l.Widget,c=s.parseColor,u=s.Color,h=s.keys,f="background-color",p="k-state-selected",m="000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7",g="FFFFFF,FFCCFF,FF99FF,FF66FF,FF33FF,FF00FF,CCFFFF,CCCCFF,CC99FF,CC66FF,CC33FF,CC00FF,99FFFF,99CCFF,9999FF,9966FF,9933FF,9900FF,FFFFCC,FFCCCC,FF99CC,FF66CC,FF33CC,FF00CC,CCFFCC,CCCCCC,CC99CC,CC66CC,CC33CC,CC00CC,99FFCC,99CCCC,9999CC,9966CC,9933CC,9900CC,FFFF99,FFCC99,FF9999,FF6699,FF3399,FF0099,CCFF99,CCCC99,CC9999,CC6699,CC3399,CC0099,99FF99,99CC99,999999,996699,993399,990099,FFFF66,FFCC66,FF9966,FF6666,FF3366,FF0066,CCFF66,CCCC66,CC9966,CC6666,CC3366,CC0066,99FF66,99CC66,999966,996666,993366,990066,FFFF33,FFCC33,FF9933,FF6633,FF3333,FF0033,CCFF33,CCCC33,CC9933,CC6633,CC3333,CC0033,99FF33,99CC33,999933,996633,993333,990033,FFFF00,FFCC00,FF9900,FF6600,FF3300,FF0000,CCFF00,CCCC00,CC9900,CC6600,CC3300,CC0000,99FF00,99CC00,999900,996600,993300,990000,66FFFF,66CCFF,6699FF,6666FF,6633FF,6600FF,33FFFF,33CCFF,3399FF,3366FF,3333FF,3300FF,00FFFF,00CCFF,0099FF,0066FF,0033FF,0000FF,66FFCC,66CCCC,6699CC,6666CC,6633CC,6600CC,33FFCC,33CCCC,3399CC,3366CC,3333CC,3300CC,00FFCC,00CCCC,0099CC,0066CC,0033CC,0000CC,66FF99,66CC99,669999,666699,663399,660099,33FF99,33CC99,339999,336699,333399,330099,00FF99,00CC99,009999,006699,003399,000099,66FF66,66CC66,669966,666666,663366,660066,33FF66,33CC66,339966,336666,333366,330066,00FF66,00CC66,009966,006666,003366,000066,66FF33,66CC33,669933,666633,663333,660033,33FF33,33CC33,339933,336633,333333,330033,00FF33,00CC33,009933,006633,003333,000033,66FF00,66CC00,669900,666600,663300,660000,33FF00,33CC00,339900,336600,333300,330000,00FF00,00CC00,009900,006600,003300,000000",v={apply:"Apply",cancel:"Cancel"},_=".kendoColorTools",b="click"+_,k="keydown"+_,w=s.support.browser,y=w.msie&&w.version<9,x=d.extend({init:function(e,t){var n,i=this;d.fn.init.call(i,e,t),e=i.element,t=i.options,i._value=t.value=c(t.value),i._tabIndex=e.attr("tabIndex")||0,n=i._ariaId=t.ariaId,n&&e.attr("aria-labelledby",n),t._standalone&&(i._triggerSelect=i._triggerChange)},options:{name:"ColorSelector",value:null,_standalone:!0},events:["change","select","cancel"],color:function(e){return e!==n&&(this._value=c(e),this._updateUI(this._value)),this._value},value:function(e){return e=this.color(e),e&&(e=this.options.opacity?e.toCssRgba():e.toCss()),e||null},enable:function(t){0===arguments.length&&(t=!0),e(".k-disabled-overlay",this.wrapper).remove(),t||this.wrapper.append("<div class='k-disabled-overlay'></div>"),this._onEnable(t)},_select:function(e,t){var n=this._value;e=this.color(e),t||(this.element.trigger("change"),e.equals(n)?this._standalone||this.trigger("cancel"):this.trigger("change",{value:this.value()}))},_triggerSelect:function(e){i(this,"select",e)},_triggerChange:function(e){i(this,"change",e)},destroy:function(){this.element&&this.element.off(_),this.wrapper&&this.wrapper.off(_).find("*").off(_),this.wrapper=null,d.fn.destroy.call(this)},_updateUI:e.noop,_selectOnHide:function(){return null},_cancel:function(){this.trigger("cancel")}}),C=x.extend({init:function(t,n){var i,r,o,l,d=this;if(x.fn.init.call(d,t,n),t=d.wrapper=d.element,n=d.options,i=n.palette,"websafe"==i?(i=g,n.columns=18):"basic"==i&&(i=m),"string"==typeof i&&(i=i.split(",")),e.isArray(i)&&(i=e.map(i,function(e){return c(e)})),d._selectedID=(n.ariaId||s.guid())+"_selected",t.addClass("k-widget k-colorpalette").attr("role","grid").attr("aria-readonly","true").append(e(d._template({colors:i,columns:n.columns,tileSize:n.tileSize,value:d._value,id:n.ariaId}))).on(b,".k-item",function(t){d._select(e(t.currentTarget).css(f))}).attr("tabIndex",d._tabIndex).on(k,a(d._keydown,d)),r=n.tileSize){if(/number|string/.test(typeof r))o=l=parseFloat(r);else{if("object"!=typeof r)throw Error("Unsupported value for the 'tileSize' argument");o=parseFloat(r.width),l=parseFloat(r.height)}t.find(".k-item").css({width:o,height:l})}},focus:function(){this.wrapper.focus()},options:{name:"ColorPalette",columns:10,tileSize:null,palette:"basic"},_onEnable:function(e){e?this.wrapper.attr("tabIndex",this._tabIndex):this.wrapper.removeAttr("tabIndex")},_keydown:function(t){var n,i,a=this.wrapper,s=a.find(".k-item"),l=s.filter("."+p).get(0),d=t.keyCode;if(d==h.LEFT?n=r(s,l,-1):d==h.RIGHT?n=r(s,l,1):d==h.DOWN?n=r(s,l,this.options.columns):d==h.UP?n=r(s,l,-this.options.columns):d==h.ENTER?(o(t),l&&this._select(e(l).css(f))):d==h.ESC&&this._cancel(),n){o(t),this._current(n);try{i=c(n.css(f)),this._triggerSelect(i)}catch(u){}}},_current:function(t){this.wrapper.find("."+p).removeClass(p).attr("aria-selected",!1).removeAttr("id"),e(t).addClass(p).attr("aria-selected",!0).attr("id",this._selectedID),this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant",this._selectedID)},_updateUI:function(t){var n=null;this.wrapper.find(".k-item").each(function(){var i=c(e(this).css(f));if(i&&i.equals(t))return n=this,!1}),this._current(n)},_template:s.template('<table class="k-palette k-reset" role="presentation"><tr role="row"># for (var i = 0; i < colors.length; ++i) { ## var selected = colors[i].equals(value); ## if (i && i % columns == 0) { # </tr><tr role="row"> # } #<td role="gridcell" unselectable="on" style="background-color:#= colors[i].toCss() #"#= selected ? " aria-selected=true" : "" # #=(id && i === 0) ? "id=\\""+id+"\\" " : "" # class="k-item#= selected ? " '+p+'" : "" #" aria-label="#= colors[i].toCss() #"></td># } #</tr></table>')}),T=x.extend({init:function(t,n){var i=this;x.fn.init.call(i,t,n),n=i.options,t=i.element,i.wrapper=t.addClass("k-widget k-flatcolorpicker").append(i._template(n)),i._hueElements=e(".k-hsv-rectangle, .k-transparency-slider .k-slider-track",t),i._selectedColor=e(".k-selected-color-display",t),i._colorAsText=e("input.k-color-value",t),i._sliders(),i._hsvArea(),i._updateUI(i._value||c("#f00")),t.find("input.k-color-value").on(k,function(t){var n,r,o=this;if(t.keyCode==h.ENTER)try{n=c(o.value),r=i.color(),i._select(n,n.equals(r))}catch(a){e(o).addClass("k-state-error")}else i.options.autoupdate&&setTimeout(function(){var e=c(o.value,!0);e&&i._updateUI(e,!0)},10)}).end().on(b,".k-controls button.apply",function(){i._select(i._getHSV())}).on(b,".k-controls button.cancel",function(){i._updateUI(i.color()),i._cancel()}),y&&i._applyIEFilter()},destroy:function(){this._hueSlider.destroy(),this._opacitySlider&&this._opacitySlider.destroy(),this._hueSlider=this._opacitySlider=this._hsvRect=this._hsvHandle=this._hueElements=this._selectedColor=this._colorAsText=null,x.fn.destroy.call(this)},options:{name:"FlatColorPicker",opacity:!1,buttons:!1,input:!0,preview:!0,autoupdate:!0,messages:v},_applyIEFilter:function(){var e=this.element.find(".k-hue-slider .k-slider-track")[0],t=e.currentStyle.backgroundImage;t=t.replace(/^url\([\'\"]?|[\'\"]?\)$/g,""),e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"', sizingMethod='scale')"},_sliders:function(){function e(e){n._updateUI(n._getHSV(e.value,null,null,null))}function t(e){n._updateUI(n._getHSV(null,null,null,e.value/100))}var n=this,i=n.element;n._hueSlider=i.find(".k-hue-slider").kendoSlider({min:0,max:360,tickPlacement:"none",showButtons:!1,slide:e,change:e}).data("kendoSlider"),n._opacitySlider=i.find(".k-transparency-slider").kendoSlider({min:0,max:100,tickPlacement:"none",showButtons:!1,slide:t,change:t}).data("kendoSlider")},_hsvArea:function(){function e(e,n){var i=this.offset,r=e-i.left,o=n-i.top,a=this.width,s=this.height;r=r<0?0:r>a?a:r,o=o<0?0:o>s?s:o,t._svChange(r/a,1-o/s)}var t=this,n=t.element,i=n.find(".k-hsv-rectangle"),r=i.find(".k-draghandle").attr("tabIndex",0).on(k,a(t._keydown,t));t._hsvEvents=new s.UserEvents(i,{global:!0,press:function(t){this.offset=s.getOffset(i),this.width=i.width(),this.height=i.height(),r.focus(),e.call(this,t.x.location,t.y.location)},start:function(){i.addClass("k-dragging"),r.focus()},move:function(t){t.preventDefault(),e.call(this,t.x.location,t.y.location)},end:function(){i.removeClass("k-dragging")}}),t._hsvRect=i,t._hsvHandle=r},_onEnable:function(e){this._hueSlider.enable(e),this._opacitySlider&&this._opacitySlider.enable(e),this.wrapper.find("input").attr("disabled",!e);var t=this._hsvRect.find(".k-draghandle");e?t.attr("tabIndex",this._tabIndex):t.removeAttr("tabIndex")},_keydown:function(e){function t(t,n){var r=i._getHSV();r[t]+=n*(e.shiftKey?.01:.05),r[t]<0&&(r[t]=0),r[t]>1&&(r[t]=1),i._updateUI(r),o(e)}function n(t){var n=i._getHSV();n.h+=t*(e.shiftKey?1:5),n.h<0&&(n.h=0),n.h>359&&(n.h=359),i._updateUI(n),o(e)}var i=this;switch(e.keyCode){case h.LEFT:e.ctrlKey?n(-1):t("s",-1);break;case h.RIGHT:e.ctrlKey?n(1):t("s",1);break;case h.UP:t(e.ctrlKey&&i._opacitySlider?"a":"v",1);break;case h.DOWN:t(e.ctrlKey&&i._opacitySlider?"a":"v",-1);break;case h.ENTER:i._select(i._getHSV());break;case h.F2:i.wrapper.find("input.k-color-value").focus().select();break;case h.ESC:i._cancel()}},focus:function(){this._hsvHandle.focus()},_getHSV:function(e,t,n,i){var r=this._hsvRect,o=r.width(),a=r.height(),s=this._hsvHandle.position();return null==e&&(e=this._hueSlider.value()),null==t&&(t=s.left/o),null==n&&(n=1-s.top/a),null==i&&(i=this._opacitySlider?this._opacitySlider.value()/100:1),u.fromHSV(e,t,n,i)},_svChange:function(e,t){var n=this._getHSV(null,e,t,null);this._updateUI(n)},_updateUI:function(e,t){var n=this,i=n._hsvRect;e&&(this._colorAsText.removeClass("k-state-error"),n._selectedColor.css(f,e.toDisplay()),t||n._colorAsText.val(n._opacitySlider?e.toCssRgba():e.toCss()),n._triggerSelect(e),e=e.toHSV(),n._hsvHandle.css({left:e.s*i.width()+"px",top:(1-e.v)*i.height()+"px"}),n._hueElements.css(f,u.fromHSV(e.h,1,1,1).toCss()),n._hueSlider.value(e.h),n._opacitySlider&&n._opacitySlider.value(100*e.a))},_selectOnHide:function(){return this.options.buttons?null:this._getHSV()},_template:s.template('# if (preview) { #<div class="k-selected-color"><div class="k-selected-color-display"><input class="k-color-value" #= !data.input ? \'style="visibility: hidden;"\' : "" #></div></div># } #<div class="k-hsv-rectangle"><div class="k-hsv-gradient"></div><div class="k-draghandle"></div></div><input class="k-hue-slider" /># if (opacity) { #<input class="k-transparency-slider" /># } ## if (buttons) { #<div unselectable="on" class="k-controls"><button class="k-button k-primary apply">#: messages.apply #</button> <button class="k-button cancel">#: messages.cancel #</button></div># } #')}),S=d.extend({init:function(t,n){var i,r,o,a,s,l=this;d.fn.init.call(l,t,n),n=l.options,t=l.element,i=t.attr("value")||t.val(),i=i?c(i,!0):c(n.value,!0),l._value=n.value=i,r=l.wrapper=e(l._template(n)),t.hide().after(r),t.is("input")&&(t.appendTo(r),o=t.closest("label"),a=t.attr("id"),a&&(o=o.add('label[for="'+a+'"]')),o.click(function(e){l.open(),e.preventDefault()})),l._tabIndex=t.attr("tabIndex")||0,l.enable(!t.attr("disabled")),s=t.attr("accesskey"),s&&(t.attr("accesskey",null),r.attr("accesskey",s)),l.bind("activate",function(e){e.isDefaultPrevented()||l.toggle()}),l._updateUI(i)},destroy:function(){this.wrapper.off(_).find("*").off(_),this._popup&&(this._selector.destroy(),this._popup.destroy()),this._selector=this._popup=this.wrapper=null,d.fn.destroy.call(this)},enable:function(e){var t=this,n=t.wrapper,i=n.children(".k-picker-wrap"),r=i.find(".k-select");0===arguments.length&&(e=!0),t.element.attr("disabled",!e),n.attr("aria-disabled",!e),r.off(_).on("mousedown"+_,o),n.addClass("k-state-disabled").removeAttr("tabIndex").add("*",n).off(_),e?n.removeClass("k-state-disabled").attr("tabIndex",t._tabIndex).on("mouseenter"+_,function(){i.addClass("k-state-hover")}).on("mouseleave"+_,function(){i.removeClass("k-state-hover")}).on("focus"+_,function(){i.addClass("k-state-focused")}).on("blur"+_,function(){i.removeClass("k-state-focused")}).on(k,a(t._keydown,t)).on(b,".k-select",a(t.toggle,t)).on(b,t.options.toolIcon?".k-tool-icon":".k-selected-color",function(){t.trigger("activate")}):t.close()},_template:s.template('<span role="textbox" aria-haspopup="true" class="k-widget k-colorpicker k-header"><span class="k-picker-wrap k-state-default"># if (toolIcon) { #<span class="k-tool-icon #= toolIcon #"><span class="k-selected-color"></span></span># } else { #<span class="k-selected-color"></span># } #<span class="k-select" unselectable="on" aria-label="select"><span class="k-icon k-i-arrow-s"></span></span></span></span>'),options:{name:"ColorPicker",palette:null,columns:10,toolIcon:null,value:null,messages:v,opacity:!1,buttons:!0,preview:!0,ARIATemplate:'Current selected color is #=data || ""#'},events:["activate","change","select","open","close"],open:function(){this.element.prop("disabled")||this._getPopup().open()},close:function(){this._getPopup().close()},toggle:function(){this.element.prop("disabled")||this._getPopup().toggle()},color:x.fn.color,value:x.fn.value,_select:x.fn._select,_triggerSelect:x.fn._triggerSelect,_isInputTypeColor:function(){var e=this.element[0];return/^input$/i.test(e.tagName)&&/^color$/i.test(e.type)},_updateUI:function(e){var t="";e&&(t=this._isInputTypeColor()||1==e.a?e.toCss():e.toCssRgba(),this.element.val(t)),this._ariaTemplate||(this._ariaTemplate=s.template(this.options.ARIATemplate)),this.wrapper.attr("aria-label",this._ariaTemplate(t)),this._triggerSelect(e),this.wrapper.find(".k-selected-color").css(f,e?e.toDisplay():"transparent")},_keydown:function(e){var t=e.keyCode;this._getPopup().visible()?(t==h.ESC?this._selector._cancel():this._selector._keydown(e),o(e)):t!=h.ENTER&&t!=h.DOWN||(this.open(),o(e))},_getPopup:function(){var t,i,r,o,a=this,l=a._popup;return l||(t=a.options,i=t.palette?C:T,t._standalone=!1,delete t.select,delete t.change,delete t.cancel,r=s.guid(),o=a._selector=new i(e('<div id="'+r+'"/>').appendTo(document.body),t),a.wrapper.attr("aria-owns",r),a._popup=l=o.wrapper.kendoPopup({anchor:a.wrapper,adjustSize:{width:5,height:0}}).data("kendoPopup"),o.bind({select:function(e){a._updateUI(c(e.value))},change:function(){a._select(o.color()),a.close()},cancel:function(){a.close()}}),l.bind({close:function(e){if(a.trigger("close"))return e.preventDefault(),n;a.wrapper.children(".k-picker-wrap").removeClass("k-state-focused");var t=o._selectOnHide();t?a._select(t):(setTimeout(function(){a.wrapper&&a.wrapper.focus()}),a._updateUI(a.color()))},open:function(e){a.trigger("open")?e.preventDefault():a.wrapper.children(".k-picker-wrap").addClass("k-state-focused")},activate:function(){o._select(a.color(),!0),o.focus(),a.wrapper.children(".k-picker-wrap").addClass("k-state-focused")}})),l}});l.plugin(C),l.plugin(T),l.plugin(S)}(jQuery,parseInt),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.numerictextbox.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){function n(e,t){var n="k-i-arrow-"+("increase"===e?"n":"s");return'<span unselectable="on" class="k-link k-link-'+e+'" aria-label="'+t+'" title="'+t+'"><span unselectable="on" class="k-icon '+n+'"></span></span>'}function i(e,t){var n=(""+parseFloat(e,10)).split(D);return n[1]&&(n[1]=n[1].substring(0,t)),n.join(D)}var r=window.kendo,o=r.caret,a=r.keys,s=r.ui,l=s.Widget,d=r._activeElement,c=r._extractFormat,u=r.parseFloat,h=r.support.placeholder,f=r.getCulture,p="change",m="disabled",g="readonly",v="k-input",_="spin",b=".kendoNumericTextBox",k="touchend",w="mouseleave"+b,y="mouseenter"+b+" "+w,x="k-state-default",C="k-state-focused",T="k-state-hover",S="focus",D=".",E="k-state-selected",F="k-state-disabled",R="aria-disabled",I="aria-readonly",A=/^(-)?(\d*)$/,M=null,z=e.proxy,H=e.extend,N=l.extend({init:function(n,i){var o,a,s,d,u,h=this,f=i&&i.step!==t;l.fn.init.call(h,n,i),i=h.options,n=h.element.on("focusout"+b,z(h._focusout,h)).attr("role","spinbutton"),i.placeholder=i.placeholder||n.attr("placeholder"),h._initialOptions=H({},i),o=h.min(n.attr("min")),a=h.max(n.attr("max")),s=h._parse(n.attr("step")),i.min===M&&o!==M&&(i.min=o),i.max===M&&a!==M&&(i.max=a),f||s===M||(i.step=s),h._reset(),h._wrapper(),h._arrows(),h._input(),r.support.mobileOS?h._text.on(k+b+" "+S+b,function(){r.support.browser.edge?h._text.one(S+b,function(){h._toggleText(!1),n.focus()}):(h._toggleText(!1),n.focus())}):h._text.on(S+b,z(h._click,h)),n.attr("aria-valuemin",i.min).attr("aria-valuemax",i.max),i.format=c(i.format),d=i.value,h.value(d!==M?d:n.val()),u=n.is("[disabled]")||e(h.element).parents("fieldset").is(":disabled"),u?h.enable(!1):h.readonly(n.is("[readonly]")),r.notify(h)},options:{name:"NumericTextBox",decimals:M,restrictDecimals:!1,min:M,max:M,value:M,step:1,round:!0,culture:"",format:"n",spinners:!0,placeholder:"",upArrowText:"Increase value",downArrowText:"Decrease value"},events:[p,_],_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly,o=t._text.add(n),a=t._inputWrapper.off(y);t._toggleText(!0),t._upArrowEventHandler.unbind("press"),t._downArrowEventHandler.unbind("press"),n.off("keydown"+b).off("keypress"+b).off("paste"+b),r||i?(a.addClass(i?F:x).removeClass(i?x:F),o.attr(m,i).attr(g,r).attr(R,i).attr(I,r)):(a.addClass(x).removeClass(F).on(y,t._toggleHover),o.removeAttr(m).removeAttr(g).attr(R,!1).attr(I,!1),t._upArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(1),t._upArrow.addClass(E)}),t._downArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(-1),t._downArrow.addClass(E)}),t.element.on("keydown"+b,z(t._keydown,t)).on("keypress"+b,z(t._keypress,t)).on("paste"+b,z(t._paste,t)))},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},destroy:function(){var e=this;e.element.add(e._text).add(e._upArrow).add(e._downArrow).add(e._inputWrapper).off(b),e._upArrowEventHandler.destroy(),e._downArrowEventHandler.destroy(),e._form&&e._form.off("reset",e._resetHandler),l.fn.destroy.call(e)},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},step:function(e){return this._option("step",e)},value:function(e){var n,i=this;return e===t?i._value:(e=i._parse(e),n=i._adjust(e),e===n&&(i._update(e),i._old=i._value),t)},focus:function(){this._focusin()},_adjust:function(e){var t=this,n=t.options,i=n.min,r=n.max;return e===M?e:(i!==M&&e<i?e=i:r!==M&&e>r&&(e=r),e)},_arrows:function(){var t,i=this,o=function(){clearTimeout(i._spinning),t.removeClass(E)},a=i.options,s=a.spinners,l=i.element;t=l.siblings(".k-icon"),t[0]||(t=e(n("increase",a.upArrowText)+n("decrease",a.downArrowText)).insertAfter(l),t.wrapAll('<span class="k-select"/>')),s||(t.parent().toggle(s),i._inputWrapper.addClass("k-expand-padding")),i._upArrow=t.eq(0),i._upArrowEventHandler=new r.UserEvents(i._upArrow,{release:o}),i._downArrow=t.eq(1),i._downArrowEventHandler=new r.UserEvents(i._downArrow,{release:o})},_blur:function(){var e=this;e._toggleText(!0),e._change(e.element.val())},_click:function(e){var t=this;clearTimeout(t._focusing),t._focusing=setTimeout(function(){var n,i,r,a=e.target,s=o(a)[0],l=a.value.substring(0,s),d=t._format(t.options.format),c=d[","],u=0;c&&(i=RegExp("\\"+c,"g"),r=RegExp("([\\d\\"+c+"]+)(\\"+d[D]+")?(\\d+)?")),r&&(n=r.exec(l)),n&&(u=n[0].replace(i,"").length,l.indexOf("(")!=-1&&t._value<0&&u++),t._focusin(),o(t.element[0],u);
})},_change:function(e){var t=this;t._update(e),e=t._value,t._old!=e&&(t._old=e,t._typing||t.element.trigger(p),t.trigger(p)),t._typing=!1},_culture:function(e){return e||f(this.options.culture)},_focusin:function(){var e=this;e._inputWrapper.addClass(C),e._toggleText(!1),e.element[0].focus()},_focusout:function(){var e=this;clearTimeout(e._focusing),e._inputWrapper.removeClass(C).removeClass(T),e._blur()},_format:function(e,t){var n=this._culture(t).numberFormat;return e=e.toLowerCase(),e.indexOf("c")>-1?n=n.currency:e.indexOf("p")>-1&&(n=n.percent),n},_input:function(){var t,n=this,i=n.options,r="k-formatted-value",o=n.element.addClass(v).show()[0],a=o.accessKey,s=n.wrapper;t=s.find(D+r),t[0]||(t=e('<input type="text"/>').insertBefore(o).addClass(r));try{o.setAttribute("type","text")}catch(l){o.type="text"}n._initialTitle=o.title,t[0].title=o.title,t[0].tabIndex=o.tabIndex,t[0].style.cssText=o.style.cssText,t.prop("placeholder",i.placeholder),a&&(t.attr("accesskey",a),o.accessKey=""),n._text=t.addClass(o.className).attr({role:"spinbutton","aria-valuemin":i.min,"aria-valuemax":i.max})},_keydown:function(e){var t=this,n=e.keyCode;t._key=n,n==a.DOWN?t._step(-1):n==a.UP?t._step(1):n==a.ENTER?t._change(t.element.val()):t._typing=!0},_keypress:function(e){var t,n,i,r,s,l,d,c,u,h,f;0===e.which||e.metaKey||e.ctrlKey||e.keyCode===a.BACKSPACE||e.keyCode===a.ENTER||(t=this,n=t.options.min,i=t.element,r=o(i),s=r[0],l=r[1],d=String.fromCharCode(e.which),c=t._format(t.options.format),u=t._key===a.NUMPAD_DOT,h=i.val(),u&&(d=c[D]),h=h.substring(0,s)+d+h.substring(l),f=t._numericRegex(c).test(h),f&&u?(i.val(h),o(i,s+d.length),e.preventDefault()):(null!==n&&n>=0&&"-"===h.charAt(0)||!f)&&e.preventDefault(),t._key=0)},_numericRegex:function(e){var t=this,n=e[D],i=t.options.decimals,r="*";return n===D&&(n="\\"+n),i===M&&(i=e.decimals),0===i?A:(t.options.restrictDecimals&&(r="{0,"+i+"}"),t._separator!==n&&(t._separator=n,t._floatRegExp=RegExp("^(-)?(((\\d+("+n+"\\d"+r+")?)|("+n+"\\d"+r+")))?$")),t._floatRegExp)},_paste:function(e){var t=this,n=e.target,i=n.value,r=t._format(t.options.format);setTimeout(function(){var e=t._parse(n.value),o=t._numericRegex(r).test(n.value);e!==M&&t._adjust(e)===e&&o||t._update(i)})},_option:function(e,n){var i=this,r=i.element,o=i.options;return n===t?o[e]:(n=i._parse(n),(n||"step"!==e)&&(o[e]=n,r.add(i._text).attr("aria-value"+e,n),r.attr(e,n)),t)},_spin:function(e,t){var n=this;t=t||500,clearTimeout(n._spinning),n._spinning=setTimeout(function(){n._spin(e,50)},t),n._step(e)},_step:function(e){var t=this,n=t.element,i=t._parse(n.val())||0;d()!=n[0]&&t._focusin(),i+=t.options.step*e,t._update(t._adjust(i)),t._typing=!1,t.trigger(_)},_toggleHover:function(t){e(t.currentTarget).toggleClass(T,"mouseenter"===t.type)},_toggleText:function(e){var t=this;t._text.toggle(e),t.element.toggle(!e)},_parse:function(e,t){return u(e,this._culture(t),this.options.format)},_round:function(e,t){var n=this.options.round?r._round:i;return n(e,t)},_update:function(e){var t,n=this,i=n.options,o=i.format,a=i.decimals,s=n._culture(),l=n._format(o,s);a===M&&(a=l.decimals),e=n._parse(e,s),t=e!==M,t&&(e=parseFloat(n._round(e,a),10)),n._value=e=n._adjust(e),n._placeholder(r.toString(e,o,s)),t?(e=""+e,e.indexOf("e")!==-1&&(e=n._round(+e,a)),e=e.replace(D,l[D])):e="",n.element.val(e),n.element.add(n._text).attr("aria-valuenow",e)},_placeholder:function(e){var t=this._text;t.val(e),h||e||t.val(this.options.placeholder),t.attr("title",this._initialTitle||t.val()),t.attr("aria-title",this._initialTitle||t.val())},_wrapper:function(){var t,n=this,i=n.element,r=i[0];t=i.parents(".k-numerictextbox"),t.is("span.k-numerictextbox")||(t=i.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(),t=t.wrap("<span/>").parent()),t[0].style.cssText=r.style.cssText,r.style.width="",n.wrapper=t.addClass("k-widget k-numerictextbox").addClass(r.className).css("display",""),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value),t.max(t._initialOptions.max),t.min(t._initialOptions.min)})},t._form=r.on("reset",t._resetHandler))}});s.plugin(N)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.filtermenu.min",["kendo.datepicker.min","kendo.numerictextbox.min","kendo.dropdownlist.min","kendo.binder.min"],e)}(function(){return function(e,t){function n(t,i){t.filters&&(t.filters=e.grep(t.filters,function(e){return n(e,i),e.filters?e.filters.length:e.field!=i}))}function i(e){var t,n,i,r,o,a;if(e&&e.length)for(a=[],t=0,n=e.length;t<n;t++)i=e[t],o=""!==i.text?i.text||i.value||i:i.text,r=null==i.value?i.text||i:i.value,a[t]={text:o,value:r};return a}function r(t,n){return e.grep(t,function(t){return t.filters?(t.filters=e.grep(t.filters,function(e){return e.field!=n}),t.filters.length):t.field!=n})}function o(t,n){t.filters&&(t.filters=e.grep(t.filters,function(e){return o(e,n),e.filters?e.filters.length:e.field==n&&"eq"==e.operator}))}function a(n){return"and"==n.logic&&n.filters.length>1?[]:n.filters?e.map(n.filters,function(e){return a(e)}):null!==n.value&&n.value!==t?[n.value]:[]}function s(e,n){for(var i,r,o=d.getter(n,!0),a=[],s=0,l={};s<e.length;)i=e[s++],r=o(i),r===t||null===r||l.hasOwnProperty(r)||(a.push(i),l[r]=!0);return a}function l(e,t){return function(n){var i=e(n);return s(i,t)}}var d=window.kendo,c=d.ui,u=e.proxy,h="kendoPopup",f="init",p="refresh",m="change",g=".kendoFilterMenu",v="Is equal to",_="Is not equal to",b={number:"numerictextbox",date:"datepicker"},k={string:"text",number:"number",date:"date"},w=d.isFunction,y=c.Widget,x='<div><div class="k-filter-help-text">#=messages.info#</div><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label><div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',C='<div><div class="k-filter-help-text">#=messages.info#</div><select data-#=ns#bind="value: filters[0].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[0].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#" data-#=ns#value-primitive="true"></select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select class="k-filter-and" data-#=ns#bind="value: logic" data-#=ns#role="dropdownlist"><option value="and">#=messages.and#</option><option value="or">#=messages.or#</option></select><select data-#=ns#bind="value: filters[1].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[1].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#" data-#=ns#value-primitive="true"></select>#}else{#<input data-#=ns#bind="value: filters[1].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""#/>#}##}#<div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',T='<div data-#=ns#role="view" data-#=ns#init-widgets="false" data-#=ns#use-native-scrolling="true" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[0].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[0].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#if(extra){#</ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="and" />#=messages.and#</label></li><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="or" />#=messages.or#</label></li></ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[1].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[1].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[1].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#}#</ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></div></form></div>',S='<div data-#=ns#role="view" data-#=ns#init-widgets="false" data-#=ns#use-native-scrolling="true" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label></li><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label></li></ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></form></div>',D=y.extend({init:function(t,n){var i,r,o,a,s=this,l="string";y.fn.init.call(s,t,n),i=s.operators=n.operators||{},t=s.element,n=s.options,n.appendToElement||(o=t.addClass("k-with-icon k-filterable").find(".k-grid-filter"),o[0]||(o=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-i-filter">'+n.messages.filter+"</span></a>").find(".k-grid-filter")),o.attr("tabindex",-1).on("click"+g,u(s._click,s))),s.link=o||e(),s.dataSource=F.create(n.dataSource),s.field=n.field||t.attr(d.attr("field")),s.model=s.dataSource.reader.model,s._parse=function(e){return null!=e?e+"":e},s.model&&s.model.fields&&(a=s.model.fields[s.field],a&&(l=a.type||"string",a.parse&&(s._parse=u(a.parse,a)))),n.values&&(l="enums"),s.type=l,i=i[l]||n.operators[l];for(r in i)break;s._defaultFilter=function(){return{field:s.field,operator:r||"eq",value:""}},s._refreshHandler=u(s.refresh,s),s.dataSource.bind(m,s._refreshHandler),n.appendToElement?s._init():s.refresh()},_init:function(){var t,n=this,i=n.options.ui,r=w(i);n.pane=n.options.pane,n.pane&&(n._isMobile=!0),r||(t=i||b[n.type]),n._isMobile?n._createMobileForm(t):n._createForm(t),n.form.on("submit"+g,u(n._submit,n)).on("reset"+g,u(n._reset,n)),r&&n.form.find(".k-textbox").removeClass("k-textbox").each(function(){i(e(this))}),n.form.find("["+d.attr("role")+"=numerictextbox]").removeClass("k-textbox").end().find("["+d.attr("role")+"=datetimepicker]").removeClass("k-textbox").end().find("["+d.attr("role")+"=timepicker]").removeClass("k-textbox").end().find("["+d.attr("role")+"=datepicker]").removeClass("k-textbox"),n.refresh(),n.trigger(f,{field:n.field,container:n.form}),d.cycleForm(n.form)},_createForm:function(t){var n=this,r=n.options,o=n.operators||{},a=n.type;o=o[a]||r.operators[a],n.form=e('<form class="k-filter-menu"/>').html(d.template("boolean"===a?x:C)({field:n.field,format:r.format,ns:d.ns,messages:r.messages,extra:r.extra,operators:o,type:a,role:t,values:i(r.values)})),r.appendToElement?(n.element.append(n.form),n.popup=n.element.closest(".k-popup").data(h)):n.popup=n.form[h]({anchor:n.link,open:u(n._open,n),activate:u(n._activate,n),close:function(){n.options.closeCallback&&n.options.closeCallback(n.element)}}).data(h),n.form.on("keydown"+g,u(n._keydown,n))},_createMobileForm:function(t){var n=this,r=n.options,o=n.operators||{},a=n.type;o=o[a]||r.operators[a],n.form=e("<div />").html(d.template("boolean"===a?S:T)({field:n.field,title:r.title||n.field,format:r.format,ns:d.ns,messages:r.messages,extra:r.extra,operators:o,type:a,role:t,useRole:!d.support.input.date&&"date"===a||"number"===a,inputType:k[a],values:i(r.values)})),n.view=n.pane.append(n.form.html()),n.form=n.view.element.find("form"),n.view.element.on("click",".k-submit",function(e){n.form.submit(),e.preventDefault()}).on("click",".k-cancel",function(e){n._closeForm(),e.preventDefault()})},refresh:function(){var e=this,t=e.dataSource.filter()||{filters:[],logic:"and"},n=[e._defaultFilter()],i=e._defaultFilter().operator;(e.options.extra||"isnull"!==i&&"isnotnull"!==i)&&n.push(e._defaultFilter()),e.filterModel=d.observable({logic:"and",filters:n}),e.form&&d.bind(e.form.children().first(),e.filterModel),e._bind(t)?e.link.addClass("k-state-active"):e.link.removeClass("k-state-active")},destroy:function(){var e=this;y.fn.destroy.call(e),e.form&&(d.unbind(e.form),d.destroy(e.form),e.form.unbind(g),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null),e.view&&(e.view.purge(),e.view=null),e.link.unbind(g),e._refreshHandler&&(e.dataSource.unbind(m,e._refreshHandler),e.dataSource=null),e.element=e.link=e._refreshHandler=e.filterModel=null},_bind:function(e){var t,n,i,r,o=this,a=e.filters,s=!1,l=0,d=o.filterModel;for(t=0,n=a.length;t<n;t++)r=a[t],r.field==o.field?(d.set("logic",e.logic),i=d.filters[l],i||(d.filters.push({field:o.field}),i=d.filters[l]),i.set("value",o._parse(r.value)),i.set("operator",r.operator),l++,s=!0):r.filters&&(s=s||o._bind(r));return s},_stripFilters:function(t){return e.grep(t,function(e){return""!==e.value&&null!=e.value||"isnull"===e.operator||"isnotnull"===e.operator||"isempty"===e.operator||"isnotempty"===e.operator})},_merge:function(e){var t,i,r,o=this,a=e.logic||"and",s=this._stripFilters(e.filters),l=o.dataSource.filter()||{filters:[],logic:"and"};for(n(l,o.field),i=0,r=s.length;i<r;i++)t=s[i],t.value=o._parse(t.value);return s.length&&(l.filters.length?(e.filters=s,"and"!==l.logic&&(l.filters=[{logic:l.logic,filters:l.filters}],l.logic="and"),l.filters.push(s.length>1?e:s[0])):(l.filters=s,l.logic=a)),l},filter:function(e){var t=this._stripFilters(e.filters);t.length&&this.trigger("change",{filter:{logic:e.logic,filters:t},field:this.field})||(e=this._merge(e),e.filters.length&&this.dataSource.filter(e))},clear:function(){var t=this,n=t.dataSource.filter()||{filters:[]};this.trigger("change",{filter:null,field:t.field})||(n.filters=e.grep(n.filters,function(e){return e.filters?(e.filters=r(e.filters,t.field),e.filters.length):e.field!=t.field}),n.filters.length||(n=null),t.dataSource.filter(n))},_submit:function(e){e.preventDefault(),e.stopPropagation(),this.filter(this.filterModel.toJSON()),this._closeForm()},_reset:function(){this.clear(),this.options.search&&this.container.find("label").parent().show(),this._closeForm()},_closeForm:function(){this._isMobile?this.pane.navigate("",this.options.animations.right):this.popup.close()},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle()},_open:function(){var t;e(".k-filter-menu").not(this.form).each(function(){t=e(this).data(h),t&&t.close()})},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_keydown:function(e){e.keyCode==d.keys.ESC&&this.popup.close()},events:[f,"change"],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:v,neq:_,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with",isnull:"Is null",isnotnull:"Is not null",isempty:"Is empty",isnotempty:"Is not empty"},number:{eq:v,neq:_,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than",isnull:"Is null",isnotnull:"Is not null"},date:{eq:v,neq:_,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before",isnull:"Is null",isnotnull:"Is not null"},enums:{eq:v,neq:_,isnull:"Is null",isnotnull:"Is not null"}},messages:{info:"Show items with value that:",isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",and:"And",or:"Or",selectValue:"-Select value-",operator:"Operator",value:"Value",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}}),E=".kendoFilterMultiCheck",F=d.data.DataSource,R='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=title#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list">#if(search){#<div class=\'k-textbox k-space-right\'><input placeholder=\'#=messages.search#\'/><span class=\'k-icon k-font-icon k-i-search\' /></div>#}#<ul class="k-multicheck-wrap"></ul></li><li class="k-button-container">#if(messages.selectedItemsFormat){#<div class=\'k-filter-selected-items\'></div>#}#<button type="reset" class="k-button">#=messages.clear#</button></li></ul></form></div>',I=y.extend({init:function(t,n){var i,r;y.fn.init.call(this,t,n),n=this.options,this.element=e(t),i=this.field=this.options.field||this.element.attr(d.attr("field")),r=n.checkSource,this._foreignKeyValues()?(this.checkSource=F.create(n.values),this.checkSource.fetch()):n.forceUnique?(r=n.dataSource.options,delete r.pageSize,this.checkSource=F.create(r),this.checkSource.reader.data=l(this.checkSource.reader.data,this.field)):this.checkSource=F.create(r),this.dataSource=n.dataSource,this.model=this.dataSource.reader.model,this._parse=function(e){return e+""},this.model&&this.model.fields&&(i=this.model.fields[this.field],i&&("number"==i.type?this._parse=parseFloat:i.parse&&(this._parse=u(i.parse,i)),this.type=i.type||"string")),n.appendToElement?this._init():this._createLink(),this._refreshHandler=u(this.refresh,this),this.dataSource.bind(m,this._refreshHandler)},_createLink:function(){var e=this.element,t=e.addClass("k-with-icon k-filterable").find(".k-grid-filter");t[0]||(t=e.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-i-filter"/></a>').find(".k-grid-filter")),this._link=t.attr("tabindex",-1).on("click"+g,u(this._click,this))},_init:function(){var e=this,t=this.options.forceUnique,n=this.options;this.pane=n.pane,this.pane&&(this._isMobile=!0),this._createForm(),this._foreignKeyValues()?this.refresh():t&&!this.checkSource.options.serverPaging&&this.dataSource.data().length?(this.checkSource.data(s(this.dataSource.data(),this.field)),this.refresh()):(this._attachProgress(),this.checkSource.fetch(function(){e.refresh.call(e)})),this.options.forceUnique||(this.checkChangeHandler=function(){e.container.empty(),e.refresh()},this.checkSource.bind(m,this.checkChangeHandler)),this.form.on("keydown"+E,u(this._keydown,this)).on("submit"+E,u(this._filter,this)).on("reset"+E,u(this._reset,this)),this.trigger(f,{field:this.field,container:this.form})},_attachProgress:function(){var e=this;this._progressHandler=function(){c.progress(e.container,!0)},this._progressHideHandler=function(){c.progress(e.container,!1)},this.checkSource.bind("progress",this._progressHandler).bind("change",this._progressHideHandler)},_input:function(){var e=this;e._clearTypingTimeout(),e._typingTimeout=setTimeout(function(){e.search()},100)},_clearTypingTimeout:function(){this._typingTimeout&&(clearTimeout(this._typingTimeout),this._typingTimeout=null)},search:function(){var e,t,n,i=this.options.ignoreCase,r=this.searchTextBox[0].value,o=this.container.find("label");for(i&&(r=r.toLowerCase()),e=0,this.options.checkAll&&o.length&&(o[0].parentNode.style.display=r?"none":"",e++);e<o.length;)t=o[e],n=t.textContent||t.innerText,i&&(n=n.toLowerCase()),t.parentNode.style.display=n.indexOf(r)>=0?"":"none",e++},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_createForm:function(){var t,n,i=this.options,r="";this._isMobile||(i.search&&(r+="<div class='k-textbox k-space-right'><input placeholder='"+i.messages.search+"'/><span class='k-icon k-font-icon k-i-search' /></div>"),r+="<ul class='k-reset k-multicheck-wrap'></ul>",i.messages.selectedItemsFormat&&(r+="<div class='k-filter-selected-items'>"+d.format(i.messages.selectedItemsFormat,0)+"</div>"),r+="<button type='submit' class='k-button k-primary'>"+i.messages.filter+"</button>",r+="<button type='reset' class='k-button'>"+i.messages.clear+"</button>",this.form=e('<form class="k-filter-menu"/>').html(r),this.container=this.form.find(".k-multicheck-wrap")),this._isMobile?(t=this,t.form=e("<div />").html(d.template(R)({field:t.field,title:i.title||t.field,ns:d.ns,messages:i.messages,search:i.search})),t.view=t.pane.append(t.form.html()),t.form=t.view.element.find("form"),n=this.view.element,this.container=n.find(".k-multicheck-wrap"),n.on("click",".k-submit",function(e){t.form.submit(),e.preventDefault()}).on("click",".k-cancel",function(e){t._closeForm(),e.preventDefault()})):i.appendToElement?(this.popup=this.element.closest(".k-popup").data(h),this.element.append(this.form)):this.popup=this.form.kendoPopup({anchor:this._link,activate:u(this._activate,this)}).data(h),i.search&&(this.searchTextBox=this.form.find(".k-textbox > input"),this.searchTextBox.on("input",u(this._input,this)))},createCheckAllItem:function(){var t=this.options,n=d.template(t.itemTemplate({field:"all",mobile:this._isMobile})),i=e(n({all:t.messages.checkAll}));this.container.prepend(i),this.checkBoxAll=i.find(":checkbox").eq(0).addClass("k-check-all"),this.checkAllHandler=u(this.checkAll,this),this.checkBoxAll.on(m+E,this.checkAllHandler)},updateCheckAllState:function(){if(this.options.messages.selectedItemsFormat&&this.form.find(".k-filter-selected-items").text(d.format(this.options.messages.selectedItemsFormat,this.container.find(":checked:not(.k-check-all)").length)),this.checkBoxAll){var e=this.container.find(":checkbox:not(.k-check-all)").length==this.container.find(":checked:not(.k-check-all)").length;this.checkBoxAll.prop("checked",e)}},refresh:function(e){var t=this.options.forceUnique,n=this.dataSource,i=this.getFilterArray();this._link&&this._link.toggleClass("k-state-active",0!==i.length),this.form&&(e&&t&&e.sender===n&&!n.options.serverPaging&&("itemchange"==e.action||"add"==e.action||"remove"==e.action||n.options.autoSync&&"sync"===e.action)&&!this._foreignKeyValues()&&(this.checkSource.data(s(this.dataSource.data(),this.field)),this.container.empty()),this.container.is(":empty")&&this.createCheckBoxes(),this.checkValues(i),this.trigger(p))},getFilterArray:function(){var t,n=e.extend(!0,{},{filters:[],logic:"and"},this.dataSource.filter());return o(n,this.field),t=a(n)},createCheckBoxes:function(){var e,t,n,i=this.options,r={field:this.field,format:i.format,mobile:this._isMobile,type:this.type};this.options.forceUnique?this._foreignKeyValues()?(e=this.checkSource.data(),r.valueField="value",r.field="text"):e=this.checkSource.data():e=this.checkSource.view(),t=d.template(i.itemTemplate(r)),n=d.render(t,e),i.checkAll&&this.createCheckAllItem(),this.container.on(m+E,":checkbox",u(this.updateCheckAllState,this)),this.container.append(n)},checkAll:function(){var e=this.checkBoxAll.is(":checked");this.container.find(":checkbox").prop("checked",e)},checkValues:function(t){var n=this;e(e.grep(this.container.find(":checkbox").prop("checked",!1),function(i){var r,o,a=!1;if(!e(i).is(".k-check-all"))for(r=n._parse(e(i).val()),o=0;o<t.length;o++)if(a="date"==n.type?t[o].getTime()==r.getTime():t[o]==r)return a})).prop("checked",!0),this.updateCheckAllState()},_filter:function(t){var n,i;t.preventDefault(),t.stopPropagation(),n={logic:"or"},i=this,n.filters=e.map(this.form.find(":checkbox:checked:not(.k-check-all)"),function(t){return{value:e(t).val(),operator:"eq",field:i.field}}),n.filters.length&&this.trigger("change",{filter:n,field:i.field})||(n=this._merge(n),n.filters.length&&this.dataSource.filter(n),this._closeForm())},_stripFilters:function(t){return e.grep(t,function(e){return null!=e.value})},_foreignKeyValues:function(){var e=this.options;return e.values&&!e.checkSource},destroy:function(){var e=this;y.fn.destroy.call(e),e.form&&(d.unbind(e.form),d.destroy(e.form),e.form.unbind(E),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null,e.container&&(e.container.unbind(E),e.container=null),e.checkBoxAll&&e.checkBoxAll.unbind(E)),e.view&&(e.view.purge(),e.view=null),e._link&&e._link.unbind(g),e._refreshHandler&&(e.dataSource.unbind(m,e._refreshHandler),e.dataSource=null),e.checkChangeHandler&&e.checkSource.unbind(m,e.checkChangeHandler),e._progressHandler&&e.checkSource.unbind("progress",e._progressHandler),e._progressHideHandler&&e.checkSource.unbind("change",e._progressHideHandler),this._clearTypingTimeout(),this.searchTextBox=null,e.element=e.checkSource=e.container=e.checkBoxAll=e._link=e._refreshHandler=e.checkAllHandler=null},options:{name:"FilterMultiCheck",itemTemplate:function(e){var n=e.field,i=e.format,r=e.valueField,o=e.mobile,a="";return r===t&&(r=n),"date"==e.type&&(a=":yyyy-MM-ddTHH:mm:sszzz"),"<li class='k-item'><label class='k-label'><input type='checkbox' class='"+(o?"k-check":"")+"'  value='#:kendo.format('{0"+a+"}',"+r+")#'/>#:kendo.format('"+(i?i:"{0}")+"', "+n+")#</label></li>"},checkAll:!0,search:!1,ignoreCase:!0,appendToElement:!1,messages:{checkAll:"Select All",clear:"Clear",filter:"Filter",search:"Search",cancel:"Cancel",selectedItemsFormat:"{0} items selected"},forceUnique:!0,animations:{left:"slide",right:"slide:right"}},events:[f,p,"change"]});e.extend(I.fn,{_click:D.fn._click,_keydown:D.fn._keydown,_reset:D.fn._reset,_closeForm:D.fn._closeForm,clear:D.fn.clear,_merge:D.fn._merge}),c.plugin(D),c.plugin(I)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.menu.min",["kendo.popup.min"],e)}(function(){return function(e,t){function n(e,t){return e=e.split(" ")[!t+0]||e,e.replace("top","up").replace("bottom","down")}function i(e,t,n){e=e.split(" ")[!t+0]||e;var i={origin:["bottom",n?"right":"left"],position:["top",n?"right":"left"]},r=/left|right/.test(e);return r?(i.origin=["top",e],i.position[1]=d.directions[e].reverse):(i.origin[0]=e,i.position[0]=d.directions[e].reverse),i.origin=i.origin.join(" "),i.position=i.position.join(" "),i}function r(t,n){try{return e.contains(t,n)}catch(i){return!1}}function o(t){t=e(t),t.addClass("k-item").children(x).addClass(I),t.children("a").addClass(S).children(x).addClass(I),t.filter(":not([disabled])").addClass(j),t.filter(".k-separator").empty().append("&nbsp;"),t.filter("li[disabled]").addClass(Y).removeAttr("disabled").attr("aria-disabled",!0),t.filter("[role]").length||t.attr("role","menuitem"),t.children("."+S).length||t.contents().filter(function(){return!(this.nodeName.match(w)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll("<span class='"+S+"'/>"),a(t),s(t)}function a(t){t=e(t),t.find("> .k-link > [class*=k-i-arrow]:not(.k-sprite)").remove(),t.filter(":has(.k-menu-group)").children(".k-link:not(:has([class*=k-i-arrow]:not(.k-sprite)))").each(function(){var t=e(this),n=t.parent().parent();t.append("<span class='k-icon "+(n.hasClass(T+"-horizontal")?"k-i-arrow-s":"k-i-arrow-e")+"'/>")})}function s(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(R),t.filter(".k-last:not(:last-child)").removeClass(D),t.filter(":first-child").addClass(R),t.filter(":last-child").addClass(D)}var l,d=window.kendo,c=d.ui,u=d._activeElement,h=d.support.touch&&d.support.mobileOS,f="mousedown",p="click",m=e.extend,g=e.proxy,v=e.each,_=d.template,b=d.keys,k=c.Widget,w=/^(ul|a|div)$/i,y=".kendoMenu",x="img",C="open",T="k-menu",S="k-link",D="k-last",E="close",F="timer",R="k-first",I="k-image",A="select",M="zIndex",z="activate",H="deactivate",N="touchstart"+y+" MSPointerDown"+y+" pointerdown"+y,P=d.support.pointers,L=d.support.msPointers,B=L||P,O=P?"pointerover":L?"MSPointerOver":"mouseenter",V=P?"pointerout":L?"MSPointerOut":"mouseleave",W=h||B,U=e(document.documentElement),q="kendoPopup",j="k-state-default",$="k-state-hover",G="k-state-focused",Y="k-state-disabled",K="k-state-selected",Q=".k-menu",X=".k-menu-group",J=X+",.k-animation-container",Z=":not(.k-list) > .k-item",ee=".k-item.k-state-disabled",te=".k-item:not(.k-state-disabled)",ne=".k-item:not(.k-state-disabled) > .k-link",ie=":not(.k-item.k-separator)",re=ie+":eq(0)",oe=ie+":last",ae="div:not(.k-animation-container,.k-list-container)",se={2:1,touch:1},le={content:_("<div #= contentCssAttributes(item) # tabindex='-1'>#= content(item) #</div>"),group:_("<ul class='#= groupCssClass(group) #'#= groupAttributes(group) # role='menu' aria-hidden='true'>#= renderItems(data) #</ul>"),itemWrapper:_("<#= tag(item) # class='#= textClass(item) #'#= textAttributes(item) #>#= image(data) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:_("<li class='#= wrapperCssClass(group, item) #' #= itemCssAttributes(item) # role='menuitem'  #=item.items ? \"aria-haspopup='true'\": \"\"##=item.enabled === false ? \"aria-disabled='true'\" : ''#>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:_("<img #= imageCssAttributes(item) # alt='' src='#= item.imageUrl #' />"),arrow:_("<span class='#= arrowClass(item, group) #'></span>"),sprite:_("<span class='k-sprite #= spriteCssClass #'></span>"),empty:_("")},de={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),t.attr&&t.attr.hasOwnProperty("class")&&(n+=" "+t.attr["class"]),t.selected&&(n+=" "+K),n},itemCssAttributes:function(e){var t,n="",i=e.attr||{};for(t in i)i.hasOwnProperty(t)&&"class"!==t&&(n+=t+'="'+i[t]+'" ');return n},imageCssAttributes:function(e){var t,n="",i=e.imageAttr||{};i["class"]?i["class"]+=" "+I:i["class"]=I;for(t in i)i.hasOwnProperty(t)&&(n+=t+'="'+i[t]+'" ');return n},contentCssAttributes:function(e){var t,n="",i=e.contentAttr||{},r="k-content k-group k-menu-group";i["class"]?i["class"]+=" "+r:i["class"]=r;for(t in i)i.hasOwnProperty(t)&&(n+=t+'="'+i[t]+'" ');return n},textClass:function(){return S},textAttributes:function(e){
return e.url?" href='"+e.url+"'":""},arrowClass:function(e,t){var n="k-icon";return n+=t.horizontal?" k-i-arrow-s":" k-i-arrow-e"},text:function(e){return e.encoded===!1?e.text:d.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-menu-group"},content:function(e){return e.content?e.content:"&nbsp;"}},ce=k.extend({init:function(t,n){var i=this;k.fn.init.call(i,t,n),t=i.wrapper=i.element,n=i.options,i._initData(n),i._updateClasses(),i._animations(n),i.nextItemZIndex=100,i._tabindex(),i._focusProxy=g(i._focusHandler,i),t.on(N,te,i._focusProxy).on(p+y,ee,!1).on(p+y,te,g(i._click,i)).on("keydown"+y,g(i._keydown,i)).on("focus"+y,g(i._focus,i)).on("focus"+y,".k-content",g(i._focus,i)).on(N+" "+f+y,".k-content",g(i._preventClose,i)).on("blur"+y,g(i._removeHoverItem,i)).on("blur"+y,"[tabindex]",g(i._checkActiveElement,i)).on(O+y,te,g(i._mouseenter,i)).on(V+y,te,g(i._mouseleave,i)).on(O+y+" "+V+y+" "+f+y+" "+p+y,ne,g(i._toggleHover,i)),n.openOnClick&&(i.clicked=!1,i._documentClickHandler=g(i._documentClick,i),e(document).click(i._documentClickHandler)),t.attr("role","menubar"),t[0].id&&(i._ariaId=d.format("{0}_mn_active",t[0].id)),d.notify(i)},events:[C,E,z,H,A],options:{name:"Menu",animation:{open:{duration:200},close:{duration:100}},orientation:"horizontal",direction:"default",openOnClick:!1,closeOnClick:!0,hoverDelay:100,popupCollision:t},_initData:function(e){var t=this;e.dataSource&&(t.angular("cleanup",function(){return{elements:t.element.children()}}),t.element.empty(),t.append(e.dataSource,t.element),t.angular("compile",function(){return{elements:t.element.children()}}))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=m(!0,t,e.animation),"dataSource"in e&&this._initData(e),this._updateClasses(),k.fn.setOptions.call(this,e)},destroy:function(){var t=this;k.fn.destroy.call(t),t.element.off(y),t._documentClickHandler&&e(document).unbind("click",t._documentClickHandler),d.destroy(t.element)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.length?t.find("> .k-menu-group, > .k-animation-container > .k-menu-group"):null);return v(n.items,function(){n.group.append(this),a(this)}),a(t),s(n.group.find(".k-first, .k-last").add(n.items)),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.before(this),a(this),s(this)}),s(t),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.after(this),a(this),s(this)}),s(t),this},_insert:function(t,n,i){var r,a,s,l,d=this;return n&&n.length||(i=d.element),s=e.isPlainObject(t),l={firstLevel:i.hasClass(T),horizontal:i.hasClass(T+"-horizontal"),expanded:!0,length:i.children().length},n&&!i.length&&(i=e(ce.renderGroup({group:l})).appendTo(n)),s||e.isArray(t)?r=e(e.map(s?[t]:t,function(t,n){return"string"==typeof t?e(t).get():e(ce.renderItem({group:l,item:m(t,{index:n})})).get()})):(r="string"==typeof t&&"<"!=t.charAt(0)?d.element.find(t):e(t),a=r.find("> ul").addClass("k-menu-group").attr("role","menu"),r=r.filter("li"),r.add(a.find("> li")).each(function(){o(this)})),{items:r,group:i}},remove:function(e){var t,n,i,r;return e=this.element.find(e),t=this,n=e.parentsUntil(t.element,Z),i=e.parent("ul:not(.k-menu)"),e.remove(),i&&!i.children(Z).length&&(r=i.parent(".k-animation-container"),r.length?r.remove():i.remove()),n.length&&(n=n.eq(0),a(n),s(n)),t},open:function(r){var o=this,a=o.options,s="horizontal"==a.orientation,l=a.direction,c=d.support.isRtl(o.wrapper);return r=o.element.find(r),/^(top|bottom|default)$/.test(l)&&(l=c?s?(l+" left").replace("default","bottom"):"left":s?(l+" right").replace("default","bottom"):"right"),r.siblings().find(">.k-popup:visible,>.k-animation-container>.k-popup:visible").each(function(){var t=e(this).data("kendoPopup");t&&t.close(!0)}),r.each(function(){var r=e(this);clearTimeout(r.data(F)),r.data(F,setTimeout(function(){var u,f,p,g,v,_,b,k,w=r.find(".k-menu-group:first:hidden");w[0]&&o._triggerEvent({item:r[0],type:C})===!1&&(!w.find(".k-menu-group")[0]&&w.children(".k-item").length>1?(f=e(window).height(),p=function(){w.css({maxHeight:f-(d._outerHeight(w)-w.height())-d.getShadows(w).bottom,overflow:"auto"})},d.support.browser.msie&&d.support.browser.version<=7?setTimeout(p,0):p()):w.css({maxHeight:"",overflow:""}),r.data(M,r.css(M)),r.css(M,o.nextItemZIndex++),u=w.data(q),g=r.parent().hasClass(T),v=g&&s,_=i(l,g,c),b=a.animation.open.effects,k=b!==t?b:"slideIn:"+n(l,g),u?(u=w.data(q),u.options.origin=_.origin,u.options.position=_.position,u.options.animation.open.effects=k):u=w.kendoPopup({activate:function(){o._triggerEvent({item:this.wrapper.parent(),type:z})},deactivate:function(e){e.sender.element.removeData("targetTransform").css({opacity:""}),o._triggerEvent({item:this.wrapper.parent(),type:H})},origin:_.origin,position:_.position,collision:a.popupCollision!==t?a.popupCollision:v?"fit":"fit flip",anchor:r,appendTo:r,animation:{open:m(!0,{effects:k},a.animation.open),close:a.animation.close},close:function(e){var t=e.sender.wrapper.parent();o._triggerEvent({item:t[0],type:E})?e.preventDefault():(t.css(M,t.data(M)),t.removeData(M),h&&(t.removeClass($),o._removeHoverItem()))}}).data(q),w.removeAttr("aria-hidden"),u.open())},o.options.hoverDelay))}),o},close:function(t,n){var i=this,r=i.element;return t=r.find(t),t.length||(t=r.find(">.k-item")),t.each(function(){var t=e(this);!n&&i._isRootItem(t)&&(i.clicked=!1),clearTimeout(t.data(F)),t.data(F,setTimeout(function(){var e=t.find(".k-menu-group:not(.k-list-container):not(.k-calendar-container):first:visible").data(q);e&&(e.close(),e.element.attr("aria-hidden",!0))},i.options.hoverDelay))}),i},_toggleDisabled:function(t,n){this.element.find(t).each(function(){e(this).toggleClass(j,n).toggleClass(Y,!n).attr("aria-disabled",!n)})},_toggleHover:function(t){var n=e(d.eventTarget(t)||t.target).closest(Z),i=t.type==O||f.indexOf(t.type)!==-1;n.parents("li."+Y).length||n.toggleClass($,i||"mousedown"==t.type||"click"==t.type),this._removeHoverItem()},_preventClose:function(){this.options.closeOnClick||(this._closurePrevented=!0)},_checkActiveElement:function(t){var n=this,i=e(t?t.currentTarget:this._hoverItem()),o=n._findRootParent(i)[0];this._closurePrevented||setTimeout(function(){document.hasFocus()&&(r(o,d._activeElement())||!t||r(o,t.currentTarget))||n.close(o)},0),this._closurePrevented=!1},_removeHoverItem:function(){var e=this._hoverItem();e&&e.hasClass(G)&&(e.removeClass(G),this._oldHoverItem=null)},_updateClasses:function(){var e,t=this.element,n=".k-menu-init div ul";t.removeClass("k-menu-horizontal k-menu-vertical"),t.addClass("k-widget k-reset k-header k-menu-init "+T).addClass(T+"-"+this.options.orientation),t.find("li > ul").filter(function(){return!d.support.matchesSelector.call(this,n)}).addClass("k-group k-menu-group").attr("role","menu").attr("aria-hidden",t.is(":visible")).end().find("li > div").addClass("k-content").attr("tabindex","-1"),e=t.find("> li,.k-menu-group > li"),t.removeClass("k-menu-init"),e.each(function(){o(this)})},_mouseenter:function(t){var n=this,i=e(t.currentTarget),o=i.children(".k-animation-container").length||i.children(X).length;t.delegateTarget==i.parents(Q)[0]&&(n.options.openOnClick&&!n.clicked||h||(P||L)&&t.originalEvent.pointerType in se&&n._isRootItem(i.closest(Z))||!r(t.currentTarget,t.relatedTarget)&&o&&n.open(i),(n.options.openOnClick&&n.clicked||W)&&i.siblings().each(g(function(e,t){n.close(t,!0)},n)))},_mouseleave:function(n){var i=this,o=e(n.currentTarget),a=o.children(".k-animation-container").length||o.children(X).length;return o.parentsUntil(".k-animation-container",".k-list-container,.k-calendar-container")[0]?(n.stopImmediatePropagation(),t):(i.options.openOnClick||h||(P||L)&&n.originalEvent.pointerType in se||r(n.currentTarget,n.relatedTarget||n.target)||!a||r(n.currentTarget,d._activeElement())||i.close(o),t)},_click:function(n){for(var i,r,o,a=this,s=a.options,l=e(d.eventTarget(n)),c=l[0],u=l[0]?l[0].nodeName.toUpperCase():"",h="INPUT"==u||"SELECT"==u||"BUTTON"==u||"LABEL"==u,f=l.closest("."+S),p=l.closest(Z),m=p[0],g=f.attr("href"),v=l.attr("href"),_=e("<a href='#' />").attr("href"),b=!!g&&g!==_,k=b&&!!g.match(/^#/),w=!!v&&v!==_,y=s.openOnClick&&o&&a._isRootItem(p);c&&c.parentNode!=m;)c=c.parentNode;if(!e(c).is(ae)){if(p.hasClass(Y))return n.preventDefault(),t;if(n.handled||!a._triggerEvent({item:p[0],type:A})||h||n.preventDefault(),n.handled=!0,r=p.children(J),o=r.is(":visible"),s.closeOnClick&&(!b||k)&&(!r.length||y))return p.removeClass($).css("height"),a._oldHoverItem=a._findRootParent(p),a.close(f.parentsUntil(a.element,Z)),a.clicked=!1,"MSPointerUp".indexOf(n.type)!=-1&&n.preventDefault(),t;b&&n.enterKey&&f[0].click(),(a._isRootItem(p)&&s.openOnClick||d.support.touch||(P||L)&&a._isRootItem(p.closest(Z)))&&(b||h||w||n.preventDefault(),a.clicked=!0,i=r.is(":visible")?E:C,(s.closeOnClick||i!=E)&&a[i](p))}},_documentClick:function(e){r(this.element[0],e.target)||(this.clicked=!1)},_focus:function(n){var i=this,r=n.target,o=i._hoverItem(),a=u();return r==i.wrapper[0]||e(r).is(":kendoFocusable")?(a===n.currentTarget&&(o.length?i._moveHover([],o):i._oldHoverItem||i._moveHover([],i.wrapper.children().first())),t):(n.stopPropagation(),e(r).closest(".k-content").closest(".k-menu-group").closest(".k-item").addClass(G),i.wrapper.focus(),t)},_keydown:function(e){var n,i,r,o=this,a=e.keyCode,s=o._oldHoverItem,l=d.support.isRtl(o.wrapper);if(e.target==e.currentTarget||a==b.ESC){if(s||(s=o._oldHoverItem=o._hoverItem()),i=o._itemBelongsToVertival(s),r=o._itemHasChildren(s),a==b.RIGHT)n=o[l?"_itemLeft":"_itemRight"](s,i,r);else if(a==b.LEFT)n=o[l?"_itemRight":"_itemLeft"](s,i,r);else if(a==b.DOWN)n=o._itemDown(s,i,r);else if(a==b.UP)n=o._itemUp(s,i,r);else if(a==b.ESC)n=o._itemEsc(s,i);else if(a==b.ENTER||a==b.SPACEBAR)n=s.children(".k-link"),n.length>0&&(o._click({target:n[0],preventDefault:function(){},enterKey:!0}),o._moveHover(s,o._findRootParent(s)));else if(a==b.TAB)return n=o._findRootParent(s),o._moveHover(s,n),o._checkActiveElement(),t;n&&n[0]&&(e.preventDefault(),e.stopPropagation())}},_hoverItem:function(){return this.wrapper.find(".k-item.k-state-hover,.k-item.k-state-focused").filter(":visible")},_itemBelongsToVertival:function(e){var t=this.wrapper.hasClass("k-menu-vertical");return e.length?e.parent().hasClass("k-menu-group")||t:t},_itemHasChildren:function(e){return!!e.length&&e.children("ul.k-menu-group, div.k-animation-container").length>0},_moveHover:function(t,n){var i=this,r=i._ariaId;t.length&&n.length&&t.removeClass(G),n.length&&(n[0].id&&(r=n[0].id),n.addClass(G),i._oldHoverItem=n,r&&(i.element.removeAttr("aria-activedescendant"),e("#"+r).removeAttr("id"),n.attr("id",r),i.element.attr("aria-activedescendant",r)))},_findRootParent:function(e){return this._isRootItem(e)?e:e.parentsUntil(Q,"li.k-item").last()},_isRootItem:function(e){return e.parent().hasClass(T)},_itemRight:function(e,t,n){var i,r,o=this;if(!e.hasClass(Y))return t?n?(o.open(e),i=e.find(".k-menu-group").children().first()):"horizontal"==o.options.orientation&&(r=o._findRootParent(e),o.close(r),i=r.nextAll(re)):(i=e.nextAll(re),i.length||(i=e.prevAll(oe))),i&&!i.length?i=o.wrapper.children(".k-item").first():i||(i=[]),o._moveHover(e,i),i},_itemLeft:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._isRootItem(n)&&"horizontal"==i.options.orientation&&(n=n.prevAll(re))):(n=e.prevAll(re),n.length||(n=e.nextAll(oe))),n.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemDown:function(e,t,n){var i,r=this;if(t)i=e.nextAll(re);else{if(!n||e.hasClass(Y))return;r.open(e),i=e.find(".k-menu-group").children().first()}return!i.length&&e.length?i=e.parent().children().first():e.length||(i=r.wrapper.children(".k-item").first()),r._moveHover(e,i),i},_itemUp:function(e,t){var n,i=this;if(t)return n=e.prevAll(re),!n.length&&e.length?n=e.parent().children().last():e.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemEsc:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._moveHover(e,n),n):e},_triggerEvent:function(e){var t=this;return t.trigger(e.type,{type:e.type,item:e.item})},_focusHandler:function(t){var n=this,i=e(d.eventTarget(t)).closest(Z);setTimeout(function(){n._moveHover([],i),i.children(".k-content")[0]&&i.parent().closest(".k-item").removeClass(G)},200)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})}});m(ce,{renderItem:function(e){e=m({menu:{},group:{}},e);var t=le.empty,n=e.item;return le.item(m(e,{image:n.imageUrl?le.image:t,sprite:n.spriteCssClass?le.sprite:t,itemWrapper:le.itemWrapper,renderContent:ce.renderContent,arrow:n.items||n.content?le.arrow:t,subGroup:ce.renderGroup},de))},renderGroup:function(e){return le.group(m({renderItems:function(e){for(var t="",n=0,i=e.items,r=i?i.length:0,o=m({length:r},e.group);n<r;n++)t+=ce.renderItem(m(e,{group:o,item:m({index:n},i[n])}));return t}},e,de))},renderContent:function(e){return le.content(m(e,de))}}),l=ce.extend({init:function(t,n){var i=this;ce.fn.init.call(i,t,n),i._marker=d.guid().substring(0,8),i.target=e(i.options.target),i._popup(),i._wire()},options:{name:"ContextMenu",filter:null,showOn:"contextmenu",orientation:"vertical",alignToAnchor:!1,target:"body"},events:[C,E,z,H,A],setOptions:function(t){var n=this;ce.fn.setOptions.call(n,t),n.target.off(n.showOn+y+n._marker,n._showProxy),n.userEvents&&n.userEvents.destroy(),n.target=e(n.options.target),t.orientation&&n.popup.wrapper[0]&&n.popup.element.unwrap(),n._wire(),ce.fn.setOptions.call(this,t)},destroy:function(){var e=this;e.target.off(e.options.showOn+y+e._marker),U.off(d.support.mousedown+y+e._marker,e._closeProxy),e.userEvents&&e.userEvents.destroy(),ce.fn.destroy.call(e)},open:function(n,i){var o=this;return n=e(n)[0],r(o.element[0],e(n)[0])?ce.fn.open.call(o,n):o._triggerEvent({item:o.element,type:C})===!1&&(o.popup.visible()&&o.options.filter&&(o.popup.close(!0),o.popup.element.kendoStop(!0)),i!==t?(o.popup.wrapper.hide(),o.popup.open(n,i)):(o.popup.options.anchor=(n?n:o.popup.anchor)||o.target,o.popup.element.kendoStop(!0),o.popup.open()),U.off(o.popup.downEvent,o.popup._mousedownProxy),U.on(d.support.mousedown+y+o._marker,o._closeProxy)),o},close:function(){var t=this;r(t.element[0],e(arguments[0])[0])?ce.fn.close.call(t,arguments[0]):t.popup.visible()&&t._triggerEvent({item:t.element,type:E})===!1&&(t.popup.close(),U.off(d.support.mousedown+y,t._closeProxy),t.unbind(A,t._closeTimeoutProxy))},_showHandler:function(e){var t,n=e,i=this,o=i.options;e.event&&(n=e.event,n.pageX=e.x.location,n.pageY=e.y.location),r(i.element[0],e.relatedTarget||e.target)||(i._eventOrigin=n,n.preventDefault(),n.stopImmediatePropagation(),i.element.find("."+G).removeClass(G),(o.filter&&d.support.matchesSelector.call(n.currentTarget,o.filter)||!o.filter)&&(o.alignToAnchor?(i.popup.options.anchor=n.currentTarget,i.open(n.currentTarget)):(i.popup.options.anchor=n.currentTarget,i._targetChild?(t=i.target.offset(),i.open(n.pageX-t.left,n.pageY-t.top)):i.open(n.pageX,n.pageY))))},_closeHandler:function(t){var n,i=this,o=e(t.relatedTarget||t.target),a=o.closest(i.target.selector)[0]==i.target[0],s=o.closest(te).children(J),l=r(i.element[0],o[0]);i._eventOrigin=t,n=3!==t.which,i.popup.visible()&&(n&&a||!a)&&(i.options.closeOnClick&&!s[0]&&l||!l)&&(l?(this.unbind(A,this._closeTimeoutProxy),i.bind(A,i._closeTimeoutProxy)):i.close())},_wire:function(){var e=this,t=e.options,n=e.target;e._showProxy=g(e._showHandler,e),e._closeProxy=g(e._closeHandler,e),e._closeTimeoutProxy=g(e.close,e),n[0]&&(d.support.mobileOS&&"contextmenu"==t.showOn?(e.userEvents=new d.UserEvents(n,{filter:t.filter,allowSelection:!1}),n.on(t.showOn+y+e._marker,!1),e.userEvents.bind("hold",e._showProxy)):t.filter?n.on(t.showOn+y+e._marker,t.filter,e._showProxy):n.on(t.showOn+y+e._marker,e._showProxy))},_triggerEvent:function(n){var i=this,r=e(i.popup.options.anchor)[0],o=i._eventOrigin;return i._eventOrigin=t,i.trigger(n.type,m({type:n.type,item:n.item||this.element[0],target:r},o?{event:o}:{}))},_popup:function(){var e=this;e._triggerProxy=g(e._triggerEvent,e),e.popup=e.element.addClass("k-context-menu").kendoPopup({anchor:e.target||"body",copyAnchorStyles:e.options.copyAnchorStyles,collision:e.options.popupCollision||"fit",animation:e.options.animation,activate:e._triggerProxy,deactivate:e._triggerProxy}).data("kendoPopup"),e._targetChild=r(e.target[0],e.popup.element[0])}}),c.plugin(ce),c.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.columnmenu.min",["kendo.popup.min","kendo.filtermenu.min","kendo.menu.min"],e)}(function(){return function(e,t){function n(t){return e.trim(t).replace(/&nbsp;/gi,"")}function i(e,t){var n,i,r,o={};for(n=0,i=e.length;n<i;n++)r=e[n],o[r[t]]=r;return o}function r(e){var t,n=[];for(t=0;t<e.length;t++)e[t].columns?n=n.concat(r(e[t].columns)):n.push(e[t]);return n}var o=window.kendo,a=o.ui,s=e.proxy,l=e.extend,d=e.grep,c=e.map,u=e.inArray,h="k-state-selected",f="asc",p="desc",m="change",g="init",v="select",_="kendoPopup",b="kendoFilterMenu",k="kendoMenu",w=".kendoColumnMenu",y=a.Widget,x=y.extend({init:function(t,n){var i,r=this;y.fn.init.call(r,t,n),t=r.element,n=r.options,r.owner=n.owner,r.dataSource=n.dataSource,r.field=t.attr(o.attr("field")),r.title=t.attr(o.attr("title")),i=t.find(".k-header-column-menu"),i[0]||(i=t.addClass("k-with-icon").prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s">'+n.messages.settings+"</span></a>").find(".k-header-column-menu")),r.link=i.attr("tabindex",-1).on("click"+w,s(r._click,r)),r.wrapper=e('<div class="k-column-menu"/>'),r._refreshHandler=s(r.refresh,r),r.dataSource.bind(m,r._refreshHandler)},_init:function(){var e=this;e.pane=e.options.pane,e.pane&&(e._isMobile=!0),e._isMobile?e._createMobileMenu():e._createMenu(),e.owner._muteAngularRebind(function(){e._angularItems("compile")}),e._sort(),e._columns(),e._filter(),e._lockColumns(),e.trigger(g,{field:e.field,container:e.wrapper})},events:[g,"sort","filtering"],options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns",done:"Done",settings:"Column Settings",lock:"Lock",unlock:"Unlock"},filter:"",columns:!0,sortable:!0,filterable:!0,animations:{left:"slide"}},_createMenu:function(){var e=this,t=e.options;e.wrapper.html(o.template(C)({uid:o.guid(),ns:o.ns,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:e._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns})),e.popup=e.wrapper[_]({anchor:e.link,open:s(e._open,e),activate:s(e._activate,e),close:function(){e.options.closeCallback&&e.options.closeCallback(e.element)}}).data(_),e.menu=e.wrapper.children()[k]({orientation:"vertical",closeOnClick:!1}).data(k)},_createMobileMenu:function(){var e=this,t=e.options,n=o.template(T)({ns:o.ns,field:e.field,title:e.title||e.field,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:e._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns});e.view=e.pane.append(n),e.wrapper=e.view.element.find(".k-column-menu"),e.menu=new S(e.wrapper.children(),{pane:e.pane}),e.view.element.on("click",".k-done",function(t){e.close(),t.preventDefault()}),e.options.lockedColumns&&e.view.bind("show",function(){e._updateLockedColumns()})},_angularItems:function(t){var n=this;n.angular(t,function(){var t=n.wrapper.find(".k-columns-item input["+o.attr("field")+"]").map(function(){return e(this).closest("li")}),i=c(n._ownerColumns(),function(e){return{column:e._originalObject}});return{elements:t,data:i}})},destroy:function(){var e=this;e._angularItems("cleanup"),y.fn.destroy.call(e),e.filterMenu&&e.filterMenu.destroy(),e._refreshHandler&&e.dataSource.unbind(m,e._refreshHandler),e.options.columns&&e.owner&&(e._updateColumnsMenuHandler&&(e.owner.unbind("columnShow",e._updateColumnsMenuHandler),e.owner.unbind("columnHide",e._updateColumnsMenuHandler)),e._updateColumnsLockedStateHandler&&(e.owner.unbind("columnLock",e._updateColumnsLockedStateHandler),e.owner.unbind("columnUnlock",e._updateColumnsLockedStateHandler))),e.menu&&(e.menu.element.off(w),e.menu.destroy()),e.wrapper.off(w),e.popup&&e.popup.destroy(),e.view&&e.view.purge(),e.link.off(w),e.owner=null,e.wrapper=null,e.element=null},close:function(){this.menu.close(),this.popup&&(this.popup.close(),this.popup.element.off("keydown"+w))},_click:function(e){e.preventDefault(),e.stopPropagation();var t=this.options;t.filter&&this.element.is(!t.filter)||(this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle())},_open:function(){var t=this;e(".k-column-menu").not(t.wrapper).each(function(){e(this).data(_).close()}),t.popup.element.on("keydown"+w,function(e){e.keyCode==o.keys.ESC&&t.close()}),t.options.lockedColumns&&t._updateLockedColumns()},_activate:function(){this.menu.element.focus()},_ownerColumns:function(){var e=r(this.owner.columns),t=d(e,function(e){var t=!0,i=n(e.title||"");return e.menu!==!1&&(e.field||i.length)||(t=!1),t});return c(t,function(t){return{originalField:t.field,field:t.field||t.title,title:t.title||t.field,hidden:t.hidden,index:u(t,e),locked:!!t.locked,_originalObject:t}})},_sort:function(){var t=this;t.options.sortable&&(t.refresh(),t.menu.bind(v,function(n){var i,r=e(n.item);r.hasClass("k-sort-asc")?i=f:r.hasClass("k-sort-desc")&&(i=p),i&&(r.parent().find(".k-sort-"+(i==f?p:f)).removeClass(h),t._sortDataSource(r,i),t.close())}))},_sortDataSource:function(e,n){var i,r,o=this,a=o.options.sortable,s=null===a.compare?t:a.compare,l=o.dataSource,d=l.sort()||[],c=e.hasClass(h)&&a&&a.allowUnsort!==!1;if(n=c?t:n,!o.trigger("sort",{sort:{field:o.field,dir:n,compare:s}})){if(c?e.removeClass(h):e.addClass(h),"multiple"===a.mode){for(i=0,r=d.length;i<r;i++)if(d[i].field===o.field){d.splice(i,1);break}d.push({field:o.field,dir:n,compare:s})}else d=[{field:o.field,dir:n,compare:s}];l.sort(d)}},_columns:function(){var t=this;t.options.columns&&(t._updateColumnsMenu(),t._updateColumnsMenuHandler=s(t._updateColumnsMenu,t),t.owner.bind(["columnHide","columnShow"],t._updateColumnsMenuHandler),t._updateColumnsLockedStateHandler=s(t._updateColumnsLockedState,t),t.owner.bind(["columnUnlock","columnLock"],t._updateColumnsLockedStateHandler),t.menu.bind(v,function(n){var i,a,s,l=e(n.item),c=r(t.owner.columns);t._isMobile&&n.preventDefault(),l.parent().closest("li.k-columns-item")[0]&&(i=l.find(":checkbox"),i.attr("disabled")||(s=i.attr(o.attr("field")),a=d(c,function(e){return e.field==s||e.title==s})[0],a.hidden===!0?t.owner.showColumn(a):t.owner.hideColumn(a)))}))},_updateColumnsMenu:function(){var e,t,n,i,r,a,s=o.attr("field"),l=o.attr("locked"),h=d(this._ownerColumns(),function(e){return!e.hidden}),f=d(h,function(e){return e.originalField}),p=d(f,function(e){return e.locked===!0}).length,m=d(f,function(e){return e.locked!==!0}).length;for(h=c(h,function(e){return e.field}),this.wrapper.find("[role='menuitemcheckbox']").attr("aria-checked",!1),a=this.wrapper.find(".k-columns-item input["+s+"]").prop("disabled",!1).prop("checked",!1),e=0,t=a.length;e<t;e++)n=a.eq(e),r="true"===n.attr(l),i=!1,u(n.attr(s),h)>-1&&(i=!0,n.prop("checked",i)),n.closest("[role='menuitemcheckbox']").attr("aria-checked",i),i&&(1==p&&r&&n.prop("disabled",!0),1!=m||r||n.prop("disabled",!0))},_updateColumnsLockedState:function(){var e,t,n,r,a=o.attr("field"),s=o.attr("locked"),l=i(this._ownerColumns(),"field"),d=this.wrapper.find(".k-columns-item input[type=checkbox]");for(e=0,t=d.length;e<t;e++)n=d.eq(e),r=l[n.attr(a)],r&&n.attr(s,r.locked);this._updateColumnsMenu()},_filter:function(){var t=this,n=b,i=t.options;i.filterable!==!1&&(i.filterable.multi&&(n="kendoFilterMultiCheck",i.filterable.dataSource&&(i.filterable.checkSource=i.filterable.dataSource,delete i.filterable.dataSource)),t.filterMenu=t.wrapper.find(".k-filterable")[n](l(!0,{},{appendToElement:!0,dataSource:i.dataSource,values:i.values,field:t.field,title:t.title,change:function(e){t.trigger("filtering",{filter:e.filter,field:e.field})&&e.preventDefault()}},i.filterable)).data(n),t._isMobile&&t.menu.bind(v,function(n){var i=e(n.item);i.hasClass("k-filter-item")&&t.pane.navigate(t.filterMenu.view,t.options.animations.left)}))},_lockColumns:function(){var t=this;t.menu.bind(v,function(n){var i=e(n.item);i.hasClass("k-lock")?(t.owner.lockColumn(t.field),t.close()):i.hasClass("k-unlock")&&(t.owner.unlockColumn(t.field),t.close())})},_updateLockedColumns:function(){var e,t,n,i,r=this.field,o=this.owner.columns,a=d(o,function(e){return e.field==r||e.title==r})[0];a&&(e=a.locked===!0,t=d(o,function(t){return!t.hidden&&(t.locked&&e||!t.locked&&!e)}).length,n=this.wrapper.find(".k-lock").removeClass("k-state-disabled"),i=this.wrapper.find(".k-unlock").removeClass("k-state-disabled"),(e||1==t)&&n.addClass("k-state-disabled"),e&&1!=t||i.addClass("k-state-disabled"),this._updateColumnsLockedState())},refresh:function(){var e,t,n,i=this,r=i.options.dataSource.sort()||[],o=i.field;for(i.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(h),t=0,n=r.length;t<n;t++)e=r[t],o==e.field&&i.wrapper.find(".k-sort-"+e.dir).addClass(h);i.link[i._filterExist(i.dataSource.filter())?"addClass":"removeClass"]("k-state-active")},_filterExist:function(e){var t,n,i,r=!1;if(e){for(e=e.filters,n=0,i=e.length;n<i;n++)t=e[n],t.field==this.field?r=!0:t.filters&&(r=r||this._filterExist(t));return r}}}),C='<ul id="#=uid#">#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#if(showColumns || filterable){#<li class="k-separator" role="presentation"></li>#}##}##if(showColumns){#<li class="k-item k-columns-item" aria-haspopup="true"><span class="k-link"><span class="k-sprite k-i-columns"></span>${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li role="menuitemcheckbox" aria-checked="false"><input type="checkbox" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</li>#}#</ul></li>#if(filterable || lockedColumns){#<li class="k-separator" role="presentation"></li>#}##}##if(filterable){#<li class="k-item k-filter-item" aria-haspopup="true"><span class="k-link"><span class="k-sprite k-filter"></span>${messages.filter}</span><ul><li><div class="k-filterable"></div></li></ul></li>#if(lockedColumns){#<li class="k-separator" role="presentation"></li>#}##}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}#</ul>',T='<div data-#=ns#role="view" data-#=ns#init-widgets="false" data-#=ns#use-native-scrolling="true" class="k-grid-column-menu"><div data-#=ns#role="header" class="k-header">${messages.settings}<button class="k-button k-done">#=messages.done#</button></div><div class="k-column-menu k-mobile-list"><ul><li><span class="k-link">${title}</span><ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link k-filterable"><span class="k-sprite k-filter"></span>${messages.filter}</span></li>#}#</ul></li>#if(showColumns){#<li class="k-columns-item"><span class="k-link">${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li class="k-item"><label class="k-label"><input type="checkbox" class="k-check" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</label></li>#}#</ul></li>#}#</ul></div></div>',S=y.extend({init:function(e,t){y.fn.init.call(this,e,t),this.element.on("click"+w,"li.k-item:not(.k-separator):not(.k-state-disabled)","_click")},events:[v],_click:function(t){e(t.target).is("[type=checkbox]")||t.preventDefault(),this.trigger(v,{item:t.currentTarget})},close:function(){this.options.pane.navigate("")},destroy:function(){y.fn.destroy.call(this),this.element.off(w)}});a.plugin(x)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.columnsorter.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o="dir",a="asc",s="single",l="field",d="desc",c=".kendoColumnSorter",u=".k-link",h="aria-sort",f=e.proxy,p=r.extend({init:function(e,t){var n,i=this;r.fn.init.call(i,e,t),i._refreshHandler=f(i.refresh,i),i.dataSource=i.options.dataSource.bind("change",i._refreshHandler),n=i.element.find(u),n[0]||(n=i.element.wrapInner('<a class="k-link" href="#"/>').find(u)),i.link=n,i.element.on("click"+c,f(i._click,i))},options:{name:"ColumnSorter",mode:s,allowUnsort:!0,compare:null,filter:""},events:["change"],destroy:function(){var e=this;r.fn.destroy.call(e),e.element.off(c),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(){var t,i,r,s,c=this,u=c.dataSource.sort()||[],f=c.element,p=f.attr(n.attr(l));for(f.removeAttr(n.attr(o)),f.removeAttr(h),t=0,i=u.length;t<i;t++)r=u[t],p==r.field&&f.attr(n.attr(o),r.dir);s=f.attr(n.attr(o)),f.find(".k-i-arrow-n,.k-i-arrow-s").remove(),s===a?(e('<span class="k-icon k-i-arrow-n" />').appendTo(c.link),f.attr(h,"ascending")):s===d&&(e('<span class="k-icon k-i-arrow-s" />').appendTo(c.link),f.attr(h,"descending"))},_click:function(e){var i,r,c=this,u=c.element,h=u.attr(n.attr(l)),f=u.attr(n.attr(o)),p=c.options,m=null===c.options.compare?t:c.options.compare,g=c.dataSource.sort()||[];if(e.preventDefault(),(!p.filter||u.is(p.filter))&&(f=f===a?d:f===d&&p.allowUnsort?t:a,!this.trigger("change",{sort:{field:h,dir:f,compare:m}}))){if(p.mode===s)g=[{field:h,dir:f,compare:m}];else if("multiple"===p.mode){for(i=0,r=g.length;i<r;i++)if(g[i].field===h){g.splice(i,1);break}g.push({field:h,dir:f,compare:m})}this.dataSource.sort(g)}}});i.plugin(p)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.editable.min",["kendo.datepicker.min","kendo.numerictextbox.min","kendo.validator.min","kendo.binder.min"],e)}(function(){return function(e,t){function n(t){return t=null!=t?t:"",t.type||e.type(t)||"string"}function i(t){t.find(":input:not(:button, ["+s.attr("role")+"=upload], ["+s.attr("skip")+"], [type=file]), select").each(function(){var t=s.attr("bind"),n=this.getAttribute(t)||"",i="checkbox"===this.type||"radio"===this.type?"checked:":"value:",r=this.name;n.indexOf(i)===-1&&r&&(n+=(n.length?",":"")+i+r,e(this).attr(t,n))})}function r(e){var t,i,r=(e.model.fields||e.model)[e.field],o=n(r),a=r?r.validation:{},l=s.attr("type"),d=s.attr("bind"),c={name:e.field};for(t in a)i=a[t],p(t,_)>=0?c[l]=t:h(i)||(c[t]=f(i)?i.value||t:i),
c[s.attr(t+"-msg")]=i.message;return p(o,_)>=0&&(c[l]=o),c[d]=("boolean"===o?"checked:":"value:")+e.field,c}function o(e){var t,n,i,r,o,a;if(e&&e.length)for(a=[],t=0,n=e.length;t<n;t++)i=e[t],o=i.text||i.value||i,r=null==i.value?i.text||i:i.value,a[t]={text:o,value:r};return a}function a(e,t){var n,i,r=e?e.validation||{}:{};for(n in r)i=r[n],f(i)&&i.value&&(i=i.value),h(i)&&(t[n]=i)}var s=window.kendo,l=s.ui,d=l.Widget,c=e.extend,u=s.support.browser.msie&&s.support.browser.version<9,h=s.isFunction,f=e.isPlainObject,p=e.inArray,m=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,g='<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-i-warning"> </span>#=message#<div class="k-callout k-callout-n"></div></div>',v="change",_=["url","email","number","date","boolean"],b={number:function(t,n){var i=r(n);e('<input type="text"/>').attr(i).appendTo(t).kendoNumericTextBox({format:n.format}),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},date:function(t,n){var i=r(n),o=n.format;o&&(o=s._extractFormat(o)),i[s.attr("format")]=o,e('<input type="text"/>').attr(i).appendTo(t).kendoDatePicker({format:n.format}),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},string:function(t,n){var i=r(n);e('<input type="text" class="k-input k-textbox"/>').attr(i).appendTo(t)},"boolean":function(t,n){var i=r(n);e('<input type="checkbox" />').attr(i).appendTo(t)},values:function(t,n){var i=r(n),a=s.stringify(o(n.values));e("<select "+s.attr("text-field")+'="text"'+s.attr("value-field")+'="value"'+s.attr("source")+"='"+(a?a.replace(/\'/g,"&apos;"):a)+"'"+s.attr("role")+'="dropdownlist"/>').attr(i).appendTo(t),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)}},k=d.extend({init:function(t,n){var i=this;n.target&&(n.$angular=n.target.options.$angular),d.fn.init.call(i,t,n),i._validateProxy=e.proxy(i._validate,i),i.refresh()},events:[v],options:{name:"Editable",editors:b,clearContainer:!0,errorTemplate:g},editor:function(e,t){var i=this,r=i.options.editors,o=f(e),a=o?e.field:e,l=i.options.model||{},d=o&&e.values,u=d?"values":n(t),h=o&&e.editor,p=h?e.editor:r[u],g=i.element.find("["+s.attr("container-for")+"="+a.replace(m,"\\$1")+"]");p=p?p:r.string,h&&"string"==typeof e.editor&&(p=function(t){t.append(e.editor)}),g=g.length?g:i.element,p(g,c(!0,{},o?e:{field:a},{model:l}))},_validate:function(t){var n,i=this,r=t.value,o=i._validationEventInProgress,a={},l=s.attr("bind"),d=t.field.replace(m,"\\$1"),c=RegExp("(value|checked)\\s*:\\s*"+d+"\\s*(,|$)");a[t.field]=t.value,n=e(":input["+l+'*="'+d+'"]',i.element).filter("["+s.attr("validate")+"!='false']").filter(function(){return c.test(e(this).attr(l))}),n.length>1&&(n=n.filter(function(){var t=e(this);return!t.is(":radio")||t.val()==r}));try{i._validationEventInProgress=!0,(!i.validatable.validateInput(n)||!o&&i.trigger(v,{values:a}))&&t.preventDefault()}finally{i._validationEventInProgress=!1}},end:function(){return this.validatable.validate()},destroy:function(){var e=this;e.angular("cleanup",function(){return{elements:e.element}}),d.fn.destroy.call(e),e.options.model.unbind("set",e._validateProxy),s.unbind(e.element),e.validatable&&e.validatable.destroy(),s.destroy(e.element),e.element.removeData("kendoValidator"),e.element.is("["+s.attr("role")+"=editable]")&&e.element.removeAttr(s.attr("role"))},refresh:function(){var n,r,o,l,d,c,h,p,m=this,g=m.options.fields||[],v=m.options.clearContainer?m.element.empty():m.element,_=m.options.model||{},b={};for(e.isArray(g)||(g=[g]),n=0,r=g.length;n<r;n++)o=g[n],l=f(o),d=l?o.field:o,c=(_.fields||_)[d],a(c,b),m.editor(o,c);if(m.options.target&&m.angular("compile",function(){return{elements:v,data:v.map(function(){return{dataItem:_}})}}),!r){h=_.fields||_;for(d in h)a(h[d],b)}i(v),m.validatable&&m.validatable.destroy(),s.bind(v,m.options.model),m.options.model.unbind("set",m._validateProxy),m.options.model.bind("set",m._validateProxy),m.validatable=new s.ui.Validator(v,{validateOnBlur:!1,errorTemplate:m.options.errorTemplate||t,rules:b}),p=v.find(":kendoFocusable").eq(0).focus(),u&&p.focus()}});l.plugin(k)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.window.min",["kendo.draganddrop.min"],e)}(function(){return function(e,t){function n(e){return t!==e}function i(e,t,n){return Math.max(Math.min(parseInt(e,10),n===1/0?n:parseInt(n,10)),parseInt(t,10))}function r(){return!this.type||this.type.toLowerCase().indexOf("script")>=0}function o(e){var t=this;t.owner=e,t._preventDragging=!1,t._draggable=new d(e.wrapper,{filter:">"+C,group:e.wrapper.id+"-resizing",dragstart:p(t.dragstart,t),drag:p(t.drag,t),dragend:p(t.dragend,t)}),t._draggable.userEvents.bind("press",p(t.addOverlay,t)),t._draggable.userEvents.bind("release",p(t.removeOverlay,t))}function a(e,t){var n=this;n.owner=e,n._preventDragging=!1,n._draggable=new d(e.wrapper,{filter:t,group:e.wrapper.id+"-moving",dragstart:p(n.dragstart,n),drag:p(n.drag,n),dragend:p(n.dragend,n),dragcancel:p(n.dragcancel,n)}),n._draggable.userEvents.stopPropagation=!1}var s=window.kendo,l=s.ui.Widget,d=s.ui.Draggable,c=e.isPlainObject,u=s._activeElement,h=s._outerWidth,f=s._outerHeight,p=e.proxy,m=e.extend,g=e.each,v=s.template,_="body",b=".kendoWindow",k=".k-window",w=".k-window-title",y=w+"bar",x=".k-window-content",C=".k-resize-handle",T=".k-overlay",S="k-content-frame",D="k-i-loading",E="k-state-hover",F="k-state-focused",R="k-window-maximized",I=":visible",A="hidden",M="cursor",z="open",H="activate",N="deactivate",P="close",L="refresh",B="minimize",O="maximize",V="resizeStart",W="resize",U="resizeEnd",q="dragstart",j="dragend",$="error",G="overflow",Y="zIndex",K=".k-window-actions .k-i-minimize,.k-window-actions .k-i-maximize",Q=".k-i-pin",X=".k-i-unpin",J=Q+","+X,Z=".k-window-titlebar .k-window-action",ee=".k-window-titlebar .k-i-refresh",te=s.isLocalUrl,ne=l.extend({init:function(i,o){var a,d,u,h,f,m,g,v=this,_={},C=!1,T=o&&o.actions&&!o.actions.length;l.fn.init.call(v,i,o),o=v.options,h=o.position,i=v.element,f=o.content,T&&(o.actions=[]),v.appendTo=e(o.appendTo),f&&!c(f)&&(f=o.content={url:f}),i.find("script").filter(r).remove(),i.parent().is(v.appendTo)||h.top!==t&&h.left!==t||(i.is(I)?(_=i.offset(),C=!0):(d=i.css("visibility"),u=i.css("display"),i.css({visibility:A,display:""}),_=i.offset(),i.css({visibility:d,display:u})),h.top===t&&(h.top=_.top),h.left===t&&(h.left=_.left)),n(o.visible)&&null!==o.visible||(o.visible=i.is(I)),a=v.wrapper=i.closest(k),i.is(".k-content")&&a[0]||(i.addClass("k-window-content k-content"),v._createWindow(i,o),a=v.wrapper=i.closest(k),v._dimensions()),v._position(),o.pinned&&v.pin(!0),f&&v.refresh(f),o.visible&&v.toFront(),m=a.children(x),v._tabindex(m),o.visible&&o.modal&&v._overlay(a.is(I)).css({opacity:.5}),a.on("mouseenter"+b,Z,p(v._buttonEnter,v)).on("mouseleave"+b,Z,p(v._buttonLeave,v)).on("click"+b,"> "+Z,p(v._windowActionHandler,v)),m.on("keydown"+b,p(v._keydown,v)).on("focus"+b,p(v._focus,v)).on("blur"+b,p(v._blur,v)),this._resizable(),this._draggable(),g=i.attr("id"),g&&(g+="_wnd_title",a.children(y).children(w).attr("id",g),m.attr({role:"dialog","aria-labelledby":g})),a.add(a.children(".k-resize-handle,"+y)).on("mousedown"+b,p(v.toFront,v)),v.touchScroller=s.touchScroller(i),v._resizeHandler=p(v._onDocumentResize,v),v._marker=s.guid().substring(0,8),e(window).on("resize"+b+v._marker,v._resizeHandler),o.visible&&(v.trigger(z),v.trigger(H)),s.notify(v)},_buttonEnter:function(t){e(t.currentTarget).addClass(E)},_buttonLeave:function(t){e(t.currentTarget).removeClass(E)},_focus:function(){this.wrapper.addClass(F)},_blur:function(){this.wrapper.removeClass(F)},_dimensions:function(){var e,t,n=this.wrapper,r=this.options,o=r.width,a=r.height,s=r.maxHeight,l=["minWidth","minHeight","maxWidth","maxHeight"];for(this.title(r.title),e=0;e<l.length;e++)t=r[l[e]]||"",t!=1/0&&n.css(l[e],t);s!=1/0&&this.element.css("maxHeight",s),n.width(o?(""+o).indexOf("%")>0?o:i(o,r.minWidth,r.maxWidth):""),n.height(a?(""+a).indexOf("%")>0?a:i(a,r.minHeight,r.maxHeight):""),r.visible||n.hide()},_position:function(){var e=this.wrapper,t=this.options.position;0===t.top&&(t.top=""+t.top),0===t.left&&(t.left=""+t.left),e.css({top:t.top||"",left:t.left||""})},_animationOptions:function(e){var t=this.options.animation,n={open:{effects:{}},close:{hide:!0,effects:{}}};return t&&t[e]||n[e]},_resize:function(){s.resize(this.element.children())},_resizable:function(){var t=this.options.resizable,n=this.wrapper;this.resizing&&(n.off("dblclick"+b).children(C).remove(),this.resizing.destroy(),this.resizing=null),t&&(n.on("dblclick"+b,y,p(function(t){e(t.target).closest(".k-window-action").length||this.toggleMaximization()},this)),g("n e s w se sw ne nw".split(" "),function(e,t){n.append(ie.resizeHandle(t))}),this.resizing=new o(this)),n=null},_draggable:function(){var e=this.options.draggable;this.dragging&&(this.dragging.destroy(),this.dragging=null),e&&(this.dragging=new a(this,e.dragHandle||y))},_actions:function(){var t=this.options.actions,n=this.wrapper.children(y),i=n.find(".k-window-actions");t=e.map(t,function(e){return{name:e}}),i.html(s.render(ie.action,t))},setOptions:function(e){var n,i;l.fn.setOptions.call(this,e),n=this.options.scrollable!==!1,this.restore(),this._dimensions(),this._position(),this._resizable(),this._draggable(),this._actions(),t!==e.modal&&(i=this.options.visible!==!1,this._overlay(e.modal&&i)),this.element.css(G,n?"":"hidden")},events:[z,H,N,P,B,O,L,V,W,U,q,j,$],options:{name:"Window",animation:{open:{effects:{zoom:{direction:"in"},fade:{direction:"in"}},duration:350},close:{effects:{zoom:{direction:"out",properties:{scale:.7}},fade:{direction:"out"}},duration:350,hide:!0}},title:"",actions:["Close"],autoFocus:!0,modal:!1,resizable:!0,draggable:!0,minWidth:90,minHeight:50,maxWidth:1/0,maxHeight:1/0,pinned:!1,scrollable:!0,position:{},content:null,visible:null,height:null,width:null,appendTo:"body",isMaximized:!1,isMinimized:!1},_closable:function(){return e.inArray("close",e.map(this.options.actions,function(e){return e.toLowerCase()}))>-1},_keydown:function(e){var t,n,r,o,a,l,d=this,c=d.options,u=s.keys,h=e.keyCode,f=d.wrapper,p=10,m=d.options.isMaximized;e.target!=e.currentTarget||d._closing||(h==u.ESC&&d._closable()&&d._close(!1),!c.draggable||e.ctrlKey||m||(t=s.getOffset(f),h==u.UP?n=f.css("top",t.top-p):h==u.DOWN?n=f.css("top",t.top+p):h==u.LEFT?n=f.css("left",t.left-p):h==u.RIGHT&&(n=f.css("left",t.left+p))),c.resizable&&e.ctrlKey&&!m&&(h==u.UP?(n=!0,o=f.height()-p):h==u.DOWN&&(n=!0,o=f.height()+p),h==u.LEFT?(n=!0,r=f.width()-p):h==u.RIGHT&&(n=!0,r=f.width()+p),n&&(a=i(r,c.minWidth,c.maxWidth),l=i(o,c.minHeight,c.maxHeight),isNaN(a)||(f.width(a),d.options.width=a+"px"),isNaN(l)||(f.height(l),d.options.height=l+"px"),d.resize())),n&&e.preventDefault())},_overlay:function(t){var n=this.appendTo.children(T),i=this.wrapper;return n.length||(n=e("<div class='k-overlay' />")),n.insertBefore(i[0]).toggle(t).css(Y,parseInt(i.css(Y),10)-1),n},_actionForIcon:function(e){var t=/\bk-i-\w+\b/.exec(e[0].className)[0];return{"k-i-close":"_close","k-i-maximize":"maximize","k-i-minimize":"minimize","k-i-restore":"restore","k-i-refresh":"refresh","k-i-pin":"pin","k-i-unpin":"unpin"}[t]},_windowActionHandler:function(n){var i,r;if(!this._closing)return i=e(n.target).closest(".k-window-action").find(".k-icon"),r=this._actionForIcon(i),r?(n.preventDefault(),this[r](),!1):t},_modals:function(){var t=this,n=e(k).filter(function(){var n=e(this),i=t._object(n),r=i&&i.options;return r&&r.modal&&r.visible&&r.appendTo===t.options.appendTo&&n.is(I)}).sort(function(t,n){return+e(t).css("zIndex")-+e(n).css("zIndex")});return t=null,n},_object:function(e){var n=e.children(x),i=s.widgetInstance(n);return i instanceof ne?i:t},center:function(){var t,n,i=this,r=i.options.position,o=i.wrapper,a=e(window),s=0,l=0;return i.options.isMaximized?i:(i.options.pinned||(s=a.scrollTop(),l=a.scrollLeft()),n=l+Math.max(0,(a.width()-o.width())/2),t=s+Math.max(0,(a.height()-o.height()-parseInt(o.css("paddingTop"),10))/2),o.css({left:n,top:t}),r.top=t,r.left=n,i)},title:function(e){var t,n=this,i=n.wrapper,r=n.options,o=i.children(y),a=o.children(w);return arguments.length?(e===!1?(i.addClass("k-window-titleless"),o.remove()):(o.length?a.html(e):(i.prepend(ie.titlebar(r)),n._actions(),o=i.children(y)),t=parseInt(f(o),10),i.css("padding-top",t),o.css("margin-top",-t)),n.options.title=e,n):a.html()},content:function(e,t){var i=this.wrapper.children(x),r=i.children(".km-scroll-container");return i=r[0]?r:i,n(e)?(this.angular("cleanup",function(){return{elements:i.children()}}),s.destroy(this.element.children()),i.empty().html(e),this.angular("compile",function(){var e,n=[];for(e=i.length;--e>=0;)n.push({dataItem:t});return{elements:i.children(),data:n}}),this):i.html()},open:function(){var t,n,i,r=this,o=r.wrapper,a=r.options,l=this._animationOptions("open"),d=o.children(x),c=e(document);return r.trigger(z)||(r._closing&&o.kendoStop(!0,!0),r._closing=!1,r.toFront(),a.autoFocus&&r.element.focus(),a.visible=!0,a.modal&&(n=!!r._modals().length,t=r._overlay(n),t.kendoStop(!0,!0),l.duration&&s.effects.Fade&&!n?(i=s.fx(t).fadeIn(),i.duration(l.duration||0),i.endValue(.5),i.play()):t.css("opacity",.5),t.show()),o.is(I)||(d.css(G,A),o.show().kendoStop().kendoAnimate({effects:l.effects,duration:l.duration,complete:p(this._activate,this)}))),a.isMaximized&&(r._documentScrollTop=c.scrollTop(),r._documentScrollLeft=c.scrollLeft(),e("html, body").css(G,A)),r},_activate:function(){var e=this.options.scrollable!==!1;this.options.autoFocus&&this.element.focus(),this.element.css(G,e?"":"hidden"),s.resize(this.element.children()),this.trigger(H)},_removeOverlay:function(n){var i,r=this._modals(),o=this.options,a=o.modal&&!r.length,l=o.modal?this._overlay(!0):e(t),d=this._animationOptions("close");a?!n&&d.duration&&s.effects.Fade?(i=s.fx(l).fadeOut(),i.duration(d.duration||0),i.startValue(.5),i.play()):this._overlay(!1).remove():r.length&&this._object(r.last())._overlay(!0)},_close:function(t){var n=this,i=n.wrapper,r=n.options,o=this._animationOptions("open"),a=this._animationOptions("close"),s=e(document);if(i.is(I)&&!n.trigger(P,{userTriggered:!t})){if(n._closing)return;n._closing=!0,r.visible=!1,e(k).each(function(t,n){var r=e(n).children(x);n!=i&&r.find("> ."+S).length>0&&r.children(T).remove()}),this._removeOverlay(),i.kendoStop().kendoAnimate({effects:a.effects||o.effects,reverse:a.reverse===!0,duration:a.duration,complete:p(this._deactivate,this)})}n.options.isMaximized&&(e("html, body").css(G,""),n._documentScrollTop&&n._documentScrollTop>0&&s.scrollTop(n._documentScrollTop),n._documentScrollLeft&&n._documentScrollLeft>0&&s.scrollLeft(n._documentScrollLeft))},_deactivate:function(){var e,t=this;t.wrapper.hide().css("opacity",""),t.trigger(N),t.options.modal&&(e=t._object(t._modals().last()),e&&e.toFront())},close:function(){return this._close(!0),this},_actionable:function(t){return e(t).is(Z+","+Z+" .k-icon,:input,a")},_shouldFocus:function(t){var n=u(),i=this.element;return this.options.autoFocus&&!e(n).is(i)&&!this._actionable(t)&&(!i.find(n).length||!i.find(t).length)},toFront:function(t){var n,i,r=this,o=r.wrapper,a=o[0],s=+o.css(Y),l=s,d=t&&t.target||null;return e(k).each(function(t,n){var i=e(n),r=i.css(Y),o=i.children(x);isNaN(r)||(s=Math.max(+r,s)),n!=a&&o.find("> ."+S).length>0&&o.append(ie.overlay)}),(!o[0].style.zIndex||l<s)&&o.css(Y,s+2),r.element.find("> .k-overlay").remove(),r._shouldFocus(d)&&(r.element.focus(),n=e(window).scrollTop(),i=parseInt(o.position().top,10),!r.options.pinned&&i>0&&i<n&&(n>0?e(window).scrollTop(i):o.css("top",n))),o=null,r},toggleMaximization:function(){return this._closing?this:this[this.options.isMaximized?"restore":"maximize"]()},restore:function(){var t=this,n=t.options,i=n.minHeight,r=t.restoreOptions,o=e(document);return n.isMaximized||n.isMinimized?(i&&i!=1/0&&t.wrapper.css("min-height",i),t.wrapper.css({position:n.pinned?"fixed":"absolute",left:r.left,top:r.top,width:r.width,height:r.height}).removeClass(R).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-restore").parent().remove().end().end().find(K).parent().show().end().end().find(J).parent().show(),t.options.width=r.width,t.options.height=r.height,e("html, body").css(G,""),this._documentScrollTop&&this._documentScrollTop>0&&o.scrollTop(this._documentScrollTop),this._documentScrollLeft&&this._documentScrollLeft>0&&o.scrollLeft(this._documentScrollLeft),n.isMaximized=n.isMinimized=!1,t.resize(),t):t},_sizingAction:function(e,t){var n=this,i=n.wrapper,r=i[0].style,o=n.options;return o.isMaximized||o.isMinimized?n:(n.restoreOptions={width:r.width,height:r.height},i.children(C).hide().end().children(y).find(K).parent().hide().eq(0).before(ie.action({name:"Restore"})),t.call(n),n.wrapper.children(y).find(J).parent().toggle("maximize"!==e),n.trigger(e),n)},maximize:function(){return this._sizingAction("maximize",function(){var t=this,n=t.wrapper,i=n.position(),r=e(document);m(t.restoreOptions,{left:i.left,top:i.top}),n.css({left:0,top:0,position:"fixed"}).addClass(R),this._documentScrollTop=r.scrollTop(),this._documentScrollLeft=r.scrollLeft(),e("html, body").css(G,A),t.options.isMaximized=!0,t._onDocumentResize()}),this},isMaximized:function(){return this.options.isMaximized},minimize:function(){return this._sizingAction("minimize",function(){var e=this;e.wrapper.css({height:"",minHeight:""}),e.element.hide(),e.options.isMinimized=!0}),this},isMinimized:function(){return this.options.isMinimized},pin:function(t){var n=this,i=e(window),r=n.wrapper,o=parseInt(r.css("top"),10),a=parseInt(r.css("left"),10);(t||!n.options.pinned&&!n.options.isMaximized)&&(r.css({position:"fixed",top:o-i.scrollTop(),left:a-i.scrollLeft()}),r.children(y).find(Q).addClass("k-i-unpin").removeClass("k-i-pin"),n.options.pinned=!0)},unpin:function(){var t=this,n=e(window),i=t.wrapper,r=parseInt(i.css("top"),10),o=parseInt(i.css("left"),10);t.options.pinned&&!t.options.isMaximized&&(i.css({position:"",top:r+n.scrollTop(),left:o+n.scrollLeft()}),i.children(y).find(X).addClass("k-i-pin").removeClass("k-i-unpin"),t.options.pinned=!1)},_onDocumentResize:function(){var t,n,i=this,r=i.wrapper,o=e(window),a=s.support.zoomLevel();i.options.isMaximized&&(t=o.width()/a,n=o.height()/a-parseInt(r.css("padding-top"),10),r.css({width:t,height:n}),i.options.width=t,i.options.height=n,i.resize())},refresh:function(t){var i,r,o,a=this,s=a.options,l=e(a.element);return c(t)||(t={url:t}),t=m({},s.content,t),r=n(s.iframe)?s.iframe:t.iframe,o=t.url,o?(n(r)||(r=!te(o)),r?(i=l.find("."+S)[0],i?i.src=o||i.src:l.html(ie.contentFrame(m({},s,{content:t}))),l.find("."+S).unbind("load"+b).on("load"+b,p(this._triggerRefresh,this))):a._ajaxRequest(t)):(t.template&&a.content(v(t.template)({})),a.trigger(L)),l.toggleClass("k-window-iframecontent",!!r),a},_triggerRefresh:function(){this.trigger(L)},_ajaxComplete:function(){clearTimeout(this._loadingIconTimeout),this.wrapper.find(ee).removeClass(D)},_ajaxError:function(e,t){this.trigger($,{status:t,xhr:e})},_ajaxSuccess:function(e){return function(t){var n=t;e&&(n=v(e)(t||{})),this.content(n,t),this.element.prop("scrollTop",0),this.trigger(L)}},_showLoading:function(){this.wrapper.find(ee).addClass(D)},_ajaxRequest:function(t){this._loadingIconTimeout=setTimeout(p(this._showLoading,this),100),e.ajax(m({type:"GET",dataType:"html",cache:!1,error:p(this._ajaxError,this),complete:p(this._ajaxComplete,this),success:p(this._ajaxSuccess(t.template),this)},t))},_destroy:function(){this.resizing&&this.resizing.destroy(),this.dragging&&this.dragging.destroy(),this.wrapper.off(b).children(x).off(b).end().find(".k-resize-handle,.k-window-titlebar").off(b),e(window).off("resize"+b+this._marker),clearTimeout(this._loadingIconTimeout),l.fn.destroy.call(this),this.unbind(t),s.destroy(this.wrapper),this._removeOverlay(!0)},destroy:function(){this._destroy(),this.wrapper.empty().remove(),this.wrapper=this.appendTo=this.element=e()},_createWindow:function(){var t,n,i=this.element,r=this.options,o=s.support.isRtl(i);r.scrollable===!1&&i.css("overflow","hidden"),n=e(ie.wrapper(r)),t=i.find("iframe:not(.k-content)").map(function(){var e=this.getAttribute("src");return this.src="",e}),n.toggleClass("k-rtl",o).appendTo(this.appendTo).append(i).find("iframe:not(.k-content)").each(function(e){this.src=t[e]}),n.find(".k-window-title").css(o?"left":"right",h(n.find(".k-window-actions"))+10),i.css("visibility","").show(),i.find("[data-role=editor]").each(function(){var t=e(this).data("kendoEditor");t&&t.refresh()}),n=i=null}}),ie={wrapper:v("<div class='k-widget k-window' />"),action:v("<a role='button' href='\\#' class='k-window-action k-link' aria-label='#= name #'><span class='k-icon k-i-#= name.toLowerCase() #'></span></a>"),titlebar:v("<div class='k-window-titlebar k-header'>&nbsp;<span class='k-window-title'>#= title #</span><div class='k-window-actions' /></div>"),overlay:"<div class='k-overlay' />",contentFrame:v("<iframe frameborder='0' title='#= title #' class='"+S+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),resizeHandle:v("<div class='k-resize-handle k-resize-#= data #'></div>")};o.prototype={addOverlay:function(){this.owner.wrapper.append(ie.overlay)},removeOverlay:function(){this.owner.wrapper.find(T).remove()},dragstart:function(t){var n=this,i=n.owner,r=i.wrapper;n._preventDragging=i.trigger(V),n._preventDragging||(n.elementPadding=parseInt(r.css("padding-top"),10),n.initialPosition=s.getOffset(r,"position"),n.resizeDirection=t.currentTarget.prop("className").replace("k-resize-handle k-resize-",""),n.initialSize={width:r.width(),height:r.height()},n.containerOffset=s.getOffset(i.appendTo,"position"),r.children(C).not(t.currentTarget).hide(),e(_).css(M,t.currentTarget.css(M)))},drag:function(t){var n,r,o,a,s,l,d,c,u,h,f,p,m,g,v;this._preventDragging||(n=this,r=n.owner,o=r.wrapper,a=r.options,s=n.resizeDirection,l=n.containerOffset,d=n.initialPosition,c=n.initialSize,m=Math.max(t.x.location,0),g=Math.max(t.y.location,0),s.indexOf("e")>=0?(u=m-d.left-l.left,o.width(i(u,a.minWidth,a.maxWidth))):s.indexOf("w")>=0&&(p=d.left+c.width+l.left,u=i(p-m,a.minWidth,a.maxWidth),o.css({left:p-u-l.left,width:u})),v=g,r.options.pinned&&(v-=e(window).scrollTop()),s.indexOf("s")>=0?(h=v-d.top-n.elementPadding-l.top,o.height(i(h,a.minHeight,a.maxHeight))):s.indexOf("n")>=0&&(f=d.top+c.height+l.top,h=i(f-v,a.minHeight,a.maxHeight),o.css({top:f-h-l.top,height:h})),u&&(r.options.width=u+"px"),h&&(r.options.height=h+"px"),r.resize())},dragend:function(t){if(!this._preventDragging){var n=this,i=n.owner,r=i.wrapper;return r.children(C).not(t.currentTarget).show(),e(_).css(M,""),i.touchScroller&&i.touchScroller.reset(),27==t.keyCode&&r.css(n.initialPosition).css(n.initialSize),i.trigger(U),!1}},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},a.prototype={dragstart:function(t){var n=this.owner,i=n.element,r=i.find(".k-window-actions"),o=s.getOffset(n.appendTo);this._preventDragging=n.trigger(q),this._preventDragging||(n.initialWindowPosition=s.getOffset(n.wrapper,"position"),n.initialPointerPosition={left:t.x.client,top:t.y.client},n.startPosition={left:t.x.client-n.initialWindowPosition.left,top:t.y.client-n.initialWindowPosition.top},n.minLeftPosition=r.length>0?h(r)+parseInt(r.css("right"),10)-h(i):20-h(i),n.minLeftPosition-=o.left,n.minTopPosition=-o.top,n.wrapper.append(ie.overlay).children(C).hide(),e(_).css(M,t.currentTarget.css(M)))},drag:function(t){var n,i;this._preventDragging||(n=this.owner,i=n.options.position,i.top=Math.max(t.y.client-n.startPosition.top,n.minTopPosition),i.left=Math.max(t.x.client-n.startPosition.left,n.minLeftPosition),s.support.transforms?e(n.wrapper).css("transform","translate("+(t.x.client-n.initialPointerPosition.left)+"px, "+(t.y.client-n.initialPointerPosition.top)+"px)"):e(n.wrapper).css(i))},_finishDrag:function(){var t=this.owner;t.wrapper.children(C).toggle(!t.options.isMinimized).end().find(T).remove(),e(_).css(M,"")},dragcancel:function(e){this._preventDragging||(this._finishDrag(),e.currentTarget.closest(k).css(this.owner.initialWindowPosition))},dragend:function(){if(!this._preventDragging)return e(this.owner.wrapper).css(this.owner.options.position).css("transform",""),this._finishDrag(),this.owner.trigger(j),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},s.ui.plugin(ne)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.mobile.view.min",["kendo.core.min","kendo.fx.min","kendo.mobile.scroller.min","kendo.view.min"],e)}(function(){return function(e,t){function n(e){var t,n,i=e.find(y("popover")),r=s.roles;for(t=0,n=i.length;t<n;t++)o.initWidget(i[t],{},r)}function i(e){o.triggeredByInput(e)||e.preventDefault()}function r(t){t.each(function(){o.initWidget(e(this),{},s.roles)})}var o=window.kendo,a=o.mobile,s=a.ui,l=o.attr,d=s.Widget,c=o.ViewClone,u="init",h='<div style="height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 20000; display: none" />',f="beforeShow",p="show",m="afterShow",g="beforeHide",v="transitionEnd",_="transitionStart",b="hide",k="destroy",w=o.attrValue,y=o.roleSelector,x=o.directiveSelector,C=o.compileMobileDirective,T=d.extend({init:function(t,n){d.fn.init.call(this,t,n),this.params={},e.extend(this,n),this.transition=this.transition||this.defaultTransition,this._id(),this.options.$angular?this._overlay():(this._layout(),this._overlay(),this._scroller(),this._model())},events:[u,f,p,m,g,b,k,_,v],options:{name:"View",title:"",layout:null,getLayout:e.noop,reload:!1,transition:"",defaultTransition:"",useNativeScrolling:!1,stretch:!1,zoom:!1,model:null,modelScope:window,scroller:{},initWidgets:!0},enable:function(e){t===e&&(e=!0),e?this.overlay.hide():this.overlay.show()},destroy:function(){this.layout&&this.layout.detach(this),this.trigger(k),d.fn.destroy.call(this),this.scroller&&this.scroller.destroy(),this.options.$angular&&this.element.scope().$destroy(),o.destroy(this.element)},purge:function(){this.destroy(),this.element.remove()},triggerBeforeShow:function(){return!this.trigger(f,{view:this})},triggerBeforeHide:function(){return!this.trigger(g,{view:this})},showStart:function(){var e=this.element;e.css("display",""),this.inited?this._invokeNgController():(this.inited=!0,this.trigger(u,{view:this})),this.layout&&this.layout.attach(this),this._padIfNativeScrolling(),this.trigger(p,{view:this}),o.resize(e)},showEnd:function(){this.trigger(m,{view:this}),this._padIfNativeScrolling()},hideEnd:function(){var e=this;e.element.hide(),e.trigger(b,{view:e}),e.layout&&e.layout.trigger(b,{view:e,layout:e.layout})},beforeTransition:function(e){this.trigger(_,{type:e})},afterTransition:function(e){this.trigger(v,{type:e})},_padIfNativeScrolling:function(){if(a.appLevelNativeScrolling()){var e=o.support.mobileOS&&o.support.mobileOS.android,t=a.application.skin()||"",n=a.application.os.android||t.indexOf("android")>-1,i="flat"===t||t.indexOf("material")>-1,r=!e&&!n||i?"header":"footer",s=!e&&!n||i?"footer":"header";this.content.css({paddingTop:this[r].height(),paddingBottom:this[s].height()})}},contentElement:function(){var e=this;return e.options.stretch?e.content:e.scrollerContent},clone:function(){return new c(this)},_scroller:function(){var t=this;a.appLevelNativeScrolling()||(t.options.stretch?t.content.addClass("km-stretched-view"):(t.content.kendoMobileScroller(e.extend(t.options.scroller,{zoom:t.options.zoom,useNative:t.options.useNativeScrolling})),t.scroller=t.content.data("kendoMobileScroller"),t.scrollerContent=t.scroller.scrollElement),o.support.kineticScrollNeeded&&(e(t.element).on("touchmove",".km-header",i),t.options.useNativeScrolling||t.options.stretch||e(t.element).on("touchmove",".km-content",i)))},_model:function(){var e=this,t=e.element,i=e.options.model;"string"==typeof i&&(i=o.getter(i)(e.options.modelScope)),e.model=i,n(t),e.element.css("display",""),e.options.initWidgets&&(i?o.bind(t,i,s,o.ui,o.dataviz.ui):a.init(t.children())),e.element.css("display","none")},_id:function(){var e=this.element,t=e.attr("id")||"";this.id=w(e,"url")||"#"+t,"#"==this.id&&(this.id=o.guid(),e.attr("id",this.id))},_layout:function(){var e=y("content"),t=this.element;t.addClass("km-view"),this.header=t.children(y("header")).addClass("km-header"),this.footer=t.children(y("footer")).addClass("km-footer"),t.children(e)[0]||t.wrapInner("<div "+l("role")+'="content"></div>'),this.content=t.children(y("content")).addClass("km-content"),this.element.prepend(this.header).append(this.footer),this.layout=this.options.getLayout(this.layout),this.layout&&this.layout.setup(this)},_overlay:function(){this.overlay=e(h).appendTo(this.element)},_invokeNgController:function(){var t,n,i;this.options.$angular&&(t=this.element.controller(),n=this.options.$angular[0],t&&(i=e.proxy(this,"_callController",t,n),/^\$(digest|apply)$/.test(n.$$phase)?i():n.$apply(i)))},_callController:function(e,t){this.element.injector().invoke(e.constructor,e,{$scope:t})}}),S=d.extend({init:function(e,t){d.fn.init.call(this,e,t),e=this.element,this.header=e.children(this._locate("header")).addClass("km-header"),this.footer=e.children(this._locate("footer")).addClass("km-footer"),this.elements=this.header.add(this.footer),n(e),this.options.$angular||o.mobile.init(this.element.children()),this.element.detach(),this.trigger(u,{layout:this})},_locate:function(e){return this.options.$angular?x(e):y(e)},options:{name:"Layout",id:null,platform:null},events:[u,p,b],setup:function(e){e.header[0]||(e.header=this.header),e.footer[0]||(e.footer=this.footer)},detach:function(e){var t=this;e.header===t.header&&t.header[0]&&e.element.prepend(t.header.detach()[0].cloneNode(!0)),e.footer===t.footer&&t.footer.length&&e.element.append(t.footer.detach()[0].cloneNode(!0))},attach:function(e){var t=this,n=t.currentView;n&&t.detach(n),e.header===t.header&&(t.header.detach(),e.element.children(y("header")).remove(),e.element.prepend(t.header)),e.footer===t.footer&&(t.footer.detach(),e.element.children(y("footer")).remove(),e.element.append(t.footer)),t.trigger(p,{layout:t,view:e}),t.currentView=e}}),D=o.Observable,E=/<body[^>]*>(([\u000a\u000d\u2028\u2029]|.)*)<\/body>/i,F="loadStart",R="loadComplete",I="showStart",A="sameViewRequested",M="viewShow",z="viewTypeDetermined",H="after",N=D.extend({init:function(t){var n,i,a,s,l=this;if(D.fn.init.call(l),e.extend(l,t),l.sandbox=e("<div />"),a=l.container,n=l._hideViews(a),l.rootView=n.first(),!l.rootView[0]&&t.rootNeeded)throw i=a[0]==o.mobile.application.element[0]?'Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container.':'Your pane element does not contain any direct child elements with data-role="view" attribute set.',Error(i);l.layouts={},l.viewContainer=new o.ViewContainer(l.container),l.viewContainer.bind("accepted",function(e){e.view.params=l.params}),l.viewContainer.bind("complete",function(e){l.trigger(M,{view:e.view})}),l.viewContainer.bind(H,function(){l.trigger(H)}),this.getLayoutProxy=e.proxy(this,"_getLayout"),l._setupLayouts(a),s=a.children(l._locate("modalview drawer")),l.$angular?(l.$angular[0].viewOptions={defaultTransition:l.transition,loader:l.loader,container:l.container,getLayout:l.getLayoutProxy},s.each(function(n,i){C(e(i),t.$angular[0])})):r(s),this.bind(this.events,t)},events:[I,H,M,F,R,A,z],destroy:function(){o.destroy(this.container);for(var e in this.layouts)this.layouts[e].destroy()},view:function(){return this.viewContainer.view},showView:function(e,t,n){if(e=e.replace(RegExp("^"+this.remoteViewURLPrefix),""),""===e&&this.remoteViewURLPrefix&&(e="/"),
e.replace(/^#/,"")===this.url)return this.trigger(A),!1;this.trigger(I);var i=this,r=function(n){return i.viewContainer.show(n,t,e)},a=i._findViewElement(e),s=o.widgetInstance(a);return i.url=e.replace(/^#/,""),i.params=n,s&&s.reload&&(s.purge(),a=[]),this.trigger(z,{remote:0===a.length,url:e}),a[0]?(s||(s=i._createView(a)),r(s)):(this.serverNavigation?location.href=e:i._loadView(e,r),!0)},append:function(e,t){var n,i,o,a=this.sandbox,s=(t||"").split("?")[0],d=this.container;return E.test(e)&&(e=RegExp.$1),a[0].innerHTML=e,d.append(a.children("script, style")),n=this._hideViews(a),o=n.first(),o.length||(n=o=a.wrapInner("<div data-role=view />").children()),s&&o.hide().attr(l("url"),s),this._setupLayouts(a),i=a.children(this._locate("modalview drawer")),d.append(a.children(this._locate("layout modalview drawer")).add(n)),r(i),this._createView(o)},_locate:function(e){return this.$angular?x(e):y(e)},_findViewElement:function(e){var t,n=e.split("?")[0];return n?(t=this.container.children("["+l("url")+"='"+n+"']"),t[0]||n.indexOf("/")!==-1||(t=this.container.children("#"===n.charAt(0)?n:"#"+n)),t):this.rootView},_createView:function(e){return this.$angular?C(e,this.$angular[0]):o.initWidget(e,{defaultTransition:this.transition,loader:this.loader,container:this.container,getLayout:this.getLayoutProxy,modelScope:this.modelScope,reload:w(e,"reload")},s.roles)},_getLayout:function(e){return""===e?null:e?this.layouts[e]:this.layouts[this.layout]},_loadView:function(t,n){this._xhr&&this._xhr.abort(),this.trigger(F),this._xhr=e.get(o.absoluteURL(t,this.remoteViewURLPrefix),"html").always(e.proxy(this,"_xhrComplete",n,t))},_xhrComplete:function(e,t,n){var i=!0;if("object"==typeof n&&0===n.status){if(!(n.responseText&&n.responseText.length>0))return;i=!0,n=n.responseText}this.trigger(R),i&&e(this.append(n,t))},_hideViews:function(e){return e.children(this._locate("view splitview")).hide()},_setupLayouts:function(t){var n,i=this;t.children(i._locate("layout")).each(function(){n=i.$angular?C(e(this),i.$angular[0]):o.initWidget(e(this),{},s.roles);var t=n.options.platform;t&&t!==a.application.os.name?n.destroy():i.layouts[n.options.id]=n})}});o.mobile.ViewEngine=N,s.plugin(T),s.plugin(S)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.mobile.loader.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.mobile.ui,r=i.Widget,o=e.map(n.eventMap,function(e){return e}).join(" ").split(" "),a=r.extend({init:function(t,n){var i=this,o=e('<div class="km-loader"><span class="km-loading km-spin"></span><span class="km-loading-left"></span><span class="km-loading-right"></span></div>');r.fn.init.call(i,o,n),i.container=t,i.captureEvents=!1,i._attachCapture(),o.append(i.options.loading).hide().appendTo(t)},options:{name:"Loader",loading:"<h1>Loading...</h1>",timeout:100},show:function(){var e=this;clearTimeout(e._loading),e.options.loading!==!1&&(e.captureEvents=!0,e._loading=setTimeout(function(){e.element.show()},e.options.timeout))},hide:function(){this.captureEvents=!1,clearTimeout(this._loading),this.element.hide()},changeMessage:function(e){this.options.loading=e,this.element.find(">h1").html(e)},transition:function(){this.captureEvents=!0,this.container.css("pointer-events","none")},transitionDone:function(){this.captureEvents=!1,this.container.css("pointer-events","")},_attachCapture:function(){function e(e){n.captureEvents&&e.preventDefault()}var t,n=this;for(n.captureEvents=!1,t=0;t<o.length;t++)n.container[0].addEventListener(o[t],e,!0)}});i.plugin(a)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.mobile.pane.min",["kendo.mobile.view.min","kendo.mobile.loader.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.mobile,r=n.roleSelector,o=i.ui,a=o.Widget,s=i.ViewEngine,l=o.View,d=i.ui.Loader,c="external",u="href",h="#!",f="navigate",p="viewShow",m="sameViewRequested",g=n.support.mobileOS,v=g.ios&&!g.appMode&&g.flatVersion>=700,_=/popover|actionsheet|modalview|drawer/,b="#:back",k=n.attrValue,w=a.extend({init:function(e,t){var i=this;a.fn.init.call(i,e,t),t=i.options,e=i.element,e.addClass("km-pane"),i.options.collapsible&&e.addClass("km-collapsible-pane"),this.history=[],this.historyCallback=function(e,t,n){var r=i.transition;return i.transition=null,v&&n&&(r="none"),i.viewEngine.showView(e,r,t)},this._historyNavigate=function(e){if(e===b){if(1===i.history.length)return;i.history.pop(),e=i.history[i.history.length-1]}else i.history.push(e);i.historyCallback(e,n.parseQueryStringParams(e))},this._historyReplace=function(e){var t=n.parseQueryStringParams(e);i.history[i.history.length-1]=e,i.historyCallback(e,t)},i.loader=new d(e,{loading:i.options.loading}),i.viewEngine=new s({container:e,transition:t.transition,modelScope:t.modelScope,rootNeeded:!t.initial,serverNavigation:t.serverNavigation,remoteViewURLPrefix:t.root||"",layout:t.layout,$angular:t.$angular,loader:i.loader,showStart:function(){i.loader.transition(),i.closeActiveDialogs()},after:function(){i.loader.transitionDone()},viewShow:function(e){i.trigger(p,e)},loadStart:function(){i.loader.show()},loadComplete:function(){i.loader.hide()},sameViewRequested:function(){i.trigger(m)},viewTypeDetermined:function(e){e.remote&&i.options.serverNavigation||i.trigger(f,{url:e.url})}}),this._setPortraitWidth(),n.onResize(function(){i._setPortraitWidth()}),i._setupAppLinks()},closeActiveDialogs:function(){var t=this.element.find(r("actionsheet popover modalview")).filter(":visible");t.each(function(){n.widgetInstance(e(this),o).close()})},navigateToInitial:function(){var e=this.options.initial;return e&&this.navigate(e),e},options:{name:"Pane",portraitWidth:"",transition:"",layout:"",collapsible:!1,initial:null,modelScope:window,loading:"<h1>Loading...</h1>"},events:[f,p,m],append:function(e){return this.viewEngine.append(e)},destroy:function(){a.fn.destroy.call(this),this.viewEngine.destroy(),this.userEvents.destroy()},navigate:function(e,t){e instanceof l&&(e=e.id),this.transition=t,this._historyNavigate(e)},replace:function(e,t){e instanceof l&&(e=e.id),this.transition=t,this._historyReplace(e)},bindToRouter:function(e){var t=this,i=this.history,r=this.viewEngine;e.bind("init",function(t){var o,a=t.url,s=e.pushState?a:"/";r.rootView.attr(n.attr("url"),s),o=i.length,"/"===a&&o&&(e.navigate(i[o-1],!0),t.preventDefault())}),e.bind("routeMissing",function(e){t.historyCallback(e.url,e.params,e.backButtonPressed)||e.preventDefault()}),e.bind("same",function(){t.trigger(m)}),t._historyNavigate=function(t){e.navigate(t)},t._historyReplace=function(t){e.replace(t)}},hideLoading:function(){this.loader.hide()},showLoading:function(){this.loader.show()},changeLoadingMessage:function(e){this.loader.changeMessage(e)},view:function(){return this.viewEngine.view()},_setPortraitWidth:function(){var e,t=this.options.portraitWidth;t&&(e=n.mobile.application.element.is(".km-vertical")?t:"auto",this.element.css("width",e))},_setupAppLinks:function(){var t=this,i="tab",o="[data-"+n.ns+"navigate-on-press]",a=e.map(["button","backbutton","detailbutton","listview-link"],function(e){return r(e)+":not("+o+")"}).join(",");this.element.handler(this).on("down",r(i)+","+o,"_mouseup").on("click",r(i)+","+a+","+o,"_appLinkClick"),this.userEvents=new n.UserEvents(this.element,{fastTap:!0,filter:a,tap:function(e){e.event.currentTarget=e.touch.currentTarget,t._mouseup(e.event)}}),this.element.css("-ms-touch-action","")},_appLinkClick:function(t){var n=e(t.currentTarget).attr("href"),i=n&&"#"!==n[0]&&this.options.serverNavigation;i||k(e(t.currentTarget),"rel")==c||t.preventDefault()},_mouseup:function(r){if(!(r.which>1||r.isDefaultPrevented())){var a=this,s=e(r.currentTarget),l=k(s,"transition"),d=k(s,"rel")||"",f=k(s,"target"),p=s.attr(u),m=v&&0===s[0].offsetHeight,g=p&&"#"!==p[0]&&this.options.serverNavigation;m||g||d===c||t===p||p===h||(s.attr(u,h),setTimeout(function(){s.attr(u,p)}),d.match(_)?(n.widgetInstance(e(p),o).openFor(s),"actionsheet"!==d&&"drawer"!==d||r.stopPropagation()):("_top"===f?a=i.application.pane:f&&(a=e("#"+f).data("kendoMobilePane")),a.navigate(p,l)),r.preventDefault())}}});w.wrap=function(e){e.is(r("view"))||(e=e.wrap("<div data-"+n.ns+'role="view" data-stretch="true"></div>').parent());var t=e.wrap('<div class="km-pane-wrapper"><div></div></div>').parent(),i=new w(t);return i.navigate(""),i},o.plugin(w)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.mobile.popover.min",["kendo.popup.min","kendo.mobile.pane.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.mobile,r=i.ui,o="hide",a="open",s="close",l='<div class="km-popup-wrapper" />',d='<div class="km-popup-arrow" />',c='<div class="km-popup-overlay" />',u="km-up km-down km-left km-right",h=r.Widget,f={down:{origin:"bottom center",position:"top center"},up:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"}},p={animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:400}}},m={horizontal:{offset:"top",size:"height"},vertical:{offset:"left",size:"width"}},g={up:"down",down:"up",left:"right",right:"left"},v=h.extend({init:function(t,i){var r,a,s=this,u=t.closest(".km-modalview-wrapper"),g=t.closest(".km-root").children(".km-pane").first(),v=u[0]?u:g;i.viewport?g=i.viewport:g[0]||(g=window),i.container?v=i.container:v[0]||(v=document.body),r={viewport:g,copyAnchorStyles:!1,autosize:!0,open:function(){s.overlay.show()},activate:e.proxy(s._activate,s),deactivate:function(){s.overlay.hide(),s._apiCall||s.trigger(o),s._apiCall=!1}},h.fn.init.call(s,t,i),t=s.element,i=s.options,t.wrap(l).addClass("km-popup").show(),a=s.options.direction.match(/left|right/)?"horizontal":"vertical",s.dimensions=m[a],s.wrapper=t.parent().css({width:i.width,height:i.height}).addClass("km-popup-wrapper km-"+i.direction).hide(),s.arrow=e(d).prependTo(s.wrapper).hide(),s.overlay=e(c).appendTo(v).hide(),r.appendTo=s.overlay,i.className&&s.overlay.addClass(i.className),s.popup=new n.ui.Popup(s.wrapper,e.extend(!0,r,p,f[i.direction]))},options:{name:"Popup",width:240,height:"",direction:"down",container:null,viewport:null},events:[o],show:function(t){this.popup.options.anchor=e(t),this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){h.fn.destroy.call(this),this.popup.destroy(),this.overlay.remove()},target:function(){return this.popup.options.anchor},_activate:function(){var t=this,n=t.options.direction,i=t.dimensions,r=i.offset,o=t.popup,a=o.options.anchor,s=e(a).offset(),l=e(o.element).offset(),d=o.flipped?g[n]:n,c=2*t.arrow[i.size](),h=t.element[i.size]()-t.arrow[i.size](),f=e(a)[i.size](),p=s[r]-l[r]+f/2;p<c&&(p=c),p>h&&(p=h),t.wrapper.removeClass(u).addClass("km-"+d),t.arrow.css(r,p).show()}}),_=h.extend({init:function(t,i){var o,a=this;a.initialOpen=!1,h.fn.init.call(a,t,i),o=e.extend({className:"km-popover-root",hide:function(){a.trigger(s)}},this.options.popup),a.popup=new v(a.element,o),a.popup.overlay.on("move",function(e){e.target==a.popup.overlay[0]&&e.preventDefault()}),a.pane=new r.Pane(a.element,e.extend(this.options.pane,{$angular:this.options.$angular})),n.notify(a,r)},options:{name:"PopOver",popup:{},pane:{}},events:[a,s],open:function(e){this.popup.show(e),this.initialOpen?this.pane.view()._invokeNgController():(this.pane.navigateToInitial()||this.pane.navigate(""),this.popup.popup._position(),this.initialOpen=!0)},openFor:function(e){this.open(e),this.trigger(a,{target:this.popup.target()})},close:function(){this.popup.hide()},destroy:function(){h.fn.destroy.call(this),this.pane.destroy(),this.popup.destroy(),n.destroy(this.element)}});r.plugin(v),r.plugin(_)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.mobile.shim.min",["kendo.popup.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.mobile.ui,r=n.ui.Popup,o='<div class="km-shim"/>',a="hide",s=i.Widget,l=s.extend({init:function(t,i){var l=this,d=n.mobile.application,c=n.support.mobileOS,u=d?d.os.name:c?c.name:"ios",h="ios"===u||"wp"===u||!!d&&d.os.skin,f="blackberry"===u,p=i.align||(h?"bottom center":f?"center right":"center center"),m=i.position||(h?"bottom center":f?"center right":"center center"),g=i.effect||(h?"slideIn:up":f?"slideIn:left":"fade:in"),v=e(o).handler(l).hide();s.fn.init.call(l,t,i),l.shim=v,t=l.element,i=l.options,i.className&&l.shim.addClass(i.className),i.modal||l.shim.on("down","_hide"),(d?d.element:e(document.body)).append(v),l.popup=new r(l.element,{anchor:v,modal:!0,appendTo:v,origin:p,position:m,animation:{open:{effects:g,duration:i.duration},close:{duration:i.duration}},close:function(e){var t=!1;l._apiCall||(t=l.trigger(a)),t&&e.preventDefault(),l._apiCall=!1},deactivate:function(){v.hide()},open:function(){v.show()}}),n.notify(l)},events:[a],options:{name:"Shim",modal:!1,align:t,position:t,effect:t,duration:200},show:function(){this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){s.fn.destroy.call(this),this.shim.kendoDestroy(),this.popup.destroy(),this.shim.remove()},_hide:function(t){t&&e.contains(this.shim.children().children(".k-popup")[0],t.target)||this.popup.close()}});i.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.mobile.actionsheet.min",["kendo.mobile.popover.min","kendo.mobile.shim.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.support,r=n.mobile.ui,o=r.Shim,a=r.Popup,s=r.Widget,l="open",d="close",c="command",u="li>a",h="actionsheetContext",f='<div class="km-actionsheet-wrapper" />',p=n.template('<li class="km-actionsheet-cancel"><a href="\\#">#:cancel#</a></li>'),m=s.extend({init:function(t,l){var d,c,h,m=this,g=i.mobileOS;s.fn.init.call(m,t,l),l=m.options,h=l.type,t=m.element,c="auto"===h?g&&g.tablet:"tablet"===h,d=c?a:o,l.cancelTemplate&&(p=n.template(l.cancelTemplate)),t.addClass("km-actionsheet").append(p({cancel:m.options.cancel})).wrap(f).on("up",u,"_click").on("click",u,n.preventDefault),m.view().bind("destroy",function(){m.destroy()}),m.wrapper=t.parent().addClass(h?" km-actionsheet-"+h:""),m.shim=new d(m.wrapper,e.extend({modal:g.ios&&g.majorVersion<7,className:"km-actionsheet-root"},m.options.popup)),m._closeProxy=e.proxy(m,"_close"),m._shimHideProxy=e.proxy(m,"_shimHide"),m.shim.bind("hide",m._shimHideProxy),c&&n.onResize(m._closeProxy),n.notify(m,r)},events:[l,d,c],options:{name:"ActionSheet",cancel:"Cancel",type:"auto",popup:{height:"auto"}},open:function(t,n){var i=this;i.target=e(t),i.context=n,i.shim.show(t)},close:function(){this.context=this.target=null,this.shim.hide()},openFor:function(e){var t=this,n=e.data(h);t.open(e,n),t.trigger(l,{target:e,context:n})},destroy:function(){s.fn.destroy.call(this),n.unbindResize(this._closeProxy),this.shim.destroy()},_click:function(t){var i,r,o,a;t.isDefaultPrevented()||(i=e(t.currentTarget),r=i.data("action"),r&&(o={target:this.target,context:this.context},a=this.options.$angular,a?this.element.injector().get("$parse")(r)(a[0])(o):n.getter(r)(window)(o)),this.trigger(c,{target:this.target,context:this.context,currentTarget:i}),t.preventDefault(),this._close())},_shimHide:function(e){this.trigger(d)?e.preventDefault():this.context=this.target=null},_close:function(e){this.trigger(d)?e.preventDefault():this.close()}});r.plugin(m)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.progressbar.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o="horizontal",a="vertical",s=0,l=100,d=0,c=5,u="k-progressbar",h="k-progressbar-reverse",f="k-progressbar-indeterminate",p="k-complete",m="k-state-selected",g="k-progress-status",v="k-state-selected",_="k-state-default",b="k-state-disabled",k={VALUE:"value",PERCENT:"percent",CHUNK:"chunk"},w="change",y="complete",x="boolean",C=Math,T=e.extend,S=e.proxy,D=100,E=400,F=3,R={progressStatus:"<span class='k-progress-status-wrap'><span class='k-progress-status'></span></span>"},I=r.extend({init:function(e,t){var n=this;r.fn.init.call(this,e,t),t=n.options,n._progressProperty=t.orientation===o?"width":"height",n._fields(),t.value=n._validateValue(t.value),n._validateType(t.type),n._wrapper(),n._progressAnimation(),t.value!==t.min&&t.value!==!1&&n._updateProgress()},setOptions:function(e){var t=this;r.fn.setOptions.call(t,e),e.hasOwnProperty("reverse")&&t.wrapper.toggleClass("k-progressbar-reverse",e.reverse),e.hasOwnProperty("enable")&&t.enable(e.enable),t._progressAnimation(),t._validateValue(),t._updateProgress()},events:[w,y],options:{name:"ProgressBar",orientation:o,reverse:!1,min:s,max:l,value:d,enable:!0,type:k.VALUE,chunkCount:c,showStatus:!0,animation:{}},_fields:function(){var t=this;t._isStarted=!1,t.progressWrapper=t.progressStatus=e()},_validateType:function(t){var i=!1;if(e.each(k,function(e,n){if(n===t)return i=!0,!1}),!i)throw Error(n.format("Invalid ProgressBar type '{0}'",t))},_wrapper:function(){var e,t=this,n=t.wrapper=t.element,i=t.options,r=i.orientation;n.addClass("k-widget "+u),n.addClass(u+"-"+(r===o?o:a)),i.enable===!1&&n.addClass(b),i.reverse&&n.addClass(h),i.value===!1&&n.addClass(f),i.type===k.CHUNK?t._addChunkProgressWrapper():i.showStatus&&(t.progressStatus=t.wrapper.prepend(R.progressStatus).find("."+g),e=i.value!==!1?i.value:i.min,t.progressStatus.text(i.type===k.VALUE?e:t._calculatePercentage(e).toFixed()+"%"))},value:function(e){return this._value(e)},_value:function(e){var n,i=this,r=i.options;return e===t?r.value:(typeof e!==x?(e=i._roundValue(e),isNaN(e)||(n=i._validateValue(e),n!==r.value&&(i.wrapper.removeClass(f),r.value=n,i._isStarted=!0,i._updateProgress()))):e||(i.wrapper.addClass(f),r.value=!1),t)},_roundValue:function(e){e=parseFloat(e);var t=C.pow(10,F);return C.floor(e*t)/t},_validateValue:function(e){var t=this,n=t.options;if(e!==!1){if(e<=n.min||e===!0)return n.min;if(e>=n.max)return n.max}else if(e===!1)return!1;return isNaN(t._roundValue(e))?n.min:e},_updateProgress:function(){var e=this,t=e.options,n=e._calculatePercentage();t.type===k.CHUNK?(e._updateChunks(n),e._onProgressUpdateAlways(t.value)):e._updateProgressWrapper(n)},_updateChunks:function(e){var t,n=this,i=n.options,r=i.chunkCount,s=parseInt(D/r*100,10)/100,l=parseInt(100*e,10)/100,d=C.floor(l/s);t=n.wrapper.find(i.orientation===o&&!i.reverse||i.orientation===a&&i.reverse?"li.k-item:lt("+d+")":"li.k-item:gt(-"+(d+1)+")"),n.wrapper.find("."+v).removeClass(v).addClass(_),t.removeClass(_).addClass(v)},_updateProgressWrapper:function(e){var t=this,n=t.options,i=t.wrapper.find("."+m),r=t._isStarted?t._animation.duration:0,o={};0===i.length&&t._addRegularProgressWrapper(),o[t._progressProperty]=e+"%",t.progressWrapper.animate(o,{duration:r,start:S(t._onProgressAnimateStart,t),progress:S(t._onProgressAnimate,t),complete:S(t._onProgressAnimateComplete,t,n.value),always:S(t._onProgressUpdateAlways,t,n.value)})},_onProgressAnimateStart:function(){this.progressWrapper.show()},_onProgressAnimate:function(e){var t,n=this,i=n.options,r=parseFloat(e.elem.style[n._progressProperty],10);i.showStatus&&(t=1e4/parseFloat(n.progressWrapper[0].style[n._progressProperty]),n.progressWrapper.find(".k-progress-status-wrap").css(n._progressProperty,t+"%")),i.type!==k.CHUNK&&r<=98&&n.progressWrapper.removeClass(p)},_onProgressAnimateComplete:function(e){var t,n=this,i=n.options,r=parseFloat(n.progressWrapper[0].style[n._progressProperty]);i.type!==k.CHUNK&&r>98&&n.progressWrapper.addClass(p),i.showStatus&&(t=i.type===k.VALUE?e:i.type==k.PERCENT?n._calculatePercentage(e).toFixed()+"%":C.floor(n._calculatePercentage(e))+"%",n.progressStatus.text(t)),e===i.min&&n.progressWrapper.hide()},_onProgressUpdateAlways:function(e){var t=this,n=t.options;t._isStarted&&t.trigger(w,{value:e}),e===n.max&&t._isStarted&&t.trigger(y,{value:n.max})},enable:function(e){var n=this,i=n.options;i.enable=t===e||e,n.wrapper.toggleClass(b,!i.enable)},destroy:function(){var e=this;r.fn.destroy.call(e)},_addChunkProgressWrapper:function(){var e,t=this,n=t.options,i=t.wrapper,r=D/n.chunkCount,o="";for(n.chunkCount<=1&&(n.chunkCount=1),o+="<ul class='k-reset'>",e=n.chunkCount-1;e>=0;e--)o+="<li class='k-item k-state-default'></li>";o+="</ul>",i.append(o).find(".k-item").css(t._progressProperty,r+"%").first().addClass("k-first").end().last().addClass("k-last"),t._normalizeChunkSize()},_normalizeChunkSize:function(){var e=this,t=e.options,n=e.wrapper.find(".k-item:last"),i=parseFloat(n[0].style[e._progressProperty]),r=D-t.chunkCount*i;r>0&&n.css(e._progressProperty,i+r+"%")},_addRegularProgressWrapper:function(){var t=this;t.progressWrapper=e("<div class='"+m+"'></div>").appendTo(t.wrapper),t.options.showStatus&&(t.progressWrapper.append(R.progressStatus),t.progressStatus=t.wrapper.find("."+g))},_calculateChunkSize:function(){var e=this,t=e.options.chunkCount,n=e.wrapper.find("ul.k-reset");return(parseInt(n.css(e._progressProperty),10)-(t-1))/t},_calculatePercentage:function(e){var n=this,i=n.options,r=e!==t?e:i.value,o=i.min,a=i.max;return n._onePercent=C.abs((a-o)/100),C.abs((r-o)/n._onePercent)},_progressAnimation:function(){var e=this,t=e.options,n=t.animation;e._animation=n===!1?{duration:0}:T({duration:E},t.animation)}});n.ui.plugin(I)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("pdf/core.min",["kendo.core.min","util/main.min"],e)}(function(){!function(e,t,n){"use strict";function i(){function e(){var t,r,o;for(t=0;t<arguments.length;++t){if(r=arguments[t],r===n)throw Error("Cannot output undefined to PDF");if(r instanceof w)r.beforeRender(e),r.render(e);else if(V(r))m(r,e);else if(p(r))g(r,e);else if("number"==typeof r){if(isNaN(r))throw Error("Cannot output NaN to PDF");o=r.toFixed(7),o.indexOf(".")>=0&&(o=o.replace(/\.?0+$/,"")),"-0"==o&&(o="0"),i.writeString(o)}else/string|boolean/.test(typeof r)?i.writeString(r+""):"function"==typeof r.get?i.write(r.get()):"object"==typeof r&&(r?e(new $(r)):i.writeString("null"))}}var t=0,i=M();return e.writeData=function(e){i.write(e)},e.withIndent=function(n){++t,n(e),--t},e.indent=function(){e(ie,u("",2*t,"  ")),e.apply(null,arguments)},e.offset=function(){return i.offset()},e.toString=function(){throw Error("FIX CALLER")},e.get=function(){return i.get()},e.stream=function(){return i},e}function r(e,t){var n=e.beforeRender,i=e.render;e.beforeRender=function(){},e.render=function(e){e(t," 0 R")},e.renderFull=function(r){e._offset=r.offset(),r(t," 0 obj "),n.call(e,r),i.call(e,r),r(" endobj")}}function o(e){var t,n,i;if("function"!=typeof e&&(t=e,e=function(e,n){return e in t?t[e]:n}),n=e("paperSize",ae.a4),!n)return{};if("string"==typeof n&&(n=ae[n.toLowerCase()],null==n))throw Error("Unknown paper size");return n[0]=k(n[0]),n[1]=k(n[1]),e("landscape",!1)&&(n=[Math.max(n[0],n[1]),Math.min(n[0],n[1])]),i=e("margin"),i&&("string"==typeof i||"number"==typeof i?(i=k(i,0),i={left:i,top:i,right:i,bottom:i}):i={left:k(i.left,0),top:k(i.top,0),right:k(i.right,0),bottom:k(i.bottom,0)},e("addMargin")&&(n[0]+=i.left+i.right,n[1]+=i.top+i.bottom)),{paperSize:n,margin:i}}function a(e){function t(t,n){return e&&null!=e[t]?e[t]:n}var n,a,s=this,l=i(),d=0,c=[];s.getOption=t,s.attach=function(e){return c.indexOf(e)<0&&(r(e,++d),c.push(e)),e},s.pages=[],s.FONTS={},s.IMAGES={},s.GRAD_COL_FUNCTIONS={},s.GRAD_OPC_FUNCTIONS={},s.GRAD_COL={},s.GRAD_OPC={},n=s.attach(new Y),a=s.attach(new K),n.setPages(a),s.addPage=function(e){var t,n,r,l=o(function(t,n){return e&&null!=e[t]?e[t]:n}),d=l.paperSize,c=l.margin,u=d[0],h=d[1];return c&&(u-=c.left+c.right,h-=c.top+c.bottom),t=new G(i(),null,(!0)),n={Contents:s.attach(t),Parent:a,MediaBox:[0,0,d[0],d[1]]},r=new Z(s,n),r._content=t,a.addPage(s.attach(r)),r.transform(1,0,0,-1,0,d[1]),c&&(r.translate(c.left,c.top),r.rect(0,0,u,h),r.clip()),s.pages.push(r),r},s.render=function(){var e,i;for(l("%PDF-1.4",ie,"%ÂÁÚÏÎ",ie,ie),e=0;e<c.length;++e)c[e].renderFull(l),l(ie,ie);for(i=l.offset(),l("xref",ie,0," ",c.length+1,ie),l("0000000000 65535 f ",ie),e=0;e<c.length;++e)l(h(c[e]._offset,10)," 00000 n ",ie);return l(ie),l("trailer",ie),l(new $({Size:c.length+1,Root:n,Info:new $({Producer:new W(t("producer","Kendo UI PDF Generator v."+te.version)),Title:new W(t("title","")),Author:new W(t("author","")),Subject:new W(t("subject","")),Keywords:new W(t("keywords","")),Creator:new W(t("creator","Kendo UI PDF Generator v."+te.version)),CreationDate:t("date",new Date)})}),ie,ie),l("startxref",ie,i,ie),l("%%EOF",ie),l.stream().offset(0)}}function s(t,n){function i(){e.console&&(e.console.error?e.console.error("Cannot load URL: %s",t):e.console.log("Cannot load URL: %s",t)),n(null)}var r=new XMLHttpRequest;r.open("GET",t,!0),ne&&(r.responseType="arraybuffer"),r.onload=function(){200==r.status||304==r.status?n(ne?new Uint8Array(r.response):new VBArray(r.responseBody).toArray()):i()},r.onerror=i,r.send(null)}function l(e,t){var n=se[e];n?t(n):s(e,function(n){if(null==n)throw Error("Cannot load font from "+e);var i=new te.pdf.TTFFont(n);se[e]=i,t(i)})}function d(e,t){function i(e){d.src=e,d.complete&&!te.support.browser.msie?o():(d.onload=o,d.onerror=r)}function r(){t(le[e]="TAINTED")}function o(){var i,o,l,c,u,h,f,p,m,g,v,_;if(s&&/^image\/jpe?g$/i.test(s.type))return i=new FileReader,i.onload=function(){d=new C(d.width,d.height,M(new Uint8Array(this.result))),URL.revokeObjectURL(a),t(le[e]=d)},i.readAsArrayBuffer(s),n;o=document.createElement("canvas"),o.width=d.width,o.height=d.height,l=o.getContext("2d"),l.drawImage(d,0,0);try{c=l.getImageData(0,0,d.width,d.height)}catch(b){return r()}finally{a&&URL.revokeObjectURL(a)}for(u=!1,h=M(),f=M(),p=c.data,m=0;m<p.length;)h.writeByte(p[m++]),h.writeByte(p[m++]),h.writeByte(p[m++]),g=p[m++],g<255&&(u=!0),f.writeByte(g);u?d=new T(d.width,d.height,h,f):(v=o.toDataURL("image/jpeg"),v=v.substr(v.indexOf(";base64,")+8),_=M(),_.writeBase64(v),_.offset(0),d=new C(d.width,d.height,_)),t(le[e]=d)}var a,s,l,d=le[e];d?t(d):(d=new Image,/^data:/i.test(e)||(d.crossOrigin="Anonymous"),ne&&!/^data:/i.test(e)?(l=new XMLHttpRequest,l.onload=function(){s=l.response,a=URL.createObjectURL(s),i(a)},l.onerror=r,l.open("GET",e,!0),l.responseType="blob",l.send()):i(e))}function c(e){return function(t,n){var i=t.length,r=i;if(0===i)return n();for(;r-- >0;)e(t[r],function(){0===--i&&n()})}}function u(e,t,n){for(;e.length<t;)e=n+e;return e}function h(e,t){return u(e+"",t,"0")}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function p(e){return e instanceof Date}function m(e,t){t("["),e.length>0&&t.withIndent(function(){for(var n=0;n<e.length;++n)n>0&&n%8===0?t.indent(e[n]):t(" ",e[n])}),t(" ]")}function g(e,t){t("(D:",h(e.getUTCFullYear(),4),h(e.getUTCMonth()+1,2),h(e.getUTCDate(),2),h(e.getUTCHours(),2),h(e.getUTCMinutes(),2),h(e.getUTCSeconds(),2),"Z)")}function v(e){return e*(72/25.4)}function _(e){return v(10*e)}function b(e){return 72*e}function k(e,n){var i,r;if("number"==typeof e)return e;if("string"==typeof e&&(i=/^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(e),i&&(r=t(i[1]),!isNaN(r))))return"pt"==i[2]?r:{mm:v,cm:_,"in":b}[i[2]](r);if(null!=n)return n;throw Error("Can't parse unit: "+e)}function w(){}function y(e,t,n){n||(n=w),e.prototype=new n;for(var i in t)f(t,i)&&(e.prototype[i]=t[i]);return e}function x(e){return f(j,e)?j[e]:j[e]=new q(e)}function C(e,t,n){this.asStream=function(){var i=new G(n,{Type:x("XObject"),Subtype:x("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:x("DeviceRGB"),Filter:x("DCTDecode")});return i._resourceName=x("I"+ ++re),i}}function T(e,t,n,i){this.asStream=function(r){var o=new G(i,{Type:x("XObject"),Subtype:x("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:x("DeviceGray")},(!0)),a=new G(n,{Type:x("XObject"),Subtype:x("Image"),Width:e,Height:t,BitsPerComponent:8,ColorSpace:x("DeviceRGB"),SMask:r.attach(o)},(!0));return a._resourceName=x("I"+ ++re),a}}function S(e){return e.map(function(e){return V(e)?S(e):"number"==typeof e?(Math.round(1e3*e)/1e3).toFixed(3):e}).join(" ")}function D(e,t,n,i,r,o,a){var s=S([t,n,i,r,o,a]),l=e.GRAD_COL_FUNCTIONS[s];return l||(l=e.GRAD_COL_FUNCTIONS[s]=e.attach(new $({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[t,n,i],C1:[r,o,a]}))),l}function E(e,t,n){var i=S([t,n]),r=e.GRAD_OPC_FUNCTIONS[i];return r||(r=e.GRAD_OPC_FUNCTIONS[i]=e.attach(new $({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[t],C1:[n]}))),r}function F(e,t){function n(e){return 1==e.length?e[0]:{FunctionType:3,Functions:e,Domain:[0,1],Bounds:u,Encode:h}}var i,r,o,a,s,l=!1,d=[],c=[],u=[],h=[];for(i=1;i<t.length;++i)r=t[i-1],o=t[i],a=r.color,s=o.color,c.push(D(e,a.r,a.g,a.b,s.r,s.g,s.b)),(a.a<1||s.a<1)&&(l=!0),u.push(o.offset),h.push(0,1);if(l)for(i=1;i<t.length;++i)r=t[i-1],o=t[i],a=r.color,s=o.color,d.push(E(e,a.a,s.a));return u.pop(),{hasAlpha:l,colors:n(c),opacities:l?n(d):null}}function R(e,t,n,i,r,o){var a,s,l;return o||(l=[t].concat(i),n.forEach(function(e){l.push(e.offset,e.color.r,e.color.g,e.color.b)}),s=S(l),a=e.GRAD_COL[s]),a||(a=new $({Type:x("Shading"),ShadingType:t?3:2,ColorSpace:x("DeviceRGB"),Coords:i,Domain:[0,1],Function:r,Extend:[!0,!0]}),e.attach(a),a._resourceName="S"+ ++re,s&&(e.GRAD_COL[s]=a)),a}function I(e,t,n,i,r,o){var a,s,l;return o||(l=[t].concat(i),n.forEach(function(e){l.push(e.offset,e.color.a)}),s=S(l),a=e.GRAD_OPC[s]),a||(a=new $({Type:x("ExtGState"),AIS:!1,CA:1,ca:1,SMask:{Type:x("Mask"),S:x("Luminosity"),G:e.attach(new G("/a0 gs /s0 sh",{Type:x("XObject"),Subtype:x("Form"),FormType:1,BBox:o?[o.left,o.top+o.height,o.left+o.width,o.top]:[0,1,1,0],Group:{Type:x("Group"),S:x("Transparency"),CS:x("DeviceGray"),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:x("DeviceGray"),Coords:i,Domain:[0,1],ShadingType:t?3:2,Function:r,Extend:[!0,!0]}}}}))}}),e.attach(a),a._resourceName="O"+ ++re,s&&(e.GRAD_OPC[s]=a)),a}function A(e,t,n){var i="radial"==t.type,r=F(e,t.stops),o=i?[t.start.x,t.start.y,t.start.r,t.end.x,t.end.y,t.end.r]:[t.start.x,t.start.y,t.end.x,t.end.y],a=R(e,i,t.stops,o,r.colors,t.userSpace&&n),s=r.hasAlpha?I(e,i,t.stops,o,r.opacities,t.userSpace&&n):null;return{hasAlpha:r.hasAlpha,shading:a,opacity:s}}function M(t){function n(){return S>=D}function i(){return S<D?t[S++]:0}function r(e){w(S),t[S++]=255&e,S>D&&(D=S)}function o(){return i()<<8|i()}function a(e){r(e>>8),r(e)}function s(){var e=o();return e>=32768?e-65536:e}function l(e){a(e<0?e+65536:e)}function d(){return 65536*o()+o()}function c(e){a(e>>>16&65535),a(65535&e)}function u(){var e=d();return e>=2147483648?e-4294967296:e}function h(e){c(e<0?e+4294967296:e)}function f(){return d()/65536}function p(e){c(Math.round(65536*e))}function m(){return u()/65536}function g(e){h(Math.round(65536*e))}function v(e){return k(e,i)}function _(e){return String.fromCharCode.apply(String,v(e))}function b(e){for(var t=0;t<e.length;++t)r(e.charCodeAt(t))}function k(e,t){for(var n=Array(e),i=0;i<e;++i)n[i]=t();return n}var w,y,x,C,T,S=0,D=0;return null==t?t=ne?new Uint8Array(256):[]:D=t.length,w=ne?function(e){if(e>=t.length){var n=new Uint8Array(Math.max(e+256,2*t.length));n.set(t,0),t=n}}:function(){},y=ne?function(){return new Uint8Array(t.buffer,0,D)}:function(){return t},x=ne?function(e){if("string"==typeof e)return b(e);var n=e.length;w(S+n),t.set(e,S),S+=n,S>D&&(D=S)}:function(e){if("string"==typeof e)return b(e);for(var t=0;t<e.length;++t)r(e[t])},C=ne?function(e,n){if(t.buffer.slice)return new Uint8Array(t.buffer.slice(e,e+n));var i=new Uint8Array(n);return i.set(new Uint8Array(t.buffer,e,n)),i}:function(e,n){return t.slice(e,e+n)},T={eof:n,readByte:i,writeByte:r,readShort:o,writeShort:a,readLong:d,writeLong:c,readFixed:f,
writeFixed:p,readShort_:s,writeShort_:l,readLong_:u,writeLong_:h,readFixed_:m,writeFixed_:g,read:v,write:x,readString:_,writeString:b,times:k,get:y,slice:C,offset:function(e){return null!=e?(S=e,T):S},skip:function(e){S+=e},toString:function(){throw Error("FIX CALLER.  BinaryStream is no longer convertible to string!")},length:function(){return D},saveExcursion:function(e){var t=S;try{return e()}finally{S=t}},writeBase64:function(t){e.atob?b(e.atob(t)):x(oe.decode(t))},base64:function(){return oe.encode(y())}}}function z(e){return e.replace(/^\s*(['"])(.*)\1\s*$/,"$2")}function H(e){var t,n=/^\s*((normal|italic)\s+)?((normal|small-caps)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i,i=n.exec(e);return i?(t=i[8]?parseInt(i[8],10):12,{italic:i[2]&&"italic"==i[2].toLowerCase(),variant:i[4],bold:i[6]&&/bold|700/i.test(i[6]),fontSize:t,lineHeight:i[12]?"normal"==i[12]?t:parseInt(i[12],10):null,fontFamily:i[14].split(/\s*,\s*/g).map(z)}):{fontSize:12,fontFamily:"sans-serif"}}function N(e){function t(t){return e.bold&&(t+="|bold"),e.italic&&(t+="|italic"),t.toLowerCase()}var n,i,r,o=e.fontFamily;if(o instanceof Array)for(r=0;r<o.length&&(n=t(o[r]),!(i=ee[n]));++r);else i=ee[o.toLowerCase()];for(;"function"==typeof i;)i=i();return i||(i="Times-Roman"),i}function P(e,t){e=e.toLowerCase(),ee[e]=function(){return ee[t]},ee[e+"|bold"]=function(){return ee[t+"|bold"]},ee[e+"|italic"]=function(){return ee[t+"|italic"]},ee[e+"|bold|italic"]=function(){return ee[t+"|bold|italic"]}}function L(e,t){if(1==arguments.length)for(var n in e)f(e,n)&&L(n,e[n]);else switch(e=e.toLowerCase(),ee[e]=t,e){case"dejavu sans":ee["sans-serif"]=t;break;case"dejavu sans|bold":ee["sans-serif|bold"]=t;break;case"dejavu sans|italic":ee["sans-serif|italic"]=t;break;case"dejavu sans|bold|italic":ee["sans-serif|bold|italic"]=t;break;case"dejavu serif":ee.serif=t;break;case"dejavu serif|bold":ee["serif|bold"]=t;break;case"dejavu serif|italic":ee["serif|italic"]=t;break;case"dejavu serif|bold|italic":ee["serif|bold|italic"]=t;break;case"dejavu mono":ee.monospace=t;break;case"dejavu mono|bold":ee["monospace|bold"]=t;break;case"dejavu mono|italic":ee["monospace|italic"]=t;break;case"dejavu mono|bold|italic":ee["monospace|bold|italic"]=t}}function B(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=t[0],d=t[1],c=t[2],u=t[3],h=t[4],f=t[5];return[n*l+i*c,n*d+i*u,r*l+o*c,r*d+o*u,a*l+s*c+h,a*d+s*u+f]}function O(e){return 1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]}var V,W,U,q,j,$,G,Y,K,Q,X,J,Z,ee,te=e.kendo,ne=!!e.Uint8Array,ie="\n",re=0,oe=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{decode:function(t){for(var n,i,r,o,a,s,l,d=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),c=0,u=d.length,h=[];c<u;)n=e.indexOf(d.charAt(c++)),i=e.indexOf(d.charAt(c++)),r=e.indexOf(d.charAt(c++)),o=e.indexOf(d.charAt(c++)),a=n<<2|i>>>4,s=(15&i)<<4|r>>>2,l=(3&r)<<6|o,h.push(a),64!=r&&h.push(s),64!=o&&h.push(l);return h},encode:function(t){for(var n,i,r,o,a,s,l,d=0,c=t.length,u="";d<c;)n=t[d++],i=t[d++],r=t[d++],o=n>>>2,a=(3&n)<<4|i>>>4,s=(15&i)<<2|r>>>6,l=63&r,d-c==2?s=l=64:d-c==1&&(l=64),u+=e.charAt(o)+e.charAt(a)+e.charAt(s)+e.charAt(l);return u}}}(),ae={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],executive:[521.86,756],folio:[612,936],legal:[612,1008],letter:[612,792],tabloid:[792,1224]},se={"Times-Roman":!0,"Times-Bold":!0,"Times-Italic":!0,"Times-BoldItalic":!0,Helvetica:!0,"Helvetica-Bold":!0,"Helvetica-Oblique":!0,"Helvetica-BoldOblique":!0,Courier:!0,"Courier-Bold":!0,"Courier-Oblique":!0,"Courier-BoldOblique":!0,Symbol:!0,ZapfDingbats:!0},le={},de=c(l),ce=c(d);a.prototype={loadFonts:de,loadImages:ce,getFont:function(e){var t=this.FONTS[e];if(!t){if(t=se[e],!t)throw Error("Font "+e+" has not been loaded");t=this.attach(t===!0?new Q(e):new X(this,t)),this.FONTS[e]=t}return t},getImage:function(e){var t=this.IMAGES[e];if(!t){if(t=le[e],!t)throw Error("Image "+e+" has not been loaded");if("TAINTED"===t)return null;t=this.IMAGES[e]=this.attach(t.asStream(this))}return t},getOpacityGS:function(e,n){var i,r,o,a=t(e).toFixed(3);return e=t(a),a+=n?"S":"F",i=this._opacityGSCache||(this._opacityGSCache={}),r=i[a],r||(o={Type:x("ExtGState")},n?o.CA=e:o.ca=e,r=this.attach(new $(o)),r._resourceName=x("GS"+ ++re),i[a]=r),r},dict:function(e){return new $(e)},name:function(e){return x(e)},stream:function(e,t){return new G(t,e)}},V=Array.isArray||function(e){return e instanceof Array},w.prototype.beforeRender=function(){},W=y(function(e){this.value=e},{render:function(e){var t,n="",i=this.escape();for(t=0;t<i.length;++t)n+=String.fromCharCode(255&i.charCodeAt(t));e("(",n,")")},escape:function(){return this.value.replace(/([\(\)\\])/g,"\\$1")},toString:function(){return this.value}}),U=y(function(e){this.value=e},{render:function(e){e("<");for(var t=0;t<this.value.length;++t)e(h(this.value.charCodeAt(t).toString(16),4));e(">")}},W),q=y(function(e){this.name=e},{render:function(e){e("/"+this.escape())},escape:function(){return this.name.replace(/[^\x21-\x7E]/g,function(e){return"#"+h(e.charCodeAt(0).toString(16),2)})},toString:function(){return this.name}}),j={},q.get=x,$=y(function(e){this.props=e},{render:function(e){var t=this.props,n=!0;e("<<"),e.withIndent(function(){for(var i in t)f(t,i)&&!/^_/.test(i)&&(n=!1,e.indent(x(i)," ",t[i]))}),n||e.indent(),e(">>")}}),G=y(function(e,t,n){if("string"==typeof e){var i=M();i.write(e),e=i}this.data=e,this.props=t||{},this.compress=n},{render:function(t){var n=this.data.get(),i=this.props;this.compress&&e.pako&&"function"==typeof e.pako.deflate&&(i.Filter?i.Filter instanceof Array||(i.Filter=[i.Filter]):i.Filter=[],i.Filter.unshift(x("FlateDecode")),n=e.pako.deflate(n)),i.Length=n.length,t(new $(i)," stream",ie),t.writeData(n),t(ie,"endstream")}}),Y=y(function(e){e=this.props=e||{},e.Type=x("Catalog")},{setPages:function(e){this.props.Pages=e}},$),K=y(function(){this.props={Type:x("Pages"),Kids:[],Count:0}},{addPage:function(e){this.props.Kids.push(e),this.props.Count++}},$),Q=y(function(e){this.props={Type:x("Font"),Subtype:x("Type1"),BaseFont:x(e)},this._resourceName=x("F"+ ++re)},{encodeText:function(e){return new W(e+"")}},$),X=y(function(e,t,n){var i,r;n=this.props=n||{},n.Type=x("Font"),n.Subtype=x("Type0"),n.Encoding=x("Identity-H"),this._pdf=e,this._font=t,this._sub=t.makeSubset(),this._resourceName=x("F"+ ++re),i=t.head,this.name=t.psName,r=this.scale=t.scale,this.bbox=[i.xMin*r,i.yMin*r,i.xMax*r,i.yMax*r],this.italicAngle=t.post.italicAngle,this.ascent=t.ascent*r,this.descent=t.descent*r,this.lineGap=t.lineGap*r,this.capHeight=t.os2.capHeight||this.ascent,this.xHeight=t.os2.xHeight||0,this.stemV=0,this.familyClass=(t.os2.familyClass||0)>>8,this.isSerif=this.familyClass>=1&&this.familyClass<=7,this.isScript=10==this.familyClass,this.flags=(t.post.isFixedPitch?1:0)|(this.isSerif?2:0)|(this.isScript?8:0)|(0!==this.italicAngle?64:0)|32},{encodeText:function(e){return new U(this._sub.encodeText(e+""))},getTextWidth:function(e,t){var n,i,r=0,o=this._font.cmap.codeMap;for(n=0;n<t.length;++n)i=o[t.charCodeAt(n)],r+=this._font.widthOfGlyph(i||0);return r*e/1e3},beforeRender:function(){var e,t,n,r,o=this,a=o._sub,s=a.render(),l=new G(M(s),{Length1:s.length},(!0)),d=o._pdf.attach(new $({Type:x("FontDescriptor"),FontName:x(o._sub.psName),FontBBox:o.bbox,Flags:o.flags,StemV:o.stemV,ItalicAngle:o.italicAngle,Ascent:o.ascent,Descent:o.descent,CapHeight:o.capHeight,XHeight:o.xHeight,FontFile2:o._pdf.attach(l)})),c=a.ncid2ogid,u=a.firstChar,h=a.lastChar,f=[];!function p(e,t){if(e<=h){var n=c[e];null==n?p(e+1):(t||f.push(e,t=[]),t.push(o._font.widthOfGlyph(n)),p(e+1,t))}}(u),e=new $({Type:x("Font"),Subtype:x("CIDFontType2"),BaseFont:x(o._sub.psName),CIDSystemInfo:new $({Registry:new W("Adobe"),Ordering:new W("Identity"),Supplement:0}),FontDescriptor:d,FirstChar:u,LastChar:h,DW:Math.round(o._font.widthOfGlyph(0)),W:f,CIDToGIDMap:o._pdf.attach(o._makeCidToGidMap())}),t=o.props,t.BaseFont=x(o._sub.psName),t.DescendantFonts=[o._pdf.attach(e)],n=new J(u,h,a.subset),r=new G(i(),null,(!0)),r.data(n),t.ToUnicode=o._pdf.attach(r)},_makeCidToGidMap:function(){return new G(M(this._sub.cidToGidMap()),null,(!0))}},$),J=y(function(e,t,n){this.firstChar=e,this.lastChar=t,this.map=n},{render:function(e){e.indent("/CIDInit /ProcSet findresource begin"),e.indent("12 dict begin"),e.indent("begincmap"),e.indent("/CIDSystemInfo <<"),e.indent("  /Registry (Adobe)"),e.indent("  /Ordering (UCS)"),e.indent("  /Supplement 0"),e.indent(">> def"),e.indent("/CMapName /Adobe-Identity-UCS def"),e.indent("/CMapType 2 def"),e.indent("1 begincodespacerange"),e.indent("  <0000><ffff>"),e.indent("endcodespacerange");var t=this;e.indent(t.lastChar-t.firstChar+1," beginbfchar"),e.withIndent(function(){var n,i,r,o;for(n=t.firstChar;n<=t.lastChar;++n){for(i=t.map[n],r=te.util.ucs2encode([i]),e.indent("<",h(n.toString(16),4),">","<"),o=0;o<r.length;++o)e(h(r.charCodeAt(o).toString(16),4));e(">")}}),e.indent("endbfchar"),e.indent("endcmap"),e.indent("CMapName currentdict /CMap defineresource pop"),e.indent("end"),e.indent("end")}}),Z=y(function(e,t){this._pdf=e,this._rcount=0,this._textMode=!1,this._fontResources={},this._gsResources={},this._xResources={},this._patResources={},this._shResources={},this._opacity=1,this._matrix=[1,0,0,1,0,0],this._annotations=[],this._font=null,this._fontSize=null,this._contextStack=[],t=this.props=t||{},t.Type=x("Page"),t.ProcSet=[x("PDF"),x("Text"),x("ImageB"),x("ImageC"),x("ImageI")],t.Resources=new $({Font:new $(this._fontResources),ExtGState:new $(this._gsResources),XObject:new $(this._xResources),Pattern:new $(this._patResources),Shading:new $(this._shResources)}),t.Annots=this._annotations},{_out:function(){this._content.data.apply(null,arguments)},transform:function(e,t,n,i,r,o){O(arguments)||(this._matrix=B(arguments,this._matrix),this._out(e," ",t," ",n," ",i," ",r," ",o," cm"),this._out(ie))},translate:function(e,t){this.transform(1,0,0,1,e,t)},scale:function(e,t){this.transform(e,0,0,t,0,0)},rotate:function(e){var t=Math.cos(e),n=Math.sin(e);this.transform(t,n,-n,t,0,0)},beginText:function(){this._textMode=!0,this._out("BT",ie)},endText:function(){this._textMode=!1,this._out("ET",ie)},_requireTextMode:function(){if(!this._textMode)throw Error("Text mode required; call page.beginText() first")},_requireFont:function(){if(!this._font)throw Error("No font selected; call page.setFont() first")},setFont:function(e,t){this._requireTextMode(),null==e?e=this._font:e instanceof X||(e=this._pdf.getFont(e)),null==t&&(t=this._fontSize),this._fontResources[e._resourceName]=e,this._font=e,this._fontSize=t,this._out(e._resourceName," ",t," Tf",ie)},setTextLeading:function(e){this._requireTextMode(),this._out(e," TL",ie)},setTextRenderingMode:function(e){this._requireTextMode(),this._out(e," Tr",ie)},showText:function(e,t){var n,i;this._requireFont(),e.length>1&&t&&this._font instanceof X&&(n=this._font.getTextWidth(this._fontSize,e),i=t/n*100,this._out(i," Tz ")),this._out(this._font.encodeText(e)," Tj",ie)},showTextNL:function(e){this._requireFont(),this._out(this._font.encodeText(e)," '",ie)},addLink:function(e,t){var n=this._toPage({x:t.left,y:t.bottom}),i=this._toPage({x:t.right,y:t.top});this._annotations.push(new $({Type:x("Annot"),Subtype:x("Link"),Rect:[n.x,n.y,i.x,i.y],Border:[0,0,0],A:new $({Type:x("Action"),S:x("URI"),URI:new W(e)})}))},setStrokeColor:function(e,t,n){this._out(e," ",t," ",n," RG",ie)},setOpacity:function(e){this.setFillOpacity(e),this.setStrokeOpacity(e),this._opacity*=e},setStrokeOpacity:function(e){if(e<1){var t=this._pdf.getOpacityGS(this._opacity*e,!0);this._gsResources[t._resourceName]=t,this._out(t._resourceName," gs",ie)}},setFillColor:function(e,t,n){this._out(e," ",t," ",n," rg",ie)},setFillOpacity:function(e){if(e<1){var t=this._pdf.getOpacityGS(this._opacity*e,!1);this._gsResources[t._resourceName]=t,this._out(t._resourceName," gs",ie)}},gradient:function(e,t){var n,i,r;this.save(),this.rect(t.left,t.top,t.width,t.height),this.clip(),e.userSpace||this.transform(t.width,0,0,t.height,t.left,t.top),n=A(this._pdf,e,t),i=n.shading._resourceName,this._shResources[i]=n.shading,n.hasAlpha&&(r=n.opacity._resourceName,this._gsResources[r]=n.opacity,this._out("/"+r+" gs ")),this._out("/"+i+" sh",ie),this.restore()},setDashPattern:function(e,t){this._out(e," ",t," d",ie)},setLineWidth:function(e){this._out(e," w",ie)},setLineCap:function(e){this._out(e," J",ie)},setLineJoin:function(e){this._out(e," j",ie)},setMitterLimit:function(e){this._out(e," M",ie)},save:function(){this._contextStack.push(this._context()),this._out("q",ie)},restore:function(){this._out("Q",ie),this._context(this._contextStack.pop())},moveTo:function(e,t){this._out(e," ",t," m",ie)},lineTo:function(e,t){this._out(e," ",t," l",ie)},bezier:function(e,t,n,i,r,o){this._out(e," ",t," ",n," ",i," ",r," ",o," c",ie)},bezier1:function(e,t,n,i){this._out(e," ",t," ",n," ",i," y",ie)},bezier2:function(e,t,n,i){this._out(e," ",t," ",n," ",i," v",ie)},close:function(){this._out("h",ie)},rect:function(e,t,n,i){this._out(e," ",t," ",n," ",i," re",ie)},ellipse:function(e,t,n,i){function r(t){return e+t}function o(e){return t+e}var a=.5522847498307936;this.moveTo(r(0),o(i)),this.bezier(r(n*a),o(i),r(n),o(i*a),r(n),o(0)),this.bezier(r(n),o(-i*a),r(n*a),o(-i),r(0),o(-i)),this.bezier(r(-n*a),o(-i),r(-n),o(-i*a),r(-n),o(0)),this.bezier(r(-n),o(i*a),r(-n*a),o(i),r(0),o(i))},circle:function(e,t,n){this.ellipse(e,t,n,n)},stroke:function(){this._out("S",ie)},nop:function(){this._out("n",ie)},clip:function(){this._out("W n",ie)},clipStroke:function(){this._out("W S",ie)},closeStroke:function(){this._out("s",ie)},fill:function(){this._out("f",ie)},fillStroke:function(){this._out("B",ie)},drawImage:function(e){var t=this._pdf.getImage(e);t&&(this._xResources[t._resourceName]=t,this._out(t._resourceName," Do",ie))},comment:function(e){var t=this;e.split(/\r?\n/g).forEach(function(e){t._out("% ",e,ie)})},_context:function(e){return null==e?{opacity:this._opacity,matrix:this._matrix}:(this._opacity=e.opacity,this._matrix=e.matrix,n)},_toPage:function(e){var t=this._matrix,n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5];return{x:n*e.x+r*e.y+a,y:i*e.x+o*e.y+s}}},$),ee={serif:"Times-Roman","serif|bold":"Times-Bold","serif|italic":"Times-Italic","serif|bold|italic":"Times-BoldItalic","sans-serif":"Helvetica","sans-serif|bold":"Helvetica-Bold","sans-serif|italic":"Helvetica-Oblique","sans-serif|bold|italic":"Helvetica-BoldOblique",monospace:"Courier","monospace|bold":"Courier-Bold","monospace|italic":"Courier-Oblique","monospace|bold|italic":"Courier-BoldOblique",zapfdingbats:"ZapfDingbats","zapfdingbats|bold":"ZapfDingbats","zapfdingbats|italic":"ZapfDingbats","zapfdingbats|bold|italic":"ZapfDingbats"},P("Times New Roman","serif"),P("Courier New","monospace"),P("Arial","sans-serif"),P("Helvetica","sans-serif"),P("Verdana","sans-serif"),P("Tahoma","sans-serif"),P("Georgia","sans-serif"),P("Monaco","monospace"),P("Andale Mono","monospace"),te.pdf={Document:a,BinaryStream:M,defineFont:L,parseFontDef:H,getFontURL:N,loadFonts:de,loadImages:ce,getPaperOptions:o,TEXT_RENDERING_MODE:{fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7}}}(window,parseFloat)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("pdf/ttf.min",["pdf/core.min","util/main.min"],e)}(function(){!function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return Object.keys(e).sort(function(e,t){return e-t}).map(parseFloat)}function i(e){var t,n,i;for(this.raw=e,this.scalerType=e.readLong(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),t=this.tables={},n=0;n<this.tableCount;++n)i={tag:e.readString(4),checksum:e.readLong(),offset:e.readLong(),length:e.readLong()},t[i.tag]=i}function r(e){function n(e,t){this.definition=t,this.length=t.length,this.offset=t.offset,this.file=e,this.rawData=e.raw,this.parse(e.raw)}n.prototype.raw=function(){return this.rawData.slice(this.offset,this.length)};for(var i in e)t(e,i)&&(n[i]=n.prototype[i]=e[i]);return n}function o(){var e,t="",n=_+"";for(e=0;e<n.length;++e)t+=String.fromCharCode(n.charCodeAt(e)-48+65);return++_,t}function a(e){this.font=e,this.subset={},this.unicodes={},this.ogid2ngid={0:0},this.ngid2ogid={0:0},this.ncid2ogid={},this.next=this.firstChar=1,this.nextGid=1,this.psName=o()+"+"+this.font.psName}function s(e,t){var n,i,r,o=this,a=o.contents=k(e);if("ttcf"==a.readString(4)){if(!t)throw Error("Must specify a name for TTC files");for(a.readLong(),n=a.readLong(),i=0;i<n;++i)if(r=a.readLong(),a.saveExcursion(function(){a.offset(r),o.parse()}),o.psName==t)return;throw Error("Font "+t+" not found in collection")}a.offset(0),o.parse()}var l,d,c,u,h,f,p,m,g,v,_,b=e.kendo.pdf,k=b.BinaryStream;i.prototype={readTable:function(e,t){var n=this.tables[e];if(!n)throw Error("Table "+e+" not found in directory");return this[e]=n.table=new t(this,n)},render:function(e){var n,i,r,o,a,s,l,d,c=Object.keys(e).length,u=Math.pow(2,Math.floor(Math.log(c)/Math.LN2)),h=16*u,f=Math.floor(Math.log(u)/Math.LN2),p=16*c-h,m=k();m.writeLong(this.scalerType),m.writeShort(c),m.writeShort(h),m.writeShort(f),m.writeShort(p),n=16*c,i=m.offset()+n,r=null,o=k();for(a in e)if(t(e,a))for(s=e[a],m.writeString(a),m.writeLong(this.checksum(s)),m.writeLong(i),m.writeLong(s.length),o.write(s),"head"==a&&(r=i),i+=s.length;i%4;)o.writeByte(0),i++;return m.write(o.get()),l=this.checksum(m.get()),d=2981146554-l,m.offset(r+8),m.writeLong(d),m.get()},checksum:function(e){e=k(e);for(var t=0;!e.eof();)t+=e.readLong();return 4294967295&t}},l=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.revision=e.readLong(),this.checkSumAdjustment=e.readLong(),this.magicNumber=e.readLong(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.read(8),this.modified=e.read(8),this.xMin=e.readShort_(),this.yMin=e.readShort_(),this.xMax=e.readShort_(),this.yMax=e.readShort_(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort_(),this.indexToLocFormat=e.readShort_(),this.glyphDataFormat=e.readShort_()},render:function(e){var t=k();return t.writeLong(this.version),t.writeLong(this.revision),t.writeLong(0),t.writeLong(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.write(this.created),t.write(this.modified),t.writeShort_(this.xMin),t.writeShort_(this.yMin),t.writeShort_(this.xMax),t.writeShort_(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort_(this.fontDirectionHint),t.writeShort_(e),t.writeShort_(this.glyphDataFormat),t.get()}}),d=r({parse:function(e){e.offset(this.offset);var t=this.file.head.indexToLocFormat;this.offsets=0===t?e.times(this.length/2,function(){return 2*e.readShort()}):e.times(this.length/4,e.readLong)},offsetOf:function(e){return this.offsets[e]},lengthOf:function(e){return this.offsets[e+1]-this.offsets[e]},render:function(e){var t,n=k(),i=e[e.length-1]>65535;for(t=0;t<e.length;++t)i?n.writeLong(e[t]):n.writeShort(e[t]/2);return{format:i?1:0,table:n.get()}}}),c=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort_(),this.minRightSideBearing=e.readShort_(),this.xMaxExtent=e.readShort_(),this.caretSlopeRise=e.readShort_(),this.caretSlopeRun=e.readShort_(),this.caretOffset=e.readShort_(),e.skip(8),this.metricDataFormat=e.readShort_(),this.numOfLongHorMetrics=e.readShort()},render:function(e){var t=k();return t.writeLong(this.version),t.writeShort_(this.ascent),t.writeShort_(this.descent),t.writeShort_(this.lineGap),t.writeShort(this.advanceWidthMax),t.writeShort_(this.minLeftSideBearing),t.writeShort_(this.minRightSideBearing),t.writeShort_(this.xMaxExtent),t.writeShort_(this.caretSlopeRise),t.writeShort_(this.caretSlopeRun),t.writeShort_(this.caretOffset),t.write([0,0,0,0,0,0,0,0]),t.writeShort_(this.metricDataFormat),t.writeShort(e.length),t.get()}}),u=r({parse:function(e){e.offset(this.offset),this.version=e.readLong(),this.numGlyphs=e.readShort(),this.maxPoints=e.readShort(),this.maxContours=e.readShort(),this.maxComponentPoints=e.readShort(),this.maxComponentContours=e.readShort(),this.maxZones=e.readShort(),this.maxTwilightPoints=e.readShort(),this.maxStorage=e.readShort(),this.maxFunctionDefs=e.readShort(),this.maxInstructionDefs=e.readShort(),this.maxStackElements=e.readShort(),this.maxSizeOfInstructions=e.readShort(),this.maxComponentElements=e.readShort(),this.maxComponentDepth=e.readShort()},render:function(e){var t=k();return t.writeLong(this.version),t.writeShort(e.length),t.writeShort(this.maxPoints),t.writeShort(this.maxContours),t.writeShort(this.maxComponentPoints),t.writeShort(this.maxComponentContours),t.writeShort(this.maxZones),t.writeShort(this.maxTwilightPoints),t.writeShort(this.maxStorage),t.writeShort(this.maxFunctionDefs),t.writeShort(this.maxInstructionDefs),t.writeShort(this.maxStackElements),t.writeShort(this.maxSizeOfInstructions),t.writeShort(this.maxComponentElements),t.writeShort(this.maxComponentDepth),t.get()}}),h=r({parse:function(e){var t,n,i;e.offset(this.offset),t=this.file,n=t.hhea,this.metrics=e.times(n.numOfLongHorMetrics,function(){return{advance:e.readShort(),lsb:e.readShort_()}}),i=t.maxp.numGlyphs-t.hhea.numOfLongHorMetrics,this.leftSideBearings=e.times(i,e.readShort_)},forGlyph:function(e){var t=this.metrics,n=t.length;return e<n?t[e]:{advance:t[n-1].advance,lsb:this.leftSideBearings[e-n]}},render:function(e){var t,n,i=k();for(t=0;t<e.length;++t)n=this.forGlyph(e[t]),i.writeShort(n.advance),i.writeShort_(n.lsb);return i.get()}}),f=function(){function e(e){this.raw=e}function n(e){var t,n,r;for(this.raw=e,t=this.glyphIds=[],n=this.idOffsets=[];;){if(r=e.readShort(),n.push(e.offset()),t.push(e.readShort()),!(r&a))break;e.skip(r&i?4:2),r&l?e.skip(8):r&s?e.skip(4):r&o&&e.skip(2)}}var i,o,a,s,l;return e.prototype={compound:!1,render:function(){return this.raw.get()}},i=1,o=8,a=32,s=64,l=128,n.prototype={compound:!0,render:function(e){var t,n,i=k(this.raw.get());for(t=0;t<this.glyphIds.length;++t)n=this.glyphIds[t],i.offset(this.idOffsets[t]),i.writeShort(e[n]);return i.get()}},r({parse:function(){this.cache={}},glyphFor:function(i){var r,o,a,s,l,d,c,u,h,f,p,m=this.cache;return t(m,i)?m[i]:(r=this.file.loca,o=r.lengthOf(i),0===o?m[i]=null:(a=this.rawData,s=this.offset+r.offsetOf(i),l=k(a.slice(s,o)),d=l.readShort_(),c=l.readShort_(),u=l.readShort_(),h=l.readShort_(),f=l.readShort_(),p=m[i]=d==-1?new n(l):new e(l),p.numberOfContours=d,p.xMin=c,p.yMin=u,p.xMax=h,p.yMax=f,p))},render:function(e,t,n){var i,r,o,a=k(),s=[];for(i=0;i<t.length;++i)r=t[i],o=e[r],s.push(a.offset()),o&&a.write(o.render(n));return s.push(a.offset()),{table:a.get(),offsets:s}}})}(),p=function(){function e(e,t){this.text=e,this.length=e.length,this.platformID=t.platformID,this.platformSpecificID=t.platformSpecificID,this.languageID=t.languageID,this.nameID=t.nameID}return r({parse:function(t){var n,i,r,o,a,s,l;for(t.offset(this.offset),t.readShort(),n=t.readShort(),i=this.offset+t.readShort(),r=t.times(n,function(){return{platformID:t.readShort(),platformSpecificID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:t.readShort()+i}}),o=this.strings={},a=0;a<r.length;++a)s=r[a],t.offset(s.offset),l=t.readString(s.length),o[s.nameID]||(o[s.nameID]=[]),o[s.nameID].push(new e(l,s));this.postscriptEntry=o[6][0],this.postscriptName=this.postscriptEntry.text.replace(/[^\x20-\x7F]/g,"")},render:function(n){var i,r,o,a,s,l,d=this.strings,c=0;for(i in d)t(d,i)&&(c+=d[i].length);r=k(),o=k(),r.writeShort(0),r.writeShort(c),r.writeShort(6+12*c);for(i in d)if(t(d,i))for(a=6==i?[new e(n,this.postscriptEntry)]:d[i],s=0;s<a.length;++s)l=a[s],r.writeShort(l.platformID),r.writeShort(l.platformSpecificID),r.writeShort(l.languageID),r.writeShort(l.nameID),r.writeShort(l.length),r.writeShort(o.offset()),o.writeString(l.text);return r.write(o.get()),r.get()}})}(),m=function(){var e=".notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat".split(/\s+/g);return r({parse:function(e){var t,n;switch(e.offset(this.offset),this.format=e.readLong(),this.italicAngle=e.readFixed_(),this.underlinePosition=e.readShort_(),this.underlineThickness=e.readShort_(),this.isFixedPitch=e.readLong(),this.minMemType42=e.readLong(),this.maxMemType42=e.readLong(),this.minMemType1=e.readLong(),this.maxMemType1=e.readLong(),this.format){case 65536:case 196608:break;case 131072:for(t=e.readShort(),this.glyphNameIndex=e.times(t,e.readShort),this.names=[],n=this.offset+this.length;e.offset()<n;)this.names.push(e.readString(e.readByte()));break;case 151552:t=e.readShort(),this.offsets=e.read(t);break;case 262144:this.map=e.times(this.file.maxp.numGlyphs,e.readShort)}},glyphFor:function(t){switch(this.format){case 65536:return e[t]||".notdef";case 131072:var n=this.glyphNameIndex[t];return n<e.length?e[n]:this.names[n-e.length]||".notdef";case 151552:case 196608:return".notdef";case 262144:return this.map[t]||65535}},render:function(t){var n,i,r,o,a,s,l;if(196608==this.format)return this.raw();for(n=k(this.rawData.slice(this.offset,32)),n.writeLong(131072),n.offset(32),i=[],r=[],o=0;o<t.length;++o)a=t[o],s=this.glyphFor(a),l=e.indexOf(s),l>=0?i.push(l):(i.push(e.length+r.length),r.push(s));for(n.writeShort(t.length),o=0;o<i.length;++o)n.writeShort(i[o]);for(o=0;o<r.length;++o)n.writeByte(r[o].length),n.writeString(r[o]);return n.get()}})}(),g=function(){function t(t,n,i){var r=this;r.platformID=t.readShort(),r.platformSpecificID=t.readShort(),r.offset=n+t.readLong(),t.saveExcursion(function(){var n,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,k;switch(t.offset(r.offset),r.format=t.readShort()){case 0:for(r.length=t.readShort(),r.language=t.readShort(),o=0;o<256;++o)i[o]=t.readByte();break;case 4:for(r.length=t.readShort(),r.language=t.readShort(),a=t.readShort()/2,t.skip(6),s=t.times(a,t.readShort),t.skip(2),l=t.times(a,t.readShort),d=t.times(a,t.readShort_),c=t.times(a,t.readShort),u=(r.length+r.offset-t.offset())/2,h=t.times(u,t.readShort),o=0;o<a;++o)for(f=l[o],p=s[o],n=f;n<=p;++n)0===c[o]?m=n+d[o]:(g=c[o]/2-(a-o)+(n-f),m=h[g]||0,0!==m&&(m+=d[o])),i[n]=65535&m;break;case 6:for(r.length=t.readShort(),r.language=t.readShort(),n=t.readShort(),v=t.readShort();v-- >0;)i[n++]=t.readShort();break;case 12:for(t.readShort(),r.length=t.readLong(),r.language=t.readLong(),_=t.readLong();_-- >0;)for(n=t.readLong(),b=t.readLong(),k=t.readLong();n<=b;)i[n++]=k++;break;default:e.console&&e.console.error("Unhandled CMAP format: "+r.format)}})}function i(e,t){function i(n){return t[e[n]]}var r,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,w,y=n(e),x=[],C=[],T=null,S=null;for(r=0;r<y.length;++r)o=y[r],a=i(o),s=a-o,null!=T&&s===S||(T&&C.push(T),x.push(o),S=s),T=o;for(T&&C.push(T),C.push(65535),x.push(65535),l=x.length,d=2*l,c=2*Math.pow(2,Math.floor(Math.log(l)/Math.LN2)),u=Math.log(c/2)/Math.LN2,h=d-c,f=[],p=[],m=[],r=0;r<l;++r){if(g=x[r],v=C[r],65535==g){f.push(0),p.push(0);break}if(_=i(g),g-_>=32768)for(f.push(0),p.push(2*(m.length+l-r)),b=g;b<=v;++b)m.push(i(b));else f.push(_-g),p.push(0)}return w=k(),w.writeShort(3),w.writeShort(1),w.writeLong(12),w.writeShort(4),w.writeShort(16+8*l+2*m.length),w.writeShort(0),w.writeShort(d),w.writeShort(c),w.writeShort(u),w.writeShort(h),C.forEach(w.writeShort),w.writeShort(0),x.forEach(w.writeShort),f.forEach(w.writeShort_),p.forEach(w.writeShort),m.forEach(w.writeShort),w.get()}return r({parse:function(e){var n,i=this,r=i.offset;e.offset(r),i.codeMap={},i.version=e.readShort(),n=e.readShort(),i.tables=e.times(n,function(){return new t(e,r,i.codeMap)})},render:function(e,t){var n=k();return n.writeShort(0),n.writeShort(1),n.write(i(e,t)),n.get()}})}(),v=r({parse:function(e){e.offset(this.offset),this.version=e.readShort(),this.averageCharWidth=e.readShort_(),this.weightClass=e.readShort(),this.widthClass=e.readShort(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort_(),this.ySubscriptYSize=e.readShort_(),this.ySubscriptXOffset=e.readShort_(),this.ySubscriptYOffset=e.readShort_(),this.ySuperscriptXSize=e.readShort_(),this.ySuperscriptYSize=e.readShort_(),this.ySuperscriptXOffset=e.readShort_(),this.ySuperscriptYOffset=e.readShort_(),this.yStrikeoutSize=e.readShort_(),this.yStrikeoutPosition=e.readShort_(),this.familyClass=e.readShort_(),this.panose=e.times(10,e.readByte),this.charRange=e.times(4,e.readLong),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=e.times(2,e.readLong),this.version>1&&(this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()))},render:function(){return this.raw()}}),_=1e5,a.prototype={use:function(e){var t,n,i,r=this;return"string"==typeof e?kendo.util.ucs2decode(e).reduce(function(e,t){return e+String.fromCharCode(r.use(t))},""):(t=r.unicodes[e],t||(t=r.next++,r.subset[t]=e,r.unicodes[e]=t,n=r.font.cmap.codeMap[e],n&&(r.ncid2ogid[t]=n,null==r.ogid2ngid[n]&&(i=r.nextGid++,r.ogid2ngid[n]=i,r.ngid2ogid[i]=n))),t)},encodeText:function(e){return this.use(e)},glyphIds:function(){return n(this.ogid2ngid)},glyphsFor:function(e,t){
var n,i,r;for(t||(t={}),n=0;n<e.length;++n)i=e[n],t[i]||(r=t[i]=this.font.glyf.glyphFor(i),r&&r.compound&&this.glyphsFor(r.glyphIds,t));return t},render:function(){var e,i,r,o,a,s,l,d,c=this.glyphsFor(this.glyphIds());for(e in c)t(c,e)&&(e=parseInt(e,10),null==this.ogid2ngid[e]&&(i=this.nextGid++,this.ogid2ngid[e]=i,this.ngid2ogid[i]=e));return r=n(this.ngid2ogid),o=r.map(function(e){return this.ngid2ogid[e]},this),a=this.font,s=a.glyf.render(c,o,this.ogid2ngid),l=a.loca.render(s.offsets),this.lastChar=this.next-1,d={cmap:g.render(this.ncid2ogid,this.ogid2ngid),glyf:s.table,loca:l.table,hmtx:a.hmtx.render(o),hhea:a.hhea.render(o),maxp:a.maxp.render(o),post:a.post.render(o),name:a.name.render(this.psName),head:a.head.render(l.format),"OS/2":a.os2.render()},this.font.directory.render(d)},cidToGidMap:function(){var e,t,n,i=k(),r=0;for(e=this.firstChar;e<this.next;++e){for(;r<e;)i.writeShort(0),r++;t=this.ncid2ogid[e],t?(n=this.ogid2ngid[t],i.writeShort(n)):i.writeShort(0),r++}return i.get()}},s.prototype={parse:function(){var e=this.directory=new i(this.contents);this.head=e.readTable("head",l),this.loca=e.readTable("loca",d),this.hhea=e.readTable("hhea",c),this.maxp=e.readTable("maxp",u),this.hmtx=e.readTable("hmtx",h),this.glyf=e.readTable("glyf",f),this.name=e.readTable("name",p),this.post=e.readTable("post",m),this.cmap=e.readTable("cmap",g),this.os2=e.readTable("OS/2",v),this.psName=this.name.postscriptName,this.ascent=this.os2.ascent||this.hhea.ascent,this.descent=this.os2.descent||this.hhea.descent,this.lineGap=this.os2.lineGap||this.hhea.lineGap,this.scale=1e3/this.head.unitsPerEm},widthOfGlyph:function(e){return this.hmtx.forGlyph(e).advance*this.scale},makeSubset:function(){return new a(this)}},b.TTFFont=s}(window)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("pdf/drawing.min",["kendo.core.min","kendo.color.min","kendo.drawing.min","pdf/core.min"],e)}(function(){!function(e,t){"use strict";function n(t,n){function i(e,t,n){return n||(n=c),n.pdf&&null!=n.pdf[e]?n.pdf[e]:t}function r(){function r(e){var t,n,r,o,l,d=e.options,c=S(e),u=c.bbox;e=c.root,t=i("paperSize",i("paperSize","auto"),d),n=!1,"auto"==t&&(u?(r=u.getSize(),t=[r.width,r.height],n=!0,o=u.getOrigin(),c=new D.Group,c.transform(new E.Matrix(1,0,0,1,(-o.x),(-o.y))),c.append(e),e=c):t="A4"),l=a.addPage({paperSize:t,margin:i("margin",i("margin"),d),addMargin:n,landscape:i("landscape",i("landscape",!1),d)}),s(e,l,a)}if(!(--o>0)){var a=new e.pdf.Document({producer:i("producer"),title:i("title"),author:i("author"),subject:i("subject"),keywords:i("keywords"),creator:i("creator"),date:i("date")});u?t.children.forEach(r):r(t),n(a.render(),a)}}var o,l=[],d=[],c=t.options,u=i("multiPage");t.traverse(function(t){a({Image:function(e){d.indexOf(e.src())<0&&d.push(e.src())},Text:function(t){var n=e.pdf.parseFontDef(t.options.font),i=e.pdf.getFontURL(n);l.indexOf(i)<0&&l.push(i)}},t)}),o=2,e.pdf.loadFonts(l,r),e.pdf.loadImages(d,r)}function i(e,t){n(e,function(e){t("data:application/pdf;base64,"+e.base64())})}function r(e,t){n(e,function(e){t(new Blob([e.get()],{type:"application/pdf"}))})}function o(t,n,o,a){window.Blob&&!e.support.browser.safari?r(t,function(t){e.saveAs({dataURI:t,fileName:n}),a&&a(t)}):i(t,function(t){e.saveAs({dataURI:t,fileName:n,proxyURL:o}),a&&a(t)})}function a(e,t){var n=e[t.nodeType];return n?n.call.apply(n,arguments):t}function s(e,t,n){var i,r,o;e.options._pdfDebug&&t.comment("BEGIN: "+e.options._pdfDebug),i=e.transform(),r=e.opacity(),t.save(),null!=r&&r<1&&t.setOpacity(r),l(e,t,n),d(e,t,n),i&&(o=i.matrix(),t.transform(o.a,o.b,o.c,o.d,o.e,o.f)),c(e,t,n),a({Path:g,MultiPath:v,Circle:_,Arc:b,Text:k,Image:y,Group:w,Rect:x},e,t,n),t.restore(),e.options._pdfDebug&&t.comment("END: "+e.options._pdfDebug)}function l(e,t){var n,i,r,o,a,s,l=e.stroke&&e.stroke();if(l){if(n=l.color){if(n=T(n),null==n)return;t.setStrokeColor(n.r,n.g,n.b),1!=n.a&&t.setStrokeOpacity(n.a)}if(i=l.width,null!=i){if(0===i)return;t.setLineWidth(i)}r=l.dashType,r&&t.setDashPattern(R[r],0),o=l.lineCap,o&&t.setLineCap(I[o]),a=l.lineJoin,a&&t.setLineJoin(A[a]),s=l.opacity,null!=s&&t.setStrokeOpacity(s)}}function d(e,t){var n,i,r=e.fill&&e.fill();if(r&&!(r instanceof D.Gradient)){if(n=r.color){if(n=T(n),null==n)return;t.setFillColor(n.r,n.g,n.b),1!=n.a&&t.setFillOpacity(n.a)}i=r.opacity,null!=i&&t.setFillOpacity(i)}}function c(e,t,n){var i=e.clip();i&&(m(i,t,n),t.clip())}function u(e){return e&&(e instanceof D.Gradient||e.color&&!/^(none|transparent)$/i.test(e.color)&&(null==e.width||e.width>0)&&(null==e.opacity||e.opacity>0))}function h(e,t,n,i){var r,o,a,s,l,d,c,u,h=e.fill();if(h instanceof D.Gradient)return i?t.clipStroke():t.clip(),r=h instanceof D.RadialGradient,r?(o={x:h.center().x,y:h.center().y,r:0},a={x:h.center().x,y:h.center().y,r:h.radius()}):(o={x:h.start().x,y:h.start().y},a={x:h.end().x,y:h.end().y}),s=h.stops.elements().map(function(e){var t,n=e.offset();return n=/%$/.test(n)?parseFloat(n)/100:parseFloat(n),t=T(e.color()),t.a*=e.opacity(),{offset:n,color:t}}),s.unshift(s[0]),s.push(s[s.length-1]),l={userSpace:h.userSpace(),type:r?"radial":"linear",start:o,end:a,stops:s},d=e.rawBBox(),c=d.topLeft(),u=d.getSize(),d={left:c.x,top:c.y,width:u.width,height:u.height},t.gradient(l,d),!0}function f(e,t,n){u(e.fill())&&u(e.stroke())?h(e,t,n,!0)||t.fillStroke():u(e.fill())?h(e,t,n,!1)||t.fill():u(e.stroke())?t.stroke():t.nop()}function p(e,t){var n,i,r,o=e.segments;if(4==o.length&&e.options.closed){for(n=[],i=0;i<o.length;++i){if(o[i].controlIn())return!1;n[i]=o[i].anchor()}if(r=n[0].y==n[1].y&&n[1].x==n[2].x&&n[2].y==n[3].y&&n[3].x==n[0].x||n[0].x==n[1].x&&n[1].y==n[2].y&&n[2].x==n[3].x&&n[3].y==n[0].y)return t.rect(n[0].x,n[0].y,n[2].x-n[0].x,n[2].y-n[0].y),!0}}function m(e,t,n){var i,r,o,a,s,l,d=e.segments;if(0!==d.length&&!p(e,t,n)){for(r=0;r<d.length;++r)o=d[r],a=o.anchor(),i?(s=i.controlOut(),l=o.controlIn(),s&&l?t.bezier(s.x,s.y,l.x,l.y,a.x,a.y):t.lineTo(a.x,a.y)):t.moveTo(a.x,a.y),i=o;e.options.closed&&t.close()}}function g(e,t,n){m(e,t,n),f(e,t,n)}function v(e,t,n){var i,r=e.paths;for(i=0;i<r.length;++i)m(r[i],t,n);f(e,t,n)}function _(e,t,n){var i=e.geometry();t.circle(i.center.x,i.center.y,i.radius),f(e,t,n)}function b(e,t,n){var i,r=e.geometry().curvePoints();for(t.moveTo(r[0].x,r[0].y),i=1;i<r.length;)t.bezier(r[i].x,r[i++].y,r[i].x,r[i++].y,r[i].x,r[i++].y);f(e,t,n)}function k(t,n){var i,r=e.pdf.parseFontDef(t.options.font),o=t._position;t.fill()&&t.stroke()?i=F.fillAndStroke:t.fill()?i=F.fill:t.stroke()&&(i=F.stroke),n.transform(1,0,0,-1,o.x,o.y+r.fontSize),n.beginText(),n.setFont(e.pdf.getFontURL(r),r.fontSize),n.setTextRenderingMode(i),n.showText(t.content(),t._pdfRect?t._pdfRect.width():null),n.endText()}function w(e,t,n){var i,r;for(e._pdfLink&&t.addLink(e._pdfLink.url,e._pdfLink),i=e.children,r=0;r<i.length;++r)s(i[r],t,n)}function y(e,t){var n,i,r,o=e.src();o&&(n=e.rect(),i=n.getOrigin(),r=n.getSize(),t.transform(r.width,0,0,-r.height,i.x,i.y+r.height),t.drawImage(o))}function x(e,t,n){var i=e.geometry();t.rect(i.origin.x,i.origin.y,i.size.width,i.size.height),f(e,t,n)}function C(e,n){var i,r=t.Deferred();for(i in n)"margin"==i&&e.options.pdf&&e.options.pdf._ignoreMargin||e.options.set("pdf."+i,n[i]);return D.pdf.toDataURL(e,r.resolve),r.promise()}function T(t){var n=e.parseColor(t,!0);return n?n.toRGB():null}function S(e){function t(e){return l=!0,e}function n(e){return e.visible()&&e.opacity()>0&&(u(e.fill())||u(e.stroke()))}function i(e){var t,n,i=[];for(t=0;t<e.length;++t)n=s(e[t]),null!=n&&i.push(n);return i}function r(e,t){var n,i=d,r=c;e.transform()&&(c=c.multiplyCopy(e.transform().matrix())),n=e.clip(),n&&(n=n.bbox(),n&&(n=n.bbox(c),d=d?E.Rect.intersect(d,n):n));try{return t()}finally{d=i,c=r}}function o(e){if(null==d)return!1;var t=e.rawBBox().bbox(c);return d&&t&&(t=E.Rect.intersect(t,d)),t}function s(s){return r(s,function(){if(!(s instanceof D.Group||s instanceof D.MultiPath)){var r=o(s);if(!r)return t(null);h=h?E.Rect.union(h,r):r}return a({Path:function(e){return 0!==e.segments.length&&n(e)?e:t(null)},MultiPath:function(e){if(!n(e))return t(null);var r=new D.MultiPath(e.options);return r.paths=i(e.paths),0===r.paths.length?t(null):r},Circle:function(e){return n(e)?e:t(null)},Arc:function(e){return n(e)?e:t(null)},Text:function(e){return/\S/.test(e.content())&&n(e)?e:t(null)},Image:function(e){return e.visible()&&e.opacity()>0?e:t(null)},Group:function(n){var r=new D.Group(n.options);return r.children=i(n.children),r._pdfLink=n._pdfLink,n===e||0!==r.children.length||n._pdfLink?r:t(null)},Rect:function(e){return n(e)?e:t(null)}},s)})}var l,d=!1,c=E.Matrix.unit(),h=null;do l=!1,e=s(e);while(e&&l);return{root:e,bbox:h}}var D=e.drawing,E=e.geometry,F=e.pdf.TEXT_RENDERING_MODE,R={dash:[4],dashDot:[4,2,1,2],dot:[1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2],solid:[]},I={butt:0,round:1,square:2},A={miter:0,round:1,bevel:2};e.deepExtend(D,{exportPDF:C,pdf:{toDataURL:i,toBlob:r,saveAs:o,toStream:n}})}(window.kendo,window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.pdf.min",["kendo.core.min","pdf/core.min","pdf/ttf.min","pdf/drawing.min","kendo.drawing.min"],e)}(function(){return function(e,t){e.PDFMixin={extend:function(e){e.events.push("pdfExport"),e.options.pdf=this.options,e.saveAsPDF=this.saveAsPDF,e._drawPDF=this._drawPDF,e._drawPDFShadow=this._drawPDFShadow},options:{fileName:"Export.pdf",proxyURL:"",paperSize:"auto",allPages:!1,landscape:!1,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator v."+e.version,date:null},saveAsPDF:function(){var n,i=new t.Deferred,r=i.promise(),o={promise:r};if(!this.trigger("pdfExport",o))return n=this.options.pdf,n.multiPage=n.multiPage||n.allPages,this._drawPDF(i).then(function(t){return e.drawing.exportPDF(t,n)}).done(function(t){e.saveAs({dataURI:t,fileName:n.fileName,proxyURL:n.proxyURL,forceProxy:n.forceProxy,proxyTarget:n.proxyTarget}),i.resolve()}).fail(function(e){i.reject(e)}),r},_drawPDF:function(n){var i=new t.Deferred;return e.drawing.drawDOM(this.wrapper).done(function(e){var t={page:e,pageNumber:1,progress:1,totalPages:1};n.notify(t),i.resolve(t.page)}).fail(function(e){i.reject(e)}),i},_drawPDFShadow:function(n,i){var r,o,a;return n=n||{},r=this.wrapper,o=t("<div class='k-pdf-export-shadow'>"),n.width&&o.css({width:n.width,overflow:"visible"}),r.before(o),o.append(n.content||r.clone(!0,!0)),a=t.Deferred(),setTimeout(function(){var t=e.drawing.drawDOM(o,i);t.always(function(){o.remove()}).then(function(){a.resolve.apply(a,arguments)}).fail(function(){a.reject.apply(a,arguments)}).progress(function(){a.progress.apply(a,arguments)})},15),a.promise()}}}(kendo,window.kendo.jQuery),kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.grid.min",["kendo.data.min","kendo.columnsorter.min","kendo.editable.min","kendo.window.min","kendo.filtermenu.min","kendo.columnmenu.min","kendo.groupable.min","kendo.pager.min","kendo.selectable.min","kendo.sortable.min","kendo.reorderable.min","kendo.resizable.min","kendo.mobile.actionsheet.min","kendo.mobile.pane.min","kendo.ooxml.min","kendo.excel.min","kendo.progressbar.min","kendo.pdf.min"],e)}(function(){return function(e,t){function n(e){return Array(e+1).join('<td class="k-group-cell">&nbsp;</td>')}function i(e){var t,n=" ";if(e){if(typeof e===ut)return e;for(t in e)n+=t+'="'+e[t]+'"'}return n}function r(t,n){e("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",n)}function o(t,n,i,r,o){var a,s=n;for(n=e(),o=o||1,a=0;a<o;a++)n=n.add(t.eq(s+a));"number"==typeof i?n[r?"insertBefore":"insertAfter"](t.eq(i)):n.appendTo(i)}function a(t,n,i){return e(t).add(n).find(i)}function s(e,t,n){var i,r,o,a;for(n=Ce(n)?n:[n],i=0,r=n.length;i<r;i++)o=n[i],ke(o)&&o.click&&(a=o.name||o.text,t.on(st+Be,"a.k-grid-"+(a||"").replace(/\s/g,""),{commandName:a},De(o.click,e)))}function l(e,t,n){return ye(e,function(e){var i,r;return e=typeof e===ut?{field:e}:e,f(e)&&!n||(e.attributes=U(e.attributes),e.footerAttributes=U(e.footerAttributes),e.headerAttributes=U(e.headerAttributes),i=!0),e.columns&&(e.columns=l(e.columns,t,i)),r=ue.guid(),e.headerAttributes=we({id:r},e.headerAttributes),we({encoded:t,hidden:i},e)})}function d(e,t){var n=[];return c(e,t,n),n[n.length-1]}function c(e,t,n){var i,r;for(n=n||[],i=0;i<t.length;i++){if(e===t[i])return!0;if(t[i].columns){if(r=n.length,n.push(t[i]),c(e,t[i].columns,n))return!0;n.splice(r,n.length-r)}}return!1}function u(e,t){var n=t?q:U;e.hidden=!t,e.attributes=n(e.attributes),e.footerAttributes=n(e.footerAttributes),e.headerAttributes=n(e.headerAttributes)}function h(){return"none"!==this.style.display}function f(e){return p([e]).length>0}function p(e){return xe(e,function(e){var t=!e.hidden;return t&&e.columns&&(t=p(e.columns).length>0),t})}function m(t){return e(t).map(function(){return this.toArray()})}function g(e,t,n){var i=b(M(t)),r=b(z(t)),o=e.rowSpan;e.rowSpan=n?i>r?o-(i-r)||1:o+(r-i):i>r?o+(i-r):o-(r-i)||1}function v(t,n,i,r,o,a,s){var l,d,c=b(t),u=b([n]);c>u&&(l=Array(s+1).join('<th class="k-group-cell k-header" scope="col">&nbsp;</th>'),d=a.children(":not(.k-filter-row)"),e(Array(c-u+1).join("<tr>"+l+"</tr>")).insertAfter(d.last())),R(a,c-u),k(i,r,o,a)}function _(t,n,i){var r,o,a,s,l,d,c,u;for(i=i||0,a=n,n=L(n),s={},l=t.find(">tr:not(.k-filter-row)"),d=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},c=0,u=n.length;c<u;c++)r=w(n[c],a),s[r.row]||(s[r.row]=l.eq(r.row).find(".k-header").filter(d)),o=s[r.row].eq(r.cell),o.attr(ue.attr("index"),i+c);return n.length}function b(e){var t,n,i=1,r=0;for(t=0;t<e.length;t++)e[t].columns&&(n=b(e[t].columns),n>r&&(r=n));return i+r}function k(t,n,i,r){var o,a,s=C(t[0],n),l=i.find(">tr:not(.k-filter-row):eq("+s.row+")>th.k-header"),d=e(),c=s.cell;for(o=0;o<t.length;o++)d=d.add(l.eq(c+o));for(r.find(">tr:not(.k-filter-row)").eq(s.row).append(d),a=[],o=0;o<t.length;o++)t[o].columns&&(a=a.concat(t[o].columns));a.length&&k(a,n,i,r)}function w(e,t,n,i){var r,o;for(n=n||0,i=i||{},i[n]=i[n]||0,o=0;o<t.length;o++){if(t[o]==e){r={cell:i[n],row:n};break}if(t[o].columns&&(r=w(e,t[o].columns,n+1,i)))break;i[n]++}return r}function y(e,t,n,i){var r,o=n.locked;do r=e[t],t+=i?1:-1;while(r&&t>-1&&t<e.length&&r!=n&&!r.columns&&r.locked==o);return r}function x(e,t,n,i){var r,o,a,s;return t.columns?(t=t.columns,t[i?0:t.length-1]):(r=d(t,e),o=r?r.columns:e,a=Te(t,o),0===a&&i?a++:a!=o.length-1||i?(a>0||0===a&&!i)&&(a+=i?-1:1):a--,s=Te(n,o),t=y(o,a,n,s>a),t&&t!=n&&t.columns?x(e,t,n,i):null)}function C(e,t,n,i){var r,o;for(n=n||0,i=i||{},i[n]=i[n]||0,o=0;o<t.length;o++){if(t[o]==e){r={cell:i[n],row:n};break}if(t[o].columns&&(r=C(e,t[o].columns,n+1,i)))break;t[o].hidden||i[n]++}return r}function T(e){var t=S(M(e));return t.concat(S(z(e)))}function S(e){var t,n=[],i=[];for(t=0;t<e.length;t++)n.push(e[t]),e[t].columns&&(i=i.concat(e[t].columns));return i.length&&(n=n.concat(S(i))),n}function D(e){var t,n,i=0;for(n=0;n<e.length;n++)t=e[n],t.columns?i+=D(t.columns):t.hidden&&i++;return i}function E(e){var t,n,i,r=0;for(n=0,i=e.length;n<i;n++)t=e[n].style.width,t&&t.indexOf("%")==-1&&(r+=parseInt(t,10));return r}function F(e,t){var n,i,r=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(i=0;i<r.length;i++)n=r[i].rowSpan,n>1&&(r[i].rowSpan=n-t||1)}function R(e,t){var n,i=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;n<i.length;n++)i[n].rowSpan+=t}function I(t){var n,i=t.find("tr:not(.k-filter-row)"),r=i.filter(function(){return!e(this).children().length}).remove().length,o=i.find("th:not(.k-group-cell,.k-hierarchy-cell)");for(n=0;n<o.length;n++)o[n].rowSpan>1&&(o[n].rowSpan-=r);return i.length-r}function A(e,t,n,i,r){var o,a,s,l=[];for(o=0,s=e.length;o<s;o++)a=n[i]||[],a.push(t.eq(r+o)),n[i]=a,e[o].columns&&(l=l.concat(e[o].columns));l.length&&A(l,t,n,i+1,r+e.length)}function M(e){return xe(e,function(e){return e.locked})}function z(e){return xe(e,function(e){return!e.locked})}function H(e){return xe(e,function(e){return!e.locked&&f(e)})}function N(e){return xe(e,function(e){return e.locked&&f(e)})}function P(e){var t,n=[];for(t=0;t<e.length;t++)e[t].hidden||(e[t].columns?n=n.concat(P(e[t].columns)):n.push(e[t]));return n}function L(e){var t,n=[];for(t=0;t<e.length;t++)e[t].columns?n=n.concat(L(e[t].columns)):n.push(e[t]);return n}function B(n){var i,r=n.find(">tr:not(.k-filter-row)"),o=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},a=e();return r.length>1&&(a=r.find("th").filter(o).filter(function(){return this.rowSpan>1})),a=a.add(r.last().find("th").filter(o)),i=ue.attr("index"),a.sort(function(n,r){var o,a;return n=e(n),r=e(r),o=n.attr(i),a=r.attr(i),o===t&&(o=e(n).index()),a===t&&(a=e(r).index()),o=parseInt(o,10),a=parseInt(a,10),o>a?1:o<a?-1:0}),a}function O(t){var n,i,r,o,a,s,l,d=t.closest("table"),c=e().add(t),u=t.closest("tr"),h=d.find("tr:not(.k-filter-row)"),f=h.index(u);if(f>0){for(n=h.eq(f-1),i=n.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!e(this).attr("rowspan")}),r=0,o=u.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),a=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.colSpan>1}),s=0;s<a.length;s++)r+=a[s].colSpan||1;for(o+=Math.max(r-1,0),r=0,s=0;s<i.length;s++)if(l=i.eq(s),r+=l.attr("colSpan")?l[0].colSpan:1,o>=s&&o<r){c=O(l).add(c);break}}return c}function V(t){var n,i,r,o,a,s,l,d=t.closest("thead"),c=e().add(t),u=t.closest("tr"),h=d.find("tr:not(.k-filter-row)"),f=h.index(u)+t[0].rowSpan,p=ue.attr("colspan");if(f<=h.length-1){for(n=u.next(),i=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)"),i=i.filter(function(){return!this.rowSpan||1===this.rowSpan}),o=0,r=0;r<i.length;r++)o+=parseInt(i.eq(r).attr(p),10)||1;for(a=n.find("th:not(.k-group-cell,.k-hierarchy-cell)"),s=parseInt(t.attr(p),10)||1,r=0;r<s;)n=a.eq(r+o),c=c.add(V(n)),l=parseInt(n.attr(p),10),l>1&&(s-=l-1),r++}return c}function W(t,n,i,r){var o,a=t;return r&&t.empty(),pe?t[0].innerHTML=i:(o=document.createElement("div"),o.innerHTML="<table><tbody>"+i+"</tbody></table>",t=o.firstChild.firstChild,n[0].replaceChild(t,a[0]),t=e(t)),t}function U(e){e=e||{};var t=e.style;return t?(t=t.replace(/((.*)?display)(.*)?:([^;]*)/i,"$1:none"),t===e.style&&(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",we({},e,{style:t})}function q(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function j(t,n,i,r){var o,a=t.find(">colgroup"),s=ye(n,function(e){return o=e.width,o&&0!==parseInt(o,10)?ue.format('<col style="width:{0}"/>',typeof o===ut?o:o+"px"):"<col />"});(i||a.find(".k-hierarchy-col").length)&&s.splice(0,0,'<col class="k-hierarchy-col" />'),a.length&&a.remove(),a=e(Array(r+1).join('<col class="k-group-col">')+s.join("")),a.is("colgroup")||(a=e("<colgroup/>").append(a)),t.prepend(a),xt.msie&&8==xt.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function $(e,t){var n,i,r=0,o=e.find("th:not(.k-group-cell)");for(n=0,i=t.length;n<i;n++)t[n].locked&&(o.eq(n).insertBefore(o.eq(r)),o=e.find("th:not(.k-group-cell)"),r++)}function G(e){var t,n,i,r={};for(n=0,i=e.length;n<i;n++)t=e[n],r[t.value]=t.text;return r}function Y(e,t,n,i){var r=n&&n.length&&ke(n[0])&&"value"in n[0],o=r?G(n)[e]:e;return o=null!=o?o:"",t?ue.format(t,o):i===!1?o:ue.htmlEncode(o)}function K(e,t,n){for(var i,r=0,o=e[r];o;){if(i=!!n||"none"!==o.style.display,i&&!bt.test(o.className)&&--t<0){o.style.display=n?"":"none";break}o=e[++r]}}function Q(t,n){for(var i,r,o=0,a=t.length;o<a;o+=1)r=t.eq(o),r.is(".k-grouping-row,.k-detail-row")?(i=r.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-1)):(r.hasClass("k-grid-edit-row")&&(i=r.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)-1),i.find("col").eq(n).remove(),r=i.find("tr:first")),K(r[0].cells,n,!1))}function X(e){var t,n,i=[];for(n=0;n<e.length&&(t=e[n],"field"in t&&"value"in t&&"items"in t);n++)i.push(t),t.hasSubgroups&&(i=i.concat(X(t.items)));return i}function J(e){var t,n,i=[];for(n=0;n<e.length&&(t=e[n],"field"in t&&"value"in t&&"items"in t);n++)t.hasSubgroups&&(i=i.concat(J(t.items))),i.push(t.aggregates);return i}function Z(t,n){for(var i,r,o,a=0,s=t.length;a<s;a+=1)r=t.eq(a),r.is(".k-grouping-row,.k-detail-row")?(i=r.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+1)):(r.hasClass("k-grid-edit-row")&&(i=r.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)+1),j(i.find(">form>table"),p(o),!1,0),r=i.find("tr:first")),K(r[0].cells,n,!0))}function ee(e,t,n){n=n||1;var i,r,o;for(r=0,o=e.length;r<o;r++)i=e.eq(r).children().last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+n),i=t.eq(r).children().last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-n)}function te(e){var t,n,i=0,r=e.find(">colgroup>col");for(t=0,n=r.length;t<n;t+=1)i+=parseInt(r[t].style.width,10);return i}function ne(e,t){var n,i,r,o;e=e[0],t=t[0],e.rows.length!==t.rows.length&&(n=e.offsetHeight,i=t.offsetHeight,n>i?(r=t.rows[t.rows.length-1],kt.test(r.className)&&(r=t.rows[t.rows.length-2]),o=n-i):(r=e.rows[e.rows.length-1],kt.test(r.className)&&(r=e.rows[e.rows.length-2]),o=i-n),r.style.height=r.offsetHeight+o+"px")}function ie(e,t){var n,i=e.offsetHeight,r=t.offsetHeight;i>r?n=i+"px":i<r&&(n=r+"px"),n&&(e.style.height=t.style.height=n)}function re(e,t){var n,i,r;if(typeof e===ut&&e===t)return e;if(ke(e)&&e.name===t)return e;if(Ce(e))for(n=0,i=e.length;n<i;n++)if(r=e[n],typeof r===ut&&r===t||r.name===t)return r;return null}function oe(t,n){var i,r,o=xt.msie||xt.edge;if(n===!0){if(t=e(t),i=t.parent().scrollTop(),r=t.parent().scrollLeft(),o)try{t[0].setActive()}catch(a){t[0].focus()}else t[0].focus();t.parent().scrollTop(i).scrollLeft(r)}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function ae(t){return e(t).is(":button,a,:input,a>.k-icon,textarea,span.k-select,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap,.k-tool-icon")}function se(n){var i=e(n.currentTarget),r=i.is("th"),o=this.table.add(this.lockedTable),a=this.thead.parent().add(e(">table",this.lockedHeader)),s=ae(n.target),l=i.closest("table")[0];if(!ue.support.touch)return s&&i.find(ue.roleSelector("filtercell")).length?(this._setCurrent(i),t):(l!==o[0]&&l!==o[1]&&l!==a[0]&&l!==a[1]||e(n.target).is("a.k-i-collapse, a.k-i-expand")||(this.options.navigatable&&this._setCurrent(i),!r&&s||setTimeout(function(){Tt&&e(ue._activeElement()).hasClass("k-widget")||ae(ue._activeElement())||oe(l,!0)}),r&&n.preventDefault()),t)}function le(e){return e&&(e.hasClass("k-edit-cell")||e.parent().hasClass("k-grid-edit-row"))}function de(e,t,i){return'<tr role="row" class="k-grouping-row">'+n(t)+'<td colspan="'+e+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1"></a>'+i+"</p></td></tr>"}function ce(e){return'<tr role="row" class="k-grouping-row"><td colspan="'+e+'" aria-expanded="true"><p class="k-reset">&nbsp;</p></td></tr>'}var ue=window.kendo,he=ue.ui,fe=ue.data.DataSource,pe=ue.support.tbodyInnerHtml,me=ue._activeElement,ge=he.Widget,ve=ue._outerWidth,_e=ue._outerHeight,be=ue.keys,ke=e.isPlainObject,we=e.extend,ye=e.map,xe=e.grep,Ce=e.isArray,Te=e.inArray,Se=Array.prototype.push,De=e.proxy,Ee=ue.isFunction,Fe=e.isEmptyObject,Re=Math,Ie="progress",Ae="error",Me=":not(.k-group-cell):not(.k-hierarchy-cell):visible",ze="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",He="tr:not(.k-footer-template):visible",Ne=":not(.k-group-cell):not(.k-hierarchy-cell):visible",Pe=He+":first>"+Ne+":first",Le="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",Be=".kendoGrid",Oe="edit",Ve="save",We="remove",Ue="detailInit",qe="filterMenuInit",je="columnMenuInit",$e="change",Ge="columnHide",Ye="columnShow",Ke="saveChanges",Qe="dataBound",Xe="detailExpand",Je="detailCollapse",Ze="k-state-focused",et="k-state-selected",tt="k-grid-norecords",nt="columnResize",it="columnReorder",rt="columnLock",ot="columnUnlock",at="navigate",st="click",lt="height",dt="tabIndex",ct="function",ut="string",ht="Are you sure you want to delete this record?",ft="No records available.",pt="Delete",mt="Cancel",gt=/(\}|\#)/gi,vt=/#/gi,_t="[\\x20\\t\\r\\n\\f]",bt=RegExp("(^|"+_t+")(k-group-cell|k-hierarchy-cell)("+_t+"|$)"),kt=RegExp("(^|"+_t+")(k-filter-row)("+_t+"|$)"),wt='<a class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass# #=imageClass#"></span>#=text#</a>',yt=!1,xt=ue.support.browser,Ct=xt.msie&&7==xt.version,Tt=xt.msie&&8==xt.version,St=ge.extend({init:function(e,t){var n=this;ge.fn.init.call(n,e,t),n._refreshHandler=De(n.refresh,n),n.setDataSource(t.dataSource),n.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind($e,t._refreshHandler),t.dataSource=e,t.dataSource.bind($e,t._refreshHandler)},options:{name:"VirtualScrollable",itemHeight:e.noop,prefetch:!0},destroy:function(){var e=this;ge.fn.destroy.call(e),e.dataSource.unbind($e,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(Be),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,n=this,i=ue.support.scrollbar()+1,r=n.element;r.css({width:"auto",overflow:"hidden"}).css(yt?"padding-left":"padding-right",i),n.content=r.children().first(),t=n.wrapper=n.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().bind("DOMMouseScroll"+Be+" mousewheel"+Be,De(n._wheelScroll,n)),ue.support.kineticScrollNeeded&&(n.drag=new ue.UserEvents(n.wrapper,{global:!0,start:function(e){e.sender.capture()},move:function(e){n.verticalScrollbar.scrollTop(n.verticalScrollbar.scrollTop()-e.y.delta),t.scrollLeft(t.scrollLeft()-e.x.delta),e.preventDefault()}})),n.verticalScrollbar=e('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:i}).appendTo(r).bind("scroll"+Be,De(n._scroll,n))},_wheelScroll:function(e){if(!e.ctrlKey){var t=this.verticalScrollbar,n=t.scrollTop(),i=ue.wheelDeltaY(e);!i||i>0&&0===n||i<0&&n+t[0].clientHeight==t[0].scrollHeight||(e.preventDefault(),this.verticalScrollbar.scrollTop(n+-i))}},_scroll:function(e){var t=this,n=!t.options.prefetch,i=e.currentTarget.scrollTop,r=t.dataSource,o=t.itemHeight,a=r.skip()||0,s=t._rangeStart||a,l=t.element.innerHeight(),d=!!(t._scrollbarTop&&t._scrollbarTop>i),c=Re.max(Re.floor(i/o),0),u=Re.max(c+Re.floor(l/o),0);t._scrollTop=i-s*o,t._scrollbarTop=i,t._scrolling=n,t._fetch(c,u,d)||(t.wrapper[0].scrollTop=t._scrollTop),n&&(t._scrollingTimeout&&clearTimeout(t._scrollingTimeout),t._scrollingTimeout=setTimeout(function(){t._scrolling=!1,t._page(t._rangeStart,t.dataSource.take())},100))},itemIndex:function(e){var t=this._rangeStart||this.dataSource.skip()||0;return t+e},position:function(e){var t,n=this._rangeStart||this.dataSource.skip()||0,i=this.dataSource.pageSize();return t=e>n?e-n+1:n-e-1,t>i?i:t},scrollIntoView:function(e){var t=this.wrapper[0],n=t.clientHeight,i=this._scrollTop||t.scrollTop,r=e[0].offsetTop,o=e[0].offsetHeight;i>r?this.verticalScrollbar[0].scrollTop-=n/2:r+o>=i+n&&(this.verticalScrollbar[0].scrollTop+=n/2)},_fetch:function(t,n,i){var r=this,o=r.dataSource,a=r.itemHeight,s=o.take(),l=r._rangeStart||o.skip()||0,d=Re.floor(t/s)*s,c=!1,u=.33;return t<l?(c=!0,l=Re.max(0,n-s),r._scrollTop=(t-l)*a,r._page(l,s)):n>=l+s&&!i?(c=!0,l=t,r._scrollTop=a,r._page(l,s)):!r._fetching&&r.options.prefetch&&(t<d+s-s*u&&t>s&&o.prefetch(d-s,s,e.noop),n>d+s*u&&o.prefetch(d+s,s,e.noop)),c},fetching:function(){return this._fetching},_page:function(e,t){var n=this,i=!n.options.prefetch,r=n.dataSource;clearTimeout(n._timeout),n._fetching=!0,n._rangeStart=e,r.inRange(e,t)?r.range(e,t):(i||ue.ui.progress(n.wrapper.parent(),!0),n._timeout=setTimeout(function(){n._scrolling||(i&&ue.ui.progress(n.wrapper.parent(),!0),r.range(e,t))},100))},repaintScrollbar:function(){var e,t=this,n="",i=25e4,r=t.dataSource,o=ue.support.kineticScrollNeeded?0:ue.support.scrollbar(),a=t.wrapper[0],s=t.itemHeight=t.options.itemHeight()||0,l=a.scrollWidth>a.offsetWidth?o:0,d=r.total()*s+l;for(e=0;e<Re.floor(d/i);e++)n+='<div style="width:1px;height:'+i+'px"></div>';d%i&&(n+='<div style="width:1px;height:'+d%i+'px"></div>'),t.verticalScrollbar.html(n),a.scrollTop=t._scrollTop},refresh:function(){var e=this,t=e.dataSource,n=e._rangeStart;ue.ui.progress(e.wrapper.parent(),!1),clearTimeout(e._timeout),e.repaintScrollbar(),e.drag&&e.drag.cancel(),n&&!e._fetching&&(e._rangeStart=t.skip(),1===t.page()&&(e.verticalScrollbar[0].scrollTop=0)),e._fetching=!1}}),Dt={create:{text:"Add new record",imageClass:"k-i-add",className:"k-grid-add",iconClass:"k-icon"},cancel:{text:"Cancel changes",imageClass:"k-i-cancel",className:"k-grid-cancel-changes",iconClass:"k-icon"},save:{text:"Save changes",imageClass:"k-i-update",className:"k-grid-save-changes",iconClass:"k-icon"},destroy:{text:"Delete",imageClass:"k-i-delete",className:"k-grid-delete",iconClass:"k-icon"},edit:{text:"Edit",imageClass:"k-i-edit",className:"k-grid-edit",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-i-update",className:"k-primary k-grid-update",iconClass:"k-icon"},canceledit:{text:"Cancel",imageClass:"k-i-cancel",className:"k-grid-cancel",iconClass:"k-icon"},excel:{text:"Export to Excel",imageClass:"k-i-excel",className:"k-grid-excel",iconClass:"k-icon"},pdf:{text:"Export to PDF",imageClass:"k-i-pdf",className:"k-grid-pdf",iconClass:"k-icon"}},Et=ue.ui.DataBoundWidget.extend({init:function(t,n,i){var r=this;n=Ce(n)?{dataSource:n}:n,ge.fn.init.call(r,t,n),i&&(r._events=i),yt=ue.support.isRtl(t),r._element(),r._aria(),r._columns(r.options.columns),r._dataSource(),r._tbody(),r._pageable(),r._thead(),r._groupable(),r._toolbar(),r._setContentHeight(),r._templates(),r._navigatable(),r._selectable(),r._clipboard(),r._details(),r._editable(),r._attachCustomCommandsEvent(),r._minScreenSupport(),r.options.autoBind?r.dataSource.fetch():(r._group=r._groups()>0,r._footer()),r.lockedContent&&(r.wrapper.addClass("k-grid-lockedcolumns"),r._resizeHandler=function(){r.resize()},e(window).on("resize"+Be,r._resizeHandler)),ue.notify(r)},events:[$e,"dataBinding","cancel",Qe,Xe,Je,Ue,qe,je,Oe,Ve,We,Ke,nt,it,Ye,Ge,rt,ot,at,"page","sort","filter","group"],setDataSource:function(e){var t=this,n=t.options.scrollable;t.options.dataSource=e,t._dataSource(),t._pageable(),t._thead(),n&&(n.virtual?t.content.find(">.k-virtual-scrollable-wrap").scrollLeft(0):t.content.scrollLeft(0)),t.options.groupable&&t._groupable(),t.virtualScrollable&&t.virtualScrollable.setDataSource(t.options.dataSource),t.options.navigatable&&t._navigatable(),t.options.selectable&&t._selectable(),t.options.autoBind&&e.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,allowCopy:!1,navigatable:!1,pageable:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",noRecords:!1,dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",messages:{editable:{cancelDelete:mt,confirmation:ht,confirmDelete:pt},commands:{create:Dt.create.text,cancel:Dt.cancel.text,save:Dt.save.text,destroy:Dt.destroy.text,edit:Dt.edit.text,update:Dt.update.text,canceledit:Dt.canceledit.text,excel:Dt.excel.text,pdf:Dt.pdf.text},noRecords:ft}},destroy:function(){var t,n=this;n._angularItems("cleanup"),n._destroyColumnAttachments(),ge.fn.destroy.call(n),this._navigatableTables=null,n._resizeHandler&&e(window).off("resize"+Be,n._resizeHandler),n.pager&&n.pager.element&&n.pager.destroy(),n.pager=null,n.groupable&&n.groupable.element&&n.groupable.element.kendoGroupable("destroy"),n.groupable=null,n.options.reorderable&&n.wrapper.data("kendoReorderable").destroy(),n.selectable&&n.selectable.element&&(n.selectable.destroy(),n.clearArea(),
n.copyHandler&&(n.wrapper.off("keydown",n.copyHandler),n.unbind(n.copyHandler)),n.updateClipBoardState&&(n.unbind(n.updateClipBoardState),n.updateClipBoardState=null),n.clearAreaHandler&&n.wrapper.off("keyup",n.clearAreaHandler)),n.selectable=null,n.resizable&&(n.resizable.destroy(),n._resizeUserEvents&&(n._resizeHandleDocumentClickHandler&&e(document).off("click",n._resizeHandleDocumentClickHandler),n._resizeUserEvents.destroy(),n._resizeUserEvents=null),n.resizable=null),n.virtualScrollable&&n.virtualScrollable.element&&n.virtualScrollable.destroy(),n.virtualScrollable=null,n._destroyEditable(),n.dataSource&&(n.dataSource.unbind($e,n._refreshHandler).unbind(Ie,n._progressHandler).unbind(Ae,n._errorHandler),n._refreshHandler=n._progressHandler=n._errorHandler=null),t=n.element.add(n.wrapper).add(n.table).add(n.thead).add(n.wrapper.find(">.k-grid-toolbar")),n.content&&(t=t.add(n.content).add(n.content.find(">.k-virtual-scrollable-wrap"))),n.lockedHeader&&n._removeLockedContainers(),n.pane&&n.pane.destroy(),n.minScreenResizeHandler&&e(window).off("resize",n.minScreenResizeHandler),n._draggableInstance&&n._draggableInstance.element&&n._draggableInstance.destroy(),n._draggableInstance=null,t.off(Be),ue.destroy(n.wrapper),n.rowTemplate=n.altRowTemplate=n.lockedRowTemplate=n.lockedAltRowTemplate=n.detailTemplate=n.footerTemplate=n.groupFooterTemplate=n.lockedGroupFooterTemplate=n.noRecordsTemplate=null,n.scrollables=n.thead=n.tbody=n.element=n.table=n.content=n.footer=n.wrapper=n.lockedTable=n.lockedContent=n.lockedHeader=n.lockedFooter=n._groupableClickHandler=n._setContentWidthHandler=null},getOptions:function(){var n,i,r,o=this.options;return o.dataSource=null,n=we(!0,{},this.options),n.columns=ue.deepExtend([],this.columns),i=this.dataSource,r=i.options.data&&i._data,i.options.data=null,n.dataSource=e.extend(!0,{},i.options),i.options.data=r,n.dataSource.data=r,n.dataSource.page=i.page(),n.dataSource.filter=i.filter(),n.dataSource.pageSize=i.pageSize(),n.dataSource.sort=i.sort(),n.dataSource.group=i.group(),n.dataSource.aggregate=i.aggregate(),n.dataSource.transport&&(n.dataSource.transport.dataSource=null),n.pageable&&n.pageable.pageSize&&(n.pageable.pageSize=i.pageSize()),n.$angular=t,n},setOptions:function(e){var t,n,i,r,o=this.getOptions();ue.deepExtend(o,e),e.dataSource||(o.dataSource=this.dataSource),t=this.wrapper,n=this._events,i=this.element,this.destroy(),this.options=null,this._isMobile&&(r=t.closest(ue.roleSelector("pane")).parent(),r.after(t),r.remove(),t.removeClass("k-grid-mobile")),t[0]!==i[0]&&(t.before(i),t.remove()),i.empty(),this.init(i,o,n),this._setEvents(o)},items:function(){return this.lockedContent?this._items(this.tbody).add(this._items(this.lockedTable.children("tbody"))):this._items(this.tbody)},_items:function(t){return t.children().filter(function(){var t=e(this);return!t.hasClass("k-grouping-row")&&!t.hasClass("k-detail-row")&&!t.hasClass("k-group-footer")})},dataItems:function(){var e,t,n,i=ue.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){for(e=i.length,t=Array(2*e),n=e;--n>=0;)t[n]=t[n+e]=i[n];i=t}return i},_destroyColumnAttachments:function(){var t=this;t.resizeHandle=null,t.thead&&(this.angular("cleanup",function(){return{elements:t.thead.get()}}),t.thead.add(t.lockedHeader).find("th").each(function(){var t=e(this),n=t.data("kendoFilterMenu"),i=t.data("kendoColumnSorter"),r=t.data("kendoColumnMenu");n&&n.destroy(),i&&i.destroy(),r&&r.destroy()}))},_attachCustomCommandsEvent:function(){var e,t,n,i=this,r=L(i.columns||[]);for(t=0,n=r.length;t<n;t++)e=r[t].command,e&&s(i,i.wrapper,e)},_aria:function(){var e=this.element.attr("id")||"aria";e&&(this._cellId=e+"_active_cell")},_element:function(){var t=this,n=t.element;n.is("table")||(n=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),n.length||(n=e("<table />").appendTo(t.element))),Ct&&n.attr("cellspacing",0),t.table=n.attr("role",t._hasDetails()?"treegrid":"grid"),t._wrapper()},_createResizeHandle:function(t,n){var i,r,o,a,s,l,d,c=this,u=c.options.columnResizeHandleWidth,h=c.options.scrollable,f=c.resizeHandle,p=this._groups();if(f&&c.lockedContent&&f.data("th")[0]!==n[0]&&(f.off(Be).remove(),f=null),f||(f=c.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>'),t.append(f)),yt)i=n.position().left,h&&(a=n.closest(".k-grid-header-wrap, .k-grid-header-locked"),s=xt.msie?a.scrollLeft():0,l=xt.webkit?a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft():0,d=xt.mozilla?a[0].scrollWidth-a[0].offsetWidth-(a[0].scrollWidth-a[0].offsetWidth-a.scrollLeft()):0,i-=l-d+s);else{for(i=n[0].offsetWidth,r=B(n.closest("thead")).filter(":visible"),o=0;o<r.length&&r[o]!=n[0];o++)i+=r[o].offsetWidth;p>0&&(i+=ve(t.find(".k-group-cell:first"))*p),c._hasDetails()&&(i+=ve(t.find(".k-hierarchy-cell:first")))}f.css({top:n.position().top,left:i-u,height:_e(n),width:3*u}).data("th",n).show(),f.off("dblclick"+Be).on("dblclick"+Be,function(){c._autoFitLeafColumn(n.data("index"))})},_positionColumnResizeHandle:function(){var t=this,n=t.options.columnResizeHandleWidth,i=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t.thead.add(i).on("mousemove"+Be,"th",function(i){function o(){var t,n=parseFloat(e(document.documentElement).css("zoom"));return isNaN(n)&&(n=1),t=parseFloat(e(document.body).css("zoom")),isNaN(t)&&(t=1),n*t}var a,s,l,d=e(this);d.hasClass("k-group-cell")||d.hasClass("k-hierarchy-cell")||(a=i.clientX/o(),s=e(window).scrollLeft(),l=d.offset().left+(yt?0:this.offsetWidth),a+s>l-n&&a+s<l+n?t._createResizeHandle(d.closest("div"),d):t.resizeHandle?t.resizeHandle.hide():r(t.wrapper,""))})},_resizeHandleDocumentClick:function(t){e(t.target).closest(".k-column-active").length||(e(document).off(t),this._hideResizeHandle())},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.off(Be).remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,n=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new ue.UserEvents(n.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,hold:function(n){var i=e(n.target);n.preventDefault(),i.addClass("k-column-active"),t._createResizeHandle(i.closest("div"),i),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=De(t._resizeHandleDocumentClick,t)),e(document).on("click",t._resizeHandleDocumentClickHandler)}})},_resizable:function(){var t,n,i,o,a,s,l,d=this,c=d.options,u=this._isMobile,h=ue.support.mobileOS?0:ue.support.scrollbar();c.resizable&&(t=c.scrollable?d.wrapper.find(".k-grid-header-wrap:first"):d.wrapper,u?d._positionColumnResizeHandleTouch(t):d._positionColumnResizeHandle(t),d.resizable&&d.resizable.destroy(),d.resizable=new he.Resizable(t.add(d.lockedHeader),{handle:(c.scrollable?"":">")+".k-resize-handle",hint:function(t){return e('<div class="k-grid-resize-indicator" />').css({height:_e(t.data("th"))+d.tbody.attr("clientHeight")})},start:function(t){var h,f,p,m;l=e(t.currentTarget).data("th"),u&&d._hideResizeHandle(),h=l.closest("table"),f=e.inArray(l[0],B(l.closest("thead")).filter(":visible")),a=h.parent().hasClass("k-grid-header-locked"),p=a?d.lockedTable:d.table,m=d.footer||e(),d.footer&&d.lockedContent&&(m=d.footer.children(a?".k-grid-footer-locked":".k-grid-footer-wrap")),r(d.wrapper,"col-resize"),s=c.scrollable?h.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")").add(p.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")")).add(m.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")")):p.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+f+")"),n=t.x.location,i=ve(l),o=ve(a?p.children("tbody"):d.tbody),xt.webkit&&d.wrapper.addClass("k-grid-column-resizing")},resize:function(t){var r,u,f,p,m,g,v=yt?-1:1,_=i+t.x.location*v-n*v;c.scrollable?(a&&d.lockedFooter?r=d.lockedFooter.children("table"):d.footer&&(r=d.footer.find(">.k-grid-footer-wrap>table")),r&&r[0]||(r=e()),u=l.closest("table"),f=a?d.lockedTable:d.table,p=!1,m=d.wrapper.width()-h,g=_,a&&o-i+g>m&&(g=i+(m-o-2*h),g<0&&(g=_),p=!0),g>10&&(s.css("width",g),o&&(g=p?m-2*h:o+t.x.location*v-n*v,f.add(u).add(r).css("width",g),a||(d._footerWidth=g)))):_>10&&s.css("width",_)},resizeend:function(){var e,t,n,o=ve(l);r(d.wrapper,""),xt.webkit&&d.wrapper.removeClass("k-grid-column-resizing"),i!=o&&(t=d.lockedHeader?d.lockedHeader.find("thead:first tr:first").add(d.thead.find("tr:first")):l.parent(),n=l.attr(ue.attr("index")),n||(n=t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(l)),e=L(d.columns)[n],e.width=o,d.trigger(nt,{column:e,oldWidth:i,newWidth:o}),d._applyLockedContainersWidth(),d._syncLockedContentHeight(),d._syncLockedHeaderHeight()),d._hideResizeHandle(),l=null}}))},_draggable:function(){var t,n=this;n.options.reorderable&&(n._draggableInstance&&n._draggableInstance.destroy(),t=n.wrapper.children(".k-grid-header"),n._draggableInstance=n.wrapper.kendoDraggable({group:ue.guid(),autoScroll:!0,filter:n.content?".k-grid-header:first "+Le:"table:first>.k-grid-header "+Le,dragstart:function(){t.children(".k-grid-header-wrap").unbind("scroll"+Be+"scrolling").bind("scroll"+Be+"scrolling",function(e){n.virtualScrollable?n.content.find(">.k-virtual-scrollable-wrap").scrollLeft(this.scrollLeft):n.scrollables.not(e.currentTarget).scrollLeft(this.scrollLeft)})},dragend:function(){t.children(".k-grid-header-wrap").unbind("scroll"+Be+"scrolling")},drag:function(){n._hideResizeHandle()},hint:function(t){var n=t.attr(ue.attr("title"));return n&&(n=ue.htmlEncode(n)),e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(n||t.attr(ue.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-i-denied" />')}}).data("kendoDraggable"))},_reorderable:function(){var t,n=this;n.options.reorderable&&(n.wrapper.data("kendoReorderable")&&n.wrapper.data("kendoReorderable").destroy(),t=function(e,t,i){var r=e[t],o=e[i],a=d(r,n.columns);return e=a?a.columns:n.columns,Te(o,e)},n.wrapper.kendoReorderable({draggable:n._draggableInstance,dragOverContainers:function(e,i){var r=T(n.columns);return r[e].lockable!==!1&&t(r,e,i)>-1},inSameContainer:function(i){return e(i.source).parent()[0]===e(i.target).parent()[0]&&t(T(n.columns),i.sourceIndex,i.targetIndex)>-1},change:function(e){var i=T(n.columns),r=i[e.oldIndex],o=t(i,e.oldIndex,e.newIndex);n.trigger(it,{newIndex:o,oldIndex:Te(r,i),column:r}),n.reorderColumn(o,r,"before"===e.position)}}))},_reorderHeader:function(e,t,n){var i,r,s,l,d=this,c=w(e[0],d.columns),u=w(t,d.columns),h=[];for(i=0;i<e.length;i++)e[i].columns&&(h=h.concat(e[i].columns));r=a(d.lockedHeader,d.thead,"tr:eq("+c.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),s=M(e).length,l=M([t]).length,h.length?(s>0&&0===l?v(e,t,h,d.columns,d.lockedHeader.find("thead"),d.thead,this._groups()):0===s&&l>0&&v(e,t,h,d.columns,d.thead,d.lockedHeader.find("thead"),this._groups()),(t.columns||c.cell-u.cell>1||u.cell-c.cell>1)&&(t=x(d.columns,t,e[0],n),t&&d._reorderHeader(h,t,n))):s!==l&&g(r[c.cell],d.columns,s),o(r,c.cell,u.cell,n,e.length)},_reorderContent:function(t,n,i){var r,s,l,d,c=this,u=e(),h=t[0],f=p(t),m=Te(h,L(c.columns)),g=Te(n,L(c.columns)),v=Te(h,P(c.columns)),_=Te(n,P(c.columns)),b=M(c.columns).length,k=!!n.locked,w=c.footer||c.wrapper.find(".k-grid-footer"),y=r=_;for(n.hidden&&(k?(_=c.lockedTable.find("colgroup"),y=c.lockedHeader.find("colgroup"),r=e(c.lockedFooter).find(">table>colgroup")):(_=c.tbody.prev(),y=c.thead.prev(),r=w.find(".k-grid-footer-wrap").find(">table>colgroup"))),c._hasFilterRow()&&o(c.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),m,g,i,t.length),o(a(c.lockedHeader,c.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),v,y,i,f.length),c.options.scrollable&&o(a(c.lockedTable,c.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),v,_,i,f.length),w&&w.length&&(o(a(c.lockedFooter,w.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),v,r,i,f.length),o(w.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),m,g,i,t.length)),s=c.tbody.children(":not(.k-grouping-row,.k-detail-row)"),c.lockedTable&&(b>g?b<=m&&ee(c.lockedTable.find(">tbody>tr.k-grouping-row"),c.table.find(">tbody>tr.k-grouping-row"),t.length):b>m&&ee(c.table.find(">tbody>tr.k-grouping-row"),c.lockedTable.find(">tbody>tr.k-grouping-row"),t.length),u=c.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),l=0,d=s.length;l<d;l+=1)o(a(u[l],s[l],">td:not(.k-group-cell,.k-hierarchy-cell)"),m,g,i,t.length)},_autoFitLeafColumn:function(e){this.autoFitColumn(L(this.columns)[e])},autoFitColumn:function(t){var n,i,r,o,a,s,l,d,c,u,p,m,g,v,_,b,k,w,y,x=this,C=x.options,T=x.columns,D=x.lockedHeader?B(x.lockedHeader.find(">table>thead")).filter(h).length:0,E="col:not(.k-group-col):not(.k-hierarchy-col)",F="td:visible:not(.k-group-cell):not(.k-hierarchy-cell)";if(t="number"==typeof t?T[t]:ke(t)?xe(S(T),function(e){return e===t})[0]:xe(S(T),function(e){return e.field===t})[0],t&&f(t)){for(n=Te(t,L(T)),o=t.locked,r=o?x.lockedHeader.children("table"):x.thead.parent(),i=r.find("[data-index='"+n+"']"),d=o?x.lockedTable:x.table,c=x.footer||e(),x.footer&&x.lockedContent&&(c=x.footer.children(o?".k-grid-footer-locked":".k-grid-footer-wrap")),u=c.find("table").first(),x.lockedHeader&&!o&&(n-=D),p=0;p<T.length&&T[p]!==t;p++)T[p].hidden&&n--;if(C.scrollable?(a=r.find(E).eq(n).add(d.children("colgroup").find(E).eq(n)).add(u.find("colgroup").find(E).eq(n)),o||(s=d.parent(),l=s.scrollLeft())):a=d.children("colgroup").find(E).eq(n),m=r.add(d).add(u),g=ve(i),a.width(""),m.css("table-layout","fixed"),a.width("auto"),m.addClass("k-autofitting"),m.css("table-layout",""),v=Math.ceil(Math.max(ve(i),ve(d.find("tr:not(.k-grouping-row)").eq(0).children(F).eq(n)),ve(u.find("tr").eq(0).children(F).eq(n))))+1,a.width(v),t.width=v,C.scrollable){for(_=r.find("col"),k=0,w=0,y=_.length;w<y;w+=1){if(b=_[w].style.width,!b||b.indexOf("%")!=-1){k=0;break}k+=parseInt(b,10)}k&&m.each(function(){this.style.width=k+"px"})}xt.msie&&8==xt.version&&(m.css("display","inline-table"),setTimeout(function(){m.css("display","table")},1)),m.removeClass("k-autofitting"),l&&s.scrollLeft(l),x.trigger(nt,{column:t,oldWidth:g,newWidth:v}),x._applyLockedContainersWidth(),x._syncLockedContentHeight(),x._syncLockedHeaderHeight()}},reorderColumn:function(e,n,i){var r,o,a=this,s=d(n,a.columns),l=s?s.columns:a.columns,c=Te(n,l),u=l[e],h=!!u.locked,f=M(a.columns).length;c!==e&&(!n.locked&&h&&1==z(a.columns).length||n.locked&&!h&&1==f||(a._hideResizeHandle(),i===t&&(i=e<c),o=[n],a._reorderHeader(o,u,i),a.lockedHeader&&(I(a.thead),I(a.lockedHeader)),u.columns&&(u=L(u.columns),u=u[i?0:u.length-1]),n.columns&&(o=L(n.columns)),a._reorderContent(o,u,i),r=!!n.locked,r=r!=h,n.locked=h,l.splice(i?e:e+1,0,n),l.splice(c<e?c:c+1,1),a._templates(),a._updateColumnCellIndex(),a._updateTablesWidth(),a._applyLockedContainersWidth(),a._syncLockedHeaderHeight(),a._syncLockedContentHeight(),a._updateFirstColumnClass(),r&&(h?a.trigger(rt,{column:n}):a.trigger(ot,{column:n}))))},_updateColumnCellIndex:function(){var e,t=0;this.lockedHeader&&(e=this.lockedHeader.find("thead"),t=_(e,M(this.columns))),_(this.thead,z(this.columns),t)},lockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:xe(n,function(t){return t.field===e})[0],!e||e.locked||e.hidden||(t=M(n).length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:xe(n,function(t){return t.field===e})[0],e&&e.locked&&!e.hidden&&(t=M(n).length,this.reorderColumn(t,e,!0))},cellIndex:function(t){var n=0;return this.lockedTable&&!e.contains(this.lockedTable[0],t[0])&&(n=L(M(this.columns)).length),e(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)+n},_modelForContainer:function(t){t=e(t),t.is("tr")||"popup"===this._editMode()||(t=t.closest("tr"));var n=t.attr(ue.attr("uid"));return this.dataSource.getByUid(n)},_editable:function(){var t,n=this,i=n.selectable&&n.selectable.options.multiple,r=n.options.editable,o=function(){var t=me(),i=n._editContainer;!i||e.contains(i[0],t)||i[0]===t||e(t).closest(".k-animation-container").length||n.editable.end()&&n.closeCell()};r&&(this.wrapper.addClass("k-editable"),t=n._editMode(),"incell"===t?r.update!==!1&&n.wrapper.on(st+Be,"tr:not(.k-grouping-row) > td",function(t){var r=e(this),o=n.lockedTable&&r.closest("table")[0]===n.lockedTable[0];r.hasClass("k-hierarchy-cell")||r.hasClass("k-detail-cell")||r.hasClass("k-group-cell")||r.hasClass("k-edit-cell")||r.has("a.k-grid-delete").length||r.has("button.k-grid-delete").length||r.closest("tbody")[0]!==n.tbody[0]&&!o||e(t.target).is(":input")||(n.editable?n.editable.end()&&(i&&e(me()).blur(),n.closeCell(),n.editCell(r)):n.editCell(r))}).on("focusin"+Be,function(){e.contains(this,me())||(clearTimeout(n.timer),n.timer=null)}).on("focusout"+Be,function(){n.timer=setTimeout(o,1)}):r.update!==!1&&n.wrapper.on(st+Be,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(t){t.preventDefault(),n.editRow(e(this).closest("tr"))}),r.destroy!==!1?n.wrapper.on(st+Be,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete",function(t){t.preventDefault(),t.stopPropagation(),n.removeRow(e(this).closest("tr"))}):n.wrapper.on(st+Be,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete",function(e){e.stopPropagation(),n._confirmation()||e.preventDefault()}))},editCell:function(t){var n,i,r,o;t=e(t),n=this,i=L(n.columns)[n.cellIndex(t)],r=n._modelForContainer(t),n.closeCell(),!r||r.editable&&!r.editable(i.field)||i.command||!i.field||(n._attachModelChange(r),n._editContainer=t,n.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:i.field,format:i.format,editor:i.editor,values:i.values},model:r,target:n,change:function(e){n.trigger(Ve,{values:e.values,container:t,model:r})&&e.preventDefault()}}).data("kendoEditable"),o=t.parent().addClass("k-grid-edit-row"),n.lockedContent&&ie(o[0],n._relatedRow(o).addClass("k-grid-edit-row")[0]),n.trigger(Oe,{container:t,model:r}))},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),n=e[0].offsetWidth>t[0].clientWidth?ue.support.scrollbar():0;this.lockedContent.height(t.height()-n)},_syncLockedContentHeight:function(){this.lockedTable&&(this.touchScroller||this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){var e,t;this.lockedHeader&&(e=this.lockedHeader.children("table"),t=this.thead.parent(),this._adjustRowsHeight(e,t),ne(e,t))},_syncLockedFooterHeight:function(){this.lockedFooter&&this.footer&&this.footer.length&&this._adjustRowsHeight(this.lockedFooter.children("table"),this.footer.find(".k-grid-footer-wrap > table"))},_destroyEditable:function(){var e=this,t=function(){if(e.editable){var t=e.editView?e.editView.element:e._editContainer;t&&(t.off(st+Be,"a.k-grid-cancel",e._editCancelClickHandler),t.off(st+Be,"a.k-grid-update",e._editUpdateClickHandler)),e._detachModelChange(),e.editable.destroy(),e.editable=null,e._editContainer=null,e._destroyEditView()}};e.editable&&("popup"!==e._editMode()||e._isMobile?t():e._editContainer.data("kendoWindow").bind("deactivate",t).close()),e._actionSheet&&(e._actionSheet.destroy(),e._actionSheet=null)},_destroyEditView:function(){this.editView&&(this.editView.purge(),this.editView=null,this.pane.navigate(""))},_attachModelChange:function(e){var t=this;t._modelChangeHandler=function(e){t._modelChange({field:e.field,model:this})},e.bind("change",t._modelChangeHandler)},_detachModelChange:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t);n&&n.unbind($e,e._modelChangeHandler)},closeCell:function(t){var n,i,r,o,a=this,s=a._editContainer;s&&(n=s.closest("tr").attr(ue.attr("uid")),o=a.dataSource.getByUid(n),t&&a.trigger("cancel",{container:s,model:o})||(s.removeClass("k-edit-cell"),i=L(a.columns)[a.cellIndex(s)],r=s.parent().removeClass("k-grid-edit-row"),a._destroyEditable(),a._displayCell(s,i,o),s.hasClass("k-dirty-cell")&&e('<span class="k-dirty"/>').prependTo(s),a.trigger("itemChange",{item:r,data:o,ns:he}),a.lockedContent&&ie(r.css("height","")[0],a._relatedRow(r).css("height","")[0])))},_displayCell:function(e,t,n){var i=this,r={storage:{},count:0},o=we({},ue.Template,i.options.templateSettings),a=ue.template(i._cellTmpl(t,r),o);r.count>0&&(a=De(a,r.storage)),e.empty().html(a(n)),i.angular("compile",function(){return{elements:e,data:[{dataItem:n}]}})},removeRow:function(e){this._confirmation(e)&&this._removeRow(e)},_removeRow:function(t){var n,i=this,r=i._editMode();"incell"!==r&&i.cancelRow(),t=e(t),i.lockedContent&&(t=t.add(i._relatedRow(t))),t=t.hide(),n=i._modelForContainer(t),n&&!i.trigger(We,{row:t,model:n})?(i.dataSource.remove(n),"inline"!==r&&"popup"!==r||i.dataSource.sync()):"incell"===r&&i._destroyEditable()},_editMode:function(){var e="incell",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e},editRow:function(t){var n,i,r,o=this;t instanceof ue.data.ObservableObject?n=t:(t=e(t),n=o._modelForContainer(t)),i=o._editMode(),o.cancelRow(),n&&(t=o.tbody.children("["+ue.attr("uid")+"="+n.uid+"]"),o._attachModelChange(n),"popup"===i?o._createPopupEditor(n):"inline"===i?o._createInlineEditor(t,n):"incell"===i&&e(t).children(Me).each(function(){var t=e(this),i=L(o.columns)[o.cellIndex(t)];if(n=o._modelForContainer(t),n&&(!n.editable||n.editable(i.field))&&i.field)return o.editCell(t),!1}),r=o.editView?o.editView.element:o._editContainer,r&&(this._editCancelClickHandler||(this._editCancelClickHandler=De(this._editCancelClick,this)),r.on(st+Be,"a.k-grid-cancel",this._editCancelClickHandler),this._editUpdateClickHandler||(this._editUpdateClickHandler=De(this._editUpdateClick,this)),r.on(st+Be,"a.k-grid-update",this._editUpdateClickHandler)))},_editUpdateClick:function(e){e.preventDefault(),e.stopPropagation(),this.saveRow()},_editCancelClick:function(t){var n,i=this,r=i.options.navigatable,o=i.editable.options.model,a=i.editView?i.editView.element:i._editContainer;t.preventDefault(),t.stopPropagation(),i.trigger("cancel",{container:a,model:o})||(n=i.items().index(e(i.current()).parent()),i.cancelRow(),r&&(i._setCurrent(i.items().eq(n).children().filter(Ne).first()),oe(i.table,!0)))},_createPopupEditor:function(n){var i,r,o,a,s,l,d,c,u,h,f,p=this,m="<div "+ue.attr("uid")+'="'+n.uid+'" class="k-popup-edit-form'+(p._isMobile?" k-mobile-list":"")+'"><div class="k-edit-form-container">',g=[],v=L(p.columns),_=p.options.editable,b=_.template,k=ke(_)?_.window:{},w=we({},ue.Template,p.options.templateSettings);if(k=k||{},b)for(typeof b===ut&&(b=window.unescape(b)),m+=ue.template(b,w)(n),o=0,a=v.length;o<a;o++)i=v[o],i.command&&(c=re(i.command,"edit"),c&&(r=c));else for(o=0,a=v.length;o<a;o++)i=v[o],i.command?i.command&&(c=re(i.command,"edit"),c&&(r=c)):(m+='<div class="k-edit-label"><label for="'+i.field+'">'+(i.title||i.field||"")+"</label></div>",n.editable&&!n.editable(i.field)||!i.field?(h={storage:{},count:0},s=ue.template(p._cellTmpl(i,h),w),h.count>0&&(s=De(s,h.storage)),m+='<div class="k-edit-field">'+s(n)+"</div>"):(g.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),m+="<div "+ue.attr("container-for")+'="'+i.field+'" class="k-edit-field"></div>'));r&&ke(r)&&(r.text&&ke(r.text)&&(l=r.text.update,d=r.text.cancel),r.attr&&(u=r.attr)),p._isMobile?(m+="</div></div>",p.editView=p.pane.append("<div data-"+ue.ns+'role="view" data-'+ue.ns+'use-native-scrolling="true" data-'+ue.ns+'init-widgets="false" class="k-grid-edit-form"><div data-'+ue.ns+'role="header" class="k-header">'+p._createButton({name:"update",text:l,attr:u})+(k.title||"Edit")+p._createButton({name:"canceledit",text:d,attr:u})+"</div>"+m+"</div>"),f=p._editContainer=p.editView.element.find(".k-popup-edit-form")):(m+='<div class="k-edit-buttons k-state-default">',m+=p._createButton({name:"update",text:l,attr:u})+p._createButton({name:"canceledit",text:d,attr:u}),m+="</div></div></div>",f=p._editContainer=e(m).appendTo(p.wrapper).eq(0).kendoWindow(we({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(i){if(i.userTriggered){if(i.sender.element.focus(),p.trigger("cancel",{container:f,model:n}))return i.preventDefault(),t;var r=p.items().index(e(p.current()).parent());p.cancelRow(),p.options.navigatable&&(p._setCurrent(p.items().eq(r).children().filter(Ne).first()),oe(p.table,!0))}}},k))),p.editable=p._editContainer.kendoEditable({fields:g,model:n,clearContainer:!1,target:p}).data("kendoEditable"),p._isMobile&&f.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),p._openPopUpEditor(),p.trigger(Oe,{container:f,model:n})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,n){var i,r,o,a=this,s=[];a.lockedContent&&(t=t.add(a._relatedRow(t))),t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(r=e(this),i=L(a.columns)[a.cellIndex(r)],i.command||!i.field||n.editable&&!n.editable(i.field)){if(i.command&&(o=re(i.command,"edit"))){r.empty();var t,l,d;ke(o)&&(o.text&&ke(o.text)&&(t=o.text.update,l=o.text.cancel),o.attr&&(d=o.attr)),e(a._createButton({name:"update",text:t,attr:d})+a._createButton({name:"canceledit",text:l,attr:d})).appendTo(r)}}else s.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),r.attr(ue.attr("container-for"),i.field),r.empty()}),a._editContainer=t,a.editable=new ue.ui.Editable(t.addClass("k-grid-edit-row"),{target:a,fields:s,model:n,clearContainer:!1}),t.length>1&&(ie(t[0],t[1]),a._applyLockedContainersWidth()),a.trigger(Oe,{container:t,model:n})},cancelRow:function(e){var t,n=this,i=n._editContainer;if(i){if(t=n._modelForContainer(i),e&&n.trigger("cancel",{container:i,model:t}))return;n._destroyEditable(),n.dataSource.cancelChanges(t),n._displayRow("popup"!==n._editMode()?i:n.tbody.find("["+ue.attr("uid")+"="+t.uid+"]"))}},saveRow:function(){var t=this._editContainer,n=this._modelForContainer(t),i=e.Deferred();return t&&this.editable?!this.editable.end()||this.trigger(Ve,{container:t,model:n})?i.reject().promise():this.dataSource.sync():i.resolve().promise()},_displayRow:function(t){var n,i,r,o,a,s=this,l=s._modelForContainer(t),d=t.hasClass("k-state-selected"),c=t.hasClass("k-alt");l&&(s.lockedContent&&(n=e((c?s.lockedAltRowTemplate:s.lockedRowTemplate)(l)),s._relatedRow(t.last()).replaceWith(n)),s.angular("cleanup",function(){return{elements:t.get()}}),i=e((c?s.altRowTemplate:s.rowTemplate)(l)),t.replaceWith(i),s.trigger("itemChange",{item:i,data:l,ns:he}),n&&n.length&&s.trigger("itemChange",{item:n,data:l,ns:he}),o=i,a=[{dataItem:l}],n&&n.length&&(o=i.add(n),a.push({dataItem:l})),s.angular("compile",function(){return{elements:o.get(),data:a}}),d&&s.options.selectable&&s.select(i.add(n)),n&&ie(i[0],n[0]),r=i.next(),r.hasClass("k-detail-row")&&r.is(":visible")&&i.find(".k-hierarchy-cell .k-icon").removeClass("k-i-expand").addClass("k-i-collapse"))},_showMessage:function(t,n){var i,r,o,a=this;return a._isMobile?(i=ue.template('<ul><li class="km-actionsheet-title">#:title#</li><li><a href="\\#" class="k-button k-grid-delete">#:confirmDelete#</a></li></ul>'),r=e(i(t)).appendTo(a.view.element),o=a._actionSheet=new ue.mobile.ui.ActionSheet(r,{cancel:t.cancelDelete,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',close:function(){this.destroy()},command:function(t){var i=e(t.currentTarget).parent();i.hasClass("km-actionsheet-cancel")||a._removeRow(n)},popup:a._actionSheetPopupOptions}),o.open(n),!1):window.confirm(t.title)},_confirmation:function(e){var t=this,n=t.options.editable,i=n===!0||typeof n===ut?t.options.messages.editable.confirmation:n.confirmation;return ke(n)&&typeof n.mode===ut&&typeof i!==ut&&i!==!1&&(i=t.options.messages.editable.confirmation),i===!1||null==i||(typeof i===ct&&(i=i(t._modelForContainer(e))),t._showMessage({confirmDelete:n.confirmDelete||t.options.messages.editable.confirmDelete,cancelDelete:n.cancelDelete||t.options.messages.editable.cancelDelete,title:i===!0?t.options.messages.editable.confirmation:i},e))},cancelChanges:function(){this.dataSource.cancelChanges()},saveChanges:function(){var e=this;(e.editable&&e.editable.end()||!e.editable)&&!e.trigger(Ke)&&e.dataSource.sync()},addRow:function(){var e,t,n,i,r,o,a=this,s=a.dataSource,l=a._editMode(),d=a.options.editable.createAt||"",c=s.pageSize(),u=s.view()||[];(a.editable&&a.editable.end()||!a.editable)&&("incell"!=l&&a.cancelRow(),e=s.indexOf(u[0]),"bottom"==d.toLowerCase()&&(e+=u.length,c&&!s.options.serverPaging&&c<=u.length&&(e-=1)),e<0&&(e=s.page()>s.totalPages()?(s.page()-1)*c:0),t=s.insert(e,{}),n=t.uid,i=a.lockedContent?a.lockedTable:a.table,r=i.find("tr["+ue.attr("uid")+"="+n+"]"),o=r.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(a._firstEditableColumnIndex(r)),"inline"===l&&r.length?a.editRow(r):"popup"===l?a.editRow(t):o.length&&a.editCell(o),"bottom"==d.toLowerCase()&&a.lockedContent&&(a.lockedContent[0].scrollTop=a.content[0].scrollTop=a.table[0].offsetHeight))},_firstEditableColumnIndex:function(e){var t,n,i,r=this,o=L(r.columns),a=r._modelForContainer(e);for(n=0,i=o.length;n<i;n++)if(t=o[n],a&&(!a.editable||a.editable(t.field))&&!t.command&&t.field&&t.hidden!==!0)return n;return-1},_toolbar:function(){var t,n=this,i=n.wrapper,r=n.options.toolbar,o=n.options.editable;r&&(t=n.wrapper.find(".k-grid-toolbar"),t.length||(Ee(r)||(r=typeof r===ut?r:n._toolbarTmpl(r).replace(vt,"\\#"),r=De(ue.template(r),n)),t=e('<div class="k-header k-grid-toolbar" />').html(r({})).prependTo(i),n.angular("compile",function(){return{elements:t.get()}})),o&&o.create!==!1&&t.on(st+Be,".k-grid-add",function(e){e.preventDefault(),n.addRow()}).on(st+Be,".k-grid-cancel-changes",function(e){e.preventDefault(),n.cancelChanges()}).on(st+Be,".k-grid-save-changes",function(e){e.preventDefault(),n.saveChanges()}),t.on(st+Be,".k-grid-excel",function(e){e.preventDefault(),n.saveAsExcel()}),t.on(st+Be,".k-grid-pdf",function(e){e.preventDefault(),n.saveAsPDF()}))},_toolbarTmpl:function(e){var t,n,i=this,r="";if(Ce(e))for(t=0,n=e.length;t<n;t++)r+=i._createButton(e[t]);return r},_createButton:function(e){var n,r=e.template||wt,o=typeof e===ut?e:e.name||e.text,a=Dt[o]?Dt[o].className:"k-grid-"+(o||"").replace(/\s/g,""),s={className:a,text:o,imageClass:"",attr:"",iconClass:""},l=this.options.messages.commands;if(!(o||ke(e)&&e.template))throw Error("Custom commands should have name specified");return ke(e)?(e=we(!0,{},e),e.className&&Te(s.className,e.className.split(" "))<0?e.className+=" "+s.className:e.className===t&&(e.className=s.className),"edit"===o&&ke(e.text)&&(e=we(!0,{},e),e.text=e.text.edit),e.attr&&(ke(e.attr)&&(e.attr=i(e.attr)),typeof e.attr===ut&&(n=e.attr.match(/class="(.+?)"/),n&&Te(n[1],e.className.split(" "))<0&&(e.className+=" "+n[1]))),s=we(!0,s,Dt[o],{text:l[o]},e)):s=we(!0,s,Dt[o],{text:l[o]}),ue.template(r)(s)},_hasFooters:function(){return!!this.footerTemplate||!!this.groupFooterTemplate||this.footer&&this.footer.length>0||this.wrapper.find(".k-grid-footer").length>0},_groupable:function(){var t=this;t._groupableClickHandler?t.table.add(t.lockedTable).off(st+Be,t._groupableClickHandler):t._groupableClickHandler=function(n){var i=e(this),r=i.closest("tr");i.hasClass("k-i-collapse")?t.collapseGroup(r):t.expandGroup(r),n.preventDefault(),n.stopPropagation()},t._isLocked()?t.lockedTable.on(st+Be,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler):t.table.on(st+Be,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler),
t._attachGroupable()},_attachGroupable:function(){var t=this,n=t.wrapper,i=t.options.groupable,r=Le+"["+ue.attr("field")+"]",o=t.content?".k-grid-header:first "+r:"table:first>.k-grid-header "+r;i&&i.enabled!==!1&&(n.has("div.k-grouping-header")[0]||e("<div>&nbsp;</div>").addClass("k-grouping-header").prependTo(n),t.groupable&&t.groupable.destroy(),t.groupable=new he.Groupable(n,we({},i,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:o,filter:o,allowDrag:t.options.reorderable,change:function(e){t.trigger("group",{groups:e.groups})&&e.preventDefault()}})))},_continuousItems:function(t,n){var i,r,o,a,s,l,d,c;if(this.lockedContent){for(i=this,r=i.table.add(i.lockedTable),o=e(t,r[0]),a=e(t,r[1]),s=n?M(i.columns).length:1,l=n?i.columns.length-s:1,d=[],c=0;c<o.length;c+=s)Se.apply(d,o.slice(c,c+s)),Se.apply(d,a.splice(0,l));return d}},_selectable:function(){var n,i,r,o,a=this,s=[],l=a._isLocked(),d=a.options.selectable;d&&(a.selectable&&a.selectable.destroy(),d=ue.ui.Selectable.parseOptions(d),n=d.multiple,i=d.cell,a._hasDetails()&&(s[s.length]=".k-detail-row"),(a.options.groupable||a._hasFooters())&&(s[s.length]=".k-grouping-row,.k-group-footer"),s=s.join(","),""!==s&&(s=":not("+s+")"),r=a.table,l&&(r=r.add(a.lockedTable)),o=">"+(i?ze:"tbody>tr"+s),a.selectable=new ue.ui.Selectable(r,{filter:o,aria:!0,multiple:n,change:function(){a.trigger($e)},useAllItems:l&&n&&i,relatedTarget:function(t){var n,r,o,s;if(!i&&l){for(r=e(),o=0,s=t.length;o<s;o++)n=a._relatedRow(t[o]),Te(n[0],t)<0&&(r=r.add(n));return r}},continuousItems:function(){return a._continuousItems(o,i)}}),a.options.navigatable&&r.on("keydown"+Be,function(o){var s=a.current(),d=o.target;if(o.keyCode===be.SPACEBAR&&e.inArray(d,r)>-1&&!s.is(".k-edit-cell,.k-header")&&s.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")){if(o.preventDefault(),o.stopPropagation(),s=i?s:s.parent(),l&&!i&&(s=s.add(a._relatedRow(s))),n)if(o.ctrlKey){if(s.hasClass(et))return s.removeClass(et),a.trigger($e),t}else a.selectable.clear();else a.selectable.clear();a.selectable.value(s)}}))},_clipboard:function(){var e,t=this.options,n=t.selectable;n&&t.allowCopy&&(e=this,t.navigatable||e.table.add(e.lockedTable).attr("tabindex",0).on("mousedown"+Be+" keydown"+Be,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}).on("mousedown"+Be,He+">"+Ne,De(se,e)),e.copyHandler=De(e.copySelection,e),e.updateClipBoardState=function(){e.areaClipBoard&&e.areaClipBoard.val(e.getTSV()).focus().select()},e.bind("change",e.updateClipBoardState),e.wrapper.on("keydown",e.copyHandler),e.clearAreaHandler=De(e.clearArea,e),e.wrapper.on("keyup",e.clearAreaHandler))},copySelection:function(t){t instanceof jQuery.Event&&!t.ctrlKey&&!t.metaKey||e(t.target).is("input:visible,textarea:visible")||window.getSelection&&""+window.getSelection()||document.selection&&document.selection.createRange().text||(this.areaClipBoard||(this.areaClipBoard=e("<textarea />").css({position:"fixed",top:"50%",left:"50%",opacity:0,width:0,height:0}).appendTo(this.wrapper)),this.areaClipBoard.val(this.getTSV()).focus().select())},getTSV:function(){var t,n,i,r,o,a,s=this,l=s.select(),d="\t",c=s.options.allowCopy,u=!0;return e.isPlainObject(c)&&c.delimeter&&(d=c.delimeter),t="",l.length&&(l.eq(0).is("tr")&&(l=l.find("td:not(.k-group-cell)")),u&&l.filter(":visible"),n=[],i=this.columns.length,r=s._isLocked()&&M(s.columns).length,o=!0,e.each(l,function(t,a){var l,d,c,h;a=e(a),l=a.closest("tr"),d=l.index(),c=a.index(),u&&(c-=a.prevAll(":hidden").length),r&&o&&(o=e.contains(s.lockedTable[0],a[0])),s._groups()&&o&&(c-=s._groups()),c=o?c:c+r,i>c&&(i=c),h=a.text(),n[d]||(n[d]=[]),n[d][c]=h}),a=n.length,n=e.each(n,function(e,t){t&&(n[e]=t.slice(i),a>e&&(a=e))}),e.each(n.slice(a),function(e,n){t+=n?n.join(d)+"\r\n":"\r\n"})),t},clearArea:function(t){var n;this.areaClipBoard&&t&&t.target===this.areaClipBoard[0]&&(n=this.options.navigatable?e(this.current()).closest("table"):this.table,oe(n,!0)),this.areaClipBoard&&(this.areaClipBoard.remove(),this.areaClipBoard=null)},_minScreenSupport:function(){var t=this.hideMinScreenCols();t&&(this.minScreenResizeHandler=De(this.hideMinScreenCols,this),e(window).on("resize",this.minScreenResizeHandler))},hideMinScreenCols:function(){var e=this.columns,t=window.innerWidth>0?window.innerWidth:screen.width;return this._iterateMinScreenCols(e,t)},_iterateMinScreenCols:function(e,n){var i,r,o,a=!1;for(i=0;i<e.length;i++)r=e[i],o=r.minScreenWidth,o!==t&&null!==o&&(a=!0,o>n?this.hideColumn(r):this.showColumn(r)),!r.hidden&&r.columns&&(a=this._iterateMinScreenCols(r.columns,n)||a);return a},_relatedRow:function(t){var n,i,r=this.lockedTable;return t=e(t),r?(n=t.closest(this.table.add(this.lockedTable)),i=n.find(">tbody>tr").index(t),n=n[0]===this.table[0]?r:this.table,n.find(">tbody>tr").eq(i)):t},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger($e)},select:function(e){var n=this,i=n.selectable;return e=n.table.add(n.lockedTable).find(e),e.length?(i.options.multiple||(i.clear(),e=e.first()),n._isLocked()&&(e=e.add(e.map(function(){return n._relatedRow(this)}))),i.value(e),t):i.value()},_updateCurrentAttr:function(t,n){var i,r=e(t).data("headerId");e(t).removeClass(Ze).removeAttr("aria-describedby").closest("table").removeAttr("aria-activedescendant"),r?(r=r.replace(this._cellId,""),e(t).attr("id",r)):e(t).removeAttr("id"),n.data("headerId",n.attr("id")).attr("id",this._cellId).addClass(Ze).closest("table").attr("aria-activedescendant",this._cellId),n.closest("tr").hasClass("k-grouping-row")||n.hasClass("k-header")?n.attr("aria-describedby",this._cellId):(i=this.columns[this.cellIndex(n)],i&&(r=i.headerAttributes.id),n.attr("aria-describedby",r+" "+this._cellId)),this._current=n},_scrollCurrent:function(){var t,n,i,r,o,a,s=this._current,l=this.options.scrollable;s&&l&&(t=s.parent(),n=t.closest("table").parent(),i=n.is(".k-grid-content-locked,.k-grid-header-locked"),r=n.is(".k-grid-content-locked,.k-grid-content,.k-virtual-scrollable-wrap"),o=e(this.content).find(">.k-virtual-scrollable-wrap").addBack().last()[0],r&&(l.virtual?(a=Math.max(Te(t[0],this._items(t.parent())),0),this._rowVirtualIndex=this.virtualScrollable.itemIndex(a),this.virtualScrollable.scrollIntoView(t)):this._scrollTo(this._relatedRow(t)[0],o)),this.lockedContent&&(this.lockedContent[0].scrollTop=o.scrollTop),i||this._scrollTo(s[0],o))},current:function(e){return this._setCurrent(e,!0)},_setCurrent:function(t,n){var i=this._current;return t=e(t),t.length&&(i&&i[0]===t[0]||(this._updateCurrentAttr(i,t),this._scrollCurrent(),n||this.trigger(at,{element:t}))),this._current},_removeCurrent:function(){this._current&&(this._current.removeClass(Ze),this._current=null)},_scrollTo:function(t,n){var i,r=t.tagName.toLowerCase(),o="td"===r||"th"===r,a=t[o?"offsetLeft":"offsetTop"],s=t[o?"offsetWidth":"offsetHeight"],l=n[o?"scrollLeft":"scrollTop"],d=n[o?"clientWidth":"clientHeight"],c=a+s,u=0,h=0,f=0;yt&&o&&(i=e(t).closest("table")[0],xt.msie?h=i.offsetLeft:xt.mozilla&&(f=i.offsetLeft-ue.support.scrollbar())),l=Math.abs(l+h-f),u=l>a?a:c>l+d?s<=d?c-d:a:l,u=Math.abs(u+h)+f,n[o?"scrollLeft":"scrollTop"]=u},_navigatable:function(){var t,n,i,r=this;r.options.navigatable&&(t=r.table.add(r.lockedTable),n=r.thead.parent().add(e(">table",r.lockedHeader)),i=t,r.options.scrollable&&(i=i.add(n),n.attr(dt,-1)),this._navigatableTables=i,i.off("mousedown"+Be+" focus"+Be+" focusout"+Be+" keydown"+Be),n.on("keydown"+Be,De(r._openHeaderMenu,r)).find("a.k-link").attr("tabIndex",-1),t.attr(dt,Re.max(t.attr(dt)||0,0)).on("mousedown"+Be+" keydown"+Be,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}),i.on(ue.support.touch?"touchstart"+Be:"mousedown"+Be,He+">"+Ne,De(se,r)).on("focus"+Be,De(r._tableFocus,r)).on("focusout"+Be,De(r._tableBlur,r)).on("keydown"+Be,De(r._tableKeyDown,r)))},_openHeaderMenu:function(e){e.altKey&&e.keyCode==be.DOWN&&(this.current().find(".k-grid-filter, .k-header-column-menu").click(),e.stopImmediatePropagation())},_setTabIndex:function(e){this._navigatableTables.attr(dt,-1),e.attr(dt,0)},_tableFocus:function(t){var n,i;ue.support.touch||(n=this.current(),i=e(t.currentTarget),n&&n.is(":visible")?n.addClass(Ze):this._setCurrent(i.find(Pe)),this._setTabIndex(i))},_tableBlur:function(){var e=this.current();e&&e.removeClass(Ze)},_tableKeyDown:function(n){var i,r=this.current(),o=this.virtualScrollable&&this.virtualScrollable.fetching(),a=e(n.target),s=!n.isDefaultPrevented()&&!a.is(":button,a,:input,a>.k-icon");return o?(n.preventDefault(),t):(r=r?r:e(this.lockedTable).add(this.table).find(Pe),r.length&&(i=!1,s&&n.keyCode==be.UP&&(i=this._moveUp(r)),s&&n.keyCode==be.DOWN&&(i=this._moveDown(r)),s&&n.keyCode==(yt?be.LEFT:be.RIGHT)&&(i=this._moveRight(r,n.altKey)),s&&n.keyCode==(yt?be.RIGHT:be.LEFT)&&(i=this._moveLeft(r,n.altKey)),s&&n.keyCode==be.PAGEDOWN&&(i=this._handlePageDown()),s&&n.keyCode==be.PAGEUP&&(i=this._handlePageUp()),n.keyCode!=be.ENTER&&n.keyCode!=be.F2||(i=this._handleEnterKey(r,n.currentTarget,a)),n.keyCode==be.ESC&&(i=this._handleEscKey(r,n.currentTarget)),n.keyCode==be.TAB&&(i=this._handleTabKey(r,n.currentTarget,n.shiftKey)),i&&(n.preventDefault(),n.stopPropagation())),t)},_moveLeft:function(e,t){var n,i,r=e.parent(),o=r.parent();return t?this.collapseRow(r):(i=o.find(He).index(r),n=this._prevHorizontalCell(o,e,i),n[0]||(o=this._horizontalContainer(o),n=this._prevHorizontalCell(o,e,i),n[0]!==e[0]&&oe(o.parent(),!0)),this._setCurrent(n)),!0},_moveRight:function(e,t){var n,i,r=e.parent(),o=r.parent();return t?this.expandRow(r):(i=o.find(He).index(r),n=this._nextHorizontalCell(o,e,i),n[0]||(o=this._horizontalContainer(o,!0),n=this._nextHorizontalCell(o,e,i),n[0]!==e[0]&&oe(o.parent(),!0)),this._setCurrent(n)),!0},_moveUp:function(e){var t=e.parent().parent(),n=this._prevVerticalCell(t,e);return n[0]||(t=this._verticalContainer(t,!0),n=this._prevVerticalCell(t,e),n[0]&&oe(t.parent(),!0)),this._setCurrent(n),!0},_moveDown:function(e){var t=e.parent().parent(),n=this._nextVerticalCell(t,e);return n[0]||(t=this._verticalContainer(t),n=this._nextVerticalCell(t,e),n[0]&&oe(t.parent(),!0)),this._setCurrent(n),!0},_handlePageDown:function(){return!!this.options.pageable&&(this.dataSource.page(this.dataSource.page()+1),!0)},_handlePageUp:function(){return!!this.options.pageable&&(this.dataSource.page(this.dataSource.page()-1),!0)},_handleTabKey:function(t,n,i){var r,o=this.options.editable&&"incell"==this._editMode();return!(!o||t.is("th"))&&(r=e(me()).closest(".k-edit-cell"),r[0]&&r[0]!==t[0]&&(t=r),r=this._tabNext(t,n,i),!!r.length&&(this._handleEditing(t,r,r.closest("table")),!0))},_handleEscKey:function(t,n){var i,r=me(),o="incell"==this._editMode();return le(t)?(o?this.closeCell(!0):(i=e(t).parent().index(),r&&r.blur(),this.cancelRow(!0),i>=0&&this._setCurrent(this.items().eq(i).children(Ne).first())),xt.msie&&xt.version<9&&document.body.focus(),oe(n,!0),!0):!!t.has(r).length&&(oe(n,!0),!0)},_toggleCurrent:function(e,t){var n=e.parent();return n.is(".k-grouping-row")?(n.find(".k-icon:first").click(),!0):!(t||!n.is(".k-master-row"))&&(n.find(".k-icon:first").click(),!0)},_handleEnterKey:function(t,n,i){var r,o=this.options.editable&&this.options.editable.update!==!1,a=i.closest("[role=gridcell]");return i.is("table")||e.contains(t[0],i[0])||(t=a),t.is("th")?(t.find(".k-link").click(),!0):!!this._toggleCurrent(t,o)||(r=t.find(":kendoFocusable:first"),r[0]&&!t.hasClass("k-edit-cell")&&t.hasClass("k-state-focused")?(r.focus(),!0):!(!o||i.is(":button,.k-button,textarea"))&&(a[0]||(a=t),this._handleEditing(a,!1,n),!0))},_nextHorizontalCell:function(e,t,n){var i,r,o,a=t.nextAll(Me);return a.length||(i=e.find(He),r=i.index(t.parent()),r!=-1)?a.first():t.hasClass("k-header")?(o=[],A([M(this.columns)[0]],V(i.eq(0).children().first()),o,0,0),o[n]?o[n][0]:t):t.parent().hasClass("k-filter-row")?i.last().children(Me).first():i.eq(n).children(Me).first()},_prevHorizontalCell:function(e,t,n){var i,r,o,a,s=t.prevAll(Me);return s.length||(i=e.find(He),r=i.index(t.parent()),r!=-1)?s.first():t.hasClass("k-header")?(o=[],a=M(this.columns),A([a[a.length-1]],V(i.eq(0).children().last()),o,0,0),o[n]?o[n][0]:t):t.parent().hasClass("k-filter-row")?i.last().children(Me).last():i.eq(n).children(Me).last()},_currentDataIndex:function(e,n){var i,r=n.attr("data-index");return r?(i=M(this.columns).length,i&&!e.closest("div").hasClass("k-grid-content-locked")[0]?r-i:r):t},_prevVerticalCell:function(t,n){var i,r=n.parent(),o=t.children(He),a=o.index(r),s=this._currentDataIndex(t,n);if(s||n.hasClass("k-header"))return i=O(n),i.eq(i.length-2);if(s=r.children(Me).index(n),r.hasClass("k-filter-row"))return B(t).eq(s);if(a==-1){if(r=t.find(".k-filter-row"),!r[0])return B(t).eq(s)}else r=0===a?e():o.eq(a-1);return i=r.children(Me),i.eq(i.length>s?s:0)},_nextVerticalCell:function(e,n){var i,r=n.parent(),o=e.children(He),a=o.index(r),s=this._currentDataIndex(e,n);return a!=-1&&s===t&&n.hasClass("k-header")?V(n).eq(1):(s=s?parseInt(s,10):r.children(Me).index(n),r=o.eq(a==-1?0:a+n[0].rowSpan),i=r.children(Me),i.eq(i.length>s?s:0))},_verticalContainer:function(e,t){var n=e.parent(),i=this._navigatableTables.length,r=Math.floor(i/2),o=Te(n[0],this._navigatableTables);return t&&(r*=-1),o+=r,(o>=0||o<i)&&(n=this._navigatableTables.eq(o)),n.find(t?"thead":"tbody")},_horizontalContainer:function(e,t){var n,i,r=this._navigatableTables.length;return r<=2?e:(n=e.parent(),i=Te(n[0],this._navigatableTables),i+=t?1:-1,!t||2!=i&&i!=r?!t&&(1==i||i<0)?e:this._navigatableTables.eq(i).find("thead, tbody"):e)},_tabNext:function(e,t,n){var i=!0,r=n?e.prevAll(Me+":first"):e.nextAll(":visible:first");return r.length||(r=e.parent(),this.lockedTable&&(i=n&&t==this.lockedTable[0]||!n&&t==this.table[0],r=this._relatedRow(r)),i&&(r=r[n?"prevAll":"nextAll"]("tr:not(.k-grouping-row):not(.k-detail-row):visible:first")),r=r.children(Me+(n?":last":":first"))),r},_handleEditing:function(n,i,r){var o,a,s=this,l=e(me()),d=s._editMode(),c=xt.msie,u=c&&xt.version<9,h=s._editContainer,f=s.options.editable&&s.options.editable.update!==!1;if(r=e(r),a="incell"==d?n.hasClass("k-edit-cell"):n.parent().hasClass("k-grid-edit-row"),s.editable){if(e.contains(h[0],l[0])&&(xt.opera||u?l.blur().change().triggerHandler("blur"):(l.blur(),c&&l.blur())),!s.editable)return oe(r),t;if(!s.editable.end())return s._setCurrent("incell"==d?h:h.children().filter(Me).first()),o=h.find(":kendoFocusable:first")[0],o&&o.focus(),t;"incell"==d?s.closeCell():(s.saveRow(),a=!0)}i&&s._setCurrent(i),u&&document.body.focus(),oe(r,!0),f&&(!a&&!i||i)&&("incell"==d?s.editCell(s.current()):s.editRow(s.current().parent()))},_wrapper:function(){var e=this,t=e.table,n=e.options.height,i=e.element;i.is("div")||(i=i.wrap("<div/>").parent()),e.wrapper=i.addClass("k-grid k-widget"),n&&(e.wrapper.css(lt,n),t.css(lt,"auto")),e._initMobile()},_initMobile:function(){var t,n=this.options,i=this;this._isMobile=n.mobile===!0&&ue.support.mobileOS||"phone"===n.mobile||"tablet"===n.mobile,this._isMobile&&(t=this.wrapper.addClass("k-grid-mobile").wrap("<div data-"+ue.ns+'stretch="true" data-'+ue.ns+'role="view" data-'+ue.ns+'init-widgets="false"></div>').parent(),this.pane=ue.mobile.ui.Pane.wrap(t),this.view=this.pane.view(),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"},n.height&&this.pane.element.parent().css(lt,n.height),this._editAnimation="slide",this.view.bind("show",function(){i._isLocked()&&(i._updateTablesWidth(),i._applyLockedContainersWidth(),i._syncLockedContentHeight(),i._syncLockedHeaderHeight(),i._syncLockedFooterHeight())}))},_tbody:function(){var t,n=this,i=n.table;t=i.find(">tbody"),t.length||(t=e("<tbody/>").appendTo(i)),n.tbody=t.attr("role","rowgroup")},_scrollable:function(){var t,n,i,r,o=this,a=o.options,s=a.scrollable,l=s!==!0&&s.virtual&&!o.virtualScrollable,d=!ue.support.kineticScrollNeeded||l?ue.support.scrollbar():0;s&&(t=o.wrapper.children(".k-grid-header"),t[0]||(t=e('<div class="k-grid-header" />').insertBefore(o.table)),t.css(yt?"padding-left":"padding-right",s.virtual?d+1:d),n=e('<table role="grid" />'),Ct&&n.attr("cellspacing",0),n.width(o.table[0].style.width),n.append(o.thead),t.empty().append(e('<div class="k-grid-header-wrap k-auto-scrollable" />').append(n)),o.content=o.table.parent(),o.content.is(".k-virtual-scrollable-wrap, .km-scroll-container")&&(o.content=o.content.parent()),o.content.is(".k-grid-content, .k-virtual-scrollable-wrap")||(o.content=o.table.wrap('<div class="k-grid-content k-auto-scrollable" />').parent()),l&&(o.virtualScrollable=new St(o.content,{dataSource:o.dataSource,itemHeight:function(){return o._averageRowHeight()}})),o.scrollables=t.children(".k-grid-header-wrap").add(o.content),i=o.wrapper.find(".k-grid-footer"),i.length&&(o.scrollables=o.scrollables.add(i.children(".k-grid-footer-wrap"))),s.virtual?o.content.find(">.k-virtual-scrollable-wrap").unbind("scroll"+Be).bind("scroll"+Be,function(){o.scrollables.scrollLeft(this.scrollLeft),o.lockedContent&&(o.lockedContent[0].scrollTop=this.scrollTop)}):(o.content.unbind("scroll"+Be).bind("scroll"+Be,function(e){o.scrollables.not(e.currentTarget).scrollLeft(this.scrollLeft),o.lockedContent&&e.currentTarget==o.content[0]&&(o.lockedContent[0].scrollTop=this.scrollTop)}),r=o.content.data("kendoTouchScroller"),r&&r.destroy(),r=ue.touchScroller(o.content),r&&r.movable&&(o.touchScroller=r,r.movable.bind("change",function(e){o.scrollables.scrollLeft(-e.sender.x),o.lockedContent&&o.lockedContent.scrollTop(-e.sender.y)}),o.one(Qe,function(e){e.sender.wrapper.addClass("k-grid-backface")}))))},_renderNoRecordsContent:function(){var t,n=this;n.options.noRecords&&(t=n.table.parent().children("."+tt),t.length&&(n.angular("cleanup",function(){return{elements:t.get()}}),t.remove()),n.dataSource&&n.dataSource.view().length||(t=e(n.noRecordsTemplate({})).insertAfter(n.table),n.angular("compile",function(){return{elements:t.get(),data:[{}]}})))},_setContentWidth:function(t){var n,i=this,r="k-grid-content-expander",o='<div class="'+r+'"></div>',a=i.resizable;i.options.scrollable&&i.wrapper.is(":visible")&&(n=i.table.parent().children("."+r),i._setContentWidthHandler=De(i._setContentWidth,i),i.dataSource&&i.dataSource.view().length?n[0]&&(n.remove(),a&&a.unbind("resize",i._setContentWidthHandler)):(n[0]||(n=e(o).appendTo(i.table.parent()),a&&a.bind("resize",i._setContentWidthHandler)),i.thead&&(n.width(i.thead.width()),isNaN(parseFloat(t,10))||i.content.scrollLeft(t))),i._applyLockedContainersWidth(),i.lockedHeader&&0===i.table[0].clientWidth&&(i.table[0].style.width="1px"))},_applyLockedContainersWidth:function(){if(this.options.scrollable&&this.lockedHeader){var e,t=this.thead.parent(),n=t.parent(),i=this.wrapper[0].clientWidth,r=this._groups(),o=ue.support.scrollbar(),a=this.lockedHeader.find(">table>colgroup>col:not(.k-group-col, .k-hierarchy-col)"),s=t.find(">colgroup>col:not(.k-group-col, .k-hierarchy-col)"),l=E(a),d=E(s);r>0&&(l+=ve(this.lockedHeader.find(".k-group-cell:first"))*r),l>=i&&(l=i-3*o),this.lockedHeader.add(this.lockedContent).width(l),n[0].style.width=n.parent().width()-l-2+"px",t.add(this.table).width(d),this.virtualScrollable&&(i-=o),this.content[0].style.width=i-l-2+"px",this.lockedFooter&&this.lockedFooter.length&&(this.lockedFooter.width(l),e=this.footer.find(".k-grid-footer-wrap"),e[0].style.width=n[0].clientWidth+"px",e.children().first().width(d))}},_setContentHeight:function(){var e,t=this,n=t.options,i=t.wrapper.innerHeight(),r=t.wrapper.children(".k-grid-header"),o=ue.support.scrollbar();n.scrollable&&t.wrapper.is(":visible")&&(i-=_e(r),t.pager&&(i-=_e(t.pager.element)),n.groupable&&(i-=_e(t.wrapper.children(".k-grouping-header"))),n.toolbar&&(i-=_e(t.wrapper.children(".k-grid-toolbar"))),t.footerTemplate&&(i-=_e(t.wrapper.children(".k-grid-footer"))),e=function(e){var t,n;return!!e[0].style.height||(t=e.height(),e.height("auto"),n=e.height(),t!=n?(e.height(""),!0):(e.height(""),!1))},e(t.wrapper)&&(i>2*o?(t.lockedContent&&(o=t.table[0].offsetWidth>t.table.parent()[0].clientWidth?o:0,t.lockedContent.height(i-o)),t.content.height(i)):t.content.height(2*o+1)))},_averageRowHeight:function(){var e,t=this,n=t._items(t.tbody).length,i=t._rowHeight;return 0===n?i:(t._rowHeight||(t._rowHeight=i=_e(t.table)/n,t._sum=i,t._measures=1),e=_e(t.table)/n,i!==e&&(t._measures++,t._sum+=e,t._rowHeight=t._sum/t._measures),i)},_dataSource:function(){var e,n=this,i=n.options,r=i.dataSource;r=Ce(r)?{data:r}:r,ke(r)&&(we(r,{table:n.table,fields:n.columns}),e=i.pageable,ke(e)&&e.pageSize!==t&&(r.pageSize=e.pageSize)),n.dataSource&&n._refreshHandler?n.dataSource.unbind($e,n._refreshHandler).unbind(Ie,n._progressHandler).unbind(Ae,n._errorHandler):(n._refreshHandler=De(n.refresh,n),n._progressHandler=De(n._requestStart,n),n._errorHandler=De(n._error,n)),n.dataSource=fe.create(r).bind($e,n._refreshHandler).bind(Ie,n._progressHandler).bind(Ae,n._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_modelChange:function(t){var n,i,r,o,a,s,l,d,c,u,h=this,f=h.tbody,p=t.model,m=h.tbody.find("tr["+ue.attr("uid")+"="+p.uid+"]"),g=m.hasClass("k-alt"),v=h._items(f).index(m),_=h.lockedContent;if(_&&(n=h._relatedRow(m)),m.add(n).children(".k-edit-cell").length&&!h.options.rowTemplate)m.add(n).children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){i=e(this),r=L(h.columns)[h.cellIndex(i)],r.field===t.field&&(i.hasClass("k-edit-cell")?i.addClass("k-dirty-cell"):(h._displayCell(i,r,p),e('<span class="k-dirty"/>').prependTo(i)))});else if(!m.hasClass("k-grid-edit-row")){for(s=e().add(m),_&&(o=(g?h.lockedAltRowTemplate:h.lockedRowTemplate)(p),s=s.add(n),n.replaceWith(o)),h.angular("cleanup",function(){return{elements:s.get()}}),o=(g?h.altRowTemplate:h.rowTemplate)(p),m.replaceWith(o),o=h._items(f).eq(v),u=[{dataItem:p}],_&&(m=m.add(n),n=h._relatedRow(o)[0],ie(o[0],n),o=o.add(n),u.push({dataItem:p})),h.angular("compile",function(){return{elements:o.get(),data:u}}),a=h.options.selectable,a&&m.hasClass("k-state-selected")&&h.select(o),d=s.children(":not(.k-group-cell,.k-hierarchy-cell)"),l=o.children(":not(.k-group-cell,.k-hierarchy-cell)"),v=0,c=h.columns.length;v<c;v++)r=h.columns[v],i=l.eq(v),a&&d.eq(v).hasClass("k-state-selected")&&i.addClass("k-state-selected"),r.field===t.field&&e('<span class="k-dirty"/>').prependTo(i);h.trigger("itemChange",{item:o,data:p,ns:he})}},_pageable:function(){var t,n=this,i=n.options.pageable;i&&(t=n.wrapper.children("div.k-grid-pager"),t.length||(t=e('<div class="k-pager-wrap k-grid-pager"/>').appendTo(n.wrapper)),n.pager&&n.pager.destroy(),n.pager="object"==typeof i&&i instanceof ue.ui.Pager?i:new ue.ui.Pager(t,we({},i,{dataSource:n.dataSource})),n.pager.bind("pageChange",function(e){n.trigger("page",{page:e.index})&&e.preventDefault()}))},_footer:function(){var t,n,i,r=this,o=r.dataSource.aggregates(),a="",s=r.footerTemplate,l=r.options,d=r.footer||r.wrapper.find(".k-grid-footer");s?(a=e(r._wrapFooter(s(o))),d.length?(n=a,r.angular("cleanup",function(){return{elements:d.get()}}),d.replaceWith(n),d=r.footer=n):d=r.footer=l.scrollable?l.pageable?a.insertBefore(r.wrapper.children("div.k-grid-pager")):a.appendTo(r.wrapper):a.insertBefore(r.tbody),r.angular("compile",function(){return{elements:d.find("td:not(.k-group-cell, .k-hierarchy-cell)").get(),data:ye(r.columns,function(e){return{column:e,aggregate:o[e.field]}})}})):d&&!r.footer&&(r.footer=d),d.length&&(l.scrollable&&(t=d.attr("tabindex",-1).children(".k-grid-footer-wrap"),r.scrollables=e(r.scrollables.filter(function(){return!e(this).is(".k-grid-footer-wrap")}).toArray()).add(t)),r._footerWidth&&d.find("table").css("width",r._footerWidth),t&&(i=r.content.scrollLeft(),l.scrollable!==!0&&l.scrollable.virtual&&(i=r.wrapper.find(".k-virtual-scrollable-wrap").scrollLeft()),t.scrollLeft(i))),r.lockedContent&&(r._appendLockedColumnFooter(),r._applyLockedContainersWidth(),r._syncLockedFooterHeight())},_wrapFooter:function(t){var n=this,i="",r=ue.support.mobileOS?0:ue.support.scrollbar();return n.options.scrollable?(i=e('<div class="k-grid-footer"><div class="k-grid-footer-wrap"><table'+(Ct?' cellspacing="0"':"")+"><tbody>"+t+"</tbody></table></div></div>"),n._appendCols(i.find("table")),i.css(yt?"padding-left":"padding-right",r),i):'<tfoot class="k-grid-footer">'+t+"</tfoot>"},_columnMenu:function(){var e,n,i,r,o,a,s,l,d,c=this,u=L(c.columns),h=c.options,f=h.columnMenu,p=xe(c.columns,function(e){return e.columns!==t}).length>0,m=this._isMobile,g=function(e){c.trigger(je,{field:e.field,container:e.container})},v=function(e){oe(e.closest("table"),!0)},_=function(e){c.trigger("sort",{sort:e.sort})&&e.preventDefault()},b=function(e){c.trigger("filter",{filter:e.filter,field:e.field})&&e.preventDefault()},k=h.$angular;if(f)for("boolean"==typeof f&&(f={}),a=B(c.thead),s=0,l=a.length;s<l;s++)n=u[s],d=a.eq(s),n.command||!n.field&&!d.attr("data-"+ue.ns+"field")||(e=d.data("kendoColumnMenu"),e&&e.destroy(),r=n.sortable!==!1&&f.sortable!==!1&&h.sortable!==!1&&we({},h.sortable,{compare:(n.sortable||{}).compare}),o=!(!h.filterable||n.filterable===!1||f.filterable===!1)&&we({pane:c.pane},h.filterable,n.filterable),n.filterable&&n.filterable.dataSource&&(o.forceUnique=!1,o.checkSource=n.filterable.dataSource),o&&(o.format=n.format),i={dataSource:c.dataSource,values:n.values,columns:f.columns,sortable:r,filterable:o,messages:f.messages,owner:c,closeCallback:v,init:g,pane:c.pane,sort:_,filtering:b,filter:m?":not(.k-column-active)":"",lockedColumns:!p&&n.lockable!==!1&&M(u).length>0},k&&(i.$angular=k),d.kendoColumnMenu(i))},_headerCells:function(){return this.thead.find("th").filter(function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")})},_filterable:function(){var e,t,n,i,r,o,a,s=this,l=L(s.columns),d=function(e){s.trigger(qe,{field:e.field,container:e.container})},c=function(e){oe(e.closest("table"),!0)},u=function(e){s.trigger("filter",{filter:e.filter,field:e.field})&&e.preventDefault()},h=s.options.filterable;if(h&&typeof h.mode==ut&&h.mode.indexOf("menu")==-1&&(h=!1),h&&!s.options.columnMenu)for(t=B(s.thead),i=0,r=t.length;i<r;i++)n=t.eq(i),l[i].filterable===!1||l[i].command||!l[i].field&&!n.attr("data-"+ue.ns+"field")||(e=n.data("kendoFilterMenu"),e&&e.destroy(),e=n.data("kendoFilterMultiCheck"),e&&e.destroy(),o=l[i].filterable,a=we({},h,o,{dataSource:s.dataSource,values:l[i].values,format:l[i].format,closeCallback:c,title:l[i].title||l[i].field,init:d,pane:s.pane,change:u}),o&&o.messages&&(a.messages=we(!0,{},h.messages,o.messages)),o&&o.dataSource&&(a.forceUnique=!1,a.checkSource=o.dataSource),o&&o.multi?n.kendoFilterMultiCheck(a):n.kendoFilterMenu(a))},_filterRow:function(){var t,n,i,r,o,a,s,l,d,c,u,h,f,p,m,g=this;if(g._hasFilterRow())for(n=g.options.$angular,i=L(g.columns),r=g.options.filterable,o=g.thead.find(".k-filter-row"),a=function(e){g.trigger("filter",{filter:e.filter,field:e.field})&&e.preventDefault()},this._updateHeader(this.dataSource.group().length),s=0;s<i.length;s++)if(d=i[s],c=g.options.filterable.operators,u=!1,h=e("<th/>"),f=d.field,d.hidden&&h.hide(),o.append(h),f&&d.filterable!==!1){if(p=d.filterable&&d.filterable.cell||{},l=g.options.dataSource,l instanceof fe&&(l=g.options.dataSource.options),m=we(!0,{},r.messages),d.filterable&&we(!0,m,d.filterable.messages),p.enabled===!1){h.html("&nbsp;");continue}p.dataSource&&(l=p.dataSource,u=!0),d.filterable&&d.filterable.operators&&(c=d.filterable.operators),t={column:d,dataSource:g.dataSource,suggestDataSource:l,customDataSource:u,field:f,messages:m,values:d.values,template:p.template,delay:p.delay,inputWidth:p.inputWidth,suggestionOperator:p.suggestionOperator,minLength:p.minLength,dataTextField:p.dataTextField,operator:p.operator,operators:c,showOperators:p.showOperators,change:a},n&&(t.$angular=n),e("<span/>").attr(ue.attr("field"),f).appendTo(h).kendoFilterCell(t)}else h.html("&nbsp;")},_sortable:function(){var e,t,n,i,r,o,a=this,s=L(a.columns),l=a.options.sortable,d=function(e){a.trigger("sort",{sort:e.sort})&&e.preventDefault()};if(l){for(i=B(a.thead),r=0,o=i.length;r<o;r++)e=s[r],e.sortable!==!1&&!e.command&&e.field&&(n=i.eq(r),t=n.data("kendoColumnSorter"),t&&t.destroy(),n.attr("data-"+ue.ns+"field",e.field).kendoColumnSorter(we({},l,e.sortable,{dataSource:a.dataSource,aria:!0,filter:":not(.k-column-active)",change:d})));i=null}},_columns:function(t){var n,i,r,o=this,a=o.table,s=a.find("col"),d=o.options.dataSource;if(t=t.length?t:ye(a.find("th"),function(t,n){t=e(t);var i=t.attr(ue.attr("sortable")),r=t.attr(ue.attr("filterable")),o=t.attr(ue.attr("type")),a=t.attr(ue.attr("groupable")),l=t.attr(ue.attr("field")),d=t.attr(ue.attr("title")),c=t.attr(ue.attr("menu"));return l||(l=t.text().replace(/\s|[^A-z0-9]/g,"")),{field:l,type:o,title:d,sortable:"false"!==i,filterable:"false"!==r,groupable:"false"!==a,menu:c,template:t.attr(ue.attr("template")),width:s.eq(n).css("width")}}),n=!(o.table.find("tbody tr").length>0&&(!d||!d.transport)),o.options.scrollable){if(r=t,i=M(t),t=z(t),i.length>0&&0===t.length)throw Error("There should be at least one non locked column");$(o.element.find("tr:has(th):first"),r),t=i.concat(t)}o.columns=l(t,n)},_groups:function(){var e=this.dataSource.group();return e?e.length:0},_tmpl:function(e,t,r,o){var a,s,l,d,c=this,u=we({},ue.Template,c.options.templateSettings),h=t.length,f={storage:{},count:0},p=c._hasDetails(),m=[],g=c._groups();if(!e){for(e="<tr",r&&m.push("k-alt"),p&&m.push("k-master-row"),m.length&&(e+=' class="'+m.join(" ")+'"'),h&&(e+=" "+ue.attr("uid")+'="#='+ue.expr("uid",u.paramName)+'#"'),e+=" role='row'>",g>0&&!o&&(e+=n(g)),p&&(e+='<td class="k-hierarchy-cell"><a class="k-icon k-i-expand" href="\\#" tabindex="-1"></a></td>'),a=0;a<h;a++)l=t[a],s=l.template,d=typeof s,e+="<td"+i(l.attributes)+" role='gridcell'>",e+=c._cellTmpl(l,f),e+="</td>";e+="</tr>"}return e=ue.template(e,u),f.count>0?De(e,f.storage):e},_headerCellText:function(e){var t=this,n=we({},ue.Template,t.options.templateSettings),i=e.headerTemplate,r=typeof i,o=e.title||e.field||"";return r===ct?o=ue.template(i,n)({}):r===ut&&(o=i),o},_cellTmpl:function(e,t){var n,i,r=this,o=we({},ue.Template,r.options.templateSettings),a=e.template,s=o.paramName,l=e.field,d="",c=e.format,u=typeof a,h=e.values;if(e.command){if(Ce(e.command)){for(n=0,i=e.command.length;n<i;n++)d+=r._createButton(e.command[n]);return d.replace(vt,"\\#")}return r._createButton(e.command).replace(vt,"\\#")}return u===ct?(t.storage["tmpl"+t.count]=a,d+="#=this.tmpl"+t.count+"("+s+")#",t.count++):u===ut?d+=a:h&&h.length&&ke(h[0])&&"value"in h[0]&&l?(d+="#var v ="+ue.stringify(G(h)).replace(vt,"\\#")+"#",d+="#var f = v[",o.useWithBlock||(d+=s+"."),d+=l+"]#",d+="${f != null ? f : ''}"):(d+=e.encoded?"#:":"#=",c&&(d+='kendo.format("'+c.replace(gt,"\\$1")+'",'),l?(l=ue.expr(l,s),d+=l+"==null?'':"+l):d+="''",c&&(d+=")"),d+="#"),d},_templates:function(){var t=this,n=t.options,i=t.dataSource,r=i.group(),o=t.footer||t.wrapper.find(".k-grid-footer"),a=i.aggregate(),s=L(t.columns),l=L(M(t.columns)),d=n.scrollable?L(z(t.columns)):s;if(n.scrollable&&l.length){if(n.rowTemplate||n.altRowTemplate)throw Error("Having both row template and locked columns is not supported");t.rowTemplate=t._tmpl(n.rowTemplate,d,!1,!0),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,d,!0,!0),t.lockedRowTemplate=t._tmpl(n.rowTemplate,l),t.lockedAltRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,l,!0)}else t.rowTemplate=t._tmpl(n.rowTemplate,d),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,d,!0);t._hasDetails()&&(t.detailTemplate=t._detailTmpl(n.detailTemplate||"")),(t._group&&!Fe(a)||!Fe(a)&&!o.length||xe(s,function(e){return e.footerTemplate}).length)&&(t.footerTemplate=t._footerTmpl(s,a,"footerTemplate","k-footer-template")),r&&xe(s,function(e){return e.groupFooterTemplate}).length&&(a=e.map(r,function(e){return e.aggregates;
}),t.groupFooterTemplate=t._footerTmpl(d,a,"groupFooterTemplate","k-group-footer",l.length),n.scrollable&&l.length&&(t.lockedGroupFooterTemplate=t._footerTmpl(l,a,"groupFooterTemplate","k-group-footer"))),t.options.noRecords&&(t.noRecordsTemplate=t._noRecordsTmpl())},_noRecordsTmpl:function(){var t,n,i,r='<div class="{0}">{1}</div>',o='<div class="k-grid-norecords-template"{1}>{0}</div>',a=this.options.scrollable&&!this.wrapper[0].style.height?' style="margin:0 auto;position:static;"':"",s={storage:{},count:0},l=e.extend({},ue.Template,this.options.templateSettings),d=l.paramName,c="";return t=this.options.noRecords.template?this.options.noRecords.template:ue.format(o,this.options.messages.noRecords,a),n=typeof t,"function"===n?(s.storage["tmpl"+s.count]=t,c+="#=this.tmpl"+s.count+"("+d+")#",s.count++):"string"===n&&(c+=t),i=ue.template(ue.format(r,tt,c),l),s.count>0&&(i=e.proxy(i,s.storage)),i},_footerTmpl:function(e,t,r,o,a){var s,l,d,c,u,h=this,f=we({},ue.Template,h.options.templateSettings),p=f.paramName,m="",g={},v=0,_={},b=h._groups(),k=h.dataSource._emptyAggregates(t);for(m+='<tr class="'+o+'">',b>0&&!a&&(m+=n(b)),h._hasDetails()&&(m+='<td class="k-hierarchy-cell">&nbsp;</td>'),s=0,l=e.length;s<l;s++)u=e[s],d=u[r],c=typeof d,m+="<td"+i(u.footerAttributes)+">",d?(c!==ct&&(_=k[u.field]?we({},f,{paramName:p+"['"+u.field+"']"}):{},d=ue.template(d,_)),g["tmpl"+v]=d,m+="#=this.tmpl"+v+"("+p+")#",v++):m+="&nbsp;",m+="</td>";return m+="</tr>",m=ue.template(m,f),v>0?De(m,g):m},_detailTmpl:function(e){var t=this,i="",r=we({},ue.Template,t.options.templateSettings),o=r.paramName,a={},s=0,l=t._groups(),d=p(L(t.columns)).length,c=typeof e;return i+='<tr class="k-detail-row">',l>0&&(i+=n(l)),i+='<td class="k-hierarchy-cell"></td><td class="k-detail-cell"'+(d?' colspan="'+d+'"':"")+">",c===ct?(a["tmpl"+s]=e,i+="#=this.tmpl"+s+"("+o+")#",s++):i+=e,i+="</td></tr>",i=ue.template(i,r),s>0?De(i,a):i},_hasDetails:function(){var e=this;return null!==e.options.detailTemplate||(e._events[Ue]||[]).length},_hasFilterRow:function(){var t=this.options.filterable,n=t&&typeof t.mode==ut&&t.mode.indexOf("row")!=-1,i=this.columns,r=e.grep(i,function(e){return e.filterable===!1});return i.length&&r.length==i.length&&(n=!1),n},_details:function(){var t=this;if(t.options.scrollable&&t._hasDetails()&&M(t.columns).length)throw Error("Having both detail template and locked columns is not supported");t.table.on(st+Be,".k-hierarchy-cell .k-i-expand, .k-hierarchy-cell .k-i-collapse",function(n){var i,r,o=e(this),a=o.hasClass("k-i-expand"),s=o.closest("tr.k-master-row"),l=t.detailTemplate,d=t._hasDetails();return o.toggleClass("k-i-expand",!a).toggleClass("k-i-collapse",a),i=s.next(),d&&!i.hasClass("k-detail-row")&&(r=t.dataItem(s),i=e(l(r)).addClass(s.hasClass("k-alt")?"k-alt":"").insertAfter(s),t.angular("compile",function(){return{elements:i.get(),data:[{dataItem:r}]}}),t.trigger(Ue,{masterRow:s,detailRow:i,data:r,detailCell:i.find(".k-detail-cell")})),t.trigger(a?Xe:Je,{masterRow:s,detailRow:i}),i.toggle(a),t._current&&t._current.attr("aria-expanded",a),n.preventDefault(),!1})},dataItem:function(t){if(t=e(t)[0],!t)return null;var n,i,r=this.tbody.children(),o=/k-grouping-row|k-detail-row|k-group-footer/,a=t.sectionRowIndex;for(i=a,n=0;n<a;n++)o.test(r[n].className)&&i--;return this._data[i]},expandRow:function(t){e(t).find("> td .k-i-expand").click()},collapseRow:function(t){e(t).find("> td .k-i-collapse").click()},_createHeaderCells:function(e,n){var r,o,a,s,l,d,c=this,u="",h=L(c.columns);for(r=0,s=e.length;r<s;r++)o=e[r].column||e[r],a=c._headerCellText(o),l="",d=Te(o,h),o.command?(u+="<th scope='col'"+i(o.headerAttributes),n&&!e[r].colSpan&&(u+=" rowspan='"+n+"'"),d>-1&&(u+=ue.attr("index")+"='"+d+"'"),u+=">"+a+"</th>"):(o.field&&(l=ue.attr("field")+"='"+o.field+"' "),u+="<th scope='col' role='columnheader' "+l,u+=" aria-haspopup='true'",n&&!e[r].colSpan&&(u+=" rowspan='"+n+"'"),e[r].colSpan>1&&(u+='colspan="'+(e[r].colSpan-D(o.columns))+'" ',u+=ue.attr("colspan")+"='"+e[r].colSpan+"'"),o.title&&(u+=ue.attr("title")+'="'+o.title.replace('"',"&quot;").replace(/'/g,"'")+'" '),o.groupable!==t&&(u+=ue.attr("groupable")+"='"+o.groupable+"' "),o.aggregates&&o.aggregates.length&&(u+=ue.attr("aggregates")+"='"+o.aggregates+"'"),d>-1&&(u+=ue.attr("index")+"='"+d+"'"),u+=i(o.headerAttributes),u+=">"+a+"</th>");return u},_appendLockedColumnContent:function(){var t,n,i,r,o,a=this.columns,s=this.table.find("colgroup"),l=s.find("col:not(.k-group-col,.k-hierarchy-col)"),d=e(),c=0,u=0;for(t=0,n=a.length;t<n;t++)if(a[t].locked)if(f(a[t])){for(r=1,a[t].columns&&(r=L(a[t].columns).length-D(a[t].columns)),r=r||1,o=0;o<r;o++)d=d.add(l.eq(t+u+o-c));u+=r-1}else c++;i=e('<div class="k-grid-content-locked"><table'+(Ct?' cellspacing="0"':"")+"><colgroup/><tbody></tbody></table></div>"),s.detach(),i.find("colgroup").append(d),s.insertBefore(this.table.find("tbody")),this.lockedContent=i.insertBefore(this.content),this.lockedTable=i.children("table")},_appendLockedColumnFooter:function(){var t,n,i=this,r=i.footer,o=r.find(".k-footer-template>td"),a=r.find(".k-grid-footer-wrap>table>colgroup>col"),s=e('<div class="k-grid-footer-locked"><table><colgroup /><tbody><tr class="k-footer-template"></tr></tbody></table></div>'),l=i._groups(),d=e(),c=e();for(d=d.add(o.filter(".k-group-cell")),t=0,n=L(M(i.columns)).length;t<n;t++)d=d.add(o.eq(t+l));for(c=c.add(a.filter(".k-group-col")),t=0,n=p(L(N(i.columns))).length;t<n;t++)c=c.add(a.eq(t+l));d.appendTo(s.find("tr")),c.appendTo(s.find("colgroup")),i.lockedFooter=s.prependTo(r)},_appendLockedColumnHeader:function(t){var n,i,r,o,a,s,l,d,c,u,h,p=this,g=this.columns,v=[],_=0,b=e(),k=p._hasFilterRow(),w=0,y=e(),x=0,C=e(),T=p.thead.prev().find("col:not(.k-group-col,.k-hierarchy-col)"),S=p.thead.find("tr:first .k-header:not(.k-group-cell,.k-hierarchy-cell)"),E=p.thead.find(".k-filter-row").find("th:not(.k-group-cell,.k-hierarchy-cell)"),R=0;for(n=0,r=g.length;n<r;n++){if(g[n].locked){if(l=S.eq(n),x=L(g[n].columns||[]).length,f(g[n])){for(d=null,g[n].columns&&(d=x-D(g[n].columns)),d=d||1,c=0;c<d;c++)b=b.add(T.eq(n+R+c-_));R+=d-1}for(A([g[n]],V(l),v,0,0),x=x||1,u=0;u<x;u++)y=y.add(E.eq(w+u));w+=x}g[n].columns&&(_+=D(g[n].columns)),f(g[n])||_++}if(v.length){for(i='<div class="k-grid-header-locked" style="width:1px"><table'+(Ct?' cellspacing="0"':"")+"><colgroup/><thead>",i+=Array(v.length+1).join("<tr></tr>"),i+=(k?'<tr class="k-filter-row" />':"")+"</thead></table></div>",s=e(i),T=s.find("colgroup"),T.append(p.thead.prev().find("col.k-group-col").add(b)),o=s.find("thead tr:not(.k-filter-row)"),n=0,r=v.length;n<r;n++)C=m(v[n]),o.eq(n).append(p.thead.find("tr:eq("+n+") .k-group-cell").add(C));return h=I(this.thead),v.length<h&&F(s,h-v.length),a=s.find(".k-filter-row"),a.append(p.thead.find(".k-filter-row .k-group-cell").add(y)),this.lockedHeader=s.prependTo(t),this.thead.find(".k-group-cell").remove(),!0}return!1},_removeLockedContainers:function(){var e=this.lockedHeader.add(this.lockedContent).add(this.lockedFooter);ue.destroy(e),e.off(Be).remove(),this.lockedHeader=this.lockedContent=this.lockedFooter=null,this.selectable=null},_thead:function(){var t,n,i,r,o,a,s,l=this,d=l.columns,c=l._hasDetails()&&d.length,u=l._hasFilterRow(),h="",f=l.table.find(">thead"),p=l.element.find("thead:first").length>0;if(f.length||(f=e("<thead/>").insertBefore(l.tbody)),l.lockedHeader&&l.thead?(n=l.thead.find("tr:has(th):not(.k-filter-row)").html(""),n.remove(),n=e(),l._removeLockedContainers()):n=l.element.find(p?"thead:first tr:has(th):not(.k-filter-row)":"tr:has(th):first"),!n.length&&(n=f.children().first(),!n.length)){for(i=[{rowSpan:1,cells:[],index:0}],l._prepareColumns(i,d),t=0;t<i.length;t++)h+="<tr>",c&&(h+='<th class="k-hierarchy-cell" scope="col">&nbsp;</th>'),h+=l._createHeaderCells(i[t].cells,i[t].rowSpan),h+="</tr>";n=e(h)}u&&(r=e("<tr/>"),r.addClass("k-filter-row"),(c||n.find(".k-hierarchy-cell").length)&&r.prepend('<th class="k-hierarchy-cell" scope="col">&nbsp;</th>'),o=(l.thead||f).find(".k-filter-row"),o.length&&(ue.destroy(o),o.remove()),f.append(r)),n.children().length?c&&!n.find(".k-hierarchy-cell")[0]&&n.prepend('<th class="k-hierarchy-cell" scope="col">&nbsp;</th>'):(h="",c&&(h+='<th class="k-hierarchy-cell" scope="col">&nbsp;</th>'),h+=l._createHeaderCells(d),n.html(h)),n.attr("role","row").find("th").addClass("k-header"),l.options.scrollable||f.addClass("k-grid-header"),n.find("script").remove().end().prependTo(f),l.thead&&l._destroyColumnAttachments(),this.angular("cleanup",function(){return{elements:f.find("th").get()}}),this.angular("compile",function(){return{elements:f.find("th").get(),data:ye(d,function(e){return{column:e}})}}),l.thead=f.attr("role","rowgroup"),l._sortable(),l._filterable(),l._filterRow(),l._scrollable(),l._updateCols(),l._columnMenu(),s=this.options.scrollable&&M(this.columns).length,s&&(a=l._appendLockedColumnHeader(l.thead.closest(".k-grid-header")),l._appendLockedColumnContent(),l.lockedContent.bind("DOMMouseScroll"+Be+" mousewheel"+Be,De(l._wheelScroll,l))),l._updateColumnCellIndex(),l._updateFirstColumnClass(),l._resizable(),l._draggable(),l._reorderable(),l._updateHeader(l._groups()),s&&(a&&l._syncLockedHeaderHeight(),l._applyLockedContainersWidth()),l.groupable&&l._attachGroupable()},_retrieveFirstColumn:function(t,n){var i,r=e();if(n.length&&t[0]){for(i=t[0];i.columns&&i.columns.length;)i=i.columns[0],n=n.filter(":not(:first())");r=r.add(n)}return r},_updateFirstColumnClass:function(){var t,n,i=this,r=i.columns||[],o=i._hasDetails()&&r.length;o||i._groups()||(t=i.thead.find(">tr:not(.k-filter-row):not(:first)"),r=z(r),n=i._retrieveFirstColumn(r,t),i._isLocked()&&(t=i.lockedHeader.find("thead>tr:not(.k-filter-row):not(:first)"),r=M(i.columns),n=n.add(i._retrieveFirstColumn(r,t))),n.each(function(){var t=e(this).find("th");t.removeClass("k-first"),t.eq(0).addClass("k-first")}))},_prepareColumns:function(e,t,n,i){var r,o,a=i||e[e.length-1],s=e[a.index+1],l=0;for(r=0;r<t.length;r++)o={column:t[r],colSpan:0},a.cells.push(o),t[r].columns&&t[r].columns.length&&(s||(s={rowSpan:0,cells:[],index:e.length},e.push(s)),o.colSpan=t[r].columns.length,this._prepareColumns(e,t[r].columns,o,s),l+=o.colSpan-1,a.rowSpan=e.length-a.index);n&&(n.colSpan+=l)},_wheelScroll:function(e){var t,n,i;e.ctrlKey||(t=this.content,this.options.scrollable.virtual&&(t=this.virtualScrollable.verticalScrollbar),n=t.scrollTop(),i=ue.wheelDeltaY(e),i&&(e.preventDefault(),t.scrollTop(n+-i)))},_isLocked:function(){return null!=this.lockedHeader},_updateHeaderCols:function(){var e=this.thead.parent().add(this.table);this._isLocked()?j(e,P(H(this.columns)),this._hasDetails(),0):j(e,P(p(this.columns)),this._hasDetails(),0)},_updateCols:function(e){e=e||this.thead.parent().add(this.table),this._appendCols(e,this._isLocked())},_updateLockedCols:function(e){this._isLocked()&&(e=e||this.lockedHeader.find("table").add(this.lockedTable),j(e,P(N(this.columns)),this._hasDetails(),this._groups()))},_appendCols:function(e,t){t?j(e,P(H(this.columns)),this._hasDetails(),0):j(e,P(p(this.columns)),this._hasDetails(),this._groups())},_autoColumns:function(e){if(e&&e.toJSON){var t,n,i=this;e=e.toJSON(),n=!(i.table.find("tbody tr").length>0&&(!i.dataSource||!i.dataSource.transport));for(t in e)i.columns.push({field:t,encoded:n,headerAttributes:{id:ue.guid()}});i._thead(),i._templates()}},_rowsHtml:function(e,t){var n,i,r=this,o="",a=t.rowTemplate,s=t.altRowTemplate;for(n=0,i=e.length;n<i;n++)o+=n%2?s(e[n]):a(e[n]),r._data.push(e[n]);return o},_groupRowHtml:function(e,t,n,i,r,o){var a,s,l,d,c=this,u="",h=e.field,f=xe(L(c.columns),function(e){return e.field==h})[0]||{},p=f.groupHeaderTemplate,m=(f.title||h)+": "+Y(e.value,f.format,f.values,f.encoded),g=c._groupAggregatesDefaultObject||{},v=we({},g,e.aggregates),_=we({},{field:e.field,value:e.value,aggregates:v},e.aggregates[e.field]),b=r.groupFooterTemplate,k=e.items;if(p&&(m=typeof p===ct?p(_):ue.template(p)(_)),u+=i(t,n,m),e.hasSubgroups)for(a=0,s=k.length;a<s;a++)u+=c._groupRowHtml(k[a],o?t:t-1,n+1,i,r,o);else u+=c._rowsHtml(k,r);if(b){l={};for(d in v)l[d]=we({},v[d],{group:{field:e.field,value:e.value}});u+=b(l)}return u},collapseGroup:function(t){var n,i,r,o,a,s,l,d,c,u;for(t=e(t),i=this.options.groupable,r=i.showFooter,o=r?0:1,s=e(),this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?s=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(s=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-i-collapse").addClass("k-i-expand").removeClass("k-i-collapse"),t.find("td[aria-expanded='true']:first").attr("aria-expanded",!1),t=t.nextAll("tr"),u=[],l=0,d=t.length;l<d&&(c=t.eq(l),a=c.find(".k-group-cell").length,c.hasClass("k-grouping-row")?o++:c.hasClass("k-group-footer")&&o--,!(a<=n||c.hasClass("k-group-footer")&&o<0));l++)s.length&&u.push(s[l]),u.push(c[0]);e(u).hide()},expandGroup:function(t){t=e(t);var n,i,r,o,a,s=this,l=s.options.groupable.showFooter,d=e(),c=[],u=1;for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?d=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(d=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-i-expand").addClass("k-i-collapse").removeClass("k-i-expand"),t.find("td[aria-expanded='false']:first").attr("aria-expanded",!0),t=t.nextAll("tr"),o=0,a=t.length;o<a&&(i=t.eq(o),r=i.find(".k-group-cell").length,!(r<=n));o++)r!=n+1||i.hasClass("k-detail-row")||(i.show(),d.eq(o).show(),i.hasClass("k-grouping-row")&&i.find(".k-icon").hasClass("k-i-collapse")&&s.expandGroup(i),i.hasClass("k-master-row")&&i.find(".k-icon").hasClass("k-i-collapse")&&(i.next().show(),d.eq(o+1).show())),i.hasClass("k-grouping-row")&&(l&&c.push(i.is(":visible")),u++),i.hasClass("k-group-footer")&&(l&&i.toggle(c.pop()),1==u?(i.show(),d.eq(o).show()):u--)},_updateHeader:function(t){var n=this,i=n._isLocked()?n.lockedHeader.find("thead"):n.thead,r=i.find("tr.k-filter-row").find("th.k-group-cell").length,o=i.find("tr:first").find("th.k-group-cell").length,a=i.children("tr:not(:first)").filter(function(){return!e(this).children(":visible").length});t>o?(e(Array(t-o+1).join('<th class="k-group-cell k-header" scope="col">&nbsp;</th>')).prependTo(i.children("tr:not(.k-filter-row)")),n.element.is(":visible")&&a.find("th.k-group-cell").hide()):t<o&&i.find("tr").each(function(){e(this).find("th.k-group-cell").filter(":eq("+t+"),:gt("+t+")").remove()}),t>r&&e(Array(t-r+1).join('<th class="k-group-cell k-header" scope="col">&nbsp;</th>')).prependTo(i.find(".k-filter-row"))},_firstDataItem:function(e,t){return e&&t&&(e=e.hasSubgroups?this._firstDataItem(e.items[0],t):e.items[0]),e},_updateTablesWidth:function(){var t,n=this;n._isLocked()&&(t=e(">.k-grid-footer>.k-grid-footer-wrap>table",n.wrapper).add(n.thead.parent()).add(n.table),n._footerWidth=te(t.eq(0)),t.width(n._footerWidth),t=e(">.k-grid-footer>.k-grid-footer-locked>table",n.wrapper).add(n.lockedHeader.find(">table")).add(n.lockedTable),t.width(te(t.eq(0))))},hideColumn:function(n){var i,r,o,s,l,d,c,m,g,v,_=this,b=0,k=_.footer||_.wrapper.find(".k-grid-footer"),w=_.columns,y=_.lockedHeader?B(_.lockedHeader.find(">table>thead")).filter(h).length:0;if(n="number"==typeof n?w[n]:ke(n)?xe(S(w),function(e){return e===n})[0]:xe(S(w),function(e){return e.field===n})[0],n&&f(n)){if(n.columns&&n.columns.length){for(d=C(n,w),u(n,!1),K(a(e(">table>thead",_.lockedHeader),_.thead,">tr:eq("+d.row+")>th"),d.cell,!1),o=0;o<n.columns.length;o++)this.hideColumn(n.columns[o]);return _.trigger(Ge,{column:n}),t}if(g=Te(n,p(L(w))),u(n,!1),_._setParentsVisibility(n,!1),_._templates(),_._updateCols(),_._updateLockedCols(),v=_.thead,c=g,_.lockedHeader&&y>g?v=_.lockedHeader.find(">table>thead"):c-=y,i=B(v).filter(h).eq(c),i[0].style.display="none",K(a(e(">table>thead",_.lockedHeader),_.thead,">tr.k-filter-row>th"),g,!1),k[0]&&(_._updateCols(k.find(">.k-grid-footer-wrap>table")),_._updateLockedCols(k.find(">.k-grid-footer-locked>table")),K(k.find(".k-footer-template>td"),g,!1)),_.lockedTable&&y>g?Q(_.lockedTable.find(">tbody>tr"),g):Q(_.tbody.children(),g-y),_.lockedTable)_._updateTablesWidth(),_._applyLockedContainersWidth(),_._syncLockedContentHeight(),_._syncLockedHeaderHeight(),_._syncLockedFooterHeight();else{for(s=_.thead.prev().find("col"),o=0,m=s.length;o<m;o+=1){if(l=s[o].style.width,!l||l.indexOf("%")!=-1){b=0;break}b+=parseInt(l,10)}r=e(">.k-grid-header table:first,>.k-grid-footer table:first",_.wrapper).add(_.table),_._footerWidth=null,b&&(r.each(function(){this.style.width=b+"px"}),_._footerWidth=b),xt.msie&&8==xt.version&&(r.css("display","inline-table"),setTimeout(function(){r.css("display","table")},1))}_._updateFirstColumnClass(),_.trigger(Ge,{column:n})}},_setParentsVisibility:function(t,n){var i,r,o,s,l,d=this.columns,h=[],f=n?function(e){return p(e.columns).length&&e.hidden}:function(e){return!p(e.columns).length&&!e.hidden};if(c(t,d,h)&&h.length)for(i=h.length-1;i>=0;i--)r=h[i],o=w(r,d),s=a(e(">table>thead",this.lockedHeader),this.thead,">tr:eq("+o.row+")>th:not(.k-group-cell):not(.k-hierarchy-cell)").eq(o.cell),f(r)&&(u(r,n),s[0].style.display=n?"":"none"),s.filter("["+ue.attr("colspan")+"]").length&&(l=parseInt(s.attr(ue.attr("colspan")),10),s[0].colSpan=l-D(r.columns)||1)},showColumn:function(n){var i,r,o,s,l,d,c,h,p,m,g,v=this,_=v.columns,b=v.footer||v.wrapper.find(".k-grid-footer"),k=v.lockedHeader?B(v.lockedHeader.find(">table>thead")).length:0;if(n="number"==typeof n?_[n]:ke(n)?xe(S(_),function(e){return e===n})[0]:xe(S(_),function(e){return e.field===n})[0],n&&!f(n)){if(n.columns&&n.columns.length){for(c=w(n,_),u(n,!0),K(a(e(">table>thead",v.lockedHeader),v.thead,">tr:eq("+c.row+")>th"),c.cell,!0),i=0;i<n.columns.length;i++)this.showColumn(n.columns[i]);return v.trigger(Ye,{column:n}),t}if(m=Te(n,L(_)),u(n,!0),v._setParentsVisibility(n,!0),v._templates(),v._updateCols(),v._updateLockedCols(),g=v.thead,d=m,v.lockedHeader&&k>m?g=v.lockedHeader.find(">table>thead"):d-=k,o=B(g).eq(d),o[0].style.display="",K(a(e(">table>thead",v.lockedHeader),v.thead,">tr.k-filter-row>th"),m,!0),b[0]&&(v._updateCols(b.find(">.k-grid-footer-wrap>table")),v._updateLockedCols(b.find(">.k-grid-footer-locked>table")),K(b.find(".k-footer-template>td"),m,!0)),v.lockedTable&&k>m?Z(v.lockedTable.find(">tbody>tr"),m):Z(v.tbody.children(),m-k),v.lockedTable)v._updateTablesWidth(),v._applyLockedContainersWidth(),v._syncLockedContentHeight(),v._syncLockedHeaderHeight();else if(s=e(">.k-grid-header table:first,>.k-grid-footer table:first",v.wrapper).add(v.table),n.width){for(l=0,p=v.thead.prev().find("col"),i=0,r=p.length;i<r;i+=1){if(h=p[i].style.width,h.indexOf("%")>-1){l=0;break}l+=parseInt(h,10)}v._footerWidth=null,l&&(s.each(function(){this.style.width=l+"px"}),v._footerWidth=l)}else s.width("");v._updateFirstColumnClass(),v.trigger(Ye,{column:n})}},_progress:function(e){var t=this.element;this.lockedContent?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content),ue.ui.progress(t,e)},_resize:function(e,t){this._syncLockedContentHeight(),this._syncLockedHeaderHeight(),this.content&&(this._setContentWidth(),this._setContentHeight()),this.virtualScrollable&&(t||this._rowHeight)&&(t&&(this._rowHeight=null),this.virtualScrollable.repaintScrollbar())},_isActiveInTable:function(){var t=me();return!!t&&(this.table[0]===t||e.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||e.contains(this.lockedTable[0],t)))},refresh:function(t){var n,i=this,r=i.dataSource.view(),o=i.options.navigatable,a=e(i.current()),s=!1,l=(i.dataSource.group()||[]).length,d=l+P(p(i.columns)).length;t&&"itemchange"===t.action&&i.editable||(t&&"remove"===t.action&&i.editable&&i.editable.options.model&&Te(i.editable.options.model,t.items)>-1&&i.editable.options.model.unbind($e,i._modelChangeHandler),t=t||{},i.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items})||(i._angularItems("cleanup"),o&&(i._isActiveInTable()||i._editContainer&&i._editContainer.data("kendoWindow"))&&(s=a.is("th"),n=Math.max(i.cellIndex(a),0)),i._destroyEditable(),i._progress(!1),i._hideResizeHandle(),i._data=[],i.columns.length||(i._autoColumns(i._firstDataItem(r[0],l)),d=l+i.columns.length),i._group=l>0||i._group,i._group&&(i._templates(),i._updateCols(),i._updateLockedCols(),i._updateHeader(l),i._group=l>0),i._renderContent(r,d,l),i._renderLockedContent(r,d,l),i._footer(),i._renderNoRecordsContent(),i._setContentHeight(),i._setContentWidth(i.content&&i.content.scrollLeft()),i.lockedTable&&(i.options.scrollable.virtual?i.content.find(">.k-virtual-scrollable-wrap").trigger("scroll"):i.touchScroller?i.touchScroller.movable.trigger("change"):(i.wrapper.one("scroll",function(e){e.stopPropagation()}),i.content.trigger("scroll"))),i._restoreCurrent(n,s),i.touchScroller&&i.touchScroller.contentResized(),i.selectable&&i.selectable.resetTouchEvents(),i._muteAngularRebind(function(){i._angularItems("compile")}),i.trigger(Qe)))},_restoreCurrent:function(n,i){var r,o,a;n===t||n<0||(this._removeCurrent(),i?this._setCurrent(this.thead.find("th:not(.k-group-cell)").eq(n)):(r=0,this._rowVirtualIndex?r=this.virtualScrollable.position(this._rowVirtualIndex):n=0,o=e(),this.lockedTable&&(o=this.lockedTable.find(">tbody>tr").eq(r)),o=o.add(this.tbody.children().eq(r)),a=o.find(">td:not(.k-group-cell):not(.k-hierarchy-cell)").eq(n),this._setCurrent(a)),this._current&&oe(this._current.closest("table")[0],!0))},_angularItems:function(e){ue.ui.DataBoundWidget.fn._angularItems.call(this,e),"cleanup"===e&&this._cleanupDetailItems(),this._angularGroupItems(e),this._angularGroupFooterItems(e)},_cleanupDetailItems:function(){var e=this;e._hasDetails()&&(e.angular("cleanup",function(){return{elements:e.tbody.children(".k-detail-row")}}),e.tbody.find(".k-detail-cell").empty())},_angularGroupItems:function(t){var n=this,i=n.tbody;n.lockedContent&&(i=n.lockedTable.find("tbody")),n._group&&n.angular(t,function(){return{elements:i.children(".k-grouping-row"),data:e.map(X(n.dataSource.view()),function(e){return{dataItem:e}})}})},_angularGroupFooterItems:function(t){var n=this,i=n.tbody;n.lockedContent&&(i=n.element),n._group&&n.groupFooterTemplate&&n.angular(t,function(){return{elements:i.find(".k-group-footer"),data:e.map(J(n.dataSource.view()),function(e){return{dataItem:e}})}})},_renderContent:function(e,t,n){var i,r,o=this,a="",s=null!=o.lockedContent,l={rowTemplate:o.rowTemplate,altRowTemplate:o.altRowTemplate,groupFooterTemplate:o.groupFooterTemplate};if(t=s?t-P(N(o.columns)).length:t,n>0)for(t=s?t-n:t,o.detailTemplate&&t++,o.groupFooterTemplate&&(o._groupAggregatesDefaultObject=o.dataSource.aggregates()),i=0,r=e.length;i<r;i++)a+=o._groupRowHtml(e[i],t,0,s?ce:de,l,s);else a+=o._rowsHtml(e,l);o.tbody=W(o.tbody,o.table,a,this.options.$angular)},_renderLockedContent:function(e,t,n){var i,r,o,a="",s={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate};if(this.lockedContent){if(o=this.lockedTable,n>0)for(t-=p(L(z(this.columns))).length,i=0,r=e.length;i<r;i++)a+=this._groupRowHtml(e[i],t,0,de,s);else a=this._rowsHtml(e,s);W(o.children("tbody"),o,a,this.options.$angular),this._syncLockedContentHeight()}},_adjustRowsHeight:function(e,t){var n,i,r,o,a=e[0].rows,s=a.length,l=t[0].rows,d=e.add(t),c=d.length,u=[];for(n=0;n<s&&l[n];n++)a[n].style.height&&(a[n].style.height=l[n].style.height="");for(n=0;n<s&&l[n];n++)i=a[n].offsetHeight,r=l[n].offsetHeight,o=0,i>r?o=i:i<r&&(o=r),u.push(o);for(n=0;n<c;n++)d[n].style.display="none";for(n=0;n<s;n++)u[n]&&(a[n].style.height=l[n].style.height=u[n]+1+"px");for(n=0;n<c;n++)d[n].style.display=""}});ue.ExcelMixin&&ue.ExcelMixin.extend(Et.prototype),ue.PDFMixin&&(ue.PDFMixin.extend(Et.prototype),Et.prototype._drawPDF_autoPageBreak=function(n){function i(){u&&s!==t?(c.one("change",r),c.page(s)):(l.refresh(),r())}function r(){f.appendTo(document.body);var t=e.extend({},l.options.pdf,{_destructive:!0,progress:function(e){n.notify({page:e.page,pageNumber:e.pageNum,progress:.5+e.pageNum/e.totalPages/2,totalPages:e.totalPages})}});ue.drawing.drawDOM(p,t).always(function(){f.remove()}).then(function(e){d.resolve(e)}).fail(function(e){d.reject(e)})}function o(){var e=c.page(),t=u?c.totalPages():1;a.append(h.find("tr")),e<t?c.page(e+1):(c.unbind("change",o),i())}var a,s,l=this,d=new e.Deferred,c=l.dataSource,u=l.options.pdf.allPages,h=l.wrapper.find(".k-grid-content tbody"),f=e("<div>").css({position:"absolute",left:-1e4,top:-1e4}),p=l.wrapper.clone().css({height:"auto",width:"auto"}).appendTo(f);return p.find(".k-grid-content").css({height:"auto",width:"auto",overflow:"visible"}),p.find(".k-grid-pager, .k-grid-toolbar, .k-grouping-header").remove(),p.find(".k-grid-header").css({paddingRight:0}),this._initPDFProgress(n),a=p.find(".k-grid-content tbody").empty(),s=c.page(),u?(c.bind("change",o),c.page(1)):o(),d.promise()},Et.prototype._drawPDF=function(n){function i(){s&&d!==t?(a.unbind("change",r),a.one("change",function(){o.resolve(l)}),a.page(d)):o.resolve(l)}function r(){c._drawPDFShadow({width:c.wrapper.width()},{avoidLinks:c.options.pdf.avoidLinks}).done(function(e){var t=a.page(),r=s?a.totalPages():1,o={page:e,pageNumber:t,progress:t/r,totalPages:r};n.notify(o),l.append(o.page),t<r?a.page(t+1):i()}).fail(function(e){o.reject(e)})}var o,a,s,l,d,c=this;return c.options.pdf.paperSize&&"auto"!=c.options.pdf.paperSize?c._drawPDF_autoPageBreak(n):(o=new e.Deferred,a=c.dataSource,s=c.options.pdf.allPages,this._initPDFProgress(n),l=new ue.drawing.Group,d=a.page(),s?(a.bind("change",r),a.page(1)):r(),o.promise())},Et.prototype._initPDFProgress=function(t){var n,i=e("<div class='k-loading-pdf-mask'><div class='k-loading-color'/></div>");i.prepend(this.wrapper.clone().css({position:"absolute",top:0,left:0})),this.wrapper.append(i),n=e("<div class='k-loading-pdf-progress'>").appendTo(i).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar"),t.progress(function(e){n.value(e.progress)}).always(function(){ue.destroy(i),i.remove()})}),he.plugin(Et),he.plugin(St)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.listview.min",["kendo.data.min","kendo.editable.min","kendo.selectable.min"],e)}(function(){return function(e,t){var n=window.kendo,i="change",r="cancel",o="dataBound",a="dataBinding",s=n.ui.Widget,l=n.keys,d=">*:not(.k-loading-mask)",c="progress",u="error",h="k-state-focused",f="k-state-selected",p="k-edit-item",m="edit",g="remove",v="save",_="click",b=".kendoListView",k=e.proxy,w=n._activeElement,y=n.ui.progress,x=n.data.DataSource,C=n.ui.DataBoundWidget.extend({init:function(t,i){var r=this;i=e.isArray(i)?{dataSource:i}:i,s.fn.init.call(r,t,i),i=r.options,r.wrapper=t=r.element,t[0].id&&(r._itemId=t[0].id+"_lv_active"),r._element(),r._dataSource(),r._templates(),r._navigatable(),r._selectable(),r._pageable(),r._crudHandlers(),r.options.autoBind&&r.dataSource.fetch(),n.notify(r)},events:[i,r,a,o,m,g,v],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},setOptions:function(e){s.fn.setOptions.call(this,e),this._templates(),this.selectable&&(this.selectable.destroy(),this.selectable=null),this._selectable()},_templates:function(){var e=this.options;this.template=n.template(e.template||""),this.altTemplate=n.template(e.altTemplate||e.template),this.editTemplate=n.template(e.editTemplate||"")},_item:function(e){return this.element.children()[e]()},items:function(){return this.element.children()},dataItem:function(t){var i=n.attr("uid"),r=e(t).closest("["+i+"]").attr(i);return this.dataSource.getByUid(r)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},_unbindDataSource:function(){var e=this;e.dataSource.unbind(i,e._refreshHandler).unbind(c,e._progressHandler).unbind(u,e._errorHandler)},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=k(e.refresh,e),e._progressHandler=k(e._progress,e),e._errorHandler=k(e._error,e)),e.dataSource=x.create(e.options.dataSource).bind(i,e._refreshHandler).bind(c,e._progressHandler).bind(u,e._errorHandler)},_progress:function(){y(this.element,!0)},_error:function(){y(this.element,!1)},_element:function(){this.element.addClass("k-widget k-listview").attr("role","listbox")},refresh:function(e){var i,r,s,l,d,c=this,u=c.dataSource.view(),h="",f=c.template,p=c.altTemplate,m=w();if(e=e||{},"itemchange"===e.action)return c._hasBindingTarget()||c.editable||(i=e.items[0],s=c.items().filter("["+n.attr("uid")+"="+i.uid+"]"),s.length>0&&(l=s.index(),c.angular("cleanup",function(){return{elements:[s]}}),s.replaceWith(f(i)),s=c.items().eq(l),s.attr(n.attr("uid"),i.uid),c.angular("compile",function(){return{elements:[s],data:[{dataItem:i}]}}),c.trigger("itemChange",{item:s,data:i}))),t;if(!c.trigger(a,{action:e.action||"rebind",items:e.items,index:e.index})){for(c._angularItems("cleanup"),c._destroyEditable(),l=0,d=u.length;l<d;l++)h+=l%2?p(u[l]):f(u[l]);for(c.element.html(h),r=c.items(),l=0,d=u.length;l<d;l++)r.eq(l).attr(n.attr("uid"),u[l].uid).attr("role","option").attr("aria-selected","false");c.element[0]===m&&c.options.navigatable&&c.current(r.eq(0)),c._angularItems("compile"),c.trigger(o)}},_pageable:function(){var t,i,r=this,o=r.options.pageable;e.isPlainObject(o)&&(i=o.pagerId,t=e.extend({},o,{dataSource:r.dataSource,pagerId:null}),r.pager=new n.ui.Pager(e("#"+i),t))},_selectable:function(){var e,r,o=this,a=o.options.selectable,s=o.options.navigatable;a&&(e=n.ui.Selectable.parseOptions(a).multiple,o.selectable=new n.ui.Selectable(o.element,{aria:!0,multiple:e,filter:d,change:function(){o.trigger(i)}}),s&&o.element.on("keydown"+b,function(n){if(n.keyCode===l.SPACEBAR){if(r=o.current(),n.target==n.currentTarget&&n.preventDefault(),e)if(n.ctrlKey){if(r&&r.hasClass(f))return r.removeClass(f),t}else o.selectable.clear();else o.selectable.clear();o.selectable.value(r)}}))},current:function(e){var n=this,i=n.element,r=n._current,o=n._itemId;return e===t?r:(r&&r[0]&&(r[0].id===o&&r.removeAttr("id"),r.removeClass(h),i.removeAttr("aria-activedescendant")),e&&e[0]&&(o=e[0].id||o,n._scrollTo(e[0]),i.attr("aria-activedescendant",o),e.addClass(h).attr("id",o)),n._current=e,t)},_scrollTo:function(t){var n,i,r=this,o=!1,a="scroll";"auto"==r.wrapper.css("overflow")||r.wrapper.css("overflow")==a?n=r.wrapper[0]:(n=window,o=!0),i=function(i,r){var s=o?e(t).offset()[i.toLowerCase()]:t["offset"+i],l=t["client"+r],d=e(n)[a+i](),c=e(n)[r.toLowerCase()]();s+l>d+c?e(n)[a+i](s+l-c):s<d&&e(n)[a+i](s)},i("Top","Height"),i("Left","Width")},_navigatable:function(){var t=this,i=t.options.navigatable,r=t.element,o=function(n){t.current(e(n.currentTarget)),e(n.target).is(":button,a,:input,a>.k-icon,textarea")||r.focus()};i&&(t._tabindex(),r.on("focus"+b,function(){var e=t._current;e&&e.is(":visible")||(e=t._item("first")),t.current(e)}).on("focusout"+b,function(){t._current&&t._current.removeClass(h)}).on("keydown"+b,function(i){var o,a,s=i.keyCode,d=t.current(),c=e(i.target),u=!c.is(":button,textarea,a,a>.t-icon,input"),h=c.is(":text,:password"),f=n.preventDefault,m=r.find("."+p),g=w();if(!(!u&&!h&&l.ESC!=s||h&&l.ESC!=s&&l.ENTER!=s))if(l.UP===s||l.LEFT===s)d&&(d=d.prev()),t.current(d&&d[0]?d:t._item("last")),f(i);else if(l.DOWN===s||l.RIGHT===s)d&&(d=d.next()),t.current(d&&d[0]?d:t._item("first")),f(i);else if(l.PAGEUP===s)t.current(null),t.dataSource.page(t.dataSource.page()-1),f(i);else if(l.PAGEDOWN===s)t.current(null),t.dataSource.page(t.dataSource.page()+1),f(i);else if(l.HOME===s)t.current(t._item("first")),f(i);else if(l.END===s)t.current(t._item("last")),f(i);else if(l.ENTER===s)0!==m.length&&(u||h)?(o=t.items().index(m),g&&g.blur(),t.save(),a=function(){t.element.trigger("focus"),t.current(t.items().eq(o))},t.one("dataBound",a)):""!==t.options.editTemplate&&t.edit(d);else if(l.ESC===s){
if(m=r.find("."+p),0===m.length)return;o=t.items().index(m),t.cancel(),t.element.trigger("focus"),t.current(t.items().eq(o))}}),r.on("mousedown"+b+" touchstart"+b,d,k(o,t)))},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(i)},select:function(n){var i=this,r=i.selectable;return n=e(n),n.length?(r.options.multiple||(r.clear(),n=n.first()),r.value(n),t):r.value()},_destroyEditable:function(){var e=this;e.editable&&(e.editable.destroy(),delete e.editable)},_modelFromElement:function(e){var t=e.attr(n.attr("uid"));return this.dataSource.getByUid(t)},_closeEditable:function(){var e,t,i,r=this,o=r.editable,a=r.template;return o&&(o.element.index()%2&&(a=r.altTemplate),r.angular("cleanup",function(){return{elements:[o.element]}}),e=r._modelFromElement(o.element),r._destroyEditable(),i=o.element.index(),o.element.replaceWith(a(e)),t=r.items().eq(i),t.attr(n.attr("uid"),e.uid),r._hasBindingTarget()&&n.bind(t,e),r.angular("compile",function(){return{elements:[t],data:[{dataItem:e}]}})),!0},edit:function(e){var t,i,r=this,o=r._modelFromElement(e),a=o.uid;r.cancel(),e=r.items().filter("["+n.attr("uid")+"="+a+"]"),i=e.index(),e.replaceWith(r.editTemplate(o)),t=r.items().eq(i).addClass(p).attr(n.attr("uid"),o.uid),r.editable=t.kendoEditable({model:o,clearContainer:!1,errorTemplate:!1,target:r}).data("kendoEditable"),r.trigger(m,{model:o,item:t})},save:function(){var e,t,n=this,i=n.editable;i&&(t=i.element,e=n._modelFromElement(t),i.end()&&!n.trigger(v,{model:e,item:t})&&(n._closeEditable(),n.dataSource.sync()))},remove:function(e){var t=this,n=t.dataSource,i=t._modelFromElement(e);t.editable&&(n.cancelChanges(t._modelFromElement(t.editable.element)),t._closeEditable()),t.trigger(g,{model:i,item:e})||(e.hide(),n.remove(i),n.sync())},add:function(){var e,t=this,n=t.dataSource,i=n.indexOf((n.view()||[])[0]);i<0&&(i=0),t.cancel(),e=n.insert(i,{}),t.edit(t.element.find("[data-uid='"+e.uid+"']"))},cancel:function(){var e,t,n=this,i=n.dataSource;n.editable&&(e=n.editable.element,t=n._modelFromElement(e),n.trigger(r,{model:t,container:e})||(i.cancelChanges(t),n._closeEditable()))},_crudHandlers:function(){var t=this,i=_+b;t.element.on(i,".k-edit-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.edit(r),i.preventDefault()}),t.element.on(i,".k-delete-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.remove(r),i.preventDefault()}),t.element.on(i,".k-update-button",function(e){t.save(),e.preventDefault()}),t.element.on(i,".k-cancel-button",function(e){t.cancel(),e.preventDefault()})},destroy:function(){var e=this;s.fn.destroy.call(e),e._unbindDataSource(),e._destroyEditable(),e.element.off(b),e.pager&&e.pager.destroy(),n.destroy(e.element)}});n.ui.plugin(C)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.upload.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(t){return e.map(i(t),function(e){return e.name}).join(", ")}function i(e){var t=e[0];return t.files?r(t.files):[{name:s(t.value),extension:a(t.value),size:null}]}function r(t){return e.map(t,function(e){return o(e)})}function o(e){var t=e.name||e.fileName;return{name:C.htmlEncode(t),extension:a(t),size:"number"==typeof e.size?e.size:e.fileSize,rawFile:e}}function a(e){var t=e.match(E);return t?t[0]:""}function s(e){var t=e.lastIndexOf("\\");return t!=-1?e.substr(t+1):e}function l(t,n){var i=C.guid();return e.map(t,function(e){return e.uid=n?C.guid():i,e})}function d(e,t){var n,i=c(t.allowedExtensions),r=t.maxFileSize,o=t.minFileSize;for(n=0;n<e.length;n++)u(e[n],i),h(e[n],o,r)}function c(t){var n=e.map(t,function(e){var t="."===e.substring(0,1)?e:"."+e;return t.toLowerCase()});return n}function u(t,n){n.length>0&&n.indexOf(t.extension.toLowerCase())<0&&(t.validationErrors=t.validationErrors||[],e.inArray(V,t.validationErrors)===-1&&t.validationErrors.push(V))}function h(t,n,i){0!==n&&t.size<n&&(t.validationErrors=t.validationErrors||[],e.inArray(O,t.validationErrors)===-1&&t.validationErrors.push(O)),0!==i&&t.size>i&&(t.validationErrors=t.validationErrors||[],e.inArray(B,t.validationErrors)===-1&&t.validationErrors.push(B))}function f(e){var t,n=0;if("number"!=typeof e[0].size)return"";for(t=0;t<e.length;t++)e[t].size&&(n+=e[t].size);return n/=1024,n<1024?n.toFixed(2)+" KB":(n/1024).toFixed(2)+" MB"}function p(t){return!t.multiple&&e(".k-file",t.wrapper).length>1}function m(n,i,r,o){var a,s;return i._supportsRemove()?(a=n.data("fileNames"),s=e.map(a,function(e){return e.name}),o===!1?(i._removeFileEntry(n),t):(i._submitRemove(s,r,function(e,t,r){var o=i.trigger(A,{operation:"remove",files:a,response:e,XMLHttpRequest:r});o||i._removeFileEntry(n)},function(e){p(i)&&i._removeFileEntry(n),i.trigger(M,{operation:"remove",files:a,XMLHttpRequest:e}),D("Server response: "+e.responseText)}),t)):(!p(i)&&o||i._removeFileEntry(n),t)}function g(t,n,i){var r=!1,o="";try{o=e.parseJSON(v(t)),r=!0}catch(a){i()}r&&n(o)}function v(e){return t!==e&&""!==e||(e="{}"),e}function _(e){e.stopPropagation(),e.preventDefault()}function b(e,t,n,i){var r,o;e.on("dragenter"+t,function(e){n(e),o=new Date,r||(r=setInterval(function(){var e=new Date-o;e>100&&(i(),clearInterval(r),r=null)},100))}).on("dragover"+t,function(){o=new Date})}function k(e){return e.is(".k-file-progress, .k-file-success, .k-file-error")}function w(t){return e(t.target).closest(".k-file")}var y,x,C=window.kendo,T=C.ui.Widget,S=C.antiForgeryTokens,D=C.logToConsole,E=/\.([^\.]+)$/,F=".kendoUpload",R="select",I="upload",A="success",M="error",z="complete",H="cancel",N="progress",P="remove",L="validationErrors",B="invalidMaxFileSize",O="invalidMinFileSize",V="invalidFileExtension",W=1e3,U=2e3,q={loading:"k-i-loading",warning:"k-i-warning",success:"k-i-tick"},j=T.extend({init:function(t,n){var i,r,o,a=this;T.fn.init.call(a,t,n),a.name=t.name,a.multiple=a.options.multiple,a.localization=a.options.localization,i=a.element,a.wrapper=i.closest(".k-upload"),0===a.wrapper.length&&(a.wrapper=a._wrapInput(i)),a._activeInput(i),a.toggle(a.options.enabled),r=a._ns=F+"-"+C.guid(),i.closest("form").on("submit"+r,e.proxy(a._onParentFormSubmit,a)).on("reset"+r,e.proxy(a._onParentFormReset,a)),a.options.async.saveUrl?(a._module=a._supportsFormData()?new x(a):new y(a),a._async=!0,o=a.options.files,o.length>0&&a._renderInitialFiles(o)):a._module=new $(a),a._supportsDrop()&&(""!==a.options.dropZone?a._setupCustomDropZone():a._setupDropZone()),a.wrapper.on("click",".k-upload-action",e.proxy(a._onFileAction,a)).on("click",".k-clear-selected",e.proxy(a._onClearSelected,a)).on("click",".k-upload-selected",e.proxy(a._onUploadSelected,a)),a.element.val()&&a._onInputChange({target:a.element})},events:[R,I,A,M,z,H,N,P],options:{name:"Upload",enabled:!0,multiple:!0,showFileList:!0,template:"",files:[],async:{removeVerb:"POST",autoUpload:!0,withCredentials:!0,accept:"*/*; q=0.5, application/json"},localization:{select:"Select files...",cancel:"Cancel",retry:"Retry",remove:"Remove",clearSelectedFiles:"Clear",uploadSelectedFiles:"Upload",dropFilesHere:"drop files here to upload",statusUploading:"uploading",statusUploaded:"uploaded",statusWarning:"warning",statusFailed:"failed",headerStatusUploading:"Uploading...",headerStatusUploaded:"Done",invalidMaxFileSize:"File size too large.",invalidMinFileSize:"File size too small.",invalidFileExtension:"File type not allowed."},validation:{allowedExtensions:[],maxFileSize:0,minFileSize:0},dropZone:""},setOptions:function(e){var t=this,n=t.element;T.fn.setOptions.call(t,e),t.multiple=t.options.multiple,n.attr("multiple",!!t._supportsMultiple()&&t.multiple),t.toggle(t.options.enabled)},enable:function(e){e=t===e||e,this.toggle(e)},disable:function(){this.toggle(!1)},toggle:function(e){e=t===e?e:!e,this.wrapper.toggleClass("k-state-disabled",e),this.element.prop("disabled",e)},destroy:function(){var t=this,n=e(t.options.dropZone);e(document).add(e(".k-dropzone",t.wrapper)).add(t.wrapper.closest("form")).off(t._ns),n.length>0&&n.off(t._ns),e(t.element).off(F),T.fn.destroy.call(t)},upload:function(){var e=this;e._module.onSaveSelected()},getFiles:function(){var t,n,i,r=this,o=[],a=r.wrapper.find(".k-file");for(n=0;n<a.length;n++)if(t=e(a[n]).data("fileNames"))for(i=0;i<t.length;i++)o.push(t[i]);return o},clearAllFiles:function(){var e=this,t=e.wrapper.find(".k-file");t.each(function(t,n){e._removeFileByDomElement(n,!1)})},removeAllFiles:function(){var e=this,t=e.wrapper.find(".k-file");t.each(function(t,n){e._removeFileByDomElement(n,!0)})},removeFileByUid:function(e){this._removeFileByUid(e,!0)},clearFileByUid:function(e){this._removeFileByUid(e,!1)},_removeFileByUid:function(t,n){var i,r=this;"string"==typeof t&&(i=e(".k-file["+C.attr("uid")+'="'+t+'"]',r.wrapper),i.length>0&&r._removeFileByDomElement(i,n))},clearFile:function(e){this._removeFile(e,!1)},removeFile:function(e){this._removeFile(e,!0)},_removeFile:function(t,n){var i,r=this,o=r.wrapper.find(".k-file");"function"==typeof t&&o.each(function(o,a){i=e(a).data("fileNames"),t(i)&&r._removeFileByDomElement(a,n)})},_removeFileByDomElement:function(t,n){var i,r=this,o={target:e(t,r.wrapper)};r.options.async.saveUrl?(e(t).hasClass("k-file-progress")?r._module.onCancel(o):r._module.onRemove(o,{},n),i=e(".k-file",r.wrapper),0===i.length?r._hideHeaderUploadstatus():r._updateHeaderUploadStatus()):r._module.onRemove(o,{},n)},_addInput:function(t){if(t[0].nodeType){var n=this,i=t.clone().val("");i.insertAfter(n.element).data("kendoUpload",n),e(n.element).hide().attr("tabindex","-1").removeAttr("id").off(F),n._activeInput(i),n.element.focus()}},_activeInput:function(t){var n=this,i=n.wrapper;n.element=t,t.attr("multiple",!!n._supportsMultiple()&&n.multiple).attr("autocomplete","off").on("click"+F,function(e){i.hasClass("k-state-disabled")&&e.preventDefault()}).on("focus"+F,function(){e(this).parent().addClass("k-state-focused")}).on("blur"+F,function(){e(this).parent().removeClass("k-state-focused")}).on("change"+F,e.proxy(n._onInputChange,n)).on("keydown"+F,e.proxy(n._onInputKeyDown,n))},_onInputKeyDown:function(e){var t=this,n=t.wrapper.find(".k-upload-action:visible:first");e.keyCode===C.keys.TAB&&n.length>0&&(e.preventDefault(),n.focus())},_onInputChange:function(t){var n,i=this,r=e(t.target),o=l(i._inputFiles(r),i._isAsyncNonBatch());d(o,i.options.validation),n=i.trigger(R,{files:o}),n?(i._addInput(r),r.remove()):i._module.onSelect({target:r},o)},_onDrop:function(t){var n,i=t.originalEvent.dataTransfer,o=this,a=i.files,s=l(r(a),o._isAsyncNonBatch());_(t),a.length>0&&!o.wrapper.hasClass("k-state-disabled")&&(!o.multiple&&s.length>1&&s.splice(1,s.length-1),d(s,o.options.validation),n=o.trigger(R,{files:s}),n||o._module.onSelect({target:e(".k-dropzone",o.wrapper)},s))},_filesContainValidationErrors:function(t){var n=!1;return e(t).each(function(e,t){if(t[L]&&t[L].length>0)return n=!0,!1}),n},_isAsyncNonBatch:function(){return this._async&&!this.options.async.batch||!1},_renderInitialFiles:function(t){var n,i,r=this,o=0;for(t=l(t,!0),o=0;o<t.length;o++)n=t[o],i=r._enqueueFile(n.name,{fileNames:[n]}),i.addClass("k-file-success").data("files",[t[o]]),r.options.template||e(".k-upload-status",i).prepend("<span class='k-upload-pct'>100%</span>"),r._supportsRemove()&&r._fileAction(i,P)},_prepareTemplateData:function(e,t){var n=t.fileNames,i={},r=0,o=0;for(o=0;o<n.length;o++)r+=n[o].size;return i.name=e,i.size=r,i.files=t.fileNames,i},_prepareDefaultSingleFileEntryTemplate:function(t){var n=this,i=t.fileNames[0],r=f(t.fileNames),o=i[L],a="";return a+=o&&o.length>0?"<li class='k-file k-file-invalid'><span class='k-progress'></span><span class='k-file-invalid-extension-wrapper'><span class='k-file-invalid-icon'>!</span><span class='k-file-state'></span></span><span class='k-file-name-size-wrapper'><span class='k-file-name k-file-name-invalid' title='"+i.name+"'>"+i.name+"</span><span class='k-file-validation-message'>"+n.localization[o[0]]+"</span></span>":"<li class='k-file'><span class='k-progress'></span><span class='k-file-extension-wrapper'><span class='k-file-extension'>"+i.extension.substring(1)+"</span><span class='k-file-state'></span></span><span class='k-file-name-size-wrapper'><span class='k-file-name' title='"+i.name+"'>"+i.name+"</span><span class='k-file-size'>"+r+"</span></span>",a+="<strong class='k-upload-status'></strong>",e(a)},_prepareDefaultMultipleFileEntriesTemplate:function(t){var n,i,r=this,o=t.fileNames,a=r._filesContainValidationErrors(o),s=f(o),l="";for(l+=a?"<li class='k-file k-file-invalid'><span class='k-progress'></span><span class='k-multiple-files-invalid-extension-wrapper'><span class='k-file-invalid-icon'>!</span>":"<li class='k-file'><span class='k-progress'></span><span class='k-multiple-files-extension-wrapper'>",l+="<span class='k-file-state'></span></span>",o.sort(function(e,t){return e[L]?-1:t[L]?1:0}),l+="<span class='k-file-name-size-wrapper'>",n=0;n<o.length;n++)i=o[n],l+=i[L]&&i[L].length>0?"<span class='k-file-name k-file-name-invalid' title='"+i.name+"'>"+i.name+"</span>":"<span class='k-file-name' title='"+i.name+"'>"+i.name+"</span>";return l+=a?"<span class='k-file-validation-message'>Invalid files(s). Please check file upload requirements.</span>":"<span class='k-file-information'>Total: "+o.length+" files, "+s+"</span>",l+="</span><strong class='k-upload-status'></strong>",e(l)},_enqueueFile:function(t,n){var i,r,o,a,s=this,l=n.fileNames[0].uid,d=e(".k-upload-files",s.wrapper),c=s.options,u=c.template;return 0===d.length&&(d=e("<ul class='k-upload-files k-reset'></ul>").appendTo(s.wrapper),s.options.showFileList||d.hide(),s.wrapper.removeClass("k-upload-empty")),i=e(".k-file",d),u?(o=s._prepareTemplateData(t,n),u=C.template(u),r=e("<li class='k-file'>"+u(o)+"</li>"),r.find(".k-upload-action").addClass("k-button k-button-bare"),s.angular("compile",function(){return{elements:r,data:[o]}})):r=1===n.fileNames.length?s._prepareDefaultSingleFileEntryTemplate(n):s._prepareDefaultMultipleFileEntriesTemplate(n),r.attr(C.attr("uid"),l).appendTo(d).data(n),s._async||e(".k-progress",r).width("100%"),!s.multiple&&i.length>0&&(a={files:i.data("fileNames")},s.trigger(P,a)||s._module.onRemove({target:e(i,s.wrapper)},a.data)),r},_removeFileEntry:function(t){var n,i,r,o=this,a=t.closest(".k-upload-files");t.remove(),n=e(".k-file",a),i=e(".k-file-success, .k-file-error",a),r=e(".k-file-invalid",a),i.length!==n.length&&r.length!==n.length||this._hideUploadButton(),0===n.length?(a.remove(),o.wrapper.addClass("k-upload-empty"),o._hideHeaderUploadstatus()):o._updateHeaderUploadStatus()},_fileAction:function(e,t){var n={remove:"k-i-delete",cancel:"k-i-cancel",retry:"k-i-retry"},i={remove:"k-i-close",cancel:"k-i-close",retry:"k-i-refresh"};n.hasOwnProperty(t)&&(this._clearFileAction(e),this.options.template?e.find(".k-upload-action").addClass("k-button k-button-bare").append("<span class='k-icon "+i[t]+" "+n[t]+"' title='"+this.localization[t]+"'aria-label='"+this.localization[t]+"'></span>").show():(e.find(".k-upload-status .k-upload-action").remove(),e.find(".k-upload-status").append(this._renderAction(n[t],this.localization[t],i[t]))))},_fileState:function(t,n){var i=this.localization,r={uploading:{text:i.statusUploading},uploaded:{text:i.statusUploaded},failed:{text:i.statusFailed}},o=r[n];o&&e("span.k-file-state",t).text(o.text)},_renderAction:function(t,n,i){return e(""!==t?"<button type='button' class='k-button k-button-bare k-upload-action'><span class='k-icon "+i+" "+t+"' title='"+n+"' aria-label='"+n+"'></span></button>":"<button type='button' class='k-button'>"+n+"</button>")},_clearFileAction:function(t){e(".k-upload-action",t).empty().hide()},_onFileAction:function(t){var n,i,r,o,a,s,l=this;return l.wrapper.hasClass("k-state-disabled")||(n=e(t.target).closest(".k-upload-action"),i=n.find(".k-icon"),r=n.closest(".k-file"),o=r.data("fileNames"),a=l._filesContainValidationErrors(o),s={files:o},i.hasClass("k-i-delete")?l.trigger(P,s)||l._module.onRemove({target:e(r,l.wrapper)},s.data,!a):i.hasClass("k-i-cancel")?(l.trigger(H,s),l._module.onCancel({target:e(r,l.wrapper)}),l._checkAllComplete(),l._updateHeaderUploadStatus()):i.hasClass("k-i-retry")&&(e(".k-i-warning",r).remove(),e(".k-progress",r).finish().show(),l._module.onRetry({target:e(r,l.wrapper)}))),!1},_onUploadSelected:function(){var e=this,t=e.wrapper;return t.hasClass("k-state-disabled")||this._module.onSaveSelected(),!1},_onClearSelected:function(){var e=this,t=e.wrapper;return t.hasClass("k-state-disabled")||e.clearAllFiles(),!1},_onFileProgress:function(t,n){var i;n>100&&(n=100),this.options.template?e(".k-progress",t.target).width(n+"%"):(i=e(".k-upload-pct",t.target),0===i.length&&e(".k-upload-status",t.target).prepend("<span class='k-upload-pct'></span>"),e(".k-upload-pct",t.target).text(n+"%"),e(".k-progress",t.target).width(n+"%")),this.trigger(N,{files:w(t).data("fileNames"),percentComplete:n})},_onUploadSuccess:function(e,t,n){var i=this,r=w(e),o=i.trigger(A,{files:r.data("fileNames"),response:t,operation:"upload",XMLHttpRequest:n});o?i._setUploadErrorState(r):(i._fileState(r,"uploaded"),r.removeClass("k-file-progress").addClass("k-file-success"),i._updateHeaderUploadStatus(),i._supportsRemove()?i._fileAction(r,P):i._clearFileAction(r)),i._hideUploadProgress(r),i._checkAllComplete()},_onUploadError:function(e,t){var n=this,i=w(e);n._setUploadErrorState(i),n.trigger(M,{operation:"upload",files:i.data("fileNames"),XMLHttpRequest:t}),D("Server response: "+t.responseText),n._hideUploadProgress(i),n._checkAllComplete()},_setUploadErrorState:function(t){var n=this,i=e(".k-upload-pct",t);n._fileState(t,"failed"),t.removeClass("k-file-progress").addClass("k-file-error"),e(".k-progress",t).width("100%"),i.length>0?i.empty().removeClass("k-upload-pct").addClass("k-icon k-i-warning"):e(".k-upload-status",t).prepend("<span class='k-icon k-i-warning'></span>"),this._updateHeaderUploadStatus(),this._fileAction(t,"retry")},_hideUploadProgress:function(t){e(".k-progress",t).delay(W).fadeOut(U,function(){e(this).css("width","0%")})},_showUploadButton:function(){var t=this,n=e(".k-upload-selected",t.wrapper),i=e(".k-clear-selected",t.wrapper);0===n.length&&(n=t._renderAction("",this.localization.uploadSelectedFiles).addClass("k-upload-selected"),i=t._renderAction("",this.localization.clearSelectedFiles).addClass("k-clear-selected")),this.wrapper.append(i,n)},_hideUploadButton:function(){e(".k-upload-selected, .k-clear-selected",this.wrapper).remove()},_showHeaderUploadStatus:function(t){var n=this,i=n.localization,r=e(".k-dropzone",n.wrapper),o=e(".k-upload-status-total",n.wrapper);0!==o.length&&o.remove(),o='<strong class="k-upload-status k-upload-status-total"><span class="k-icon"></span></strong>',t?(o=e(o).append(i.headerStatusUploading),o.find(".k-icon").addClass(q.loading).text(i.statusUploading)):(o=e(o).append(i.headerStatusUploaded),o.find(".k-icon").addClass(q.warning).text(i.statusWarning)),r.length>0?r.append(o):e(".k-upload-button",n.wrapper).after(o)},_updateHeaderUploadStatus:function(){var t,n,i=this,r=i.localization,o=e(".k-upload-status-total",this.wrapper),a=e(".k-file",i.wrapper).not(".k-file-success, .k-file-error, .k-file-invalid"),s=e(".k-file-invalid",i.wrapper);(0===a.length||s.length>0)&&(t=e(".k-file.k-file-error, .k-file.k-file-invalid",i.wrapper),o=e(".k-upload-status-total",i.wrapper),n=e(".k-icon",o).removeClass().addClass("k-icon").addClass(0!==t.length?q.warning:q.success).text(0!==t.length?r.statusWarning:r.statusUploaded),o.html(n).append(i.localization.headerStatusUploaded))},_hideHeaderUploadstatus:function(){e(".k-upload-status-total",this.wrapper).remove()},_onParentFormSubmit:function(){var n,i=this,r=i.element;t!==this._module.onAbort&&this._module.onAbort(),r.value||(n=e(r),n.attr("disabled","disabled"),window.setTimeout(function(){n.removeAttr("disabled")},0))},_onParentFormReset:function(){e(".k-upload-files",this.wrapper).remove()},_supportsFormData:function(){return"undefined"!=typeof FormData},_supportsMultiple:function(){var e=this._userAgent().indexOf("Windows")>-1;return!(C.support.browser.opera||C.support.browser.safari&&e)},_supportsDrop:function(){var e=this._userAgent().toLowerCase(),t=/chrome/.test(e),n=!t&&/safari/.test(e),i=n&&/windows/.test(e);return!i&&this._supportsFormData()&&this.options.async.saveUrl},_userAgent:function(){return navigator.userAgent},_setupDropZone:function(){var t,n,i=this;e(".k-upload-button",i.wrapper).wrap("<div class='k-dropzone'></div>"),t=i._ns,n=e(".k-dropzone",i.wrapper).append(e("<em>"+i.localization.dropFilesHere+"</em>")).on("dragenter"+t,_).on("dragover"+t,function(e){e.preventDefault()}).on("drop"+t,e.proxy(i._onDrop,i)),b(n,t,function(){n.closest(".k-upload").hasClass("k-state-disabled")||n.addClass("k-dropzone-hovered")},function(){n.removeClass("k-dropzone-hovered")}),i._bindDocumentDragEventWrappers(n)},_setupCustomDropZone:function(){var t,n=this,i=e(n.options.dropZone);e(".k-upload-button",n.wrapper).wrap("<div class='k-dropzone'></div>"),t=n._ns,i.on("dragenter"+t,_).on("dragover"+t,function(e){e.preventDefault()}).on("drop"+t,e.proxy(n._onDrop,n)),b(i,t,function(t){n.wrapper.hasClass("k-state-disabled")||(i.removeClass("k-dropzone-hovered"),e(t.target).addClass("k-dropzone-hovered"))},function(){i.removeClass("k-dropzone-hovered")}),n._bindDocumentDragEventWrappers(i)},_bindDocumentDragEventWrappers:function(t){var n=this,i=n._ns;b(e(document),i,function(){n.wrapper.hasClass("k-state-disabled")||(t.addClass("k-dropzone-active"),t.closest(".k-upload").removeClass("k-upload-empty"))},function(){t.removeClass("k-dropzone-active"),0===e("li.k-file",t.closest(".k-upload")).length&&t.closest(".k-upload").addClass("k-upload-empty")})},_supportsRemove:function(){return!!this.options.async.removeUrl},_submitRemove:function(t,n,i,r){var o=this,a=o.options.async.removeField||"fileNames",s=e.extend(n,S());s[a]=t,jQuery.ajax({type:this.options.async.removeVerb,dataType:"json",dataFilter:v,url:this.options.async.removeUrl,traditional:!0,data:s,success:i,error:r,xhrFields:{withCredentials:this.options.async.withCredentials}})},_wrapInput:function(e){var t=this,n=t.options;return e.wrap("<div class='k-widget k-upload k-header'><div class='k-button k-upload-button' aria-label='"+this.localization.select+"'></div></div>"),n.async.saveUrl||e.closest(".k-upload").addClass("k-upload-sync"),e.closest(".k-upload").addClass("k-upload-empty"),e.closest(".k-button").append("<span>"+this.localization.select+"</span>"),e.closest(".k-upload")},_checkAllComplete:function(){0===e(".k-file.k-file-progress",this.wrapper).length&&this.trigger(z)},_inputFiles:function(e){return i(e)}}),$=function(e){this.name="syncUploadModule",this.element=e.wrapper,this.upload=e,this.element.closest("form").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data")};$.prototype={onSelect:function(t,i){var r,o,a=this.upload,s=e(t.target),l=a._filesContainValidationErrors(i);a._addInput(s),r={fileNames:i},l?s.remove():r.relatedInput=s,o=a._enqueueFile(n(s),r),l&&a._hideUploadProgress(o),a._fileAction(o,P)},onRemove:function(e){var t=w(e),n=t.data("relatedInput");n&&n.remove(),this.upload._removeFileEntry(t)}},y=function(e){this.name="iframeUploadModule",this.element=e.wrapper,this.upload=e,this.iframes=[]},j._frameId=0,y.prototype={onSelect:function(t,n){var i=this.upload,r=e(t.target),o=i._filesContainValidationErrors(n),a=this.prepareUpload(r,n,o);i.options.async.autoUpload?o?(i._fileAction(a,P),i._showHeaderUploadStatus(!1)):this.performUpload(a):(i._fileAction(a,P),o?i._updateHeaderUploadStatus():i._showUploadButton()),o&&i._hideUploadProgress(a)},prepareUpload:function(t,i,r){var o,a,s,l,d=this.upload,c=e(d.element),u=d.options.async.saveField||t.attr("name");return d._addInput(t),t.attr("name",u),r?(t.remove(),a={fileNames:i}):(s=this.createFrame(d.name+"_"+j._frameId++),this.registerFrame(s),l=this.createForm(d.options.async.saveUrl,s.attr("name")).append(c),a={frame:s,relatedInput:c,fileNames:i}),o=d._enqueueFile(n(t),a),s&&s.data({form:l,file:o}),o},performUpload:function(t){var n,i,r,o={files:t.data("fileNames")},a=t.data("frame"),s=this.upload;if(s.trigger(I,o))s._removeFileEntry(a.data("file")),this.cleanupFrame(a),this.unregisterFrame(a);else{s._hideUploadButton(),s._showHeaderUploadStatus(!0),a.appendTo(document.body),n=a.data("form").attr("action",s.options.async.saveUrl).appendTo(document.body),o.data=e.extend({},o.data,S());for(i in o.data)r=n.find("input[name='"+i+"']"),0===r.length&&(r=e("<input>",{type:"hidden",name:i}).prependTo(n)),r.val(o.data[i]);s._fileAction(t,H),s._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),a.one("load",e.proxy(this.onIframeLoad,this)),n[0].submit()}},onSaveSelected:function(){var t=this,n=t.upload;e(".k-file",this.element).each(function(){var i=e(this),r=k(i),o=n._filesContainValidationErrors(i.data("fileNames"));r||o||t.performUpload(i)})},onIframeLoad:function(t){var n,i=e(t.target);try{n=i.contents().text()}catch(r){n="Error trying to get server response: "+r}this.processResponse(i,n)},processResponse:function(t,n){var i=t.data("file"),r=this,o={responseText:n};g(n,function(n){e.extend(o,{statusText:"OK",status:"200"}),r.upload._onFileProgress({target:e(i,r.upload.wrapper)},100),r.upload._onUploadSuccess({target:e(i,r.upload.wrapper)},n,o),r.cleanupFrame(t),r.unregisterFrame(t)},function(){e.extend(o,{statusText:"error",status:"500"}),r.upload._onUploadError({target:e(i,r.upload.wrapper)},o)})},onCancel:function(t){var n=e(t.target).data("frame");this.stopFrameSubmit(n),this.cleanupFrame(n),this.unregisterFrame(n),this.upload._removeFileEntry(n.data("file"))},onRetry:function(e){var t=w(e);this.performUpload(t)},onRemove:function(e,t,n){var i=this,r=i.upload,o=w(e),a=o.data("frame");a?(i.unregisterFrame(a),r._removeFileEntry(o),i.cleanupFrame(a)):o.hasClass("k-file-success")?m(o,r,t,n):r._removeFileEntry(o)},onAbort:function(){var t=this.element,n=this;e.each(this.iframes,function(){e("input",this.data("form")).appendTo(t),n.stopFrameSubmit(this[0]),this.data("form").remove(),this.remove()}),this.iframes=[]},createFrame:function(t){return e("<iframe name='"+t+"' id='"+t+"' style='display:none;' />")},createForm:function(t,n){return e("<form enctype='multipart/form-data' method='POST' action='"+t+"' target='"+n+"'/>")},stopFrameSubmit:function(e){t!==e.stop?e.stop():e.document&&e.document.execCommand("Stop")},registerFrame:function(e){this.iframes.push(e)},unregisterFrame:function(t){this.iframes=e.grep(this.iframes,function(e){return e.attr("name")!=t.attr("name")})},cleanupFrame:function(e){var t=e.data("form");e.data("file").data("frame",null),setTimeout(function(){t.remove(),e.remove()},1)}},x=function(e){this.name="formDataUploadModule",this.element=e.wrapper,this.upload=e},x.prototype={onSelect:function(t,n){var i,r=this.upload,o=this,a=e(t.target),s=this.prepareUpload(a,n);e.each(s,function(){i=r._filesContainValidationErrors(e(this.data("fileNames"))),r.options.async.autoUpload?i?(r._fileAction(this,P),r._showHeaderUploadStatus(!1)):o.performUpload(this):(r._fileAction(this,P),i?r._updateHeaderUploadStatus():r._showUploadButton()),i&&r._hideUploadProgress(this)})},prepareUpload:function(t,n){var i=this.enqueueFiles(n);return t.is("input")&&(e.each(i,function(){e(this).data("relatedInput",t)}),t.data("relatedFileEntries",i),this.upload._addInput(t)),i},enqueueFiles:function(t){var n,i,r,o,a=this.upload,s=t.length,l=[];if(a.options.async.batch===!0)n=e.map(t,function(e){return e.name}).join(", "),o=a._enqueueFile(n,{fileNames:t}),o.data("files",t),l.push(o);else for(i=0;i<s;i++)r=t[i],n=r.name,o=a._enqueueFile(n,{fileNames:[r]}),o.data("files",[r]),l.push(o);return l},performUpload:function(t){var n,i=this.upload,r=this.createFormData(),o=this.createXHR(),a={files:t.data("fileNames"),XMLHttpRequest:o};if(i.trigger(I,a))this.removeFileEntry(t);else{if(i._fileAction(t,H),i._hideUploadButton(),i._showHeaderUploadStatus(!0),a.formData)r=a.formData;else{a.data=e.extend({},a.data,S());for(n in a.data)r.append(n,a.data[n]);this.populateFormData(r,t.data("files"))}i._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),this.postFormData(i.options.async.saveUrl,r,t,o)}},onSaveSelected:function(){var t=this,n=t.upload;e(".k-file",this.element).each(function(){var i=e(this),r=k(i),o=n._filesContainValidationErrors(i.data("fileNames"));r||o||t.performUpload(i)})},onCancel:function(e){var t=w(e);this.stopUploadRequest(t),this.removeFileEntry(t)},onRetry:function(e){var t=w(e);this.performUpload(t)},onRemove:function(e,t,n){var i=this,r=i.upload,o=w(e);o.hasClass("k-file-success")?m(o,r,t,n):i.removeFileEntry(o)},createXHR:function(){return new XMLHttpRequest},postFormData:function(e,t,n,i){var r,o=this;n.data("request",i),i.addEventListener("load",function(e){o.onRequestSuccess.call(o,e,n)},!1),i.addEventListener(M,function(e){o.onRequestError.call(o,e,n)},!1),i.upload.addEventListener("progress",function(e){o.onRequestProgress.call(o,e,n)},!1),i.open("POST",e,!0),i.withCredentials=this.upload.options.async.withCredentials,r=this.upload.options.async.accept,r&&i.setRequestHeader("Accept",r),i.send(t)},createFormData:function(){return new FormData},populateFormData:function(e,t){var n,i=this.upload,r=t.length;for(n=0;n<r;n++)e.append(i.options.async.saveField||i.name,t[n].rawFile);return e},onRequestSuccess:function(t,n){function i(){o.upload._onUploadError({target:e(n,o.upload.wrapper)},r)}var r=t.target,o=this;r.status>=200&&r.status<=299?g(r.responseText,function(t){o.upload._onFileProgress({target:e(n,o.upload.wrapper)},100),o.upload._onUploadSuccess({target:e(n,o.upload.wrapper)},t,r),o.cleanupFileEntry(n)},i):i()},onRequestError:function(t,n){var i=t.target;this.upload._onUploadError({target:e(n,this.upload.wrapper)},i)},cleanupFileEntry:function(t){var n=t.data("relatedInput"),i=!0;n&&(e.each(n.data("relatedFileEntries")||[],function(){this.parent().length>0&&this[0]!=t[0]&&(i=i&&this.hasClass("k-file-success"))}),i&&n.remove())},removeFileEntry:function(e){this.cleanupFileEntry(e),this.upload._removeFileEntry(e)},onRequestProgress:function(t,n){var i=Math.round(100*t.loaded/t.total);this.upload._onFileProgress({target:e(n,this.upload.wrapper)},i)},stopUploadRequest:function(e){e.data("request").abort()}},C.ui.plugin(j)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.filebrowser.min",["kendo.listview.min","kendo.dropdownlist.min","kendo.upload.min"],e)}(function(){return function(e,t){function n(e,t,n){var i,r;e.on("dragenter"+x,function(){t(),r=new Date,i||(i=setInterval(function(){var e=new Date-r;e>100&&(n(),clearInterval(i),i=null)},100))}).on("dragover"+x,function(){r=new Date})}function i(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function r(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}function o(e,t){var n=e[t];return h(n)?n.from||n.field||t:n}var a,s,l,d,c=window.kendo,u=c.ui.Widget,h=e.isPlainObject,f=e.proxy,p=e.extend,m=c.support.placeholder,g=c.support.browser,v=c.isFunction,_=/(^\/|\/$)/g,b="change",k="apply",w="error",y="click",x=".kendoFileBrowser",C=".kendoBreadcrumbs",T=".kendoSearchBox",S="name",D="size",E="type",F={field:E,dir:"asc"},R=c.template('<li class="k-tile-empty"><strong>${text}</strong></li>'),I='<div class="k-widget k-filebrowser-toolbar k-header k-floatwrap"><div class="k-toolbar-wrap"># if (showUpload) { # <div class="k-widget k-upload"><div class="k-button k-button-icontext k-upload-button"><span class="k-icon k-i-add"></span>#=messages.uploadFile#<input type="file" name="file" /></div></div># } ## if (showCreate) { #<button type="button" class="k-button k-button-icon"><span class="k-icon k-i-add-folder" /></button># } ## if (showDelete) { #<button type="button" class="k-button k-button-icon k-state-disabled"><span class="k-icon k-i-delete" /></button>&nbsp;# } #</div><div class="k-tiles-arrange"><label>#=messages.orderBy#: <select /></label></div></div>';
p(!0,c.data,{schemas:{filebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),p(!0,c.data,{transports:{filebrowser:c.data.RemoteTransport.extend({init:function(t){c.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),v(this.options[t])?this.options[t].call(this,n):c.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),a=g.msie&&g.version<8?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},s=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n.element.addClass("k-filebrowser"),n.element.on(y+x,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-i-delete)",f(n._deleteClick,n)).on(y+x,".k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-i-add-folder)",f(n._addClick,n)).on("keydown"+x,"li.k-state-selected input",f(n._directoryKeyDown,n)).on("blur"+x,"li.k-state-selected input",f(n._directoryBlur,n)),n._dataSource(),n.refresh(),n.path(n.options.path)},options:{name:"FileBrowser",messages:{uploadFile:"Upload",orderBy:"Arrange by",orderByName:"Name",orderBySize:"Size",directoryNotFound:"A directory with this name was not found.",emptyFolder:"Empty Folder",deleteFile:'Are you sure you want to delete "{0}"?',invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',dropFilesHere:"drop file here to upload",search:"Search"},transport:{},path:"/",fileTypes:"*.*"},events:[w,b,k],destroy:function(){var e=this;u.fn.destroy.call(e),e.dataSource.unbind(w,e._errorHandler),e.element.add(e.list).add(e.toolbar).off(x),c.destroy(e.element)},value:function(){var e,t=this,n=t._selectedItem(),r=t.options.transport.fileUrl;if(n&&"f"===n.get(E))return e=i(t.path(),n.get(S)).replace(_,""),r&&(e=v(r)?r(e):c.format(r,encodeURIComponent(e))),e},_selectedItem:function(){var e=this.listView,t=e.select();if(t.length)return this.dataSource.getByUid(t.attr(c.attr("uid")))},_toolbar:function(){var t=this,n=c.template(I),i=t.options.messages,r=[{text:i.orderByName,value:"name"},{text:i.orderBySize,value:"size"}];t.toolbar=e(n({messages:i,showUpload:t.options.transport.uploadUrl,showCreate:t.options.transport.create,showDelete:t.options.transport.destroy})).appendTo(t.element).find(".k-upload input").kendoUpload({multiple:!1,localization:{dropFilesHere:i.dropFilesHere},async:{saveUrl:t.options.transport.uploadUrl,autoUpload:!0},upload:f(t._fileUpload,t),error:function(e){t._error({xhr:e.XMLHttpRequest,status:"error"})}}).end(),t.upload=t.toolbar.find(".k-upload input").data("kendoUpload"),t.arrangeBy=t.toolbar.find(".k-tiles-arrange select").kendoDropDownList({dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){t.orderBy(this.value())}}).data("kendoDropDownList"),t._attachDropzoneEvents()},_attachDropzoneEvents:function(){var t=this;t.options.transport.uploadUrl&&(n(e(document.documentElement),e.proxy(t._dropEnter,t),e.proxy(t._dropLeave,t)),t._scrollHandler=f(t._positionDropzone,t))},_dropEnter:function(){this._positionDropzone(),e(document).on("scroll"+x,this._scrollHandler)},_dropLeave:function(){this._removeDropzone(),e(document).off("scroll"+x,this._scrollHandler)},_positionDropzone:function(){var e=this,t=e.element,n=t.offset();e.toolbar.find(".k-dropzone").addClass("k-filebrowser-dropzone").offset(n).css({width:t[0].clientWidth,height:t[0].clientHeight,lineHeight:t[0].clientHeight+"px"})},_removeDropzone:function(){this.toolbar.find(".k-dropzone").removeClass("k-filebrowser-dropzone").css({width:"",height:"",lineHeight:"",top:"",left:""})},_deleteClick:function(){var e=this,t=e.listView.select(),n=c.format(e.options.messages.deleteFile,t.find("strong").text());t.length&&e._showMessage(n,"confirm")&&e.listView.remove(t)},_addClick:function(){this.createDirectory()},_getFieldName:function(e){return o(this.dataSource.reader.model.fields,e)},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),a=e.files[0].name,s=S,l=D;o.test(a)?(e.data={path:n.path()},t=n._createFile(a),t?n.upload.one("success",function(e){var i=n._insertFileToList(t);i.set(s,e.response[n._getFieldName(s)]),i.set(l,e.response[n._getFieldName(l)]),n._tiles=n.listView.items().filter("["+c.attr("type")+"=f]")}):e.preventDefault()):(e.preventDefault(),n._showMessage(c.format(i.messages.invalidFileType,a,r)))},_findFile:function(e){var t,n,i,r=this.dataSource.data(),o=E,a=S;for(e=e.toLowerCase(),t=0,i=r.length;t<i;t++)if("f"===r[t].get(o)&&r[t].get(a).toLowerCase()===e){n=r[t];break}return n},_createFile:function(e){var t=this,n={},i=E,r=t._findFile(e);return r?t._showMessage(c.format(t.options.messages.overwriteFile,e),"confirm")?(r._override=!0,r):null:(n[i]="f",n[S]=e,n[D]=0,n)},_insertFileToList:function(e){var t,n,i,r,o;if(e._override)return e;for(n=this.dataSource,i=n.view(),r=0,o=i.length;r<o;r++)if("f"===i[r].get(E)){t=r;break}return n.insert(++t,e)},createDirectory:function(){var e,t,n=this,i=0,r=E,o=S,a=n.dataSource.data(),s=n._nameDirectory(),l=new n.dataSource.reader.model;for(e=0,t=a.length;e<t;e++)"d"===a[e].get(r)&&(i=e);l.set(r,"d"),l.set(o,s),n.listView.one("dataBound",function(){var e=n.listView.items().filter("["+c.attr("uid")+"="+l.uid+"]"),t=e.find("input");e.length&&this.edit(e),this.element.scrollTop(e.attr("offsetTop")-this.element[0].offsetHeight),setTimeout(function(){t.select()})}).one("save",function(e){var t=e.model.get(o);t?e.model.set(o,n._nameExists(t,l.uid)?n._nameDirectory():t):e.model.set(o,s)}),n.dataSource.insert(++i,l)},_directoryKeyDown:function(e){13==e.keyCode&&e.currentTarget.blur()},_directoryBlur:function(){this.listView.save()},_nameExists:function(e,t){var n,i,r=this.dataSource.data(),o=E,a=S;for(n=0,i=r.length;n<i;n++)if("d"===r[n].get(o)&&r[n].get(a).toLowerCase()===e.toLowerCase()&&r[n].uid!==t)return!0;return!1},_nameDirectory:function(){var t,n,i,r="New folder",o=this.dataSource.data(),a=[],s=E,l=S;for(n=0,i=o.length;n<i;n++)"d"===o[n].get(s)&&o[n].get(l).toLowerCase().indexOf(r.toLowerCase())>-1&&a.push(o[n].get(l));if(e.inArray(r,a)>-1){n=2;do t=r+" ("+n+")",n++;while(e.inArray(t,a)>-1);r=t}return r},orderBy:function(e){this.dataSource.sort([{field:E,dir:"asc"},{field:e,dir:"asc"}])},search:function(e){this.dataSource.filter({field:S,operator:"contains",value:e})},_content:function(){var t=this;t.list=e('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("dblclick"+x,"li",f(t._dblClick,t)),t.listView=new c.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-i-delete").parent().addClass("k-state-disabled"),"remove"!==e.action&&"sync"!==e.action||e.preventDefault()},dataBound:function(){t.dataSource.view().length?t._tiles=this.items().filter("["+c.attr("type")+"=f]"):this.wrapper.append(R({text:t.options.messages.emptyFolder}))},change:f(t._listViewChange,t)})},_dblClick:function(t){var n,r=this,o=e(t.currentTarget);o.hasClass("k-edit-item")&&r._directoryBlur(),o.filter("["+c.attr("type")+"=d]").length?(n=r.dataSource.getByUid(o.attr(c.attr("uid"))),n&&(r.path(i(r.path(),n.get(S))),r.breadcrumbs.value(r.path()))):o.filter("["+c.attr("type")+"=f]").length&&r.trigger(k)},_listViewChange:function(){var e=this._selectedItem();e&&(this.toolbar.find(".k-i-delete").parent().removeClass("k-state-disabled"),this.trigger(b,{selected:e}))},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=p({},F),o={field:S,dir:"asc"},a={type:i.type||"filebrowser",sort:[r,o]};h(i)&&(i.path=f(t.path,t),a.transport=i),h(n.schema)?a.schema=n.schema:i.type&&h(c.data.schemas[i.type])&&(e=c.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(w,t._errorHandler):t._errorHandler=f(t._error,t),t.dataSource=c.data.DataSource.create(a).bind(w,t._errorHandler)},_navigation:function(){var t=this,n=e('<div class="k-floatwrap"><input/><input/></div>').appendTo(this.element);t.breadcrumbs=n.find("input:first").kendoBreadcrumbs({value:t.options.path,change:function(){t.path(this.value())}}).data("kendoBreadcrumbs"),t.searchBox=n.parent().find("input:last").kendoSearchBox({label:t.options.messages.search,change:function(){t.search(this.value())}}).data("kendoSearchBox")},_error:function(e){var t,n,i=this;i.trigger(w,e)||(t=e.xhr.status,"error"==e.status?"404"==t?i._showMessage(i.options.messages.directoryNotFound):"0"!=t&&i._showMessage("Error! The requested URL returned "+t+" - "+e.xhr.statusText):"timeout"==t&&i._showMessage("Error! Server timeout."),n=i.dataSource,n.hasChanges()&&n.cancelChanges())},_showMessage:function(e,t){return window[t||"alert"](e)},refresh:function(){var e=this;e._navigation(),e._toolbar(),e._content()},_editTmpl:function(){var e='<li class="k-tile k-state-selected" '+c.attr("uid")+'="#=uid#" ';return e+=c.attr("type")+'="${'+E+'}">',e+="#if("+E+' == "d") { #',e+='<div class="k-thumb"><span class="k-icon k-i-folder"></span></div>',e+="#}else{#",e+='<div class="k-thumb"><span class="k-icon k-i-loading"></span></div>',e+="#}#",e+="#if("+E+' == "d") { #',e+='<input class="k-input" '+c.attr("bind")+'="value:'+S+'"/>',e+="#}#",e+="</li>",f(c.template(e),{sizeFormatter:r})},_itemTmpl:function(){var e='<li class="k-tile" '+c.attr("uid")+'="#=uid#" ';return e+=c.attr("type")+'="${'+E+'}">',e+="#if("+E+' == "d") { #',e+='<div class="k-thumb"><span class="k-icon k-i-folder"></span></div>',e+="#}else{#",e+='<div class="k-thumb"><span class="k-icon k-i-file"></span></div>',e+="#}#",e+="<strong>${"+S+"}</strong>",e+="#if("+E+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+D+")}</span> #}#",e+="</li>",f(c.template(e),{sizeFormatter:r})},path:function(e){var n=this,i=n._path||"";return e!==t?(n._path=e.replace(_,"")+"/",n.dataSource.read({path:n._path}),t):(i&&(i=i.replace(_,"")),"/"===i||""===i?"":i+"/")}}),l=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),m&&n.element.attr("placeholder",n.options.label),n._wrapper(),n.element.on("keydown"+T,f(n._keydown,n)).on("change"+T,f(n._updateValue,n)),n.wrapper.on(y+T,"a",f(n._click,n)),m||n.element.on("focus"+T,f(n._focus,n)).on("blur"+T,f(n._blur,n))},options:{name:"SearchBox",label:"Search",value:""},events:[b],destroy:function(){var e=this;e.wrapper.add(e.element).add(e.label).off(T),u.fn.destroy.call(e)},_keydown:function(e){13===e.keyCode&&this._updateValue()},_click:function(e){e.preventDefault(),this._updateValue()},_updateValue:function(){var e=this,t=e.element.val();t!==e.value()&&(e.value(t),e.trigger(b))},_blur:function(){this._updateValue(),this._toggleLabel()},_toggleLabel:function(){m||this.label.toggle(!this.element.val())},_focus:function(){this.label.hide()},_wrapper:function(){var t=this.element,n=t.parents(".k-search-wrap");t[0].style.width="",t.addClass("k-input"),n.length||(n=t.wrap(e('<div class="k-widget k-search-wrap k-textbox"/>')).parent(),m||e('<label style="display:block">'+this.options.label+"</label>").insertBefore(t),e('<a href="#" class="k-icon k-i-search k-search"/>').appendTo(n)),this.wrapper=n,this.label=n.find(">label")},value:function(e){var n=this;return e!==t?(n.options.value=e,n.element.val(e),n._toggleLabel(),t):n.options.value}}),d=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n._wrapper(),n.wrapper.on("focus"+C,"input",f(n._focus,n)).on("blur"+C,"input",f(n._blur,n)).on("keydown"+C,"input",f(n._keydown,n)).on(y+C,"a.k-i-arrow-n:first",f(n._rootClick,n)).on(y+C,"a:not(.k-i-arrow-n)",f(n._click,n)),n.value(n.options.value)},options:{name:"Breadcrumbs",gap:50},events:[b],destroy:function(){var e=this;u.fn.destroy.call(e),e.wrapper.add(e.wrapper.find("input")).add(e.wrapper.find("a")).off(C)},_update:function(e){e="/"===(e||"").charAt(0)?e:"/"+(e||""),e!==this.value()&&(this.value(e),this.trigger(b))},_click:function(t){t.preventDefault(),this._update(this._path(e(t.target).prevAll("a:not(.k-i-arrow-n)").addBack()))},_rootClick:function(e){e.preventDefault(),this._update("")},_focus:function(){var e=this,t=e.element;e.overlay.hide(),e.element.val(e.value()),setTimeout(function(){t.select()})},_blur:function(){if(!this.overlay.is(":visible")){var e=this,t=e.element,n=t.val().replace(/\/{2,}/g,"/");e.overlay.show(),t.val(""),e._update(n)}},_keydown:function(e){var t=this;13===e.keyCode&&(t._blur(),setTimeout(function(){t.overlay.find("a:first").focus()}))},_wrapper:function(){var t,n=this.element,i=n.parents(".k-breadcrumbs");n[0].style.width="",n.addClass("k-input"),i.length||(i=n.wrap(e('<div class="k-widget k-breadcrumbs k-textbox"/>')).parent()),t=i.find(".k-breadcrumbs-wrap"),t.length||(t=e('<div class="k-breadcrumbs-wrap"/>').appendTo(i)),this.wrapper=i,this.overlay=t},refresh:function(){var n,i,r,o,a="",s=this.value();for(s!==t&&s.match(/^\//)||(s="/"+(s||"")),n=s.split("/"),r=0,o=n.length;r<o;r++)i=n[r],i&&(a||(a+='<a href="#" class="k-icon k-i-arrow-n">root</a>'),a+='<a class="k-link" href="#">'+n[r]+"</a>",a+='<span class="k-icon k-i-arrow-e">&gt;</span>');this.overlay.empty().append(e(a)),this._adjustSectionWidth()},_adjustSectionWidth:function(){var t,n=this,i=n.wrapper,r=i.width()-n.options.gap,o=n.overlay.find("a");o.each(function(n){t=e(this),t.parent().width()>r&&(n==o.length-1?t.width(r):t.prev().addBack().hide())})},value:function(e){return e!==t?(this._value=e.replace(/\/{2,}/g,"/"),this.refresh(),t):this._value},_path:function(t){return"/"+e.map(t,function(t){return e(t).text()}).join("/")}}),c.ui.plugin(s),c.ui.plugin(d),c.ui.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.imagebrowser.min",["kendo.filebrowser.min"],e)}(function(){return function(e,t){function n(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function i(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}var r,o,a=window.kendo,s=a.ui.FileBrowser,l=e.isPlainObject,d=e.proxy,c=e.extend,u=a.support.browser,h=a.isFunction,f=/(^\/|\/$)/g,p="error",m=".kendoImageBrowser",g="name",v="size",_="type",b={field:_,dir:"asc"},k=a.template('<li class="k-tile-empty"><strong>${text}</strong></li>');c(!0,a.data,{schemas:{imagebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),c(!0,a.data,{transports:{imagebrowser:a.data.RemoteTransport.extend({init:function(t){a.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),h(this.options[t])?this.options[t].call(this,n):a.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),r=u.msie&&u.version<8?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},o=s.extend({init:function(e,t){var n=this;t=t||{},s.fn.init.call(n,e,t),n.element.addClass("k-imagebrowser")},options:{name:"ImageBrowser",fileTypes:"*.png,*.gif,*.jpg,*.jpeg"},value:function(){var e,t=this,i=t._selectedItem(),r=t.options.transport.imageUrl;if(i&&"f"===i.get(_))return e=n(t.path(),i.get(g)).replace(f,""),r&&(e=h(r)?r(e):a.format(r,encodeURIComponent(e))),e},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),s=e.files[0].name,l=g,d=v;o.test(s)?(e.data={path:n.path()},t=n._createFile(s),t?(t._uploading=!0,n.upload.one("success",function(e){delete t._uploading;var i=n._insertFileToList(t);i.set(l,e.response[n._getFieldName(l)]),i.set(d,e.response[n._getFieldName(d)]),n._tiles=n.listView.items().filter("["+a.attr("type")+"=f]"),n._scroll()})):e.preventDefault()):(e.preventDefault(),n._showMessage(a.format(i.messages.invalidFileType,s,r)))},_content:function(){var t=this;t.list=e('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("scroll"+m,d(t._scroll,t)).on("dblclick"+m,"li",d(t._dblClick,t)),t.listView=new a.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-i-delete").parent().addClass("k-state-disabled"),"remove"!==e.action&&"sync"!==e.action||e.preventDefault()},dataBound:function(){t.dataSource.view().length?(t._tiles=this.items().filter("["+a.attr("type")+"=f]"),t._scroll()):this.wrapper.append(k({text:t.options.messages.emptyFolder}))},change:d(t._listViewChange,t)})},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=c({},b),o={field:g,dir:"asc"},s={type:i.type||"imagebrowser",sort:[r,o]};l(i)&&(i.path=d(t.path,t),s.transport=i),l(n.schema)?s.schema=n.schema:i.type&&l(a.data.schemas[i.type])&&(e=a.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(p,t._errorHandler):t._errorHandler=d(t._error,t),t.dataSource=a.data.DataSource.create(s).bind(p,t._errorHandler)},_loadImage:function(t){var n=this,i=e(t),r=n.dataSource.getByUid(i.attr(a.attr("uid"))),o=r.get(g),s=n.options.transport.thumbnailUrl,l=e("<img />",{alt:o}),d="?";r._uploading||(l.hide().on("load"+m,function(){e(this).prev().remove().end().addClass("k-image").fadeIn()}),i.find(".k-i-loading").after(l),h(s)?s=s(n.path(),encodeURIComponent(o)):(s.indexOf("?")>=0&&(d="&"),s=s+d+"path="+encodeURIComponent(n.path()+o),r._override&&(s+="&_="+(new Date).getTime(),delete r._override)),l.attr("src",s),t.loaded=!0)},_scroll:function(){var e=this;e.options.transport&&e.options.transport.thumbnailUrl&&(clearTimeout(e._timeout),e._timeout=setTimeout(function(){var t=a._outerHeight(e.list),n=e.list.scrollTop(),i=n+t;e._tiles.each(function(){var t=r(this),o=t+this.offsetHeight;if((t>=n&&t<i||o>=n&&o<i)&&e._loadImage(this),t>i)return!1}),e._tiles=e._tiles.filter(function(){return!this.loaded})},250))},_itemTmpl:function(){var e=this,t='<li class="k-tile" '+a.attr("uid")+'="#=uid#" ';return t+=a.attr("type")+'="${'+_+'}">',t+="#if("+_+' == "d") { #',t+='<div class="k-thumb"><span class="k-icon k-i-folder"></span></div>',t+="#}else{#",t+=e.options.transport&&e.options.transport.thumbnailUrl?'<div class="k-thumb"><span class="k-icon k-i-loading"></span></div>':'<div class="k-thumb"><span class="k-icon k-i-file"></span></div>',t+="#}#",t+="<strong>${"+g+"}</strong>",t+="#if("+_+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+v+")}</span> #}#",t+="</li>",d(a.template(t),{sizeFormatter:i})}}),a.ui.plugin(o)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/undoredostack.min",["kendo.core.min"],e)}(function(){!function(e){var t=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this,t),this.clear()},events:["undo","redo"],push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1},undo:function(){if(this.canUndo()){var e=this.stack[this.currentCommandIndex--];e.undo(),this.trigger("undo",{command:e})}},redo:function(){if(this.canRedo()){var e=this.stack[++this.currentCommandIndex];e.redo(),this.trigger("redo",{command:e})}},clear:function(){this.stack=[],this.currentCommandIndex=-1},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}});e.deepExtend(e,{util:{UndoRedoStack:t}})}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/main.min",["util/undoredostack.min","kendo.combobox.min","kendo.dropdownlist.min","kendo.window.min","kendo.colorpicker.min"],e)}(function(){!function(e,t){var n,i,r,o,a,s=window.kendo,l=s.Class,d=s.ui.Widget,c=s.support.mobileOS,u=s.support.browser,h=e.extend,f=e.proxy,p=s.deepExtend,m=s.keys,g="select",v=l.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return s.template(e.template,{useWithBlock:!1})(e)}}),_={editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap" role="presentation"><ul class="k-editor-toolbar" role="toolbar" /></td></tr><tr><td class="k-editable-area" /></tr></tbody></table>',buttonTemplate:'# var iconCssClass= "k-i-" + kendo.toHyphens(data.cssClass.replace("k-", ""));#<a href="" role="button" class="k-tool"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #"><span unselectable="on" class="k-tool-icon #= iconCssClass #"></span><span class="k-tool-text">#= data.title #</span></a>',colorPickerTemplate:'<div class="k-colorpicker #= data.cssClass #" />',comboBoxTemplate:'<select title="#= data.title #" class="#= data.cssClass #" />',dropDownListTemplate:'<span class="k-editor-dropdown"><select title="#= data.title #" class="#= data.cssClass #" /></span>',separatorTemplate:'<span class="k-separator" />',overflowAnchorTemplate:'<a href="" role="button" class="k-tool k-overflow-anchor" data-popup unselectable="on"><span unselectable="on" class="k-icon k-i-more"></span></a>',formatByName:function(t,n){for(var i=0;i<n.length;i++)if(e.inArray(t,n[i].tags)>=0)return n[i]},registerTool:function(e,t){var n=t.options;n&&n.template&&(n.template.options.cssClass="k-"+e),t.name||(t.options.name=e,t.name=e.toLowerCase()),y.defaultTools[e]=t},registerFormat:function(e,t){y.fn.options.formats[e]=t}},b={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertFile:"Insert file",insertHtml:"Insert HTML",viewHtml:"View HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",formatting:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",editAreaTitle:"Editable area. Press F10 for toolbar.",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",imageWidth:"Width (px)",imageHeight:"Height (px)",fileWebAddress:"Web address",fileTitle:"Title",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogOk:"Ok",dialogCancel:"Cancel",createTable:"Create table",createTableHint:"Create a {0} x {1} table",addColumnLeft:"Add column on the left",addColumnRight:"Add column on the right",addRowAbove:"Add row above",addRowBelow:"Add row below",deleteRow:"Delete row",deleteColumn:"Delete column",tableWizard:"Table Wizard",tableTab:"Table",cellTab:"Cell",accessibilityTab:"Accessibility",caption:"Caption",summary:"Summary",width:"Width",height:"Height",cellSpacing:"Cell Spacing",cellPadding:"Cell Padding",cellMargin:"Cell Margin",alignment:"Alignment",background:"Background",cssClass:"CSS Class",id:"ID",border:"Border",borderStyle:"Border Style",collapseBorders:"Collapse borders",wrapText:"Wrap text",associateCellsWithHeaders:"Associate cells with headers",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignLeftTop:"Align Left Top",alignCenterTop:"Align Center Top",alignRightTop:"Align Right Top",alignLeftMiddle:"Align Left Middle",alignCenterMiddle:"Align Center Middle",alignRightMiddle:"Align Right Middle",alignLeftBottom:"Align Left Bottom",alignCenterBottom:"Align Center Bottom",alignRightBottom:"Align Right Bottom",alignRemove:"Remove Alignment",columns:"Columns",rows:"Rows",selectAllCells:"Select All Cells"},k=!c||c.ios&&c.flatVersion>=500||!c.ios&&t!==document.documentElement.contentEditable,w={basic:["bold","italic","underline"],alignment:["justifyLeft","justifyCenter","justifyRight"],lists:["insertUnorderedList","insertOrderedList"],indenting:["indent","outdent"],links:["createLink","unlink"],tables:["tableWizard","createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"]},y=d.extend({init:function(n,i){var r,o,a,l,c,u=this,m=s.ui.editor,g=m.Dom;k&&(d.fn.init.call(u,n,i),u.options=p({},u.options,i),u.options.tools=u.options.tools.slice(),n=u.element,c=n[0],l=g.name(c),this._registerHandler(n.closest("form"),"submit",f(u.update,u,t)),a=h({},u.options),a.editor=u,"textarea"==l?(u._wrapTextarea(),o=u.wrapper.find(".k-editor-toolbar"),c.id&&o.attr("aria-controls",c.id)):(u.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),a.popup=!0,o=e('<ul class="k-editor-toolbar" role="toolbar" />').insertBefore(n)),u.toolbar=new m.Toolbar(o[0],a),u.toolbar.bindTo(u),"textarea"==l&&setTimeout(function(){var e=u.wrapper[0].style.height,t=parseInt(e,10),n=u.wrapper.height();e.indexOf("px")>0&&!isNaN(t)&&n>t&&u.wrapper.height(t-(n-t))}),u._resizable(),u._initializeContentElement(u),u.keyboard=new m.Keyboard([new m.BackspaceHandler(u),new m.TypingHandler(u),new m.SystemHandler(u),new m.SelectAllHandler(u)]),u.clipboard=new m.Clipboard(this),u.undoRedoStack=new s.util.UndoRedoStack,i&&i.value?r=i.value:u.textarea?(r=c.value,u.options.encoded&&e.trim(c.defaultValue).length&&(r=c.defaultValue),r=r.replace(/[\r\n\v\f\t ]+/gi," ")):r=c.innerHTML,u.value(r||s.ui.editor.emptyElementContent),this._registerHandler(document,{mousedown:function(){u._endTyping()},mouseup:function(){u._mouseup()}}),u._initializeImmutables(),u.toolbar.resize(),s.notify(u))},setOptions:function(e){var t=this;d.fn.setOptions.call(t,e),e.tools&&t.toolbar.bindTo(t)},_endTyping:function(){var e=this.keyboard;try{e.isTypingInProgress()&&(e.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){this._selectionStarted=!1,this.saveSelection(),this.trigger("select",{})},_resizable:function(){var n=this.options.resizable,i=e.isPlainObject(n)?n.content===t||n.content===!0:n;i&&this.textarea&&(e("<div class='k-resize-handle'><span class='k-icon k-i-resize-se' /></div>").insertAfter(this.textarea),this.wrapper.kendoResizable(h({},this.options.resizable,{start:function(t){var n=this.editor=e(t.currentTarget).closest(".k-editor");this.initialSize=n.height(),n.find("td:last").append("<div class='k-overlay' />")},resize:function(e){var t=e.y.initialDelta,n=this.initialSize+t,i=this.options.min||0,r=this.options.max||1/0;n=Math.min(r,Math.max(i,n)),this.editor.height(n)},resizeend:function(){this.editor.find(".k-overlay").remove(),this.editor=null}})))},_initializeTableResizing:function(){var e=this;s.ui.editor.TableResizing.create(e),e._showTableResizeHandlesProxy=f(e._showTableResizeHandles,e),e.bind(g,e._showTableResizeHandlesProxy)},_destroyTableResizing:function(){var e=this,t=e.tableResizing;t&&(t.destroy(),e.tableResizing=null),e._showTableResizeHandlesProxy&&e.unbind(g,e._showTableResizeHandlesProxy)},_showTableResizeHandles:function(){var e=this,t=e.tableResizing;t&&t.showResizeHandles()},_initializeColumnResizing:function(){s.ui.editor.ColumnResizing.create(this)},_destroyColumnResizing:function(){var e=this;e.columnResizing&&(e.columnResizing.destroy(),e.columnResizing=null)},_initializeRowResizing:function(){s.ui.editor.RowResizing.create(this)},_destroyRowResizing:function(){var e=this;e.rowResizing&&(e.rowResizing.destroy(),e.rowResizing=null)},_wrapTextarea:function(){var t=this,n=t.element,i=n[0].style.width,r=n[0].style.height,o=_.editorWrapperTemplate,a=e(o).insertBefore(n).width(i).height(r),s=a.find(".k-editable-area");n.attr("autocomplete","off").appendTo(s).addClass("k-content k-raw-content").css("display","none"),t.textarea=n,t.wrapper=a},_createContentElement:function(t){var n,i,r,o=this,a=o.textarea,l=o.options.domain,d=l||document.domain,h="",f='javascript:""';return(l||d!=location.hostname)&&(h='<script>document.domain="'+d+'"</script>',f="javascript:document.write('"+h+"')"),a.hide(),n=e("<iframe />",{title:o.options.messages.editAreaTitle,frameBorder:"0"})[0],e(n).css("display","").addClass("k-content").attr("tabindex",a[0].tabIndex).insertBefore(a),n.src=f,i=n.contentWindow||n,r=i.document||n.contentDocument,e(n).one("load",function(){o.toolbar.decorateFrom(r.body)}),r.open(),r.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;height:100%;min-height:100%;}body{box-sizing:border-box;font-size:12px;font-family:Verdana,Geneva,sans-serif;margin-top:-1px;padding:5px .4em 0;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+(s.support.isRtl(a)?"direction:rtl;":"")+(u.msie||u.edge?"height:auto;":"")+(c.ios?"word-break:break-all;":"")+"}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\\3Ascript{display: none;}.k-table{width:100%;border-spacing:0;margin: 0 0 1em;}.k-table td{min-width:1px;padding:.2em .3em;}.k-table,.k-table td{outline:0;border: 1px dotted #ccc;}.k-table p{margin:0;padding:0;}.k-column-resize-handle-wrapper {position: absolute; height: 10px; width:10px; cursor: col-resize; z-index: 2;}.k-column-resize-handle {width: 100%; height: 100%;}.k-column-resize-handle > .k-column-resize-marker {width:2px; height:100%; margin:0 auto; background-color:#00b0ff; display:none; opacity:0.8;}.k-row-resize-handle-wrapper {position: absolute; cursor: row-resize; z-index:2; width: 10px; height: 10px;}.k-row-resize-handle {display: table; width: 100%; height: 100%;}.k-row-resize-marker-wrapper{display: table-cell; height:100%; width:100%; margin:0; padding:0; vertical-align: middle;}.k-row-resize-marker{margin: 0; padding:0; width:100%; height:2px; background-color: #00b0ff; opacity:0.8; display:none;}.k-table-resize-handle-wrapper {position: absolute; background-color: #fff; border: 1px solid #000; z-index: 100; width: 5px; height: 5px;}.k-table-resize-handle {width: 100%; height: 100%;}.k-table-resize-handle.k-resize-east{cursor:e-resize;}.k-table-resize-handle.k-resize-north{cursor:n-resize;}.k-table-resize-handle.k-resize-northeast{cursor:ne-resize;}.k-table-resize-handle.k-resize-northwest{cursor:nw-resize;}.k-table-resize-handle.k-resize-south{cursor:s-resize;}.k-table-resize-handle.k-resize-southeast{cursor:se-resize;}.k-table-resize-handle.k-resize-southwest{cursor:sw-resize;}.k-table-resize-handle.k-resize-west{cursor:w-resize;}.k-table.k-table-resizing{opacity:0.6;}k\\:script{display:none;}</style>"+h+"<script>(function(d,c){d[c]('header'),d[c]('article'),d[c]('nav'),d[c]('section'),d[c]('footer');})(document, 'createElement');</script>"+e.map(t,function(e){return"<link rel='stylesheet' href='"+e+"'>"}).join("")+"</head><body autocorrect='off' contenteditable='true'></body></html>"),
r.close(),i},_blur:function(){var e=this.textarea,t=e?e.val():this._oldValue,n=this.options.encoded?this.encodedValue():this.value();this.update(),e&&e.trigger("blur"),n!=t&&this.trigger("change")},_spellCorrect:function(e){var n,i=!1;this._registerHandler(e.body,{contextmenu:function(){e.one("select",function(){n=null}),e._spellCorrectTimeout=setTimeout(function(){n=new s.ui.editor.RestorePoint(e.getRange(),e.body),i=!1},10)},input:function(){if(n)return s.support.browser.mozilla&&!i?(i=!0,t):(s.ui.editor._finishUpdate(e,n),t)}})},_registerHandler:function(t,n,i){var r,o=".kendoEditor";if(t=e(t),this._handlers||(this._handlers=[]),t.length)if(e.isPlainObject(n))for(r in n)n.hasOwnProperty(r)&&this._registerHandler(t,r,n[r]);else n=n.split(" ").join(o+" ")+o,this._handlers.push({element:t,type:n,handler:i}),t.on(n,i)},_deregisterHandlers:function(){var e,t,n=this._handlers;for(e=0;e<n.length;e++)t=n[e],t.element.off(t.type,t.handler);this._handlers=[]},_initializeContentElement:function(){var n,i,r,o=this;o.textarea?(o.window=o._createContentElement(o.options.stylesheets),n=o.document=o.window.contentDocument||o.window.document,o.body=n.body,i=o.window,r=n,this._registerHandler(n,"mouseup",f(this._mouseup,this))):(o.window=window,n=o.document=document,o.body=o.element[0],i=o.body,r=o.body,o.toolbar.decorateFrom(o.body)),this._registerHandler(i,"blur",f(this._blur,this)),this._registerHandler(r,"mousedown ",f(this._mousedown,this));try{n.execCommand("enableInlineTableEditing",null,!1)}catch(a){}s.support.touch&&this._registerHandler(n,{selectionchange:f(this._selectionChange,this),keydown:function(){s._activeElement()!=n.body&&o.window.focus()}}),this._spellCorrect(o),this._registerHandler(o.body,{keydown:function(e){var n,i,r,a,s,l,d,c,u,h;return(e.keyCode!==m.BACKSPACE&&e.keyCode!==m.DELETE||"true"===o.body.getAttribute("contenteditable"))&&(e.keyCode===m.F10?(setTimeout(f(o.toolbar.focus,o.toolbar),100),e.preventDefault(),t):(e.keyCode!=m.LEFT&&e.keyCode!=m.RIGHT||(n=o.getRange(),i=e.keyCode==m.LEFT,r=n[i?"startContainer":"endContainer"],a=n[i?"startOffset":"endOffset"],s=i?-1:1,l=a+s,d=i?l:a,3==r.nodeType&&"\ufeff"==r.nodeValue[d]&&(n.setStart(r,l),n.collapse(!0),o.selectRange(n))),c=o.toolbar.tools,u=o.keyboard.toolFromShortcut(c,e),h=u?c[u].options:{},u&&!h.keyPressCommand?(e.preventDefault(),/^(undo|redo)$/.test(u)||o.keyboard.endTyping(!0),o.trigger("keydown",e),o.exec(u),o._runPostContentKeyCommands(e),!1):(o.keyboard.clearTimeout(),o.keyboard.keydown(e),t)))},keypress:function(e){setTimeout(function(){o._runPostContentKeyCommands(e),o._showTableResizeHandles()},0)},keyup:function(t){var n=[m.BACKSPACE,m.TAB,m.PAGEUP,m.PAGEDOWN,m.END,m.HOME,m.LEFT,m.UP,m.RIGHT,m.DOWN,m.INSERT,m.DELETE];(e.inArray(t.keyCode,n)>-1||65==t.keyCode&&t.ctrlKey&&!t.altKey&&!t.shiftKey)&&o._selectionChange(),o.keyboard.keyup(t)},click:function(e){var t,n=s.ui.editor.Dom;"img"===n.name(e.target)&&(t=o.createRange(),t.selectNode(e.target),o.selectRange(t))},"cut copy paste":function(e){o.clipboard["on"+e.type](e)},focusin:function(){o.body.hasAttribute("contenteditable")&&(e(this).addClass("k-state-active"),o.toolbar.show())},focusout:function(){setTimeout(function(){var t,n=s._activeElement(),i=o.body,r=o.toolbar;r.options.popup&&(t=r.window.element.get(0),t&&!e.contains(t,n)&&t!=n&&(r.preventPopupHide=!1)),n==i||e.contains(i,n)||e(n).is(".k-editortoolbar-dragHandle")||r.focused()||(e(i).removeClass("k-state-active"),r.hide())},10)}}),o._initializeColumnResizing(),o._initializeRowResizing(),o._initializeTableResizing()},_initializeImmutables:function(){var e=this,t=s.ui.editor;e.options.immutables&&(e.immutables=new t.Immutables(e))},_mousedown:function(t){var n,i=this;i._selectionStarted=!0,u.gecko||(n=e(t.target),(2==t.which||1==t.which&&t.ctrlKey)&&n.is("a[href]")&&window.open(n.attr("href"),"_new"))},_mouseup:function(){var e=this;e._selectionStarted&&setTimeout(function(){e._selectionChange()},1)},_runPostContentKeyCommands:function(e){var t,n,i,r,o=this.getRange(),a=this.keyboard.toolsFromShortcut(this.toolbar.tools,e);for(t=0;t<a.length;t++)n=a[t],i=n.options,i.keyPressCommand&&(r=new i.command({range:o}),r.changesContent()&&(this.keyboard.endTyping(!0),this.exec(n.name)))},refresh:function(){var e=this;e.textarea&&(e._destroyResizings(),e.textarea.val(e.value()),e.wrapper.find("iframe").remove(),e._initializeContentElement(e),e.value(e.textarea.val()))},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:b,formats:{},encoded:!0,domain:null,resizable:!1,deserialization:{custom:null},serialization:{entities:!0,semantic:!0,scripts:!1},pasteCleanup:{all:!1,css:!1,custom:null,keepNewLines:!1,msAllFormatting:!1,msConvertLists:!0,msTags:!0,none:!1,span:!1},stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},imageBrowser:null,fileBrowser:null,fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:[].concat.call(["formatting"],w.basic,w.alignment,w.lists,w.indenting,w.links,["insertImage"],w.tables)},destroy:function(){var e=this;d.fn.destroy.call(this),this._endTyping(!0),this._deregisterHandlers(),clearTimeout(this._spellCorrectTimeout),this._focusOutside(),this.toolbar.destroy(),e._destroyResizings(),s.destroy(this.wrapper)},_destroyResizings:function(){var e=this;e._destroyTableResizing(),s.ui.editor.TableResizing.dispose(e),e._destroyRowResizing(),s.ui.editor.RowResizing.dispose(e),e._destroyColumnResizing(),s.ui.editor.ColumnResizing.dispose(e)},_focusOutside:function(){if(s.support.browser.msie&&this.textarea){var t=e("<input style='position:fixed;left:1px;top:1px;width:1px;height:1px;font-size:0;border:0;opacity:0' />").appendTo(document.body).focus();t.blur().remove()}},state:function(e){var t,n,i=y.defaultTools[e],r=i&&(i.options.finder||i.finder),o=s.ui.editor.RangeUtils;return!!r&&(t=this.getRange(),n=o.textNodes(t),!n.length&&t.collapsed&&(n=[t.startContainer]),r.getFormat?r.getFormat(n):r.isFormatted(n))},value:function(e){var n=this.body,i=s.ui.editor,r=this.options,o=i.Serializer.domToXhtml(n,r.serialization);return e===t?o:(e!=o&&(i.Serializer.htmlToDom(e,n,r.deserialization),this.selectionRestorePoint=null,this.update(),this.toolbar.refreshTools()),t)},saveSelection:function(t){t=t||this.getRange();var n=t.commonAncestorContainer,i=this.body;(n==i||e.contains(i,n))&&(this.selectionRestorePoint=new s.ui.editor.RestorePoint(t,i))},_focusBody:function(){var e,t=this.body,n=this.wrapper&&this.wrapper.find("iframe")[0],i=this.document.documentElement,r=s._activeElement();r!=t&&r!=n&&(e=i.scrollTop,t.focus(),i.scrollTop=e)},restoreSelection:function(){this._focusBody(),this.selectionRestorePoint&&this.selectRange(this.selectionRestorePoint.toRange())},focus:function(){this.restoreSelection()},update:function(e){e=e||this.options.encoded?this.encodedValue():this.value(),this.textarea?this.textarea.val(e):this._oldValue=e},encodedValue:function(){return s.ui.editor.Dom.encode(this.value())},createRange:function(e){return s.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return s.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(e){this._focusBody();var t=this.getSelection();t.removeAllRanges(),t.addRange(e),this.saveSelection(e)},getRange:function(){var e=this.getSelection(),t=e&&e.rangeCount>0?e.getRangeAt(0):this.createRange(),n=this.document;return t.startContainer!=n||t.endContainer!=n||t.startOffset||t.endOffset||(t.setStart(this.body,0),t.collapse(!0)),t},selectedHtml:function(){return s.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(t,n){this.focus();var i=new s.ui.editor.InsertHtmlCommand(e.extend({range:this.getRange(),html:t},n));i.editor=this,i.exec()},exec:function(e,n){var i,r,o,a,s=this,l=null;if(!e)throw Error("kendoEditor.exec(): `name` parameter cannot be empty");if("true"!==s.body.getAttribute("contenteditable")&&"print"!==e&&"pdf"!==e)return!1;if(e=e.toLowerCase(),s.keyboard.isTypingInProgress()||s.restoreSelection(),r=s.toolbar.toolById(e),!r)for(a in y.defaultTools)if(a.toLowerCase()==e){r=y.defaultTools[a];break}if(r){if(i=s.getRange(),r.command&&(l=r.command(h({range:i,body:s.body,immutables:!!s.immutables},n))),o=s.trigger("execute",{name:e,command:l}))return;if(/^(undo|redo)$/i.test(e))s.undoRedoStack[e]();else if(l&&(l.managesUndoRedo||s.undoRedoStack.push(l),l.editor=s,l.exec(),l.async))return l.change=f(s._selectionChange,s),t;s._selectionChange()}}});y.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},s.ui.plugin(y),n=l.extend({init:function(e){this.options=e},initialize:function(e,t){e.attr({unselectable:"on",title:t.title}),e.children(".k-tool-text").html(t.title)},command:function(e){return new this.options.command(e)},update:e.noop}),n.exec=function(e,t,n){e.exec(t,{value:n})},i=n.extend({init:function(e){n.fn.init.call(this,e)},command:function(e){var t=this;return new s.ui.editor.FormatCommand(h(e,{formatter:t.options.formatter}))},update:function(e,t){var n=this.options.finder.isFormatted(t);e.toggleClass("k-state-selected",n),e.attr("aria-pressed",n)}}),_.registerTool("separator",new n({template:new v({template:_.separatorTemplate})})),r=u.msie&&u.version<9?"\ufeff":"",o="\ufeff",a=o,u.msie&&10==u.version&&(a="&nbsp;"),h(s.ui,{editor:{ToolTemplate:v,EditorUtils:_,Tool:n,FormatTool:i,_bomFill:r,emptyElementContent:o,emptyTableCellContent:a}}),s.PDFMixin&&(s.PDFMixin.extend(y.prototype),y.prototype._drawPDF=function(){return s.drawing.drawDOM(this.body,this.options.pdf)},y.prototype.saveAsPDF=function(){var t,n=new e.Deferred,i=n.promise(),r={promise:i};if(!this.trigger("pdfExport",r))return t=this.options.pdf,this._drawPDF(n).then(function(e){return s.drawing.exportPDF(e,t)}).done(function(e){s.saveAs({dataURI:e,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy}),n.resolve()}).fail(function(e){n.reject(e)}),i})}(window.jQuery||window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/dom.min",["editor/main.min"],e)}(function(){!function(e){function t(e){var t,n,i={};for(t=0,n=e.length;t<n;t++)i[e[t]]=!0;return i}var n,i,r,o,a,s,l,d,c,u,h,f=window.kendo,p=e.map,m=e.extend,g=f.support.browser,v="style",_="float",b="cssFloat",k="styleFloat",w="class",y="k-marker",x=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),C="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,map,menu,noframes,noscript,object,pre,script,table,tbody,td,tfoot,th,thead,tr,header,article,nav,footer,section,aside,main,figure,figcaption".split(","),T=C.concat(["ul","ol","li"]),S=t(T),D="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var,data,time,mark,ruby".split(","),E=t(D),F=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),R=function(e){1==e.nodeType&&e.normalize()};g.msie&&g.version>=8&&(R=function(e){if(1==e.nodeType&&e.firstChild)for(var t=e.firstChild,n=t;;){if(n=n.nextSibling,!n)break;3==n.nodeType&&3==t.nodeType&&(n.nodeValue=t.nodeValue+n.nodeValue,h.remove(t)),t=n}}),n=/^\s+$/,i=/^[\n\r\t]+$/,r=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,o=/\ufeff/g,a=/^(\s+|\ufeff)$/,l="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),d=/[<>\&]/g,c=/[\u00A0-\u2666<>\&]/g,u={34:"quot",38:"amp",39:"apos",60:"lt",62:"gt",160:"nbsp",161:"iexcl",162:"cent",163:"pound",164:"curren",165:"yen",166:"brvbar",167:"sect",168:"uml",169:"copy",170:"ordf",171:"laquo",172:"not",173:"shy",174:"reg",175:"macr",176:"deg",177:"plusmn",178:"sup2",179:"sup3",180:"acute",181:"micro",182:"para",183:"middot",184:"cedil",185:"sup1",186:"ordm",187:"raquo",188:"frac14",189:"frac12",190:"frac34",191:"iquest",192:"Agrave",193:"Aacute",194:"Acirc",195:"Atilde",196:"Auml",197:"Aring",198:"AElig",199:"Ccedil",200:"Egrave",201:"Eacute",202:"Ecirc",203:"Euml",204:"Igrave",205:"Iacute",206:"Icirc",207:"Iuml",208:"ETH",209:"Ntilde",210:"Ograve",211:"Oacute",212:"Ocirc",213:"Otilde",214:"Ouml",215:"times",216:"Oslash",217:"Ugrave",218:"Uacute",219:"Ucirc",220:"Uuml",221:"Yacute",222:"THORN",223:"szlig",224:"agrave",225:"aacute",226:"acirc",227:"atilde",228:"auml",229:"aring",230:"aelig",231:"ccedil",232:"egrave",233:"eacute",234:"ecirc",235:"euml",236:"igrave",237:"iacute",238:"icirc",239:"iuml",240:"eth",241:"ntilde",242:"ograve",243:"oacute",244:"ocirc",245:"otilde",246:"ouml",247:"divide",248:"oslash",249:"ugrave",250:"uacute",251:"ucirc",252:"uuml",253:"yacute",254:"thorn",255:"yuml",402:"fnof",913:"Alpha",914:"Beta",915:"Gamma",916:"Delta",917:"Epsilon",918:"Zeta",919:"Eta",920:"Theta",921:"Iota",922:"Kappa",923:"Lambda",924:"Mu",925:"Nu",926:"Xi",927:"Omicron",928:"Pi",929:"Rho",931:"Sigma",932:"Tau",933:"Upsilon",934:"Phi",935:"Chi",936:"Psi",937:"Omega",945:"alpha",946:"beta",947:"gamma",948:"delta",949:"epsilon",950:"zeta",951:"eta",952:"theta",953:"iota",954:"kappa",955:"lambda",956:"mu",957:"nu",958:"xi",959:"omicron",960:"pi",961:"rho",962:"sigmaf",963:"sigma",964:"tau",965:"upsilon",966:"phi",967:"chi",968:"psi",969:"omega",977:"thetasym",978:"upsih",982:"piv",8226:"bull",8230:"hellip",8242:"prime",8243:"Prime",8254:"oline",8260:"frasl",8472:"weierp",8465:"image",8476:"real",8482:"trade",8501:"alefsym",8592:"larr",8593:"uarr",8594:"rarr",8595:"darr",8596:"harr",8629:"crarr",8656:"lArr",8657:"uArr",8658:"rArr",8659:"dArr",8660:"hArr",8704:"forall",8706:"part",8707:"exist",8709:"empty",8711:"nabla",8712:"isin",8713:"notin",8715:"ni",8719:"prod",8721:"sum",8722:"minus",8727:"lowast",8730:"radic",8733:"prop",8734:"infin",8736:"ang",8743:"and",8744:"or",8745:"cap",8746:"cup",8747:"int",8756:"there4",8764:"sim",8773:"cong",8776:"asymp",8800:"ne",8801:"equiv",8804:"le",8805:"ge",8834:"sub",8835:"sup",8836:"nsub",8838:"sube",8839:"supe",8853:"oplus",8855:"otimes",8869:"perp",8901:"sdot",8968:"lceil",8969:"rceil",8970:"lfloor",8971:"rfloor",9001:"lang",9002:"rang",9674:"loz",9824:"spades",9827:"clubs",9829:"hearts",9830:"diams",338:"OElig",339:"oelig",352:"Scaron",353:"scaron",376:"Yuml",710:"circ",732:"tilde",8194:"ensp",8195:"emsp",8201:"thinsp",8204:"zwnj",8205:"zwj",8206:"lrm",8207:"rlm",8211:"ndash",8212:"mdash",8216:"lsquo",8217:"rsquo",8218:"sbquo",8220:"ldquo",8221:"rdquo",8222:"bdquo",8224:"dagger",8225:"Dagger",8240:"permil",8249:"lsaquo",8250:"rsaquo",8364:"euro"},h={block:S,inline:E,findNodeIndex:function(e,t){var n=0;if(!e)return-1;for(;;){if(e=e.previousSibling,!e)break;t&&3==e.nodeType||n++}return n},isDataNode:function(e){return e&&null!==e.nodeValue&&null!==e.data},isAncestorOf:function(t,n){try{return!h.isDataNode(t)&&(e.contains(t,h.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(i){return!1}},isAncestorOrSelf:function(e,t){return h.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(h.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return h.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n,i=e.cloneNode(!1),r="",o=e.nextSibling;o&&3==o.nodeType&&o.nodeValue;)r+=o.nodeValue,n=o,o=o.nextSibling,h.remove(n);e.deleteData(t,e.length),i.deleteData(0,t),i.nodeValue+=r,h.insertAfter(i,e)},attrEquals:function(e,t){var n,i;for(n in t)if(i=e[n],n==_&&(i=e[f.support.cssFloat?b:k]),"object"==typeof i){if(!h.attrEquals(i,t[n]))return!1}else if(i!=t[n])return!1;return!0},blockParentOrBody:function(e){return h.parentOfType(e,T)||e.ownerDocument.body},blockParents:function(t){var n,i,r,o=[];for(n=0,i=t.length;n<i;n++)r=h.parentOfType(t[n],h.blockElements),r&&e.inArray(r,o)<0&&o.push(r);return o},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:R,blockElements:T,nonListBlockElements:C,inlineElements:D,empty:x,fillAttrs:F,nodeTypes:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},toHex:function(e){var t=r.exec(e);return t?"#"+p(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e,t){var n=!t||t.entities?c:d;return e.replace(n,function(e){var t=e.charCodeAt(0),n=u[t];return n?"&"+n+";":e})},isBom:function(e){return e&&3===e.nodeType&&/^[\ufeff]+$/.test(e.nodeValue)},stripBom:function(e){return(e||"").replace(o,"")},stripBomNode:function(e){h.isBom(e)&&e.parentNode.removeChild(e)},insignificant:function(e){var t=e.attributes;return"k-marker"==e.className||h.is(e,"br")&&("k-br"==e.className||t._moz_dirty||t._moz_editor_bogus_node)},tableCell:function(e){return h.is(e,"td")||h.is(e,"th")},significantNodes:function(t){return e.grep(t,function(e){var t=h.name(e);return"br"!=t&&(!h.insignificant(e)&&(!h.emptyTextNode(e)&&!(1==e.nodeType&&!x[t]&&h.emptyNode(e))))})},emptyTextNode:function(e){return e&&3==e.nodeType&&a.test(e.nodeValue)},emptyNode:function(e){return 1==e.nodeType&&!h.significantNodes(e.childNodes).length},name:function(e){return e.nodeName.toLowerCase()},significantChildNodes:function(t){return e.grep(t.childNodes,function(e){return 3!=e.nodeType||!h.isWhitespace(e)})},lastTextNode:function(e){var t,n=null;if(3==e.nodeType)return e;for(t=e.lastChild;t;t=t.previousSibling)if(n=h.lastTextNode(t))return n;return n},is:function(e,t){return e&&h.name(e)==t},isMarker:function(e){return e.className==y},isWhitespace:function(e){return n.test(e.nodeValue)},isEmptyspace:function(e){return i.test(e.nodeValue)},htmlIndentSpace:function(t){var n,r,a,s,l,d;return!(!h.isDataNode(t)||!h.isWhitespace(t))&&(!!i.test(t.nodeValue)||(n=function(e,t){for(;e[t];)if(e=e[t],h.significantNodes([e]).length>0)return e},r=t.parentNode,a=n(t,"previousSibling"),s=n(t,"nextSibling"),o.test(t.nodeValue)?!(!a&&!s):!!e(r).is("tr,tbody,thead,tfoot,table,ol,ul")||!!((h.isBlock(r)||h.is(r,"body"))&&(l=a&&h.isBlock(a),d=s&&h.isBlock(s),!s&&l||!a&&d||l&&d))))},isBlock:function(e){return S[h.name(e)]},isEmpty:function(e){return x[h.name(e)]},isInline:function(e){return E[h.name(e)]},list:function(e){var t=e?h.name(e):"";return"ul"==t||"ol"==t||"dl"==t},scrollContainer:function(e){var t=h.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=f.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,i,r=e(h.isDataNode(t)?t.parentNode:t),o=h.windowFromDocument(t.ownerDocument),a=o.innerHeight,s=h.scrollContainer(t.ownerDocument);n=r.offset().top,i=r[0].offsetHeight,i||(i=parseInt(r.css("line-height"),10)||Math.ceil(1.2*parseInt(r.css("font-size"),10))||15),i+n>s.scrollTop+a&&(s.scrollTop=i+n-a)},persistScrollTop:function(e){s=h.scrollContainer(e).scrollTop},offset:function(e,t){for(var n={top:e.offsetTop,left:e.offsetLeft},i=e.offsetParent;i&&(!t||h.isAncestorOf(t,i));)n.top+=i.offsetTop,n.left+=i.offsetLeft,i=i.offsetParent;return n},restoreScrollTop:function(e){"number"==typeof s&&(h.scrollContainer(e).scrollTop=s)},insertAt:function(e,t,n){e.insertBefore(t,e.childNodes[n]||null)},insertBefore:function(e,t){return t.parentNode?t.parentNode.insertBefore(e,t):t},insertAfter:function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},remove:function(e){e.parentNode.removeChild(e)},removeTextSiblings:function(e){for(var t=e.parentNode;e.nextSibling&&3==e.nextSibling.nodeType;)t.removeChild(e.nextSibling);for(;e.previousSibling&&3==e.previousSibling.nodeType;)t.removeChild(e.previousSibling)},trim:function(e){var t,n;for(t=e.childNodes.length-1;t>=0;t--)n=e.childNodes[t],h.isDataNode(n)?(h.stripBom(n.nodeValue).length||h.remove(n),h.isWhitespace(n)&&h.insertBefore(n,e)):n.className!=y&&(h.trim(n),n.childNodes.length||h.isEmpty(n)||h.remove(n));return e},closest:function(e,t){for(;e&&h.name(e)!=t;)e=e.parentNode;return e},closestBy:function(e,t,n){for(;e&&!t(e);){if(n&&n(e))return null;e=e.parentNode}return e},sibling:function(e,t){do e=e[t];while(e&&1!=e.nodeType);return e},next:function(e){return h.sibling(e,"nextSibling")},prev:function(e){return h.sibling(e,"previousSibling")},parentOfType:function(e,t){do e=e.parentNode;while(e&&!h.ofType(e,t));return e},ofType:function(t,n){return e.inArray(h.name(t),n)>=0},changeTag:function(e,t,n){var i,r,o,a,s,l=h.create(e.ownerDocument,t),d=e.attributes;if(!n)for(i=0,r=d.length;i<r;i++)s=d[i],s.specified&&(o=s.nodeName,a=s.nodeValue,o==w?l.className=a:o==v?l.style.cssText=e.style.cssText:l.setAttribute(o,a));for(;e.firstChild;)l.appendChild(e.firstChild);return h.insertBefore(l,e),h.remove(e),l},editableParent:function(e){for(;e&&(3==e.nodeType||"true"!==e.contentEditable);)e=e.parentNode;return e},wrap:function(e,t){return h.insertBefore(t,e),t.appendChild(e),t},unwrap:function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)},wrapper:function(t){var n=h.closestBy(t,function(e){return e.parentNode&&h.significantNodes(e.parentNode.childNodes).length>1});return e(n).is("body,.k-editor")?void 0:n},create:function(e,t,n){return h.attr(e.createElement(t),n)},attr:function(e,t){t=m({},t),t&&v in t&&(h.style(e,t.style),delete t.style);for(var n in t)null===t[n]?(e.removeAttribute(n),delete t[n]):"className"==n&&(e[n]=t[n]);return m(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(e,t){for(var n in t)n==_&&(n=f.support.cssFloat?b:k),e.style[n]="";""===e.style.cssText&&e.removeAttribute(v)},inlineStyle:function(t,n,i){var r,o=e(h.create(t.ownerDocument,n,i));return t.appendChild(o[0]),r=p(l,function(e){return g.msie&&"line-height"==e&&"1px"==o.css(e)?"line-height:1.5":e+":"+o.css(e)}).join(";"),o.remove(),r},getEffectiveBackground:function(e){var t=e.css("background-color");return t.indexOf("rgba(0, 0, 0, 0")<0&&"transparent"!==t?t:"html"===e[0].tagName.toLowerCase()?"Window":h.getEffectiveBackground(e.parent())},innerText:function(e){var t=e.innerHTML;return t=t.replace(/<!--(.|\s)*?-->/gi,""),t=t.replace(/<\/?[^>]+?\/?>/gm,"")},removeClass:function(t,n){var i,r,o=" "+t.className+" ",a=n.split(" ");for(i=0,r=a.length;i<r;i++)o=o.replace(" "+a[i]+" "," ");o=e.trim(o),o.length?t.className=o:t.removeAttribute(w)},commonAncestor:function(){var e,t,n,i,r,o=arguments.length,a=[],s=1/0,l=null;if(!o)return null;if(1==o)return arguments[0];for(e=0;e<o;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;a.push(t.reverse()),s=Math.min(s,t.length)}if(1==o)return a[0][0];for(e=0;e<s;e++){for(i=a[0][e],r=1;r<o;r++)if(i!=a[r][e])return l;l=i}return l},closestSplittableParent:function(t){var n,i,r;return n=1==t.length?h.parentOfType(t[0],["ul","ol"]):h.commonAncestor.apply(null,t),n||(n=h.parentOfType(t[0],["p","td"])||t[0].ownerDocument.body),h.isInline(n)&&(n=h.blockParentOrBody(n)),i=p(t,h.editableParent),r=h.commonAncestor(i)[0],e.contains(n,r)&&(n=r),n},closestEditable:function(t,n){var i,r=h.editableParent(t);return i=h.ofType(t,n)?t:h.parentOfType(t,n),i&&r&&e.contains(i,r)?i=r:!i&&r&&(i=r),i},closestEditableOfType:function(e,t){var n=h.closestEditable(e,t);if(n&&h.ofType(n,t))return n},filter:function(e,t,n){var i=function(t){return h.name(t)==e};return h.filterBy(t,i,n)},filterBy:function(e,t,n){for(var i,r=0,o=e.length,a=[];r<o;r++)i=t(e[r]),(i&&!n||!i&&n)&&a.push(e[r]);return a},ensureTrailingBreaks:function(t){var n=e(t).find("p,td,th"),i=n.length,r=0;if(i)for(;r<i;r++)h.ensureTrailingBreak(n[r]);else h.ensureTrailingBreak(t)},removeTrailingBreak:function(t){e(t).find("br[type=_moz],.k-br").remove()},ensureTrailingBreak:function(e){var t,n,i;h.removeTrailingBreak(e),t=e.lastChild,n=t&&h.name(t),(!n||"br"!=n&&"img"!=n||"br"==n&&"k-br"!=t.className)&&(i=e.ownerDocument.createElement("br"),i.className="k-br",e.appendChild(i))}},f.ui.editor.Dom=h}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/serializer.min",["editor/dom.min"],e)}(function(){!function(e,t){var n,i,r,o,a=window.kendo,s=a.ui.editor,l=s.Dom,d=e.extend,c="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),u=/"/g,h=/<br[^>]*>/i,f=/^\d+(\.\d*)?(px)?$/i,p=/<p>(?:&nbsp;)?<\/p>/i,m=/(\*?[-#\/\*\\\w]+(?:\[[0-9a-z_-]+\])?)\s*:\s*((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/g,g=/^sizzle-\d+/i,v=/^k-script-/i,_=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,b='<br class="k-br">',k=document.createElement("div");k.innerHTML=" <hr>",n=3===k.firstChild.nodeType,k=null,i=e.isFunction,r="td",o={toEditableHtml:function(e){return(e||"").replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<(\/?)script([^>]*)>/gi,"<$1k:script$2>").replace(/<img([^>]*)>/gi,function(e){return e.replace(_,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1").replace(/^<(table|blockquote)/i,b+"<$1").replace(/^[\s]*(&nbsp;|\u00a0)/i,"$1").replace(/<\/(table|blockquote)>$/i,"</$1>"+b)},_toEditableImmutables:function(t){for(var n=s.Immutables.immutable,i=l.emptyTextNode,r=t.firstChild,o=t.lastChild;i(r);)r=r.nextSibling;for(;i(o);)o=o.previousSibling;r&&n(r)&&e(b).prependTo(t),o&&n(o)&&e(b).appendTo(t)},_fillEmptyElements:function(t){e(t).find("p,td").each(function(){var t,n=e(this);if(/^\s*$/g.test(n.text())&&!n.find("img,input").length){for(t=this;t.firstChild&&3!=t.firstChild.nodeType;)t=t.firstChild;1!=t.nodeType||l.empty[l.name(t)]||(t.innerHTML=l.is(t,"td")?a.ui.editor.emptyTableCellContent:a.ui.editor.emptyElementContent)}})},_removeSystemElements:function(t){e(".k-paste-container",t).remove()},_resetOrderedLists:function(e){var t,n,i,r=e.getElementsByTagName("ol");for(t=0;t<r.length;t++)n=r[t],i=n.getAttribute("start"),n.setAttribute("start",1),i?n.setAttribute("start",i):n.removeAttribute(i)},_preventScriptExecution:function(t){e(t).find("*").each(function(){var e,t,n,i,r=this.attributes;for(t=0,n=r.length;t<n;t++)e=r[t],i=e.nodeName,e.specified&&/^on/i.test(i)&&(this.setAttribute("k-script-"+i,e.value),this.removeAttribute(i))})},htmlToDom:function(t,n,r){var s=a.support.browser,d=s.msie,c=d&&s.version<9,u="originalsrc",h="originalhref",f=r||{},p=f.immutables;return t=o.toEditableHtml(t),c&&(t="<br/>"+t,t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,h+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,u+'="$1"')),i(f.custom)&&(t=f.custom(t)||t),n.innerHTML=t,p&&p.deserialize(n),c?(l.remove(n.firstChild),e(n).find("k\\:script,script,link,img,a").each(function(){var e=this;e[h]&&(e.setAttribute("href",e[h]),e.removeAttribute(h)),e[u]&&(e.setAttribute("src",e[u]),e.removeAttribute(u))})):d&&(l.normalize(n),o._resetOrderedLists(n)),o._preventScriptExecution(n),o._fillEmptyElements(n),o._removeSystemElements(n),o._toEditableImmutables(n),e("table",n).addClass("k-table"),n},domToXhtml:function(i,o){function d(t){return e.grep(t,function(e){return"style"!=e.name})}function _(t){var n,i,r,o=e.trim,a=o(t),s=[];for(m.lastIndex=0;;){if(n=m.exec(a),!n)break;i=o(n[1].toLowerCase()),r=o(n[2]),"font-size-adjust"!=i&&"font-stretch"!=i&&(i.indexOf("color")>=0?r=l.toHex(r):i.indexOf("font")>=0?r=r.replace(u,"'"):/\burl\(/g.test(r)&&(r=r.replace(u,"")),s.push({property:i,value:r}))}return s}function b(e){var t,n=_(e);for(t=0;t<n.length;t++)E.push(n[t].property),E.push(":"),E.push(n[t].value),E.push(";")}function k(e){var t,n,i,r,a,s,d=[],c=e.attributes;for(n=0,i=c.length;n<i;n++)t=c[n],r=t.nodeName,a=t.value,s=t.specified,"value"==r&&"value"in e&&e.value?s=!0:"type"==r&&"text"==a?s=!0:"class"!=r||a?g.test(r)?s=!1:"complete"==r?s=!1:"altHtml"==r?s=!1:"start"==r&&l.is(e,"ul")?s=!1:"start"==r&&l.is(e,"ol")&&"1"==a?s=!1:r.indexOf("_moz")>=0?s=!1:v.test(r)?s=!!o.scripts:"data-role"==r&&"resizable"==a&&(l.is(e,"tr")||l.is(e,"td"))&&(s=!1):s=!1,s&&d.push(t);return d}function w(n,i){var r,o,s,d,c,u,h,p;if(i=i||k(n),l.is(n,"img")&&(u=n.style.width,h=n.style.height,p=e(n),u&&f.test(u)&&(p.attr("width",parseInt(u,10)),l.unstyle(n,{width:t})),h&&f.test(h)&&(p.attr("height",parseInt(h,10)),l.unstyle(n,{height:t}))),i.length)for(i.sort(function(e,t){return e.nodeName>t.nodeName?1:e.nodeName<t.nodeName?-1:0}),r=0,o=i.length;r<o;r++)s=i[r],d=s.nodeName,c=s.value,"class"==d&&"k-table"==c||(d=d.replace(v,""),E.push(" "),E.push(d),E.push('="'),"style"==d?b(c||n.style.cssText):E.push("src"==d||"href"==d?a.htmlEncode(n.getAttribute(d,2)):l.fillAttrs[d]?d:c),E.push('"'))}function y(e,t,n){for(var i=e.firstChild;i;i=i.nextSibling)T(i,t,n)}function x(e){return e.nodeValue.replace(/\ufeff/g,"")}function C(e){if("\ufeff"===e.nodeValue){do{if(e=e.parentNode,l.is(e,r)&&1===e.childNodes.length)return!0;if(1!==e.childNodes.length)return!1}while(!l.isBlock(e));return!0}return!1}function T(i,r,a){var d,c,u,h,f,p=i.nodeType;if(!(e(i).hasClass("k-table-resize-handle")||e(i).hasClass("k-column-resize-handle")||e(i).hasClass("k-row-resize-handle")))if(F&&s.Immutables.immutable(i))E.push(F.serialize(i));else if(1==p){if(d=l.name(i),!d||l.insignificant(i))return;if(!o.scripts&&("script"==d||"k:script"==d))return;if(c=R[d],c&&(t===c.semantic||o.semantic^c.semantic))return c.start(i),y(i,!1,c.skipEncoding),c.end(i),t;E.push("<"),E.push(d),w(i),l.empty[d]?E.push(" />"):(E.push(">"),y(i,r||l.is(i,"pre")),E.push("</"),E.push(d),E.push(">"))}else if(3==p){if(C(i))return E.push("&nbsp;"),t;h=x(i),!r&&n&&(u=i.parentNode,f=i.previousSibling,f||(f=(l.isInline(u)?u:i).previousSibling),f&&""!==f.innerHTML&&!l.isBlock(f)||(h=h.replace(/^[\r\n\v\f\t ]+/,"")),h=h.replace(/ +/," ")),E.push(a?h:l.encode(h,o))}else 4==p?(E.push("<![CDATA["),E.push(i.data),E.push("]]>")):8==p&&(i.data.indexOf("[CDATA[")<0?(E.push("<!--"),E.push(i.data),E.push("-->")):(E.push("<!"),E.push(i.data),E.push(">")))}function S(e){var t=e.childNodes.length,n=t&&3==e.firstChild.nodeType;return n&&(1==t||2==t&&l.insignificant(e.lastChild))}function D(){e.isFunction(o.custom)&&(E=o.custom(E)||E)}var E=[],F=o&&o.immutables,R={iframe:{start:function(e){E.push("<iframe"),w(e),E.push(">")},end:function(){E.push("</iframe>")}},"k:script":{start:function(e){E.push("<script"),w(e),E.push(">")},end:function(){E.push("</script>")},skipEncoding:!0},span:{semantic:!0,start:function(t){var n,i,r=t.style,o=k(t),a=d(o);a.length&&(E.push("<span"),w(t,a),E.push(">")),"underline"==r.textDecoration&&E.push("<u>"),n=[],r.color&&n.push('color="'+l.toHex(r.color)+'"'),r.fontFamily&&n.push('face="'+r.fontFamily+'"'),r.fontSize&&(i=e.inArray(r.fontSize,c),n.push('size="'+i+'"')),n.length&&E.push("<font "+n.join(" ")+">")},end:function(e){var t=e.style;(t.color||t.fontFamily||t.fontSize)&&E.push("</font>"),
"underline"==t.textDecoration&&E.push("</u>"),d(k(e)).length&&E.push("</span>")}},strong:{semantic:!0,start:function(){E.push("<b>")},end:function(){E.push("</b>")}},em:{semantic:!0,start:function(){E.push("<i>")},end:function(){E.push("</i>")}},b:{semantic:!1,start:function(){E.push("<strong>")},end:function(){E.push("</strong>")}},i:{semantic:!1,start:function(){E.push("<em>")},end:function(){E.push("</em>")}},u:{semantic:!1,start:function(){E.push('<span style="text-decoration:underline;">')},end:function(){E.push("</span>")}},font:{semantic:!1,start:function(e){var t,n,i;E.push('<span style="'),t=e.getAttribute("color"),n=c[e.getAttribute("size")],i=e.getAttribute("face"),t&&(E.push("color:"),E.push(l.toHex(t)),E.push(";")),i&&(E.push("font-family:"),E.push(i),E.push(";")),n&&(E.push("font-size:"),E.push(n),E.push(";")),E.push('">')},end:function(){E.push("</span>")}}};return R.script=R["k:script"],o=o||{},t===o.semantic&&(o.semantic=!0),S(i)?(E=l.encode(x(i.firstChild).replace(/[\r\n\v\f\t ]+/," "),o),D(),E):(y(i),E=E.join(""),D(),""===E.replace(h,"").replace(p,"")?"":E)}},d(s,{Serializer:o})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/range.min",["editor/serializer.min"],e)}(function(){!function(e){function t(e,t,n,i){var r,o,a,s;if(e==t)return i-n;for(r=t;r&&r.parentNode!=e;)r=r.parentNode;if(r)return y(r)-n;for(r=e;r&&r.parentNode!=t;)r=r.parentNode;if(r)return i-y(r)-1;for(o=w.commonAncestor(e,t),a=e;a&&a.parentNode!=o;)a=a.parentNode;for(a||(a=o),s=t;s&&s.parentNode!=o;)s=s.parentNode;return s||(s=o),a==s?0:y(s)-y(a)}function n(e,n){function i(e){try{return t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)<0}catch(n){return!0}}i(e)&&(n?(e.commonAncestorContainer=e.endContainer=e.startContainer,e.endOffset=e.startOffset):(e.commonAncestorContainer=e.startContainer=e.endContainer,e.startOffset=e.endOffset),e.collapsed=!0)}function i(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!w.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function r(e){var t=e.duplicate(),n=e.duplicate();return t.collapse(!0),n.collapse(!1),w.commonAncestor(e.parentElement(),t.parentElement(),n.parentElement())}function o(e,t,n){var i,r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],a=0,s=x(r),l=s?r:r.childNodes[o]||null,d=s?r.parentNode:r,c=t.ownerDocument,u=c.body.createTextRange();3!=r.nodeType&&4!=r.nodeType||(a=o),d||(d=c.body),"img"==d.nodeName.toLowerCase()?(u.moveToElementText(d),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u)):(i=d.insertBefore(w.create(c,"a"),l),u.moveToElementText(i),w.remove(i),u[n?"moveStart":"moveEnd"]("character",a),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u))}function a(e,t,n,i){var r,o,a,s,l,d,c,u=w.create(t.ownerDocument,"a"),h=e.duplicate(),f=i?"StartToStart":"StartToEnd",p=!1;u.innerHTML="\ufeff",h.collapse(i),o=h.parentElement(),w.isAncestorOrSelf(n,o)||(o=n);do p?o.insertBefore(u,u.previousSibling):(o.appendChild(u),p=!0),h.moveToElementText(u);while((r=h.compareEndPoints(f,e))>0&&u.previousSibling);a=u.nextSibling,r==-1&&x(a)?(h.setEndPoint(i?"EndToStart":"EndToEnd",e),w.remove(u),d=[a,h.text.length]):(s=!i&&u.previousSibling,l=i&&u.nextSibling,x(l)?d=[l,0]:x(s)?d=[s,s.length]:(c=y(u),d=o.nextSibling&&c==o.childNodes.length-1?[o.nextSibling,0]:[o,c]),w.remove(u)),t[i?"setStart":"setEnd"].apply(t,d)}var s,l,d,c,u,h,f,p,m,g=window.kendo,v=g.Class,_=e.extend,b=g.ui.editor,k=g.support.browser,w=b.Dom,y=w.findNodeIndex,x=w.isDataNode,C=w.findClosestAncestor,T=w.getNodeLength,S=w.normalize,D={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new l(e.document)},selectionFromRange:function(e){var t=m.documentFromRange(e);return D.selectionFromDocument(t)},selectionFromDocument:function(e){return D.selectionFromWindow(w.windowFromDocument(e))}},E=v.extend({init:function(t){e.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(e,t){this.startContainer=e,this.startOffset=t,i(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,i(this),n(this,!1)},setStartBefore:function(e){this.setStart(e.parentNode,y(e))},setStartAfter:function(e){this.setStart(e.parentNode,y(e)+1)},setEndBefore:function(e){this.setEnd(e.parentNode,y(e))},setEndAfter:function(e){this.setEnd(e.parentNode,y(e)+1)},selectNode:function(e){this.setStartBefore(e),this.setEndAfter(e)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e[1===e.nodeType?"childNodes":"nodeValue"].length)},collapse:function(e){var t=this;e?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(C(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new s(t))},cloneContents:function(){var e=m.documentFromRange(this);return function t(n){for(var i,r=e.createDocumentFragment();i=n.next();)i=i.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&i.appendChild(t(n.getSubtreeIterator())),r.appendChild(i);return r}(new s(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(C(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=m.documentFromRange(t),function i(n){for(var r,o=e.createDocumentFragment();r=n.next();)n.hasPartialSubtree()?(r=r.cloneNode(!1),r.appendChild(i(n.getSubtreeIterator()))):n.remove(t.originalRange),o.appendChild(r);return o}(new s(n))},insertNode:function(e){var t=this;x(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&w.splitDataNode(t.startContainer,t.startOffset),w.insertAfter(e,t.startContainer)):w.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new E(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var e=this.startContainer.nodeName,t=this.endContainer.nodeName;return("#text"==e?this.startContainer.nodeValue:e)+"("+this.startOffset+") : "+("#text"==t?this.endContainer.nodeValue:t)+"("+this.endOffset+")"}});E.fromNode=function(e){return new E(e.ownerDocument)},s=v.extend({init:function(t){if(e.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var n=t.commonAncestorContainer;this._next=t.startContainer!=n||x(t.startContainer)?C(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||x(t.endContainer)?C(n,t.endContainer).nextSibling:t.endContainer.childNodes[t.endOffset]}},hasNext:function(){return!!this._next},next:function(){var e=this,t=e._current=e._next;return e._next=e._current&&e._current.nextSibling!=e._end?e._current.nextSibling:null,x(e._current)&&(e.range.endContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(e.range.endOffset,t.length-e.range.endOffset)),e.range.startContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(0,e.range.startOffset))),t},traverse:function(e){function t(){return i._current=i._next,i._next=i._current&&i._current.nextSibling!=i._end?i._current.nextSibling:null,i._current}for(var n,i=this;n=t();)i.hasPartialSubtree()?i.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,i,r,o,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;x(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,i=n-t,e&&(s||l)&&(a._current==e.startContainer&&t<=e.startOffset&&(e.startOffset-=i),a._current==e.endContainer&&n<=e.endOffset&&(e.endOffset-=i)),a._current.deleteData(t,i)):(r=a._current.parentNode,!e||a.range.startContainer!=r&&a.range.endContainer!=r||(o=y(a._current),r==e.startContainer&&o<=e.startOffset&&(e.startOffset-=1),r==e.endContainer&&o<e.endOffset&&(e.endOffset-=1)),w.remove(a._current))},hasPartialSubtree:function(){return!x(this._current)&&(w.isAncestorOrSelf(this._current,this.range.startContainer)||w.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){return new s(this.getSubRange())},getSubRange:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),w.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),w.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),t}}),l=v.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();o(t,e,!1),o(t,e,!0),t.select()},removeAllRanges:function(){var e=this.ownerDocument.selection;"None"!=e.type&&e.empty()},getRangeAt:function(){var e,t,n,i,o,s,l,d,c=new E(this.ownerDocument),u=this.ownerDocument.selection;try{if(e=u.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return c}catch(h){return c}if("Control"==u.type)c.selectNode(e.item(0));else if(n=r(e),a(e,c,n,!0),a(e,c,n,!1),9==c.startContainer.nodeType&&c.setStart(c.endContainer,c.startOffset),9==c.endContainer.nodeType&&c.setEnd(c.startContainer,c.endOffset),0===e.compareEndPoints("StartToEnd",e)&&c.collapse(!1),i=c.startContainer,o=c.endContainer,s=this.ownerDocument.body,!(c.collapsed||0!==c.startOffset||c.endOffset!=T(c.endContainer)||i==o&&x(i)&&i.parentNode==s)){for(l=!1,d=!1;0===y(i)&&i==i.parentNode.firstChild&&i!=s;)i=i.parentNode,l=!0;for(;y(o)==T(o.parentNode)-1&&o==o.parentNode.lastChild&&o!=s;)o=o.parentNode,d=!0;i==s&&o==s&&l&&d&&(c.setStart(i,0),c.setEnd(o,T(s)))}return c}}),d=v.extend({init:function(e){this.enumerate=function(){function t(e){if(w.is(e,"img")||3==e.nodeType&&(!w.isEmptyspace(e)||"\ufeff"==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new s(e).traverse(t),n}}}),c=s.extend({hasPartialSubtree:function(){var e=b.Immutables&&b.Immutables.immutable;return e&&!e(this._current)&&s.fn.hasPartialSubtree.call(this)},getSubtreeIterator:function(){return new c(this.getSubRange())}}),u=v.extend({init:function(e){this.enumerate=function(){function t(e){if(i&&!i(e))if(w.is(e,"img")||3==e.nodeType&&(!w.isEmptyspace(e)||"\ufeff"==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[],i=b.Immutables&&b.Immutables.immutable;return new c(e).traverse(t),n}}}),h=v.extend({init:function(e,t,n){var i=this;i.range=e,i.rootNode=m.documentFromRange(e),i.body=t||i.getEditable(e),"body"!=w.name(i.body)&&(i.rootNode=i.body),i.startContainer=i.nodeToPath(e.startContainer),i.endContainer=i.nodeToPath(e.endContainer),i.startOffset=i.offset(e.startContainer,e.startOffset),i.endOffset=i.offset(e.endContainer,e.endOffset),i.immutables=n&&n.immutables,i.immutables&&(i.serializedImmutables=b.Immutables.removeImmutables(i.body)),i.html=i.body.innerHTML,i.immutables&&!i.serializedImmutables.empty&&b.Immutables.restoreImmutables(i.body,i.serializedImmutables)},index:function(e){for(var t,n=0,i=e.nodeType;e=e.previousSibling;)t=e.nodeType,3==t&&i==t||n++,i=t;return n},getEditable:function(e){for(var t=e.commonAncestorContainer;t&&(3==t.nodeType||t.attributes&&(!t.attributes.contentEditable||"false"==t.attributes.contentEditable.nodeValue.toLowerCase()));)t=t.parentNode;return t},restoreHtml:function(){var e=this;e.body.innerHTML=e.html,e.immutables&&!e.serializedImmutables.empty&&b.Immutables.restoreImmutables(e.body,e.serializedImmutables)},offset:function(e,t){if(3==e.nodeType)for(;(e=e.previousSibling)&&3==e.nodeType;)t+=e.nodeValue.length;return t},nodeToPath:function(e){for(var t=[];e!=this.rootNode;)t.push(this.index(e)),e=e.parentNode;return t},toRangePoint:function(e,t,n,i){for(var r=this.rootNode,o=n.length,a=i;o--;)r=r.childNodes[n[o]];for(;r&&3==r.nodeType&&r.nodeValue.length<a;)a-=r.nodeValue.length,r=r.nextSibling;r&&a>=0&&e[t?"setStart":"setEnd"](r,a)},toRange:function(){var e=this,t=e.range.cloneRange();return e.toRangePoint(t,!0,e.startContainer,e.startOffset),e.toRangePoint(t,!1,e.endContainer,e.endOffset),t}}),f=v.extend({init:function(){this.caret=null},addCaret:function(e){var t=this,n=t.caret=w.create(m.documentFromRange(e),"span",{className:"k-marker"});return e.insertNode(n),w.stripBomNode(n.previousSibling),w.stripBomNode(n.nextSibling),e.selectNode(n),n},removeCaret:function(e){var t,n,i,r,o=this,a=o.caret.previousSibling,s=0;a&&(s=x(a)?a.nodeValue.length:y(a)),t=o.caret.parentNode,n=a?y(a):0,w.remove(o.caret),S(t),i=t.childNodes[n],x(i)?e.setStart(i,s):i?(r=w.lastTextNode(i),r?e.setStart(r,r.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](i)):(k.msie||t.innerHTML||(t.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,i,r=this,o=e.collapsed&&!m.isExpandable(e),a=m.documentFromRange(e);return t&&e.collapsed&&(r.addCaret(e),e=m.expand(e)),n=e.cloneRange(),n.collapse(!1),r.end=w.create(a,"span",{className:"k-marker"}),n.insertNode(r.end),n=e.cloneRange(),n.collapse(!0),r.start=r.end.cloneNode(!0),n.insertNode(r.start),r._removeDeadMarkers(r.start,r.end),o&&(i=a.createTextNode("\ufeff"),w.insertAfter(i.cloneNode(),r.start),w.insertBefore(i,r.end)),S(e.commonAncestorContainer),e.setStartBefore(r.start),e.setEndAfter(r.end),e},_removeDeadMarkers:function(e,t){e.previousSibling&&"\ufeff"==e.previousSibling.nodeValue&&w.remove(e.previousSibling),t.nextSibling&&"\ufeff"==t.nextSibling.nodeValue&&w.remove(t.nextSibling)},_normalizedIndex:function(e){for(var t=y(e),n=e;n.previousSibling;)3==n.nodeType&&3==n.previousSibling.nodeType&&t--,n=n.previousSibling;return t},remove:function(e){var t,n,i,r,o,a,s,l,d,c,u,h=this,f=h.start,p=h.end;for(S(e.commonAncestorContainer);!f.nextSibling&&f.parentNode;)f=f.parentNode;for(;!p.previousSibling&&p.parentNode;)p=p.parentNode;if(t=f.previousSibling&&3==f.previousSibling.nodeType&&f.nextSibling&&3==f.nextSibling.nodeType,n=p.previousSibling&&3==p.previousSibling.nodeType&&p.nextSibling&&3==p.nextSibling.nodeType,i=t&&n,f=f.nextSibling,p=p.previousSibling,r=!1,o=!1,f==h.end&&(o=!!h.start.previousSibling,f=p=h.start.previousSibling||h.end.nextSibling,r=!0),w.remove(h.start),w.remove(h.end),!f||!p)return e.selectNodeContents(e.commonAncestorContainer),void e.collapse(!0);if(a=r?x(f)?f.nodeValue.length:f.childNodes.length:0,s=x(p)?p.nodeValue.length:p.childNodes.length,3==f.nodeType)for(;f.previousSibling&&3==f.previousSibling.nodeType;)f=f.previousSibling,a+=f.nodeValue.length;if(3==p.nodeType)for(;p.previousSibling&&3==p.previousSibling.nodeType;)p=p.previousSibling,s+=p.nodeValue.length;l=f.parentNode,d=p.parentNode,c=this._normalizedIndex(f),u=this._normalizedIndex(p),S(l),3==f.nodeType&&(f=l.childNodes[c]),S(d),3==p.nodeType&&(p=d.childNodes[u]),r?(3==f.nodeType?e.setStart(f,a):e[o?"setStartAfter":"setStartBefore"](f),e.collapse(!0)):(3==f.nodeType?e.setStart(f,a):e.setStartBefore(f),3==p.nodeType?e.setEnd(p,s):e.setEndAfter(p)),h.caret&&h.removeCaret(e)}}),p=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,m={nodes:function(e){var t=m.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=m.textNodes(e),t.length||(t=w.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new d(e).enumerate()},editableTextNodes:function(e){var t=[],n=b.Immutables&&b.Immutables.immutableParent;return n&&!n(e.commonAncestorContainer)&&(t=new u(e).enumerate()),t},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return k.msie&&k.version<9?new E(e):e.createRange()},selectRange:function(e){var t,n=m.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=D.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},stringify:function(e){return g.format("{0}:{1} - {2}:{3}",w.name(e.startContainer),e.startOffset,w.name(e.endContainer),e.endOffset)},split:function(e,t,n){function i(i){var r,o=e.cloneRange();o.collapse(i),o[i?"setStartBefore":"setEndAfter"](t),r=o.extractContents(),n&&(r=w.trim(r)),w[i?"insertBefore":"insertAfter"](r,t)}i(!0),i(!1)},mapAll:function(t,n){var i=[];return new s(t).traverse(function(t){var r=n(t);r&&e.inArray(r,i)<0&&i.push(r)}),i},getAll:function(e,t){var n=t;return"string"==typeof t&&(t=function(e){return w.is(e,n)}),m.mapAll(e,function(e){if(t(e))return e})},getMarkers:function(e){return m.getAll(e,function(e){return"k-marker"==e.className})},image:function(e){var t=m.getAll(e,"img");if(1==t.length)return t[0]},isStartOf:function(e,t){var n,i,r;if(0!==e.startOffset)return!1;for(n=e.cloneRange();0===n.startOffset&&n.startContainer!=t;){for(i=w.findNodeIndex(n.startContainer),r=n.startContainer.parentNode;i>0&&r[i-1]&&w.insignificant(r[i-1]);)i--;n.setStart(r,i)}return 0===n.startOffset&&n.startContainer==t},isEndOf:function(e,t){function n(e){w.insignificant(e)||r.push(e)}var i,r,o=e.cloneRange();return o.collapse(!1),i=o.startContainer,w.isDataNode(i)&&o.startOffset==w.getNodeLength(i)&&(o.setStart(i.parentNode,w.findNodeIndex(i)+1),o.collapse(!0)),o.setEnd(t,w.getNodeLength(t)),r=[],new s(o).traverse(n),!r.length},wrapSelectedElements:function(e){function t(e,t){var n,i=w.getNodeLength(t);if(e==i)return!0;for(n=e;n<i;n++)if(!w.insignificant(t.childNodes[n]))return!1;return!0}for(var n=w.editableParent(e.startContainer),i=w.editableParent(e.endContainer);0===e.startOffset&&e.startContainer!=n;)e.setStart(e.startContainer.parentNode,w.findNodeIndex(e.startContainer));for(;t(e.endOffset,e.endContainer)&&e.endContainer!=i;)e.setEnd(e.endContainer.parentNode,w.findNodeIndex(e.endContainer)+1);return e},expand:function(e){var t,n,i,r,o=e.cloneRange(),a=o.startContainer.childNodes[0===o.startOffset?0:o.startOffset-1],s=o.endContainer.childNodes[o.endOffset];return x(a)&&x(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(i=t.split("").reverse().join("").search(p),r=n.search(p),i&&r?(r=r==-1?n.length:r,i=i==-1?0:t.length-i,o.setStart(a,i),o.setEnd(s,r),o):o):o):o},isExpandable:function(e){var t,n,i,r,o,a,s=e.startContainer,l=m.documentFromRange(e);return s!=l&&s!=l.body&&(t=e.cloneRange(),!!(n=s.nodeValue)&&(i=n.substring(0,t.startOffset),r=n.substring(t.startOffset),o=0,a=0,i&&(o=i.split("").reverse().join("").search(p)),r&&(a=r.search(p)),o&&a))}},_(b,{SelectionUtils:D,W3CRange:E,RangeIterator:s,W3CSelection:l,RangeEnumerator:d,RestorePoint:h,Marker:f,RangeUtils:m})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/system.min",["editor/range.min"],e)}(function(){!function(e){function t(e,t){var n=e.selectionRestorePoint=new f(e.getRange(),e.body),i=new w(t,n);return i.editor=e,e.undoRedoStack.push(i),n}function n(e,t){return t.startContainer===e&&t.endContainer===e&&0===t.startOffset&&t.endOffset==e.childNodes.length}function i(e,t,n){for(var i=e?e[t]:null;i&&!n(i);)i=i[t];return i}var r=window.kendo,o=r.Class,a=r.ui.editor,s=a.EditorUtils,l=a.RangeUtils,d=s.registerTool,c=a.Dom,u=a.Tool,h=a.ToolTemplate,f=a.RestorePoint,p=a.Marker,m=r.support.browser,g='<br class="k-br">',v=e.extend,_=c.nodeTypes,b="previousSibling",k=o.extend({init:function(e){this.options=e,this.restorePoint=new f(e.range,e.body,{immutables:e.immutables}),this.marker=new p,this.formatter=e.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(e){return this.marker.add(this.getRange(),e)},releaseRange:function(e){this.marker.remove(e),this.editor.selectRange(e)},undo:function(){var e=this.restorePoint;e.restoreHtml(),this.editor.selectRange(e.toRange())},redo:function(){this.exec()},createDialog:function(t,n){var i=this.editor;return e(t).appendTo(document.body).kendoWindow(v({},i.options.dialogOptions,n)).closest(".k-window").toggleClass("k-rtl",r.support.isRtl(i.wrapper)).end()},exec:function(){var e=this.lockRange(!0);this.formatter.editor=this.editor,this.formatter.toggle(e),this.releaseRange(e)},immutables:function(){return this.editor&&this.editor.options.immutables},expandImmutablesIn:function(e){this.immutables()&&(r.ui.editor.Immutables.expandImmutablesIn(e),this.restorePoint=new f(e,this.editor.body))}}),w=o.extend({init:function(e,t){this.body=e.body,this.startRestorePoint=e,this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html,this.editor.selectRange(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,this.editor.selectRange(this.startRestorePoint.toRange())}}),y=k.extend({init:function(e){k.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e,t=this.editor,n=this.options,i=n.range,r=t.body,o=new f(i,r),a=n.html||n.value||"";t.selectRange(i),t.clipboard.paste(a,n),n.postProcess&&n.postProcess(t,t.getRange()),e=new w(o,new f(t.getRange(),r)),e.editor=t,t.undoRedoStack.push(e),t.focus()}}),x=u.extend({initialize:function(e,t){var n=t.editor,i=this.options,r=i.items?i.items:n.options.insertHtml;this._selectBox=new a.SelectBox(e,{dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){u.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new y(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),C="td,th,caption",T="table,tbody,thead,tfoot,tr",S=T+","+C,D=function(t){return!t.collapsed&&e(t.commonAncestorContainer).is(T)},E=o.extend({remove:function(t){var n,i,r,o,a,s,d,u=this,h=new p;h.add(t,!1),n=l.getAll(t,function(t){return e(t).is(S)}),i=l.documentFromRange(t),r=h.start,o=h.end,a=C.split(","),s=c.parentOfType(r,a),d=c.parentOfType(o,a),u._removeContent(r,s,!0),u._removeContent(o,d,!1),e(n).each(function(t,n){n=e(n),(n.is(C)?n:n.find(C)).each(function(e,t){t.innerHTML="&#65279;"})}),s&&!r.previousSibling&&c.insertBefore(i.createTextNode("\ufeff"),r),d&&!o.nextSibling&&c.insertAfter(i.createTextNode("\ufeff"),o),s?t.setStartBefore(r):n[0]&&(s=e(n[0]),s=s.is(C)?s:s.find(C).first(),s.length&&t.setStart(s.get(0),0)),t.collapse(!0),c.remove(r),c.remove(o)},_removeContent:function(t,n,i){if(n){var r,o=i?"nextSibling":"previousSibling",a=function(t){for(;t&&!t[o];)t=t.parentNode;return t&&e.contains(n,t)?t[o]:null};for(t=a(t);t;)r=a(t),c.remove(t),t=r}}}),F=o.extend({init:function(e){this.editor=e},keydown:function(i){var r,o,s,l,d=this,c=d.editor,u=c.keyboard,h=u.isTypingKey(i),p=v(e.Event(),i);return d.editor.trigger("keydown",p),p.isDefaultPrevented()?(i.preventDefault(),!0):!(p.isDefaultPrevented()||!h||u.isTypingInProgress())&&(r=c.getRange(),o=c.body,d.startRestorePoint=new f(r,o),D(r)&&(s=new E(c),s.remove(r),c.selectRange(r)),m.webkit&&!r.collapsed&&n(o,r)&&(o.innerHTML=""),c.immutables&&a.Immutables.immutablesContext(r)&&(l=new a.BackspaceHandler(c),l.deleteSelection(r)),u.startTyping(function(){d.endRestorePoint=t(c,d.startRestorePoint)}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),!!t.isTypingInProgress()&&(t.endTyping(),!0)}}),R=o.extend({init:function(e){this.editor=e},_addCaret:function(e){var t=c.create(this.editor.document,"a");return c.insertAt(e,t,0),c.stripBomNode(t.previousSibling),c.stripBomNode(t.nextSibling),t},_restoreCaret:function(e){var t=this.editor.createRange();t.setStartAfter(e),t.collapse(!0),this.editor.selectRange(t),c.remove(e)},_handleDelete:function(e){var t,n,i=e.endContainer,r=c.closestEditableOfType(i,c.blockElements);return!(!r||!a.RangeUtils.isEndOf(e,r))&&(t=c.next(r),!(!t||"p"!=c.name(t))&&(n=this._addCaret(t),this._merge(r,t),this._restoreCaret(n),!0))},_cleanBomBefore:function(e){for(var t=e.startOffset,n=e.startContainer,i=n.nodeValue,r=0;t-r>=0&&"\ufeff"==i[t-r-1];)r++;r>0&&(n.deleteData(t-r,r),e.setStart(n,Math.max(0,t-r)),e.collapse(!0),this.editor.selectRange(e))},_handleBackspace:function(e){var t,n,r,o,s=e.startContainer,l=c.closestEditableOfType(s,["li"]),d=c.closestEditableOfType(s,"p,h1,h2,h3,h4,h5,h6".split(","));return c.isDataNode(s)&&this._cleanBomBefore(e),t=i(d,b,function(e){return!c.htmlIndentSpace(e)}),e.collapsed&&e.startOffset!==e.endOffset&&e.startOffset<0&&(e.startOffset=0,e.endOffset=0,this.editor.selectRange(e)),d&&t&&a.RangeUtils.isStartOf(e,d)?(n=this._addCaret(d),this._merge(t,d),this._restoreCaret(n),!0):!(!l||!a.RangeUtils.isStartOf(e,l))&&(r=l.firstChild,r||(l.innerHTML=a.emptyElementContent,r=l.firstChild),o=new a.ListFormatter(c.name(l.parentNode),"p"),e.selectNodeContents(l),o.toggle(e),c.insignificant(r)?e.setStartBefore(r):e.setStart(r,0),this.editor.selectRange(e),!0)},_handleSelection:function(t){var n,i,r,o,s=t.commonAncestorContainer,l=c.closest(s,"table"),d=a.emptyElementContent,u=this.editor;return D(t)?(n=new E(u),n.remove(t),u.selectRange(t),!0):(i=new p,i.add(t,!1),u.immutables&&this._handleImmutables(i),t.setStartAfter(i.start),t.setEndBefore(i.end),r=t.startContainer,o=t.endContainer,t.deleteContents(),l&&""===e(l).text()&&(t.selectNode(l),t.deleteContents()),s=t.commonAncestorContainer,"p"===c.name(s)&&""===s.innerHTML&&(s.innerHTML=d,t.setStart(s,0)),this._join(r,o),c.insertAfter(u.document.createTextNode("\ufeff"),i.start),i.remove(t),r=t.startContainer,"tr"==c.name(r)&&(r=r.childNodes[Math.max(0,t.startOffset-1)],t.setStart(r,c.getNodeLength(r))),t.collapse(!0),u.selectRange(t),!0)},_handleImmutables:function(e){var t=a.Immutables.immutableParent,n=t(e.start),i=t(e.start);n&&c.insertBefore(e.start,n),i&&c.insertAfter(e.end,i),n&&c.remove(n),i&&i.parentNode&&c.remove(i)},_root:function(e){for(;e&&e.parentNode&&"body"!=c.name(e.parentNode);)e=e.parentNode;return e},_join:function(e,t){e=this._root(e),t=this._root(t),e!=t&&c.is(t,"p")&&this._merge(e,t)},_merge:function(e,t){for(c.removeTrailingBreak(e);e&&t.firstChild;)1==e.nodeType?(e=c.list(e)?e.children[e.children.length-1]:e,e&&e.appendChild(t.firstChild)):e.nodeType===_.TEXT_NODE?this._mergeWithTextNode(e,t.firstChild):e.parentNode.appendChild(t.firstChild);c.remove(t)},_mergeWithTextNode:function(e,t){e&&e.nodeType===_.TEXT_NODE&&(e.nextSibling&&this._isCaret(e.nextSibling)?c.insertAfter(t,e.nextSibling):c.insertAfter(t,e))},_isCaret:function(t){return e(t).is("a")},keydown:function(e){var n,i,o=this.editor,a=o.getRange(),s=e.keyCode,l=r.keys,d=s===l.BACKSPACE,c=s==l.DELETE;o.immutables&&o.immutables.keydown(e,a)||(!d&&!c||a.collapsed?d?n="_handleBackspace":c&&(n="_handleDelete"):n="_handleSelection",n&&(i=new f(a,o.body),this[n](a)&&(e.preventDefault(),t(o,i))))},deleteSelection:function(e){this._handleSelection(e)},keyup:e.noop}),I=o.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){this.startRestorePoint=this.endRestorePoint=t(this.editor,this.startRestorePoint)},changed:function(){return!!this.startRestorePoint&&this.startRestorePoint.html!=this.editor.body.innerHTML},keydown:function(e){var t=this,n=t.editor,i=n.keyboard;return i.isModifierKey(e)?(i.isTypingInProgress()&&i.endTyping(!0),t.startRestorePoint=new f(n.getRange(),n.body),!0):!!i.isSystem(e)&&(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0)},keyup:function(){var e=this;return!(!e.systemCommandIsInProgress||!e.changed())&&(e.systemCommandIsInProgress=!1,e.createUndoCommand(),!0)}}),A=o.extend({init:function(e){this.editor=e},keydown:function(e){!m.webkit||e.isDefaultPrevented()||!e.ctrlKey||65!=e.keyCode||e.altKey||e.shiftKey||(this.editor.options.immutables&&this._toSelectableImmutables(),this._selectEditorBody())},_selectEditorBody:function(){var e=this.editor,t=e.getRange();t.selectNodeContents(e.body),e.selectRange(t)},_toSelectableImmutables:function(){for(var t=this.editor,n=t.body,i=a.Immutables.immutable,r=c.emptyTextNode,o=n.firstChild,s=n.lastChild;r(o);)o=o.nextSibling;for(;r(s);)s=s.previousSibling;o&&i(o)&&e(g).prependTo(n),s&&i(s)&&e(g).appendTo(n)},keyup:e.noop}),M=o.extend({init:function(e){this.handlers=e,this.typingInProgress=!1},isCharacter:function(e){return e>=48&&e<=90||e>=96&&e<=111||e>=186&&e<=192||e>=219&&e<=222||229==e},toolFromShortcut:function(t,n){var i,r,o=String.fromCharCode(n.keyCode);for(i in t)if(r=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),(r.key==o||r.key==n.keyCode)&&r.ctrl==n.ctrlKey&&r.alt==n.altKey&&r.shift==n.shiftKey)return i},toolsFromShortcut:function(t,n){var i,r,o,a=String.fromCharCode(n.keyCode),s=[],l=function(e){return e==a||e==n.keyCode};for(i in t)r=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),o=e.isArray(r.key)?e.grep(r.key,l).length>0:l(r.key),o&&r.ctrl==n.ctrlKey&&r.alt==n.altKey&&r.shift==n.shiftKey&&s.push(t[i]);return s},isTypingKey:function(e){var t=e.keyCode;return this.isCharacter(t)&&!e.ctrlKey&&!e.altKey||32==t||13==t||8==t||46==t&&!e.shiftKey&&!e.ctrlKey&&!e.altKey},isModifierKey:function(e){var t=e.keyCode;return 17==t&&!e.shiftKey&&!e.altKey||16==t&&!e.ctrlKey&&!e.altKey||18==t&&!e.ctrlKey&&!e.shiftKey},isSystem:function(e){return 46==e.keyCode&&e.ctrlKey&&!e.altKey&&!e.shiftKey},startTyping:function(e){this.onEndTyping=e,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress&&this.onEndTyping&&this.onEndTyping(),this.typingInProgress=!1},endTyping:function(t){var n=this;n.clearTimeout(),t?n.stopTyping():n.timeout=window.setTimeout(e.proxy(n.stopTyping,n),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(e,t){var n,i=this.handlers;for(n=0;n<i.length&&!i[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),z=o.extend({init:function(e){this.editor=e;var t=e.options.pasteCleanup;this.cleaners=[new N(t),new P(t),new L(t),new B(t),new V(t),new W(t),new $(t),new G(t)]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=c.create(n,"div"),r=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)r.appendChild(i.firstChild);return r},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},_startModification:function(){var e,t,n=this.editor;if(!this._inProgress)return this._inProgress=!0,e=n.getRange(),t=new f(e,n.body),c.persistScrollTop(n.document),{range:e,restorePoint:t}},_endModification:function(e){t(this.editor,e.restorePoint),this.editor._selectionChange(),this._inProgress=!1},_contentModification:function(e,t){var n=this,i=n.editor,r=n._startModification();r&&(e.call(n,i,r.range),setTimeout(function(){t.call(n,i,r.range),n._endModification(r)}))},_removeBomNodes:function(e){var t,n=a.RangeUtils.textNodes(e);for(t=0;t<n.length;t++)n[t].nodeValue=c.stripBom(n[t].nodeValue)},_onBeforeCopy:function(e){var t=new p;t.add(e),this._removeBomNodes(e),t.remove(e),this.editor.selectRange(e)},oncopy:function(){this._onBeforeCopy(this.editor.getRange())},oncut:function(){this._onBeforeCopy(this.editor.getRange()),this._contentModification(e.noop,e.noop)},_fileToDataURL:function(t){var n=e.Deferred(),i=new FileReader;return t instanceof window.File||!t.getAsFile||(t=t.getAsFile()),i.onload=e.proxy(n.resolve,n),i.readAsDataURL(t),n.promise()},_triggerPaste:function(e,t){var n={html:e||""};n.html=n.html.replace(/\ufeff/g,""),this.editor.trigger("paste",n),this.paste(n.html,t||{})},_handleImagePaste:function(t){var n,i,r,o,a;if("FileReader"in window&&!(m.msie&&m.version>10)&&(n=t.clipboardData||t.originalEvent.clipboardData||window.clipboardData||{},i=n.items||n.files,i&&(r=e.grep(i,function(e){return/^image\//i.test(e.type)}),o=e.grep(i,function(e){return/^text\/html/i.test(e.type)}),!o.length&&r.length&&(a=this._startModification()))))return e.when.apply(e,e.map(r,this._fileToDataURL)).done(e.proxy(function(){var t=Array.prototype.slice.call(arguments),n=e.map(t,function(e){
return'<img src="'+e.target.result+'" />'}).join("");this._triggerPaste(n),this._endModification(a)},this)),!0},onpaste:function(t){return this._handleImagePaste(t)?void t.preventDefault():(this.expandImmutablesIn(),void this._contentModification(function(n,i){var o,a,s,l=c.create(n.document,"div",{className:"k-paste-container",innerHTML:"\ufeff"}),d=r.support.browser,u=n.body;this._decoreateClipboardNode(l,u),u.appendChild(l),d.webkit&&this._moveToCaretPosition(l,i),d.msie&&d.version<11?(t.preventDefault(),o=n.createRange(),o.selectNodeContents(l),n.selectRange(o),a=n.document.body.createTextRange(),a.moveToElementText(l),e(u).unbind("paste"),a.execCommand("Paste"),e(u).bind("paste",e.proxy(this.onpaste,this))):(s=n.createRange(),s.selectNodeContents(l),n.selectRange(s)),i.deleteContents()},function(t,n){var i,r="";t.selectRange(n),i=e(t.body).children(".k-paste-container"),i.each(function(){var e=this.lastChild;e&&c.is(e,"br")&&c.remove(e),r+=this.innerHTML}),i.remove(),this._triggerPaste(r,{clean:!0})}))},_decoreateClipboardNode:function(t,n){var i,r,o,a;(m.msie||m.webkit)&&(t=e(t),t.css({borderWidth:"0px",width:"0px",height:"0px",overflow:"hidden",margin:"0",padding:"0"}),m.msie&&(i=e(n.ownerDocument.documentElement),t.css({fontVariant:"normal",fontWeight:"normal",lineSpacing:"normal",lineHeight:"normal",textDecoration:"none"}),r=i.css("color"),r&&t.css("color",r),o=i.css("fontFamily"),o&&t.css("fontFamily",o),a=i.css("fontSize"),a&&t.css("fontSize",a)))},_moveToCaretPosition:function(t,n){var i=this,r=i.editor.body,o=c.offset(t,r),a=i._caretOffset(n,r),s=a.left-o.left,l=a.top-o.top,d="translate("+s+"px,"+l+"px)";e(t).css({"-webkit-transform":d,transform:d})},_caretOffset:function(e,t){var n,i,r,o,a,s,l=this.editor,d=c.create(l.document,"span",{innerHTML:"\ufeff"}),u=e.startContainer;return e.collapsed?(i=c.isDataNode(u),i&&(c.isBom(u)||0===e.startOffset)?c.insertBefore(d,u):i&&e.startOffset===u.length?c.insertAfter(d,u):(e.insertNode(d),n=!0)):(u=u===t?u.childNodes[e.startOffset]:u,c.insertBefore(d,u)),r=c.offset(d,t),o=d.previousSibling,a=d.nextSibling,c.remove(d),n&&c.isDataNode(o)&&c.isDataNode(a)&&!c.isBom(o)&&!c.isBom(a)&&(s=o.length,a.data=o.data+a.data,e.setStart(a,s),c.remove(o),e.collapse(!0),l.selectRange(e)),r},expandImmutablesIn:function(e){var t,n,i,o=this.editor;o&&o.options.immutables&&(t=o.body,e=e||o.getRange(),r.ui.editor.Immutables.expandImmutablesIn(e),e.startContainer===t&&0===e.startOffset&&(n=t.ownerDocument,i=n.createTextNode("\ufeff"),t.insertBefore(i,t.childNodes[0]),e.setStartBefore(i)),o.selectRange(e))},splittableParent:function(e,t){var n,i;if(e)return c.closestEditableOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,c.isInline(n))for(;n.parentNode!=i&&!c.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(t,n){var i,r,o,s,l,d,u,h,f,m,g,_,b=this.editor;if(this.expandImmutablesIn(),n=v({clean:!1,split:!0},n),!n.skipCleaners)for(i=0,r=this.cleaners.length;i<r;i++)this.cleaners[i].applicable(t)&&(t=this.cleaners[i].clean(t));if(n.clean&&(t=t.replace(/(<br>(\s|&nbsp;)*)+(<\/?(div|p|li|col|t))/gi,"$3"),t=t.replace(/<(a|span)[^>]*><\/\1>/gi,"")),t=t.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>"),o=this.isBlock(t),b.focus(),s=b.getRange(),s.deleteContents(),s.startContainer==b.document&&s.selectNodeContents(b.body),l=new p,d=l.addCaret(s),u=this.splittableParent(o,d),h=!1,f=u!=b.body&&!c.is(u,"td"),n.split&&f&&(o||c.isInline(u))&&(s.selectNode(d),a.RangeUtils.split(s,u,!0),h=!0),m=this.htmlToFragment(t),m.firstChild&&"k-paste-container"===m.firstChild.className){for(g=[],i=0,r=m.childNodes.length;i<r;i++)g.push(m.childNodes[i].innerHTML);m=this.htmlToFragment(g.join("<br />"))}if(e(m.childNodes).filter("table").addClass("k-table").end().find("table").addClass("k-table"),s.insertNode(m),u=this.splittableParent(o,d),h){for(;d.parentNode!=u;)c.unwrap(d.parentNode);c.unwrap(d.parentNode)}c.normalize(s.commonAncestorContainer),d.style.display="inline",c.restoreScrollTop(b.document),c.scrollTo(d),l.removeCaret(s),_=s.commonAncestorContainer.parentNode,s.collapsed&&"tbody"==c.name(_)&&(s.setStartAfter(e(_).closest("table")[0]),s.collapse(!0)),b.selectRange(s)}}),H=o.extend({init:function(e){this.options=e||{},this.replacements=[]},clean:function(e,t){var n,i,r=this,o=t||r.replacements;for(n=0,i=o.length;n<i;n+=2)e=e.replace(o[n],o[n+1]);return e}}),N=H.extend({init:function(e){H.fn.init.call(this,e),this.replacements=[/<(\/?)script([^>]*)>/i,"<$1telerik:script$2>"]},applicable:function(e){return!this.options.none&&/<script[^>]*>/i.test(e)}}),P=H.extend({init:function(e){H.fn.init.call(this,e);var t=" ";this.replacements=[/<span\s+class="Apple-tab-span"[^>]*>\s*<\/span>/gi,t,/\t/gi,t,/&nbsp;&nbsp; &nbsp;/gi,t]},applicable:function(e){return/&nbsp;&nbsp; &nbsp;|class="?Apple-tab-span/i.test(e)}}),L=H.extend({init:function(e){H.fn.init.call(this,e),this.junkReplacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/&quot;/g,"'",/<o:p>&nbsp;<\/o:p>/gi,"&nbsp;",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/<\/o>/g,""],this.replacements=this.junkReplacements.concat([/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>(?!\n)/g," ",/<table([^>]*)>(\s|&nbsp;)+<t/gi,"<table$1><t",/<tr[^>]*>(\s|&nbsp;)*<\/tr>/gi,"",/<tbody[^>]*>(\s|&nbsp;)*<\/tbody>/gi,"",/<table[^>]*>(\s|&nbsp;)*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*(&nbsp;)+/gi,"",/(&nbsp;|<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)font(\s[^>]*)?>/gi,this.convertFontMatch,/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/style=(["|'])\s*\1/g,"",/(<br[^>]*>)?\n/g,function(e,t){return t?e:" "}])},convertFontMatch:function(e,t,n){var i=/face=['"]([^'"]+)['"]/i,r=i.exec(n),o=n&&r&&r[1];return t?"</span>":o?'<span style="font-family:'+o+'">':"<span>"},applicable:function(e){return/class="?Mso/i.test(e)||/style="[^"]*mso-/i.test(e)||/urn:schemas-microsoft-com:office/.test(e)},stripEmptyAnchors:function(e){return e.replace(/<a([^>]*)>\s*<\/a>/gi,function(e,t){return!t||t.indexOf("href")<0?"":e})},listType:function(e,t){var n,i=e.innerHTML,r=c.innerText(e),o=i.match(/^(?:<span [^>]*texhtml[^>]*>)?<span [^>]*(?:Symbol|Wingdings)[^>]*>([^<]+)/i),a=o&&o[1],s=/^[a-z\d]/i.test(a),l=function(e){return e.replace(/^(?:&nbsp;|[\u00a0\n\r\s])+/,"")};return o&&(n=!0),i=i.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),!n&&/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(i)||n&&/^.\u00a0+/.test(i)||a&&!s&&t?{tag:"ul",style:this._guessUnorderedListStyle(l(r))}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(i)?{tag:"ol",style:this._guessOrderedListStyle(l(r))}:void 0},_convertToLi:function(e){var t;return 1==e.childNodes.length?t=e.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(c.remove(e.firstChild),3==e.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(e.firstChild.nodeValue)&&c.remove(e.firstChild),/^(&nbsp;|\s)+$/i.test(e.firstChild.innerHTML)&&c.remove(e.firstChild),t=e.innerHTML),c.remove(e),c.create(document,"li",{innerHTML:t})},_guessUnorderedListStyle:function(e){return/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(e)?null:/^o/.test(e)?"circle":"square"},_guessOrderedListStyle:function(e){var t=null;return/^\d/.test(e)||(t=(/^[a-z]/.test(e)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(e)?"roman":"alpha")),t},extractListLevels:function(e){var t=/style=['"]?[^'"]*?mso-list:\s?[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi;return e=e.replace(t,function(e,t,n){return r.format('data-list="{0}" data-level="{1}" {2}',t,n,e)})},lists:function(t){var n,i,r,o,a,s,l,d,u,h,f,p,m=e(t).find(c.blockElements.join(",")),g=-1,v={},_=t;for(o=0;o<m.length;o++)a=m[o],u=e(a).data(),h=u.list,n=c.name(a),"td"!=n&&(f=this.listType(a,u),s=f&&f.tag,s&&"p"==n?(l=parseFloat(a.style.marginLeft||0),void 0===i&&(i=l),p=s+h,v[l]||(v[l]={}),d=v[l][p],(l>g||!d)&&(d=c.create(document,s,{style:{listStyleType:f.style}}),_==t||l<=g?(r&&i!==l?r.appendChild(d):c.insertBefore(d,a),v[l]={}):(r=_,_.appendChild(d)),v[l][p]=d),_=this._convertToLi(a),d.appendChild(_),g=l):a.innerHTML?(g=-1,_=t):c.remove(a))},removeAttributes:function(e){for(var t=e.attributes,n=t.length;n--;)"colspan"!=c.name(t[n])&&e.removeAttributeNode(t[n])},createColGroup:function(t){var n=t.cells,i=e(t).closest("table"),o=i.children("colgroup");n.length<2||(o.length&&(n=o.children(),o[0].parentNode.removeChild(o[0])),o=e(e.map(n,function(e){var t=e.width;return t&&0!==parseInt(t,10)?r.format('<col style="width:{0}px;"/>',t):"<col />"}).join("")),o.is("colgroup")||(o=e("<colgroup/>").append(o)),o.prependTo(i))},convertHeaders:function(t){var n,i=t.cells,r=e.map(i,function(t){var n=e(t).children("p").children("strong")[0];if(n&&"strong"==c.name(n))return n});if(r.length==i.length){for(n=0;n<r.length;n++)c.unwrap(r[n]);for(e(t).closest("table").find("colgroup").after("<thead></thead>").end().find("thead").append(t),n=0;n<i.length;n++)c.changeTag(i[n],"th")}},removeParagraphs:function(t){var n,i,r,o,a;for(n=0;n<t.length;n++)for(this.removeAttributes(t[n]),o=e(t[n]),a=o.children("p"),i=0,r=a.length;i<r;i++)i<r-1&&c.insertAfter(c.create(document,"br"),a[i]),c.unwrap(a[i])},removeDefaultColors:function(e){for(var t=0;t<e.length;t++)/^\s*color:\s*[^;]*;?$/i.test(e[t].style.cssText)&&c.unwrap(e[t])},tables:function(t){var n,i,r,o,a,s=e(t).find("table"),l=this;for(o=0;o<s.length;o++){for(n=s[o].rows,r=i=n[0],a=1;a<n.length;a++)n[a].cells.length>r.cells.length&&(r=n[a]);l.createColGroup(r),l.convertHeaders(i),l.removeAttributes(s[o]),l.removeParagraphs(s.eq(o).find("td,th")),l.removeDefaultColors(s.eq(o).find("span"))}},headers:function(t){var n,i=e(t).find("p.MsoTitle");for(n=0;n<i.length;n++)c.changeTag(i[n],"h1")},removeFormatting:function(t){e(t).find("*").each(function(){e(this).css({fontSize:"",fontFamily:""}),this.getAttribute("style")||this.style.cssText||this.removeAttribute("style")})},clean:function(e){var t,n=this,i=this.options;return i.none?(e=H.fn.clean.call(n,e,this.junkReplacements),e=n.stripEmptyAnchors(e)):(e=this.extractListLevels(e),e=H.fn.clean.call(n,e),e=n.stripEmptyAnchors(e),t=c.create(document,"div",{innerHTML:e}),n.headers(t),i.msConvertLists&&n.lists(t),n.tables(t),i.msAllFormatting&&n.removeFormatting(t),e=t.innerHTML.replace(/(<[^>]*)\s+class="?[^"\s>]*"?/gi,"$1")),e}}),B=H.extend({init:function(e){H.fn.init.call(this,e),this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^<div>(.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)}}),O=H.extend({clean:function(e){var t=c.create(document,"div",{innerHTML:e});return t=this.cleanDom(t),t.innerHTML},cleanDom:function(e){return e}}),V=O.extend({cleanDom:function(t){var n=this.collectTags();return e(t).find(n).each(function(){c.unwrap(this)}),t},collectTags:function(){if(this.options.span)return"span"},applicable:function(){return this.options.span}}),W=O.extend({cleanDom:function(t){var n=this.collectAttr(),i=e(t).find("["+n.join("],[")+"]");return i.removeAttr(n.join(" ")),t},collectAttr:function(){return this.options.css?["class","style"]:[]},applicable:function(){return this.options.css}}),U=function(){this.text="",this.add=function(e){this.text+=e}},q=o.extend({init:function(e){this.separators=e||{text:" ",line:"<br/>"},this.lines=[],this.inlineBlockText=[],this.resetLine()},appendText:function(e){3===e.nodeType&&(e=e.nodeValue),this.textContainer.add(e)},appendInlineBlockText:function(e){this.inlineBlockText.push(e)},flashInlineBlockText:function(){this.inlineBlockText.length&&(this.appendText(this.inlineBlockText.join(" ")),this.inlineBlockText=[])},endLine:function(){this.flashInlineBlockText(),this.resetLine()},html:function(){var e,t,n,i,r,o,a,s,l=this.separators,d="",c=this.lines;for(this.flashInlineBlockText(),e=0,t=c.length,n=t-1;e<t;e++){for(i=c[e],r=0,o=i.length,a=o-1;r<o;r++)s=i[r].text,d+=s,r!==a&&(d+=l.text);e!==n&&(d+=l.line)}return d},resetLine:function(){this.textContainer=new U,this.line=[],this.line.push(this.textContainer),this.lines.push(this.line)}}),j=o.extend({init:function(e){this.callback=e},enumerate:function(e){var t,n;e&&(t=this.callback(e),n=e.firstChild,!t&&n&&this.enumerate(n),this.enumerate(e.nextSibling))}}),$=H.extend({init:function(t){H.fn.init.call(this,t),this.hasText=!1,this.enumerator=new j(e.proxy(this.buildText,this))},clean:function(e){var t=c.create(document,"div",{innerHTML:e});return this.cleanDom(t)},cleanDom:function(e){return this.separators=this.getDefaultSeparators(),this.htmlLines=new q(this.separators),this.enumerator.enumerate(e.firstChild),this.hasText=!1,this.htmlLines.html()},buildText:function(e){if(c.isDataNode(e)){if(c.isEmptyspace(e))return;this.htmlLines.appendText(e.nodeValue.replace("\n",this.separators.line)),this.hasText=!0}else if(c.isBlock(e)&&this.hasText){var t=this.actions[c.name(e)]||this.actions.block;return t(this,e)}},applicable:function(){var e=this.options;return e.all||e.keepNewLines},getDefaultSeparators:function(){return this.options.all?{text:" ",line:" "}:{text:" ",line:"<br/>"}},actions:{ul:e.noop,ol:e.noop,table:e.noop,thead:e.noop,tbody:e.noop,td:function(e,t){var n=new $({all:!0}),i=n.cleanDom(t);return e.htmlLines.appendInlineBlockText(i),!0},block:function(e){e.htmlLines.endLine()}}}),G=H.extend({clean:function(e){return this.options.custom(e)},applicable:function(){return"function"==typeof this.options.custom}}),Y=k.extend({init:function(e){k.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e=this.editor;r.support.browser.msie?e.document.execCommand("print",!1,null):e.window.print&&e.window.print()}}),K=k.extend({init:function(e){this.async=!0,k.fn.init.call(this,e)},exec:function(){var e=this,t=this.lockRange(!0);this.editor.saveAsPDF().then(function(){e.releaseRange(t)})}});v(a,{_finishUpdate:t,Command:k,GenericCommand:w,InsertHtmlCommand:y,InsertHtmlTool:x,TypingHandler:F,SystemHandler:I,BackspaceHandler:R,SelectAllHandler:A,Keyboard:M,Clipboard:z,Cleaner:H,ScriptCleaner:N,TabCleaner:P,MSWordFormatCleaner:L,WebkitFormatCleaner:B,HtmlTagsCleaner:V,HtmlAttrCleaner:W,HtmlContentCleaner:$,HtmlTextLines:q,CustomCleaner:G,PrintCommand:Y,ExportPdfCommand:K}),d("insertHtml",new x({template:new h({template:s.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})})),d("print",new u({command:Y,template:new h({template:s.buttonTemplate,title:"Print"})})),d("pdf",new u({command:K,template:new h({template:s.buttonTemplate,title:"Export PDF"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/inlineformat.min",["editor/system.min"],e)}(function(){!function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,r=t.ui.Editor.fn.options.formats,o=i.EditorUtils,a=i.Tool,s=i.ToolTemplate,l=i.FormatTool,d=i.Dom,c=i.RangeUtils,u=e.extend,h=i.EditorUtils.registerTool,f=i.EditorUtils.registerFormat,p="k-marker",m=n.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,i=0,r=0,o=e.parentNode;for(t=o.firstChild;t;t=t.nextSibling)t!=e&&(t.className==p?r++:3==t.nodeType?n++:i++);return r>1&&o.firstChild.className==p&&o.lastChild.className==p?0:i+n},findSuitable:function(e,t){var n,i;if(!t&&this.numberOfSiblings(e)>0)return null;for(n=e.parentNode,i=this.format[0].tags;!d.ofType(n,i);){if(this.numberOfSiblings(n)>0)return null;n=n.parentNode}return n},findFormat:function(e){var t,n,i,r,o,a=this.format,s=d.attrEquals;for(t=0,n=a.length;t<n;t++){if(i=e,r=a[t].tags,o=a[t].attr,i&&d.ofType(i,r)&&s(i,o))return i;for(;i;)if(i=d.parentOfType(i,r),i&&s(i,o))return i}return null},isFormatted:function(e){var t,n;for(t=0,n=e.length;t<n;t++)if(this.findFormat(e[t]))return!0;return!1}}),g=n.extend({init:function(e,t){this.finder=new m(e),this.attributes=u({},e[0].attr,t),this.tag=e[0].tags[0]},wrap:function(e){return d.wrap(e,d.create(e.ownerDocument,this.tag,this.attributes))},activate:function(e,t){this.finder.isFormatted(t)?(this.split(e),this.remove(t)):this.apply(t)},toggle:function(e){var t=this.immutables()?c.editableTextNodes:c.textNodes,n=t(e);n.length>0&&this.activate(e,n)},immutables:function(){return this.editor&&this.editor.options.immutables},apply:function(e){var t,n,i,r,o=[],a=this.attributes,s=a?a.style||{}:{};for(t=0,n=e.length;t<n;t++){if(i=e[t],r=this.finder.findSuitable(i))d.is(r,"font")&&(s.color&&r.removeAttribute("color"),s.fontName&&r.removeAttribute("face"),s.fontSize&&r.removeAttribute("size")),d.attr(r,a);else{for(;!d.isBlock(i.parentNode)&&1==i.parentNode.childNodes.length&&"true"!==i.parentNode.contentEditable;)i=i.parentNode;r=this.wrap(i)}o.push(r)}this.consolidate(o)},remove:function(e){var t,n,i;for(t=0,n=e.length;t<n;t++)i=this.finder.findFormat(e[t]),i&&(this.attributes&&this.attributes.style?(d.unstyle(i,this.attributes.style),i.style.cssText||i.attributes["class"]||d.unwrap(i)):d.unwrap(i))},split:function(e){var t,n,i=c.textNodes(e),r=i.length;if(r>0)for(t=0;t<r;t++)n=this.finder.findFormat(i[t]),n&&c.split(e,n,!0)},consolidate:function(e){for(var t,n;e.length>1;)if(t=e.pop(),n=e[e.length-1],t.previousSibling&&t.previousSibling.className==p&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);d.remove(t)}}}),v=m.extend({init:function(e,t){this.format=e,this.greedyProperty=t,m.fn.init.call(this,e)},getInlineCssValue:function(t){var n,i,r,o,a,s,l,c,u,h,f,p,m=t.attributes,g=e.trim;if(m)for(n=0,i=m.length;n<i;n++)if(r=m[n],o=r.nodeName,a=r.nodeValue,r.specified&&"style"==o)for(s=g(a||t.style.cssText).split(";"),c=0,u=s.length;c<u;c++)if(l=s[c],l.length){if(h=l.split(":"),f=g(h[0].toLowerCase()),p=g(h[1]),f!=this.greedyProperty)continue;return f.indexOf("color")>=0?d.toHex(p):p}},getFormatInner:function(t){var n,i,r,o=e(d.isDataNode(t)?t.parentNode:t),a=o.parentsUntil("[contentEditable]").addBack().toArray().reverse();for(n=0,i=a.length;n<i;n++)if(r="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return r;return"inherit"},getFormat:function(e){var t,n,i=this.getFormatInner(e[0]);for(t=1,n=e.length;t<n;t++)if(i!=this.getFormatInner(e[t]))return"";return i},isFormatted:function(e){return""!==this.getFormat(e)}}),_=g.extend({init:function(e,n,i){g.fn.init.call(this,e,n),this.values=n,this.finder=new v(e,i),i&&(this.greedyProperty=t.toCamelCase(i))},activate:function(e,t){var n=this.greedyProperty,i="apply";this.split(e),n&&"inherit"==this.values.style[n]&&(i="remove"),this[i](t)}}),b=l.extend({init:function(e){l.fn.init.call(this,u(e,{finder:new m(e.format),formatter:function(){return new g(e.format)}}))}}),k=a.extend({update:function(e,t){var n=e.data(this.type);n.close(),n.value(this.finder.getFormat(t))}}),w=k.extend({init:function(e){a.fn.init.call(this,e),this.type=t.support.browser.msie||t.support.touch?"kendoDropDownList":"kendoComboBox",this.format=[{tags:["span","font"]}],this.finder=new v(this.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,r={};return new i.FormatCommand(u(e,{formatter:function(){return r[t.domAttr]=e.value,new _(n,{style:r},t.cssAttr)}}))},initialize:function(e,t){var n,i=t.editor,r=this.options,o=r.name,s=[];r.defaultValue&&(s=[{text:i.options.messages[r.defaultValue[0].text],value:r.defaultValue[0].value}]),n=s.concat(r.items?r.items:i.options[o]||[]),e.attr({title:t.title}),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){a.exec(i,o,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+o).find("*").addBack().attr("unselectable","on"),e.data(this.type).value("inherit")}}),y=a.extend({init:function(e){a.fn.init.call(this,e),this.format=[{tags:["span","font"]}],this.finder=new v(this.format,e.cssAttr)},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,r={};return new i.FormatCommand(u(e,{formatter:function(){return r[t.domAttr]=e.value,new _(n,{style:r},t.cssAttr)}}))},initialize:function(e,n){var i=n.editor,r=this.name,o=u({},y.fn.options,this.options),s=o.palette;e=this._widget=new t.ui.ColorPicker(e,{toolIcon:"k-"+o.name,palette:s,change:function(){var t=e.value();t&&a.exec(i,r,t),e.value(null),i.focus()},activate:function(t){t.preventDefault(),e.trigger("change")}}),e.wrapper.attr({title:n.title,unselectable:"on"}).find("*").attr("unselectable","on")}});u(i,{InlineFormatFinder:m,InlineFormatter:g,DelayedExecutionTool:k,GreedyInlineFormatFinder:v,GreedyInlineFormatter:_,InlineFormatTool:b,FontTool:w,ColorTool:y}),f("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),h("bold",new b({key:"B",ctrl:!0,format:r.bold,template:new s({template:o.buttonTemplate,title:"Bold"})})),f("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),h("italic",new b({key:"I",ctrl:!0,format:r.italic,template:new s({template:o.buttonTemplate,title:"Italic"})})),f("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]),h("underline",new b({key:"U",ctrl:!0,format:r.underline,template:new s({template:o.buttonTemplate,title:"Underline"})})),f("strikethrough",[{tags:["del","strike"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),h("strikethrough",new b({format:r.strikethrough,template:new s({template:o.buttonTemplate,title:"Strikethrough"})})),f("superscript",[{tags:["sup"]}]),h("superscript",new b({format:r.superscript,template:new s({template:o.buttonTemplate,title:"Superscript"})})),f("subscript",[{tags:["sub"]}]),h("subscript",new b({format:r.subscript,template:new s({template:o.buttonTemplate,title:"Subscript"})})),h("foreColor",new y({cssAttr:"color",domAttr:"color",name:"foreColor",template:new s({template:o.colorPickerTemplate,title:"Color"})})),h("backColor",new y({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new s({template:o.colorPickerTemplate,title:"Background Color"})})),h("fontName",new w({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new s({template:o.comboBoxTemplate,title:"Font Name"})})),h("fontSize",new w({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new s({template:o.comboBoxTemplate,title:"Font Size"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/formatblock.min",["editor/inlineformat.min"],e)}(function(){!function(e){var t,n=window.kendo,i=n.Class,r=e.extend,o=n.ui.editor,a=n.ui.Editor.fn.options.formats,s=o.Dom,l=o.Command,d=o.ToolTemplate,c=o.FormatTool,u=o.EditorUtils,h=u.registerTool,f=u.registerFormat,p=o.RangeUtils,m=i.extend({init:function(e){this.format=e},contains:function(e,t){var n,i,r;for(n=0,i=t.length;n<i;n++)if(r=t[n],!r||!s.isAncestorOrSelf(e,r))return!1;return!0},findSuitable:function(t){var n,i,r,o,a=this.format,l=[];for(n=0,i=t.length;n<i;n++){for(o=a.length-1;o>=0&&!(r=s.ofType(t[n],a[o].tags)?t[n]:s.closestEditableOfType(t[n],a[o].tags));o--);if(!r||"true"===r.contentEditable)return[];e.inArray(r,l)<0&&l.push(r)}for(this._resolveListsItems(l),n=0,i=l.length;n<i;n++)if(this.contains(l[n],l))return[l[n]];return l},_resolveListsItems:function(e){var t,n,i;for(t=0;t<e.length;t++)n=e[t],i=s.is(n,"li")?n:s.wrapper(n),i=i&&s.list(i)?i.children[0]:i,s.is(i,"li")&&(n=e[t]=i)},findFormat:function(e){var t,n,i,r,a,l,d=this.format,c=s.editableParent(e),u=this.options&&this.options.immutables,h=o.Immutables;for(t=0,n=d.length;t<n;t++){if(i=e,r=d[t].tags,a=d[t].attr,u&&r&&"immutable"==r[0]&&(l=h.immutableParent(i),l&&s.attrEquals(l,a)))return i;for(;i&&s.isAncestorOf(c,i);){if(s.ofType(i,r)&&s.attrEquals(i,a))return i;i=i.parentNode}}return null},getFormat:function(e){var t,n,i=this,r=function(e){return i.findFormat(s.isDataNode(e)?e.parentNode:e)},o=r(e[0]);if(!o)return"";for(t=1,n=e.length;t<n;t++)if(o!=r(e[t]))return"";return o.nodeName.toLowerCase()},isFormatted:function(e){for(var t=0,n=e.length;t<n;t++)if(!this.findFormat(e[t]))return!1;return!0}}),g=i.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new m(e)},wrap:function(e,t,n){var i,r,o,a,l,d=1==n.length?s.blockParentOrBody(n[0]):s.commonAncestor.apply(null,n);for(s.isInline(d)&&(d=s.blockParentOrBody(d)),i=s.significantChildNodes(d),r=s.findNodeIndex(i[0]),o=s.create(d.ownerDocument,e,t),a=0;a<i.length;a++)l=i[a],s.isBlock(l)?(s.attr(l,t),o.childNodes.length&&(s.insertBefore(o,l),o=o.cloneNode(!1)),r=s.findNodeIndex(l)+1):o.appendChild(l);o.firstChild&&s.insertAt(d,o,r)},apply:function(t){function n(e){return r({},e&&e.attr,p)}var i,o,a,l,d,c,h,f,p=this.values;if(this._handleImmutables(t,!0),o=s.filter("img",t),a=u.formatByName("img",this.format),l=n(a),e.each(o,function(){s.attr(this,l)}),o.length!=t.length)if(d=s.filter("img",t,!0),c=this.finder.findSuitable(d),c.length)for(h=0,f=c.length;h<f;h++)i=u.formatByName(s.name(c[h]),this.format),s.attr(c[h],n(i));else i=this.format[0],this.wrap(i.tags[0],n(i),d)},_handleImmutables:function(e,t){var n,i,r,a,l;if(this.immutables()&&(n=u.formatByName("immutable",this.format)))for(i=o.Immutables,r=e.length-1,a=r;a>=0;a--)l=i.immutableParent(e[a]),l&&(l!==e[a+1]&&(t?s.attr(l,n.attr):s.unstyle(l,n.attr.style)),e.splice(a,1))},immutables:function(){return this.editor&&this.editor.options.immutables},remove:function(e){var t,n,i,r,o;for(this._handleImmutables(e,!1),t=0,n=e.length;t<n;t++)i=this.finder.findFormat(e[t]),i&&(o=s.name(i),"div"!=o||i.getAttribute("class")?(r=u.formatByName(o,this.format),r.attr.style&&s.unstyle(i,r.attr.style),r.attr.className&&s.removeClass(i,r.attr.className)):s.unwrap(i))},toggle:function(e){var t=this,n=s.filterBy(p.nodes(e),s.htmlIndentSpace,!0);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),v=i.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new m(e)},apply:function(e){var t,n,i,r,a,l,d,c,u,h,f=this.format,p=s.blockParents(e),m=f[0].tags[0];if(p.length)for(t=0,n=p.length;t<n;t++)c=p[t],u=this.immutables()&&o.Immutables.immutableParent(c),u||(d=s.name(c),"li"==d?(i=c.parentNode,r=new o.ListFormatter(i.nodeName.toLowerCase(),m),a=this.editor.createRange(),a.selectNode(p[t]),r.toggle(a)):m&&("td"==d||c.attributes.contentEditable)?new g(f,this.values).apply(c.childNodes):(l=s.changeTag(c,m),s.attr(l,f[0].attr)));else h=new g(f,this.values),h.editor=this.editor,h.apply(e)},toggle:function(e){var t=p.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=p.textNodes(e),t.length||(t=s.significantChildNodes(e.commonAncestorContainer))),this.apply(t)},immutables:function(){return this.editor&&this.editor.options.immutables}}),_=l.extend({init:function(e){e.formatter=e.formatter();var t=e.formatter.finder;t&&u.formatByName("immutable",t.format)&&t._initOptions({immutables:e.immutables}),l.fn.init.call(this,e)}}),b=c.extend({init:function(e){c.fn.init.call(this,r(e,{finder:new m(e.format),formatter:function(){return new g(e.format)}}))}});r(o,{BlockFormatFinder:m,BlockFormatter:g,GreedyBlockFormatter:v,FormatCommand:_,BlockFormatTool:b}),t=["ul","ol","li"],f("justifyLeft",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left",display:"",marginLeft:"",marginRight:""}}},{tags:["immutable"],attr:{style:{"float":"left",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"left",listStylePosition:""}}}]),h("justifyLeft",new b({format:a.justifyLeft,template:new d({template:u.buttonTemplate,title:"Justify Left"})})),f("justifyCenter",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:["immutable"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"center",listStylePosition:"inside"}}}]),h("justifyCenter",new b({format:a.justifyCenter,template:new d({template:u.buttonTemplate,title:"Justify Center"})})),f("justifyRight",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right",display:"",marginLeft:"",marginRight:""}}},{tags:["immutable"],attr:{style:{"float":"right",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"right",listStylePosition:"inside"}}}]),h("justifyRight",new b({format:a.justifyRight,template:new d({template:u.buttonTemplate,title:"Justify Right"})})),f("justifyFull",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"justify"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:["immutable"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"justify",listStylePosition:""}}}]),h("justifyFull",new b({format:a.justifyFull,template:new d({template:u.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/linebreak.min",["editor/formatblock.min"],e)}(function(){!function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,r=i.Dom,o=i.Command,a=i.Tool,s=i.BlockFormatter,l=r.normalize,d=i.RangeUtils,c=i.EditorUtils.registerTool,u=o.extend({init:function(e){this.options=e,o.fn.init.call(this,e)},_insertMarker:function(e,t){var n,i=r.create(e,"a");return i.className="k-marker",t.insertNode(i),i.parentNode||(n=t.commonAncestorContainer,n.innerHTML="",n.appendChild(i)),l(i.parentNode),i},_moveFocus:function(e,t){if(r.isEmpty(t))e.setStartBefore(t);else{e.selectNodeContents(t);var n=d.textNodes(e)[0];if(!n){for(;t.childNodes.length&&!r.is(t.firstChild,"br");)t=t.firstChild;n=t}r.isEmpty(n)?e.setStartBefore(n):(r.emptyNode(n)&&(n.innerHTML="\ufeff"),e.setStartBefore(n.firstChild||n))}},shouldTrim:function(e){var t="p,h1,h2,h3,h4,h5,h6".split(","),n=r.parentOfType(e.startContainer,t),i=r.parentOfType(e.endContainer,t);return n&&!i||!n&&i},_blankAfter:function(e){for(;e&&(r.isMarker(e)||""===r.stripBom(e.nodeValue));)e=e.nextSibling;return!e},exec:function(){var t,n,o,a,c,u,h,f,p,m,g,v,_,b=this.getRange(),k=d.documentFromRange(b),w=i.emptyElementContent;this.expandImmutablesIn(b),p=this.shouldTrim(b),b.deleteContents(),c=this._insertMarker(k,b),r.stripBomNode(c.previousSibling),r.stripBomNode(c.nextSibling),u=r.closestEditableOfType(c,["li"]),h=r.closestEditableOfType(c,"h1,h2,h3,h4,h5,h6".split(",")),u?r.emptyNode(u)&&(a=r.create(k,"p"),r.next(u)&&(f=b.cloneRange(),f.selectNode(u),d.split(f,u.parentNode)),m=e("br",u),1==m.length&&m.remove(),g=u.parentNode,v=u.parentNode.children.length,_=v>1&&1==u.childNodes.length&&u.children[0],r.insertAfter(a,g),r.remove(1==v?u.parentNode:u),_&&_!==c?(a.appendChild(_),a.appendChild(c)):a.innerHTML=w,o=a):h&&this._blankAfter(c)&&(a=r.create(k,"p"),r.insertAfter(a,h),a.innerHTML=w,r.remove(c),o=a),o||(u||h||new s([{tags:["p"]}]).apply([c]),b.selectNode(c),t=r.parentOfType(c,[u?"li":h?r.name(h):"p"]),d.split(b,t,p),n=t.previousSibling,r.is(n,"li")&&n.firstChild&&!r.is(n.firstChild,"br")&&(n=n.firstChild),o=t.nextSibling,this.clean(n),this.clean(o,{links:!0}),r.is(o,"li")&&o.firstChild&&!r.is(o.firstChild,"br")&&(o=o.firstChild),r.remove(t),l(n)),l(o),this._moveFocus(b,o),b.collapse(!0),r.scrollTo(o),d.selectRange(b)},clean:function(t,n){var o,a=t;if(t.firstChild&&r.is(t.firstChild,"br")&&r.remove(t.firstChild),r.isDataNode(t)&&!t.nodeValue&&(t=t.parentNode),t){for(o=!1;t.firstChild&&1==t.firstChild.nodeType;)o=o||r.significantNodes(t.childNodes).length>1,t=t.firstChild;if(r.isEmpty(t)||!/^\s*$/.test(t.innerHTML)||o||(e(a).find(".k-br").remove(),t.innerHTML=i.emptyElementContent),n&&n.links)for(;t!=a;){if(r.is(t,"a")&&r.emptyNode(t)){r.unwrap(t);break}
t=t.parentNode}}}}),h=o.extend({init:function(e){this.options=e,o.fn.init.call(this,e)},exec:function(){var e,n,i,o,a=this.getRange();this.expandImmutablesIn(a),e=r.create(d.documentFromRange(a),"br"),i=t.support.browser,o=i.msie&&i.version<11,a.deleteContents(),a.insertNode(e),l(e.parentNode),o||e.nextSibling&&!r.isWhitespace(e.nextSibling)||(n=e.cloneNode(!0),n.className="k-br",r.insertAfter(n,e)),a.setStartAfter(e),a.collapse(!0),r.scrollTo(e.nextSibling||e),d.selectRange(a)}});n(i,{ParagraphCommand:u,NewLineCommand:h}),c("insertLineBreak",new a({key:13,shift:!0,command:h})),c("insertParagraph",new a({key:13,command:u}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/lists.min",["editor/linebreak.min"],e)}(function(){!function(e){var t=window.kendo,n=t.Class,i=e.extend,r=t.ui.editor,o=r.Dom,a=r.RangeUtils,s=r.EditorUtils,l=r.Command,d=r.ToolTemplate,c=r.FormatTool,u=r.BlockFormatFinder,h=a.textNodes,f=r.EditorUtils.registerTool,p=u.extend({init:function(e){this.tag=e;var t=this.tags=["ul"==e?"ol":"ul",e];u.fn.init.call(this,[{tags:t}])},isFormatted:function(e){var t,n,i=[];for(n=0;n<e.length;n++)t=this.findFormat(e[n]),t&&o.name(t)==this.tag&&i.push(t);if(i.length<1)return!1;if(i.length!=e.length)return!1;for(n=0;n<i.length&&i[n].parentNode==t.parentNode;n++)if(i[n]!=t)return!1;return!0},findSuitable:function(e){var t=this.findFormat(e[0]);return t&&o.name(t)==this.tag?t:null}}),m=n.extend({init:function(e,t){var n=this;n.finder=new p(e),n.tag=e,n.unwrapTag=t},isList:function(e){return o.list(e)},immutables:function(){return this.editor&&!!this.editor.options.immutables},wrap:function(t,n){var i,a,s=o.create(t.ownerDocument,"li"),l=this.immutables()?r.Immutables.immutable:e.noop;for(i=0;i<n.length;i++)if(a=n[i],o.is(a,"li"))t.appendChild(a);else if(this.isList(a))for(;a.firstChild;)t.appendChild(a.firstChild);else if(o.is(a,"td")){for(;a.firstChild;)s.appendChild(a.firstChild);t.appendChild(s),a.appendChild(t),t=t.cloneNode(!1),s=s.cloneNode(!1)}else s.appendChild(a),o.isBlock(a)&&(t.appendChild(s),l(a)||o.unwrap(a),s=s.cloneNode(!1));s.firstChild&&t.appendChild(s)},containsAny:function(e,t){for(var n=0;n<t.length;n++)if(o.isAncestorOrSelf(e,t[n]))return!0;return!1},suitable:function(e,t){if("k-marker"==e.className){var n=e.nextSibling;if(n&&o.isBlock(n))return!1;if(n=e.previousSibling,n&&o.isBlock(n))return!1}return this.containsAny(e,t)||o.isInline(e)||3==e.nodeType},_parentLists:function(t){var n=o.closestEditable(t);return e(t).parentsUntil(n,"ul,ol")},split:function(e){var t,n,i,r,s,l,d=h(e);if(d.length)for(t=o.parentOfType(d[0],["li"]),n=o.parentOfType(d[d.length-1],["li"]),e.setStartBefore(t),e.setEndAfter(n),r=0,s=d.length;r<s;r++)l=this.finder.findFormat(d[r]),l&&(i=this._parentLists(l),i.length?a.split(e,i.last()[0],!0):a.split(e,l,!0))},merge:function(e,t){for(var n,i=t.previousSibling;i&&("k-marker"==i.className||3==i.nodeType&&o.isWhitespace(i));)i=i.previousSibling;if(i&&o.name(i)==e){for(;t.firstChild;)i.appendChild(t.firstChild);o.remove(t),t=i}for(n=t.nextSibling;n&&("k-marker"==n.className||3==n.nodeType&&o.isWhitespace(n));)n=n.nextSibling;if(n&&o.name(n)==e){for(;t.lastChild;)n.insertBefore(t.lastChild,n.firstChild);o.remove(t)}},breakable:function(e){return e!=e.ownerDocument.body&&!/table|tbody|tr|td/.test(o.name(e))&&!e.attributes.contentEditable},applyOnSection:function(t,n){function i(){u.push(this)}var r,a,s,l,d=this.tag,c=o.closestSplittableParent(n),u=[],h=this.finder.findSuitable(n);for(h||(h=new p("ul"==d?"ol":"ul").findSuitable(n)),/table|tbody/.test(o.name(c))?r=e.map(n,function(e){return o.parentOfType(e,["td"])}):(r=o.significantChildNodes(c),e.grep(r,o.isBlock).length&&(r=e.grep(r,e.proxy(function(e){return this.containsAny(e,n)},this))),r.length||(r=n)),a=0;a<r.length;a++)s=r[a],l=(!h||!o.isAncestorOrSelf(h,s))&&this.suitable(s,n),l&&(h&&this.isList(s)?(e.each(s.children,i),o.remove(s)):u.push(s));for(u.length==r.length&&this.breakable(c)&&(u=[c]),h||(h=o.create(c.ownerDocument,d),o.insertBefore(h,u[0])),this.wrap(h,u);o.isBom(h.nextSibling);)o.remove(h.nextSibling);o.is(h,d)||o.changeTag(h,d),this.merge(d,h)},apply:function(t){function n(){i&&c.push({section:i,nodes:a})}var i,a,s,l,d=0,c=[],u=t.length,h=this.immutables()?r.Immutables.immutableParent:e.noop;for(d=0;d<u;d++)l=h(t[d])||t[d],s=o.closestEditable(l,["td","body"]),i&&s==i?a.push(l):(n(),a=[l],i=s);for(n(),d=0;d<c.length;d++)this.applyOnSection(c[d].section,c[d].nodes)},unwrap:function(e){var t,n,i,r,a=e.ownerDocument.createDocumentFragment(),s=this.unwrapTag;for(n=e.firstChild;n;n=n.nextSibling){for(i=o.create(e.ownerDocument,s||"p");n.firstChild;)r=n.firstChild,o.isBlock(r)?(i.firstChild&&(a.appendChild(i),i=o.create(e.ownerDocument,s||"p")),a.appendChild(r)):i.appendChild(r);i.firstChild&&a.appendChild(i)}t=this._parentLists(e),t[0]?(o.insertAfter(a,t.last()[0]),t.last().remove()):o.insertAfter(a,e),o.remove(e)},remove:function(e){var t,n,i;for(n=0,i=e.length;n<i;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,i=h(e),r=e.commonAncestorContainer;i.length||(e.selectNodeContents(r),i=h(e),i.length||(t=r.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),i=[t],e.selectNode(t.parentNode))),i=o.filterBy(i,o.htmlIndentSpace,!0),n.finder.isFormatted(i)?(n.split(e),n.remove(i)):n.apply(i)}}),g=l.extend({init:function(e){e.formatter=new m(e.tag),l.fn.init.call(this,e)}}),v=c.extend({init:function(e){this.options=e,c.fn.init.call(this,i(e,{finder:new p(e.tag)}))},command:function(e){return new g(i(e,{tag:this.options.tag}))}});i(r,{ListFormatFinder:p,ListFormatter:m,ListCommand:g,ListTool:v}),f("insertUnorderedList",new v({tag:"ul",template:new d({template:s.buttonTemplate,title:"Insert unordered list"})})),f("insertOrderedList",new v({tag:"ol",template:new d({template:s.buttonTemplate,title:"Insert ordered list"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/link.min",["editor/lists.min"],e)}(function(){!function(e,t){function n(e,t){for(var n=e.length;n--&&!t.test(e[n]););return n}function i(e,t){var n=t.exec(e);return n?n.index:-1}var r=window.kendo,o=r.Class,a=e.extend,s=e.proxy,l=r.ui.editor,d=l.Dom,c=l.RangeUtils,u=l.EditorUtils,h=l.Command,f=l.Tool,p=l.ToolTemplate,m=l.InlineFormatter,g=l.InlineFormatFinder,v=c.textNodes,_=c.editableTextNodes,b=l.EditorUtils.registerTool,k=r.keys,w="http://",y=/^\w*:\/\//,x=/[\w\/\$\-_\*\?]/i,C=o.extend({findSuitable:function(e){return d.parentOfType(e,["a"])}}),T=o.extend({init:function(){this.finder=new C},apply:function(e,t){var n,i,r,o,a,s,l,u=this.immutables?_(e):v(e);if(t.innerHTML){for(i=c.documentFromRange(e),n=c.getMarkers(e),e.deleteContents(),o=d.create(i,"a",t),e.insertNode(o),a=o.parentNode,"a"==d.name(a)&&d.insertAfter(o,a),d.emptyNode(a)&&d.remove(a),s=o,l=0;l<n.length;l++)d.insertAfter(n[l],s),s=n[l];n.length&&(d.insertBefore(i.createTextNode("\ufeff"),n[1]),d.insertAfter(i.createTextNode("\ufeff"),n[1]),e.setStartBefore(n[0]),e.setEndAfter(n[n.length-1]))}else r=new m([{tags:["a"]}],t),r.finder=this.finder,r.apply(u)}}),S=h.extend({init:function(e){var t=this;e.formatter={toggle:function(e){var n=t.immutables()?_(e):v(e);new m([{tags:["a"]}]).remove(n)}},this.options=e,h.fn.init.call(this,e)}}),D=h.extend({init:function(e){var t;this.options=e,h.fn.init.call(this,e),this.formatter=new T,e.url?this.exec=function(){this.formatter.immutables=t&&t.immutables(),this.formatter.apply(e.range,{href:e.url,innerHTML:e.text||e.url,target:e.target})}:(this.attributes=null,this.async=!0)},_dialogTemplate:function(){return r.template("<div class=\"k-editor-dialog k-popup-edit-form k-edit-form-container\"><div class='k-edit-label'><label for='k-editor-link-url'>#: messages.linkWebAddress #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-url'></div><div class='k-edit-label k-editor-link-text-row'><label for='k-editor-link-text'>#: messages.linkText #</label></div><div class='k-edit-field k-editor-link-text-row'><input type='text' class='k-input k-textbox' id='k-editor-link-text'></div><div class='k-edit-label'><label for='k-editor-link-title'>#: messages.linkToolTip #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-title'></div><div class='k-edit-label'></div><div class='k-edit-field'><input type='checkbox' class='k-checkbox' id='k-editor-link-target'><label for='k-editor-link-target' class='k-checkbox-label'>#: messages.linkOpenInNewWindow #</label></div><div class='k-edit-buttons k-state-default'><button class=\"k-dialog-insert k-button k-primary\">#: messages.dialogInsert #</button><button class=\"k-dialog-close k-button\">#: messages.dialogCancel #</button></div></div>")({messages:this.editor.options.messages})},exec:function(){var t,n,i,r,o=this.editor.options.messages;this._initialText="",this._range=this.lockRange(!0),this.formatter.immutables=this.immutables(),t=v(this._range),n=t.length?this.formatter.finder.findSuitable(t[0]):null,i=t.length&&"img"==d.name(t[0]),r=this.createDialog(this._dialogTemplate(),{title:o.createLink,close:s(this._close,this),visible:!1}),n&&(this._range.selectNodeContents(n),t=v(this._range)),this._initialText=this.linkText(t),r.find(".k-dialog-insert").click(s(this._apply,this)).end().find(".k-dialog-close").click(s(this._close,this)).end().find(".k-edit-field input").keydown(s(this._keydown,this)).end().find("#k-editor-link-url").val(this.linkUrl(n)).end().find("#k-editor-link-text").val(this._initialText).end().find("#k-editor-link-title").val(n?n.title:"").end().find("#k-editor-link-target").attr("checked",!!n&&"_blank"==n.target).end().find(".k-editor-link-text-row").toggle(!i),this._dialog=r.data("kendoWindow").center().open(),e("#k-editor-link-url",r).focus().select()},_keydown:function(e){var t=r.keys;e.keyCode==t.ENTER?this._apply(e):e.keyCode==t.ESC&&this._close(e)},_apply:function(t){var n,i,r,o=this._dialog.element,a=e("#k-editor-link-url",o).val(),s=e("#k-editor-link-text",o);a&&a!=w&&(a.indexOf("@")>0&&!/^(\w+:)|(\/\/)/i.test(a)&&(a="mailto:"+a),this.attributes={href:a},n=e("#k-editor-link-title",o).val(),n&&(this.attributes.title=n),s.is(":visible")&&(i=s.val(),i||this._initialText?i&&i!==this._initialText&&(this.attributes.innerHTML=d.stripBom(i)):this.attributes.innerHTML=a),r=e("#k-editor-link-target",o).is(":checked"),this.attributes.target=r?"_blank":null,this.formatter.apply(this._range,this.attributes)),this._close(t),this.change&&this.change()},_close:function(e){e.preventDefault(),this._dialog.destroy(),d.windowFromDocument(c.documentFromRange(this._range)).focus(),this.releaseRange(this._range)},linkUrl:function(e){return e?e.getAttribute("href",2):w},linkText:function(e){var t,n="";for(t=0;t<e.length;t++)n+=e[t].nodeValue;return d.stripBom(n||"")},redo:function(){var e=this.lockRange(!0);this.formatter.apply(e,this.attributes),this.releaseRange(e)}}),E=h.extend({init:function(e){h.fn.init.call(this,e),this.formatter=new T},exec:function(){var e,t,n,i=this.detectLink();i&&(e=this.getRange(),t=new r.ui.editor.Marker,n=e.cloneRange(),n.setStart(i.start.node,i.start.offset),n.setEnd(i.end.node,i.end.offset),e=this.lockRange(),t.add(n),this.formatter.apply(n,{href:this._ensureWebProtocol(i.text)}),t.remove(n),this.releaseRange(e))},detectLink:function(){var e=this.getRange(),t=new M({node:e.startContainer,offset:e.startOffset,cancelAtNode:function(e){return e&&"a"===d.name(e)}}),n=new R(t);return n.detectLink()},changesContent:function(){return!!this.detectLink()},_ensureWebProtocol:function(e){var t=this._hasProtocolPrefix(e);return t?e:this._prefixWithWebProtocol(e)},_hasProtocolPrefix:function(e){return y.test(e)},_prefixWithWebProtocol:function(e){return w+e}}),F=f.extend({init:function(t){this.options=t,this.finder=new g([{tags:["a"]}]),f.fn.init.call(this,e.extend(t,{command:S}))},initialize:function(e,t){f.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){e.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}}),R=o.extend({init:function(e){this.traverser=e,this.start=I(),this.end=I(),this.text=""},detectLink:function(){var t,n,i,r,o=this.traverser.node,a=this.traverser.offset;if(d.isDataNode(o)){if(t=o.data.substring(0,a),/\s{2}$/.test(d.stripBom(t)))return}else 0===a&&(n=d.closestEditableOfType(o,d.blockElements),n&&n.previousSibling&&this.traverser.init({node:n.previousSibling}));return this.traverser.traverse(e.proxy(this._detectEnd,this)),this.end.blank()||(this.traverser=this.traverser.clone(this.end),this.traverser.traverse(e.proxy(this._detectStart,this)),this._isLinkDetected()||(i=this.traverser.extendOptions(this.start),r=new z(i),r.traverse(e.proxy(this._skipStartPuntuation,this)),this._isLinkDetected()||(this.start=I()))),this.start.blank()?null:{start:this.start,end:this.end,text:this.text}},_isLinkDetected:function(){return y.test(this.text)||/^w{3}\./i.test(this.text)},_detectEnd:function(e,t){var i=n(e,x);if(i>-1)return this.end.node=t,this.end.offset=i+1,!1},_detectStart:function(e,t){var i=n(e,/\s/),r=i+1;if(this.text=e.substring(r)+this.text,this.start.node=t,this.start.offset=r,i>-1)return!1},_skipStartPuntuation:function(e,t,n){var r=i(e,/\w/),o=r;if(r===-1&&(o=e.length),this.text=this.text.substring(o),this.start.node=t,this.start.offset=o+(0|n),r>-1)return!1}}),I=function(){return{node:null,offset:null,blank:function(){return null===this.node&&null===this.offset}}},A=o.extend({init:function(n){this.node=n.node,this.offset=n.offset===t?d.isDataNode(this.node)&&this.node.length||0:n.offset,this.cancelAtNode=n.cancelAtNode||this.cancelAtNode||e.noop},traverse:function(e){e&&(this.cancel=!1,this._traverse(e,this.node,this.offset))},_traverse:function(e,n,i){var r,o,a,s;if(n&&!this.cancel){if(3!==n.nodeType)return o=this.edgeNode(n),this.cancel=this.cancel||this.cancelAtNode(o),this._traverse(e,o);if(r=n.data,i!==t&&(r=this.subText(r,i)),this.cancel=e(r,n,i)===!1,a=this.next(n),!a)for(s=n.parentNode;!a&&d.isInline(s);)a=this.next(s),s=s.parentNode;this.cancel=this.cancel||this.cancelAtNode(a),this._traverse(e,a)}},extendOptions:function(t){return e.extend({node:this.node,offset:this.offset,cancelAtNode:this.cancelAtNode},t||{})},edgeNode:function(e){},next:function(e){},subText:function(e,t){}}),M=A.extend({subText:function(e,t){return e.substring(0,t)},next:function(e){return e.previousSibling},edgeNode:function(e){return e.lastChild},clone:function(e){var t=this.extendOptions(e);return new M(t)}}),z=A.extend({subText:function(e,t){return e.substring(t)},next:function(e){return e.nextSibling},edgeNode:function(e){return e.firstChild},clone:function(e){var t=this.extendOptions(e);return new z(t)}});a(r.ui.editor,{LinkFormatFinder:C,LinkFormatter:T,UnlinkCommand:S,LinkCommand:D,AutoLinkCommand:E,UnlinkTool:F,DomTextLinkDetection:R,LeftDomTextTraverser:M,RightDomTextTraverser:z}),b("createLink",new f({key:"K",ctrl:!0,command:D,template:new p({template:u.buttonTemplate,title:"Create Link"})})),b("unlink",new F({key:"K",ctrl:!0,shift:!0,template:new p({template:u.buttonTemplate,title:"Remove Link"})})),b("autoLink",new f({key:[k.ENTER,k.SPACEBAR],keyPressCommand:!0,command:E}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/file.min",["kendo.filebrowser.min","editor/link.min"],e)}(function(){!function(e,t){var n=window.kendo,i=e.extend,r=n.ui.editor,o=r.EditorUtils,a=r.Dom,s=o.registerTool,l=r.ToolTemplate,d=r.RangeUtils,c=r.Command,u=r.LinkFormatter,h=d.textNodes,f=n.keys,p="#k-editor-file-url",m="#k-editor-file-title",g=c.extend({init:function(e){var t=this;c.fn.init.call(t,e),t.formatter=new u,t.async=!0,t.attributes={}},insertFile:function(e,t){var n=this.attributes,i=d.documentFromRange(t);if(n.href&&"http://"!=n.href){if(!e)return e=a.create(i,"a",{href:n.href}),e.innerHTML=n.innerHTML,t.deleteContents(),t.insertNode(e),e.nextSibling||a.insertAfter(i.createTextNode("\ufeff"),e),t.setStartAfter(e),t.setEndAfter(e),d.selectRange(t),!0;a.attr(e,n)}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-filebrowser"></div># } #<div class=\'k-edit-label\'><label for="k-editor-file-url">#: messages.fileWebAddress #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-url"></div><div class=\'k-edit-label\'><label for="k-editor-file-title">#: messages.fileTitle #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-file-title"></div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #</button><button class="k-dialog-close k-button">#: messages.dialogCancel #</button></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();this.formatter.apply(t,this.attributes),e.releaseRange(t)},exec:function(){function e(e){var t=s.element,n=t.find(p).val().replace(/ /g,"%20"),i=t.find(m).val();l.attributes={href:n,innerHTML:""!==i?i:n},g=l.insertFile(v,c),r(e),l.change&&l.change()}function r(e){e.preventDefault(),s.destroy(),a.windowFromDocument(d.documentFromRange(c)).focus(),g||l.releaseRange(c)}function o(t){t.keyCode==f.ENTER?e(t):t.keyCode==f.ESC&&r(t)}var s,l=this,c=l.lockRange(),u=h(c),g=!1,v=u.length?this.formatter.finder.findSuitable(u[0]):null,_=l.editor.options,b=_.messages,k=_.fileBrowser,w=!!(n.ui.FileBrowser&&k&&k.transport&&k.transport.read!==t),y={title:b.insertFile,visible:!1,resizable:w};this.expandImmutablesIn(c),y.close=r,w&&(y.width=750),s=this.createDialog(l._dialogTemplate(w),y).toggleClass("k-filebrowser-dialog",w).find(".k-dialog-insert").click(e).end().find(".k-dialog-close").click(r).end().find(".k-edit-field input").keydown(o).end().find(p).val(v?v.getAttribute("href",2):"http://").end().find(m).val(v?v.title:"").end().data("kendoWindow"),w&&(l._fileBrowser=new n.ui.FileBrowser(s.element.find(".k-filebrowser"),i({},k)),l._fileBrowser.bind("change",function(e){"f"===e.selected.get("type")&&s.element.find(p).val(this.value())}),l._fileBrowser.bind("apply",e)),s.center().open(),s.element.find(p).focus().select()}});n.ui.editor.FileCommand=g,s("insertFile",new r.Tool({command:g,template:new l({template:o.buttonTemplate,title:"Insert File"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/image.min",["kendo.imagebrowser.min","editor/link.min"],e)}(function(){!function(e,t){var n=window.kendo,i=e.extend,r=n.ui.editor,o=r.EditorUtils,a=r.Dom,s=o.registerTool,l=r.ToolTemplate,d=r.RangeUtils,c=r.Command,u=n.keys,h="#k-editor-image-url",f="#k-editor-image-title",p="#k-editor-image-width",m="#k-editor-image-height",g=c.extend({init:function(e){var t=this;c.fn.init.call(t,e),t.async=!0,t.attributes={}},insertImage:function(e,t){var n,i=this.attributes,r=d.documentFromRange(t);if(i.src&&"http://"!=i.src){if(n=function(){setTimeout(function(){i.width||e.removeAttribute("width"),i.height||e.removeAttribute("height"),e.removeAttribute("complete")})},!e)return e=a.create(r,"img",i),e.onload=e.onerror=n,t.deleteContents(),t.insertNode(e),e.nextSibling||a.insertAfter(r.createTextNode("\ufeff"),e),n(),t.setStartAfter(e),t.setEndAfter(e),d.selectRange(t),!0;e.onload=e.onerror=n,a.attr(e,i),n()}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-filebrowser k-imagebrowser"></div># } #<div class=\'k-edit-label\'><label for="k-editor-image-url">#: messages.imageWebAddress #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-url"></div><div class=\'k-edit-label\'><label for="k-editor-image-title">#: messages.imageAltText #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-title"></div><div class=\'k-edit-label\'><label for="k-editor-image-width">#: messages.imageWidth #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-width"></div><div class=\'k-edit-label\'><label for="k-editor-image-height">#: messages.imageHeight #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-height"></div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #</button><button class="k-dialog-close k-button">#: messages.dialogCancel #</button></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();e.insertImage(d.image(t),t)||e.releaseRange(t)},exec:function(){function e(e){var t=s.element,n=parseInt(t.find(p).val(),10),i=parseInt(t.find(m).val(),10);l.attributes={src:t.find(h).val().replace(/ /g,"%20"),alt:t.find(f).val()},l.attributes.width=null,l.attributes.height=null,!isNaN(n)&&n>0&&(l.attributes.width=n),!isNaN(i)&&i>0&&(l.attributes.height=i),g=l.insertImage(v,c),r(e),l.change&&l.change()}function r(e){e.preventDefault(),s.destroy(),a.windowFromDocument(d.documentFromRange(c)).focus(),g||l.releaseRange(c)}function o(t){t.keyCode==u.ENTER?e(t):t.keyCode==u.ESC&&r(t)}var s,l=this,c=l.lockRange(),g=!1,v=d.image(c),_=v&&v.getAttribute("width")||"",b=v&&v.getAttribute("height")||"",k=l.editor.options,w=k.messages,y=k.imageBrowser,x=!!(n.ui.ImageBrowser&&y&&y.transport&&y.transport.read!==t),C={title:w.insertImage,visible:!1,resizable:x};this.expandImmutablesIn(c),C.close=r,x&&(C.width=750),s=this.createDialog(l._dialogTemplate(x),C).toggleClass("k-filebrowser-dialog",x).find(".k-dialog-insert").click(e).end().find(".k-dialog-close").click(r).end().find(".k-edit-field input").keydown(o).end().find(h).val(v?v.getAttribute("src",2):"http://").end().find(f).val(v?v.alt:"").end().find(p).val(_).end().find(m).val(b).end().data("kendoWindow"),x&&(this._imageBrowser=new n.ui.ImageBrowser(s.element.find(".k-imagebrowser"),i({},y)),this._imageBrowser.bind("change",function(e){"f"===e.selected.get("type")&&s.element.find(h).val(this.value())}),this._imageBrowser.bind("apply",e)),s.center().open(),s.element.find(h).focus().select()}});n.ui.editor.ImageCommand=g,s("insertImage",new r.Tool({command:g,template:new l({template:o.buttonTemplate,title:"Insert Image"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/components.min",["editor/image.min"],e)}(function(){!function(e,t){var n=window.kendo,i=n.ui.DropDownList,r=n.ui.editor.Dom,o=i.extend({init:function(t,r){var o=this;i.fn.init.call(o,t,r),n.support.mobileOS.ios&&(this._initSelectOverlay(),this.bind("dataBound",e.proxy(this._initSelectOverlay,this))),o.text(o.options.title),o.bind("open",function(){if(o.options.autoSize){var e,t=o.list;t.css({whiteSpace:"nowrap",width:"auto"}),e=t.width(),e?e+=20:e=o._listWidth,t.css("width",e+n.support.scrollbar()),o._listWidth=e}})},options:{name:"SelectBox",index:-1},_initSelectOverlay:function(){var t,i,r,o,a=this,s=a.value(),l=this.dataSource.view(),d="",c=n.htmlEncode;for(i=0;i<l.length;i++)t=l[i],d+="<option value='"+c(t.value)+"'",t.value==s&&(d+=" selected"),d+=">"+c(t.text)+"</option>";r=e("<select class='k-select-overlay'>"+d+"</select>"),o=e(this.element).closest(".k-widget"),o.next(".k-select-overlay").remove(),r.insertAfter(o),r.on("change",function(){a.value(this.value),a.trigger("change")})},value:function(e){var n=this,r=i.fn.value.call(n,e);return e===t?r:(i.fn.value.call(n)||n.text(n.options.title),t)},decorate:function(t){var n,i,o,a,s=this,l=s.dataSource,d=l.data();for(t&&s.list.css("background-color",r.getEffectiveBackground(e(t))),n=0;n<d.length;n++)i=d[n].tag||"span",o=d[n].className,a=r.inlineStyle(t,i,{className:o}),a=a.replace(/"/g,"'"),d[n].style=a+";display:inline-block";l.trigger("change")}});n.ui.plugin(o),n.ui.editor.SelectBox=o}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/indent.min",["editor/components.min"],e)}(function(){!function(e,t){function n(n,i){var r="rtl"==e(n).css("direction"),o=r?"Right":"Left",a="td"!=s.name(n)?"margin"+o:"padding"+o;return i===t?n.style[a]||0:(i>0?n.style[a]=i+"px":(n.style[a]="",n.style.cssText||n.removeAttribute("style")),t)}var i=window.kendo,r=i.Class,o=e.extend,a=i.ui.editor,s=a.Dom,l=a.EditorUtils,d=l.registerTool,c=a.Command,u=a.Tool,h=a.ToolTemplate,f=a.RangeUtils,p=s.blockElements,m=a.BlockFormatFinder,g=a.BlockFormatter,v=r.extend({init:function(){this.finder=new m([{tags:s.blockElements}])},apply:function(t){var i,r,o,a,l,d,c,u,h,f,p,m;if(t=s.filterBy(t,s.htmlIndentSpace,!0),i=this.finder.findSuitable(t),r=[],i=this.mapImmutables(i),i.length){for(o=0,a=i.length;o<a;o++)s.is(i[o],"li")?e(i[o]).index()?e.inArray(i[o].parentNode,r)<0&&r.push(i[o]):r.push(i[o].parentNode):r.push(i[o]);for(;r.length;)if(l=r.shift(),s.is(l,"li"))if(d=l.parentNode,c=e(l).prev("li"),u=c.find("ul,ol").last(),h=e(l).children("ul,ol")[0],h&&c[0])u[0]?(u.append(l),u.append(e(h).children()),s.remove(h)):(c.append(h),h.insertBefore(l,h.firstChild));else for(h=c.children("ul,ol")[0],h||(h=s.create(l.ownerDocument,s.name(d)),c.append(h));l&&l.parentNode==d;)h.appendChild(l),l=r.shift();else for(f=parseInt(n(l),10)+30,n(l,f),p=0;p<r.length;p++)e.contains(l,r[p])&&r.splice(p,1)}else m=new g([{tags:["p"]}],{style:{marginLeft:30}}),m.apply(t)},mapImmutables:function(t){if(this.immutables){var n=[];return e.map(t,function(t){var i=a.Immutables.immutableParent(t);if(i){if(e.inArray(i,n)!==-1)return null;n.push(i)}return i||t})}return t},remove:function(t){t=s.filterBy(t,s.htmlIndentSpace,!0);var i,r,o,a,l,d,c,u,h=this.finder.findSuitable(t);for(h=this.mapImmutables(h),r=0,o=h.length;r<o;r++){if(c=e(h[r]),c.is("li")){if(a=c.parent(),l=a.parent(),l.is("li,ul,ol")&&!n(a[0])){if(i&&e.contains(i,l[0]))continue;d=c.nextAll("li"),d.length&&e(a[0].cloneNode(!1)).appendTo(c).append(d),l.is("li")?c.insertAfter(l):c.appendTo(l),a.children("li").length||a.remove();continue}if(i==a[0])continue;i=a[0]}else i=h[r];u=parseInt(n(i),10)-30,n(i,u)}}}),_=c.extend({init:function(t){var n=this;t.formatter={toggle:e.proxy(function(e){var t=new v;t.immutables=this.editor&&this.editor.options.immutables,t.apply(f.nodes(e))},n)},c.fn.init.call(this,t)}}),b=c.extend({init:function(t){var n=this;t.formatter={toggle:e.proxy(function(e){var t=new v;t.immutables=this.editor&&this.editor.options.immutables,t.remove(f.nodes(e))},n)},c.fn.init.call(this,t)}}),k=u.extend({init:function(e){u.fn.init.call(this,e),this.finder=new m([{tags:p}])},initialize:function(t,n){u.fn.initialize.call(this,t,n),e.extend(this.options,{immutables:n.editor&&n.editor.options.immutables}),t.addClass("k-state-disabled")},update:function(i,r){var o,l,d,c,u,h,f=this.finder.findSuitable(r);for(d=0,c=f.length;d<c;d++)if(u=f[d],this.options.immutables&&(h=a.Immutables.immutableParent(u),h&&(u=h)),o=n(u),o||(l=e(u).parents("ul,ol").length,o=s.is(u,"li")&&(l>1||n(u.parentNode))||s.ofType(u,["ul","ol"])&&l>0),o)return i.removeClass("k-state-disabled"),t;i.addClass("k-state-disabled").removeClass("k-state-hover")}});o(a,{IndentFormatter:v,IndentCommand:_,OutdentCommand:b,OutdentTool:k}),d("indent",new u({command:_,template:new h({template:l.buttonTemplate,title:"Indent"})})),d("outdent",new k({command:b,template:new h({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/viewhtml.min",["editor/indent.min"],e)}(function(){!function(e,t){var n=window.kendo,i=e.extend,r=n.ui.editor,o=r.EditorUtils,a=r.Command,s=r.Tool,l=r.ToolTemplate,d=a.extend({init:function(e){var t=this;t.options=e,a.fn.init.call(t,e),t.attributes=null,t.async=!0},exec:function(){function i(e){l.deserialization.immutables=s.immutables,s.value(u.find(h).val()),l.deserialization.immutables=t,r(e),a.change&&a.change(),s.trigger("change")}function r(e){e.preventDefault(),u.data("kendoWindow").destroy(),s.immutables&&(s.immutables.serializedImmutables={}),s.focus()}var o,a=this,s=a.editor,l=s.options,c=s.options.messages,u=e(n.template(d.template)(c)).appendTo(document.body),h=".k-editor-textarea";l.serialization.immutables=s.immutables,o=d.indent(s.value()),l.serialization.immutables=t,this.createDialog(u,{title:c.viewHtml,close:r,visible:!1}).find(h).val(o).end().find(".k-dialog-update").click(i).end().find(".k-dialog-close").click(r).end().data("kendoWindow").center().open(),u.find(h).focus()}});i(d,{template:"<div class='k-editor-dialog k-popup-edit-form k-edit-form-container k-viewhtml-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-edit-buttons k-state-default'><button class='k-dialog-update k-button k-primary'>#: dialogUpdate #</button><button class='k-dialog-close k-button'>#: dialogCancel #</button></div></div>",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")}}),n.ui.editor.ViewHtmlCommand=d,r.EditorUtils.registerTool("viewHtml",new s({command:d,template:new l({template:o.buttonTemplate,title:"View HTML"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/formatting.min",["editor/viewhtml.min"],e)}(function(){!function(e){function t(e){var t,r,o=l.closestEditableOfType(e,["li"]);o&&(t=new i.ListFormatter(l.name(o.parentNode)),r=n.ui.editor.W3CRange.fromNode(e),r.selectNode(o),t.toggle(r))}var n=window.kendo,i=n.ui.editor,r=i.Tool,o=i.ToolTemplate,a=i.DelayedExecutionTool,s=i.Command,l=i.Dom,d=i.EditorUtils,c=i.RangeUtils,u=d.registerTool,h=a.extend({init:function(e){var t=this;r.fn.init.call(t,n.deepExtend({},t.options,e)),t.type="kendoSelectBox",t.finder={getFormat:function(){return""}}},options:{items:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],width:110},toFormattingItem:function(e){var t,n=e.value;return n?e.tag||e.className?e:(t=n.indexOf("."),0===t?e.className=n.substring(1):t==-1?e.tag=n:(e.tag=n.substring(0,t),e.className=n.substring(t+1)),e):e},command:function(t){var n=this,r=t.value;return r=this.toFormattingItem(r),new i.FormatCommand({range:t.range,formatter:function(){var t,o=(r.tag||r.context||"span").split(","),a=[{tags:o,attr:{className:r.className||""}}];return t=e.inArray(o[0],l.inlineElements)>=0?new i.GreedyInlineFormatter(a):new i.GreedyBlockFormatter(a),t.editor=n.editor,t}})},initialize:function(e,t){var i=t.editor,o=this.options,a=o.name,s=this;s.editor=i,e.width(o.width),e.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:o.items||i.options[a],title:i.options.messages[a],autoSize:!0,change:function(){var e=this.dataItem();e&&r.exec(i,a,e.toJSON())},dataBound:function(){var e,t=this.dataSource.data();for(e=0;e<t.length;e++)t[e]=s.toFormattingItem(t[e])},highlightFirst:!1,template:n.template('<span unselectable="on" style="display:block;#=(data.style||"")#">#:data.text#</span>')}),e.addClass("k-decorated").closest(".k-widget").removeClass("k-"+a).find("*").addBack().attr("unselectable","on")},getFormattingValue:function(t,n){var i,r,o,a,s,l,d;for(i=0;i<t.length;i++)if(r=t[i],o=r.tag||r.context||"",a=r.className?"."+r.className:"",s=o+a,l=e(n[0]).closest(s)[0]){if(1==n.length)return r.value;for(d=1;d<n.length&&e(n[d]).closest(s)[0];d++)if(d==n.length-1)return r.value;
}return""},update:function(t,n){var i,r,o,s,d,c=e(t).data(this.type);if(c&&(i=c.dataSource,r=i.data(),d=l.commonAncestor.apply(null,n),d==l.closestEditable(d)||this._ancestor!=d)){for(this._ancestor=d,o=0;o<r.length;o++)s=r[o].context,r[o].visible=!s||!!e(d).closest(s).length;i.filter([{field:"visible",operator:"eq",value:!0}]),a.fn.update.call(this,t,n),c.value(this.getFormattingValue(i.view(),n)),c.wrapper.toggleClass("k-state-disabled",!i.view().length)}},destroy:function(){this._ancestor=null}}),f=s.extend({exec:function(){var e,t,n,i=this.lockRange(!0);for(this.tagsToClean=this.options.remove||"strong,em,span,sup,sub,del,b,i,u,font".split(","),c.wrapSelectedElements(i),e=c.mapAll(i,function(e){return e}),t=e.length-1;t>=0;t--)n=e[t],this.immutableParent(n)||this.clean(n);this.releaseRange(i)},clean:function(n){var r,o,a,s,d;if(n&&!l.isMarker(n)){if(r=l.name(n),"ul"==r||"ol"==r)for(o=new i.ListFormatter(r),a=n.previousSibling,s=n.nextSibling,o.unwrap(n);a&&a!=s;a=a.nextSibling)this.clean(a);else if("blockquote"==r)l.changeTag(n,"p");else if(1!=n.nodeType||l.insignificant(n))t(n);else{for(d=n.childNodes.length-1;d>=0;d--)this.clean(n.childNodes[d]);n.removeAttribute("style"),n.removeAttribute("class")}e.inArray(r,this.tagsToClean)>-1&&l.unwrap(n)}},immutableParent:function(e){return this.immutables()&&i.Immutables.immutableParent(e)}});e.extend(i,{FormattingTool:h,CleanFormatCommand:f}),u("formatting",new h({template:new o({template:d.dropDownListTemplate,title:"Format"})})),u("cleanFormatting",new r({command:f,template:new o({template:d.buttonTemplate,title:"Clean formatting"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/toolbar.min",["editor/formatting.min"],e)}(function(){!function(e,t){var n,i=window.kendo,r=i.ui,o=r.editor,a=r.Widget,s=e.extend,l=e.proxy,d=i.keys,c=".kendoEditor",u=i.ui.editor.EditorUtils,h=i.ui.editor.ToolTemplate,f=i.ui.editor.Tool,p=i._outerWidth,m=i._outerHeight,g="overflowAnchor",v=".k-tool-group:visible a.k-tool:not(.k-state-disabled),.k-tool.k-overflow-anchor,.k-tool-group:visible .k-widget.k-colorpicker,.k-tool-group:visible .k-selectbox,.k-tool-group:visible .k-dropdown,.k-tool-group:visible .k-combobox .k-input",_=f.extend({initialize:function(t,n){t.attr({unselectable:"on"});var i=n.editor.toolbar;t.on("click",e.proxy(function(){this.overflowPopup.toggle()},i))},options:{name:g},command:e.noop,update:e.noop,destroy:e.noop});u.registerTool(g,new _({key:"",ctrl:!0,template:new h({template:u.overflowAnchorTemplate})})),n=a.extend({init:function(e,t){var n=this;t=s({},t,{name:"EditorToolbar"}),a.fn.init.call(n,e,t),t.popup&&n._initPopup(),t.resizable&&t.resizable.toolbar&&(n._resizeHandler=i.onResize(function(){n.resize()}),n.element.addClass("k-toolbar-resizable"))},events:["execute"],groups:{basic:["bold","italic","underline","strikethrough"],scripts:["subscript","superscript"],alignment:["justifyLeft","justifyCenter","justifyRight","justifyFull"],links:["insertImage","insertFile","createLink","unlink"],lists:["insertUnorderedList","insertOrderedList","indent","outdent"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"],advanced:["viewHtml","cleanFormatting","print","pdf"],fonts:["fontName","fontSize"],colors:["foreColor","backColor"]},overflowFlaseTools:["formatting","fontName","fontSize","foreColor","backColor","insertHtml"],_initPopup:function(){var t=this;this.window=e(this.element).wrap("<div class='editorToolbarWindow k-header' />").parent().prepend("<button class='k-button k-button-bare k-editortoolbar-dragHandle'><span class='k-icon k-i-move' /></button>").kendoWindow({title:!1,resizable:!1,draggable:{dragHandle:".k-editortoolbar-dragHandle"},animation:{open:{effects:"fade:in"},close:{effects:"fade:out"}},minHeight:42,visible:!1,autoFocus:!1,actions:[],dragend:function(){this._moved=!0}}).on("mousedown",function(n){e(n.target).is(".k-icon")||(t.preventPopupHide=!0)}).on("focusout",function(){t.options.editor.element.focusout()}).data("kendoWindow")},_toggleOverflowStyles:function(e,t){e.find("li").toggleClass("k-item k-state-default",t).find(".k-tool:not(.k-state-disabled),.k-overflow-button").toggleClass("k-overflow-button k-button",t)},_initOverflowPopup:function(t){var n=this,i="<ul class='k-editor-overflow-popup k-overflow-container k-list-container'></ul>";n.overflowPopup=e(i).appendTo("body").kendoPopup({anchor:t,origin:"bottom right",position:"top right",copyAnchorStyles:!1,open:function(e){this.element.is(":empty")&&e.preventDefault(),n._toggleOverflowStyles(this.element,!0)},activate:l(n.focusOverflowPopup,n)}).data("kendoPopup")},items:function(){var e,t,n=this.options.resizable&&this.options.resizable.toolbar;return t=this.element.children().find("> *, select"),n&&(e=this.overflowPopup,t=t.add(e.element.children().find("> *"))),t},focused:function(){return this.element.find(".k-state-focused").length>0||this.preventPopupHide||this.overflowPopup&&this.overflowPopup.visible()},toolById:function(e){var t,n=this.tools;for(t in n)if(t.toLowerCase()==e)return n[t]},toolGroupFor:function(t){var n,i=this.groups;if(this.isCustomTool(t))return"custom";for(n in i)if(e.inArray(t,i[n])>=0)return n},bindTo:function(t){var n=this,i=n.window;n._editor&&n._editor.unbind("select",l(n.resize,n)),n._editor=t,n.options.resizable&&n.options.resizable.toolbar&&t.options.tools.push(g),n.tools=n.expandTools(t.options.tools),n.render(),n.element.find(".k-combobox .k-input").keydown(function(t){var n=e(this).closest(".k-combobox").data("kendoComboBox"),i=t.keyCode;i==d.RIGHT||i==d.LEFT?n.close():i==d.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),n._attachEvents(),n.items().each(function(){var i,r=n._toolName(this),o="more"!==r?n.tools[r]:n.tools.overflowAnchor,a=o&&o.options,s=t.options.messages,l=a&&a.tooltip||s[r],d=e(this);o&&o.initialize&&("fontSize"!=r&&"fontName"!=r||(i=s[r+"Inherit"],d.find("input").val(i).end().find("span.k-input").text(i).end()),o.initialize(d,{title:n._appendShortcutSequence(l,o),editor:n._editor}),d.closest(".k-widget",n.element).addClass("k-editor-widget"),d.closest(".k-colorpicker",n.element).next(".k-colorpicker").addClass("k-editor-widget"))}),t.bind("select",l(n.resize,n)),n.update(),i&&i.wrapper.css({top:"",left:"",width:""})},show:function(){var e,t,n,i=this,r=i.window,o=i.options.editor;r&&(e=r.wrapper,t=o.element,e.is(":visible")&&i.window.options.visible||(e[0].style.width||e.width(p(t)-parseInt(e.css("border-left-width"),10)-parseInt(e.css("border-right-width"),10)),r._moved||(n=t.offset(),e.css({top:Math.max(0,parseInt(n.top,10)-m(e)-parseInt(i.window.element.css("padding-bottom"),10)),left:Math.max(0,parseInt(n.left,10))})),r.open()))},hide:function(){this.window&&this.window.close()},focus:function(){var e="tabIndex",t=this.element,n=this._editor.element.attr(e);t.attr(e,n||0).focus().find(v).first().focus(),n||0===n||t.removeAttr(e)},focusOverflowPopup:function(){var e="tabIndex",t=this.overflowPopup.element,n=this._editor.element.attr(e);t.closest(".k-animation-container").addClass("k-overflow-wrapper"),t.attr(e,n||0).find(v).first().focus(),n||0===n||t.removeAttr(e)},_appendShortcutSequence:function(e,t){if(!t.key)return e;var n=e+" (";return t.ctrl&&(n+="Ctrl + "),t.shift&&(n+="Shift + "),t.alt&&(n+="Alt + "),n+=t.key+")"},_nativeTools:["insertLineBreak","insertParagraph","redo","undo","autoLink"],tools:{},isCustomTool:function(e){return!(e in i.ui.Editor.defaultTools)},expandTools:function(t){var n,r,a,l,d=this._nativeTools,c=i.deepExtend({},i.ui.Editor.defaultTools),u={};for(r=0;r<t.length;r++)n=t[r],l=n.name,e.isPlainObject(n)?l&&c[l]?(u[l]=s({},c[l]),s(u[l].options,n)):(a=s({cssClass:"k-i-custom",type:"button",title:""},n),a.name||(a.name="custom"),a.cssClass="k-"+a.name,a.template||"button"!=a.type||(a.template=o.EditorUtils.buttonTemplate,a.title=a.title||a.tooltip),u[l]={options:a}):c[n]&&(u[n]=c[n]);for(r=0;r<d.length;r++)u[d[r]]||(u[d[r]]=c[d[r]]);return u},render:function(){function t(t){var n;return t.getHtml?n=t.getHtml():(e.isFunction(t)||(t=i.template(t)),n=t(o)),e.trim(n)}function n(){h.children().length&&(y&&(h.data("position",w),w++),h.appendTo(_))}function r(t){t!==g?(h=e("<li class='k-tool-group' role='presentation' />"),h.data("overflow",e.inArray(t,x)===-1)):h=e("<li class='k-overflow-tools' />")}var o,a,s,d,c,u,h,f,p=this,m=p.tools,v=p._editor.element,_=p.element.empty(),b=p._editor.options.tools,k=i.support.browser,w=0,y=p.options.resizable&&p.options.resizable.toolbar,x=this.overflowFlaseTools;for(_.empty(),b.length&&(d=b[0].name||b[0]),r(d,x),f=0;f<b.length;f++)d=b[f].name||b[f],o=m[d]&&m[d].options,!o&&e.isPlainObject(d)&&(o=d),a=o&&o.template,"break"==d&&(n(),e("<li class='k-row-break' />").appendTo(p.element),r(d,x)),a&&(u=p.toolGroupFor(d),c==u&&d!=g||(n(),r(d,x),c=u),a=t(a),s=e(a).appendTo(h),"custom"==u&&(n(),r(d,x)),o.exec&&s.hasClass("k-tool")&&s.click(l(o.exec,v[0])));n(),e(p.element).children(":has(> .k-tool)").addClass("k-button-group"),p.options.popup&&k.msie&&k.version<9&&p.window.wrapper.find("*").attr("unselectable","on"),p.updateGroups(),y&&p._initOverflowPopup(p.element.find(".k-overflow-anchor")),p.angular("compile",function(){return{elements:p.element}})},updateGroups:function(){e(this.element).children().each(function(){e(this).children().filter(function(){return!e(this).hasClass("k-state-disabled")}).removeClass("k-group-end").first().addClass("k-group-start").end().last().addClass("k-group-end").end()})},decorateFrom:function(t){this.items().filter(".k-decorated").each(function(){var n=e(this).data("kendoSelectBox");n&&n.decorate(t)})},destroy:function(){a.fn.destroy.call(this);var e,t=this.tools;for(e in t)t[e].destroy&&t[e].destroy();this.window&&this.window.destroy(),this._resizeHandler&&i.unbindResize(this._resizeHandler),this.overflowPopup&&this.overflowPopup.destroy()},_attachEvents:function(){var t=this,n=t.overflowPopup?t.overflowPopup.element:e([]);t.attachToolsEvents(t.element.add(n))},attachToolsEvents:function(t){var n=this,i="[role=button].k-tool",r=i+":not(.k-state-disabled)",o=i+".k-state-disabled";t.off(c).on("mouseenter"+c,r,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+c,r,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+c,i,function(e){e.preventDefault()}).on("keydown"+c,v,function(t){function i(e,t,n){var i=t.find(v),r=i.index(a)+e;return n&&(r=Math.max(0,Math.min(i.length-1,r))),i[r]}var r,o,a=this,s=n.options.resizable&&n.options.resizable.toolbar,l=t.keyCode;l==d.RIGHT||l==d.LEFT?e(a).hasClass(".k-dropdown")||(r=i(l==d.RIGHT?1:-1,n.element,!0)):!s||l!=d.UP&&l!=d.DOWN?l==d.ESC?(n.overflowPopup&&n.overflowPopup.visible()&&n.overflowPopup.close(),r=n._editor):l!=d.TAB||t.ctrlKey||t.altKey||(o=s&&e(a.parentElement).hasClass("k-overflow-tool-group")?n.overflowPopup.element:n.element,t.shiftKey?r=i(-1,o):(r=i(1,o),r||(r=n._editor))):r=i(l==d.DOWN?1:-1,n.overflowPopup.element,!0),r&&(t.preventDefault(),r.focus())}).on("click"+c,r,function(t){var i=e(this);t.preventDefault(),t.stopPropagation(),i.removeClass("k-state-hover"),i.is("[data-popup]")||n._editor.exec(n._toolName(this))}).on("click"+c,o,function(e){e.preventDefault()})},_toolName:function(t){var n,r,o;if(t)return n=t.className,/k-tool\b/i.test(n)&&(n=t.firstChild.className),r=e.grep(n.split(" "),function(e){return!/^k-(widget|tool|tool-icon|icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)}),r[0]?(o=r[0],o.indexOf("k-i-")>=0?i.toCamelCase(o.substring(o.indexOf("k-i-")+4)):o.substring(o.lastIndexOf("-")+1)):"custom"},refreshTools:function(){var t=this,n=i.ui.editor,r=t._editor,o=r.getRange(),a=n.RangeUtils.textNodes(o),s=r.options.immutables,l=t._immutablesContext(o);a=n.Dom.filterBy(a,n.Dom.htmlIndentSpace,!0),a.length||(a=[o.startContainer]),t.items().each(function(){var n,i=t.tools[t._toolName(this)];i&&(n=e(this),i.update&&i.update(n,a),s&&t._updateImmutablesState(i,n,l))}),this.update()},_immutablesContext:function(e){if(this._editor.options.immutables){var t=i.ui.editor;return e.collapsed?t.Immutables.immutablesContext(e):0===t.RangeUtils.editableTextNodes(e).length}},_updateImmutablesState:function(n,i,r){var a,s,l,d,c,u=n.name,h=i,f=n.options.trackImmutables;if(f===t&&(f=e.inArray(u,o.Immutables.toolsToBeUpdated)>-1),f){if(a=r?"none":"",!i.is(".k-tool")){s=i.data();for(l in s)if(l.match(/^kendo[A-Z][a-zA-Z]*/)){d=s[l],h=d.wrapper;break}}h.css("display",a),c=h.closest("li"),0===c.children(":visible").length&&c.css("display",a)}},update:function(){this.updateGroups()},_resize:function(e){var t=e.width,n=this.options.resizable&&this.options.resizable.toolbar,i=this.overflowPopup;this.refreshTools(),n&&(i.visible()&&i.close(!0),this._refreshWidths(),this._shrink(t),this._stretch(t),this._toggleOverflowStyles(this.element,!1),this._toggleOverflowStyles(this.overflowPopup.element,!0),this.element.children("li.k-overflow-tools").css("visibility",i.element.is(":empty")?"hidden":"visible"))},_refreshWidths:function(){this.element.children("li").each(function(t,n){var i=e(n);i.data("outerWidth",p(i,!0))})},_shrink:function(e){var t,n,i;if(e<this._groupsWidth())for(n=this._visibleGroups().filter(":not(.k-overflow-tools)"),i=n.length-1;i>=0&&(t=n.eq(i),!(e>this._groupsWidth()));i--)this._hideGroup(t)},_stretch:function(e){var t,n,i;if(e>this._groupsWidth())for(n=this._hiddenGroups(),i=0;i<n.length&&(t=n.eq(i),!(e<this._groupsWidth())&&this._showGroup(t,e));i++);},_hiddenGroups:function(){var t=this.overflowPopup,n=this.element.children("li.k-tool-group").filter(":hidden");return n=n.add(t.element.children("li")),n.sort(function(t,n){return e(t).data("position")>e(n).data("position")?1:-1}),n},_visibleGroups:function(){return this.element.children("li.k-tool-group, li.k-overflow-tools").filter(":visible")},_groupsWidth:function(){var t=0;return this._visibleGroups().each(function(){t+=e(this).data("outerWidth")}),Math.ceil(t)},_hideGroup:function(e){if(e.data("overflow")){var t=this.overflowPopup;e.detach().prependTo(t.element).addClass("k-overflow-tool-group")}else e.hide()},_showGroup:function(t,n){var i,r;return!!(t.length&&n>this._groupsWidth()+t.data("outerWidth"))&&(t.hasClass("k-overflow-tool-group")?(i=t.data("position"),0===i?t.detach().prependTo(this.element):(r=this.element.children().filter(function(t,n){return e(n).data("position")===i-1}),t.detach().insertAfter(r)),t.removeClass("k-overflow-tool-group")):t.show(),!0)}}),e.extend(o,{Toolbar:n})}(window.jQuery||window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/tables.min",["editor/toolbar.min"],e)}(function(){!function(e,t){var n=window.kendo,i=e.extend,r=e.proxy,o=n.ui.editor,a=o.Dom,s=o.EditorUtils,l=o.RangeUtils,d=o.Command,c="kendoEditor",u="k-state-active",h="k-state-selected",f=o.Tool,p=o.ToolTemplate,m=o.InsertHtmlCommand,g=o.BlockFormatFinder,v=o.EditorUtils.registerTool,_=n.getTouches,b=n.template,k="<td style='width:#=width#%;'>#=content#</td>",w=new g([{tags:["table"]}]),y=m.extend({init:function(t){var n=e.extend({postProcess:this.postProcess,skipCleaners:!0},t||{});m.fn.init.call(this,n)},_tableHtml:function(e,t){var n,i;return e=e||1,t=t||1,n=b(k)({width:100/t,content:o.emptyTableCellContent}),i=100/e,"<table class='k-table' data-last>"+Array(e+1).join("<tr style='height:"+i+"%;'>"+Array(t+1).join(n)+"</tr>")+"</table>"},postProcess:function(t,n){var i=e("table[data-last]",t.document).removeAttr("data-last");n.setStart(i.find("td")[0],0),n.collapse(!0),t.selectRange(n)},exec:function(){var e=this.options;e.html=this._tableHtml(e.rows,e.columns),m.fn.exec.call(this)}}),x=f.extend({initialize:function(t,n){var i,a,l,d;f.fn.initialize.call(this,t,n),i=e(this.options.popupTemplate).appendTo("body").kendoPopup({anchor:t,copyAnchorStyles:!1,open:r(this._open,this),activate:r(this._activate,this),close:r(this._close,this)}).data("kendoPopup"),t.click(r(this._toggle,this)).keydown(r(this._keydown,this)),a=this._editor=n.editor,this._popup=i,l=new o.TableWizardTool({template:new p({template:s.buttonTemplate,title:a.options.messages.tableWizard}),command:o.TableWizardCommand,insertNewTable:!0}),v("tableWizardInsert",l),d=e("<div class='k-editor-toolbar'>"+l.options.template.getHtml()+"</div>"),d.appendTo(i.element),a.toolbar&&a.toolbar.attachToolsEvents(d)},popup:function(){return this._popup},_activate:e.noop,_open:function(){this._popup.options.anchor.addClass(u)},_close:function(){this._popup.options.anchor.removeClass(u)},_keydown:function(e){var t=n.keys,i=e.keyCode;i==t.DOWN&&e.altKey?this._popup.open():i==t.ESC&&this._popup.close()},_toggle:function(t){var n=e(t.target).closest(".k-tool");n.hasClass("k-state-disabled")||this.popup().toggle()},update:function(e){var t=this.popup();t.wrapper&&"block"==t.wrapper.css("display")&&t.close(),e.removeClass("k-state-hover")},destroy:function(){this._popup.destroy()}}),C=x.extend({init:function(t){this.cols=8,this.rows=6,x.fn.init.call(this,e.extend(t,{command:y,popupTemplate:"<div class='k-ct-popup'>"+Array(this.cols*this.rows+1).join("<span class='k-ct-cell k-state-disabled' />")+"<div class='k-status'></div></div>"}))},_activate:function(){function t(t){var n=e(window);return{row:Math.floor((t.clientY+n.scrollTop()-u.top)/r)+1,col:Math.floor((t.clientX+n.scrollLeft()-u.left)/i)+1}}var i,r,o=this,a=o._popup.element,s=a.find(".k-ct-cell"),l=s.eq(0),d=s.eq(s.length-1),u=n.getOffset(l),h=n.getOffset(d),f=o.cols,p=o.rows;a.find("*").addBack().attr("unselectable","on"),h.left+=d[0].offsetWidth,h.top+=d[0].offsetHeight,i=(h.left-u.left)/f,r=(h.top-u.top)/p,a.autoApplyNS(c).on("mousemove",function(e){o._setTableSize(t(e))}).on("mouseleave",function(){o._setTableSize()}).on("down",function(e){e.preventDefault();var n=_(e)[0];o._exec(t(n.location))})},_valid:function(e){return e&&e.row>0&&e.col>0&&e.row<=this.rows&&e.col<=this.cols},_exec:function(e){this._valid(e)&&(this._editor.exec("createTable",{rows:e.row,columns:e.col}),this._popup.close())},_setTableSize:function(t){var i=this._popup.element,r=i.find(".k-status"),o=i.find(".k-ct-cell"),a=this.cols,s=this._editor.options.messages;this._valid(t)?(r.text(n.format(s.createTableHint,t.row,t.col)),o.each(function(n){e(this).toggleClass(h,n%a<t.col&&n/a<t.row)})):(r.text(s.dialogCancel),o.removeClass(h))},_keydown:function(e){var t,i,r,o,a,s,l,d;x.fn._keydown.call(this,e),this._popup.visible()&&(t=n.keys,i=e.keyCode,r=this._popup.element.find(".k-ct-cell"),o=Math.max(r.filter(".k-state-selected").last().index(),0),a=Math.floor(o/this.cols),s=o%this.cols,l=!1,i!=t.DOWN||e.altKey?i==t.UP?(l=!0,a--):i==t.RIGHT?(l=!0,s++):i==t.LEFT&&(l=!0,s--):(l=!0,a++),d={row:Math.max(1,Math.min(this.rows,a+1)),col:Math.max(1,Math.min(this.cols,s+1))},i==t.ENTER?this._exec(d):this._setTableSize(d),l&&(e.preventDefault(),e.stopImmediatePropagation()))},_open:function(){var e=this._editor.options.messages;x.fn._open.call(this),this.popup().element.find(".k-status").text(e.dialogCancel).end().find(".k-ct-cell").removeClass(h)},_close:function(){x.fn._close.call(this),this.popup().element.off("."+c)}}),T=d.extend({exec:function(){for(var e,t,n,i,r=this.lockRange(!0),s=r.endContainer;"td"!=a.name(s);)s=s.parentNode;if(!this.immutables()||!o.Immutables.immutableParent(s)){for(t=s.parentNode,e=t.children.length,n=t.cloneNode(!0),i=0;i<t.cells.length;i++)n.cells[i].innerHTML=o.emptyTableCellContent;"before"==this.options.position?a.insertBefore(n,t):a.insertAfter(n,t),this.releaseRange(r)}}}),S=d.extend({exec:function(){var e,t,n,i,r=this.lockRange(!0),s=a.closest(r.endContainer,"td"),l=a.closest(s,"table"),d=l.rows,c=this.options.position;if(!this.immutables()||!o.Immutables.immutableParent(s)){for(e=a.findNodeIndex(s,!0),t=0;t<d.length;t++)n=d[t].cells[e],i=n.cloneNode(),i.innerHTML=o.emptyTableCellContent,"before"==c?a.insertBefore(i,n):a.insertAfter(i,n);this.releaseRange(r)}}}),D=d.extend({exec:function(){var t,n,i,r=this.lockRange(),s=l.mapAll(r,function(t){return e(t).closest("tr")[0]}),d=s[0];if(!this.immutables()||!o.Immutables.immutableParent(d)){if(t=a.closest(d,"table"),t.rows.length<=s.length)n=a.next(t),n&&!a.insignificant(n)||(n=a.prev(t)),a.remove(t);else for(i=0;i<s.length;i++)d=s[i],a.removeTextSiblings(d),n=a.next(d)||a.prev(d),n=n.cells[0],a.remove(d);n&&(r.setStart(n,0),r.collapse(!0),this.editor.selectRange(r))}}}),E=d.extend({exec:function(){var e,t,n=this.lockRange(),i=a.closest(n.endContainer,"td"),r=a.closest(i,"table"),s=r.rows,l=a.findNodeIndex(i,!0),d=s[0].cells.length;if(!this.immutables()||!o.Immutables.immutableParent(i)){if(1==d)e=a.next(r),e&&!a.insignificant(e)||(e=a.prev(r)),a.remove(r);else for(a.removeTextSiblings(i),e=a.next(i)||a.prev(i),t=0;t<s.length;t++)a.remove(s[t].cells[l]);e&&(n.setStart(e,0),n.collapse(!0),this.editor.selectRange(n))}}}),F=f.extend({command:function(e){return e=i(e,this.options),"delete"==e.action?"row"==e.type?new D(e):new E(e):"row"==e.type?new T(e):new S(e)},initialize:function(e,t){f.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){var n=!w.isFormatted(t);e.toggleClass("k-state-disabled",n)}});i(n.ui.editor,{PopupTool:x,TableCommand:y,InsertTableTool:C,TableModificationTool:F,InsertRowCommand:T,InsertColumnCommand:S,DeleteRowCommand:D,DeleteColumnCommand:E}),v("createTable",new C({template:new p({template:s.buttonTemplate,popup:!0,title:"Create table"})})),v("addColumnLeft",new F({type:"column",position:"before",template:new p({template:s.buttonTemplate,title:"Add column on the left"})})),v("addColumnRight",new F({type:"column",template:new p({template:s.buttonTemplate,title:"Add column on the right"})})),v("addRowAbove",new F({type:"row",position:"before",template:new p({template:s.buttonTemplate,title:"Add row above"})})),v("addRowBelow",new F({type:"row",template:new p({template:s.buttonTemplate,title:"Add row below"})})),v("deleteRow",new F({type:"row",action:"delete",template:new p({template:s.buttonTemplate,title:"Delete row"})})),v("deleteColumn",new F({type:"column",action:"delete",template:new p({template:s.buttonTemplate,title:"Delete column"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/resizing/resizing-utils.min",["editor/main.min"],e)}(function(){!function(e,t){function n(e){var t=e.value,n=e.min,i=e.max;return h(u(f(t),f(i)),f(n))}function i(t){return t&&!p(t).is("body")&&t.scrollHeight>t.clientHeight?e.support.scrollbar():0}function r(e,t){return o(e)?f(e):f(e)/t*100}function o(e){return typeof e===w&&b.test(e)}function a(e){return typeof e===w&&k.test(e)}function s(e){return f(e)+v}function l(e){return f(e)+_}var d=window,c=d.Math,u=c.min,h=c.max,f=d.parseFloat,p=e.jQuery,m=p.extend,g=e.ui.editor,v="%",_="px",b=/(\d+)(\.?)(\d*)%/,k=/(\d+)(\.?)(\d*)px/,w="string",y={constrain:n,getScrollBarWidth:i,calculatePercentageRatio:r,inPercentages:o,inPixels:a,toPercentages:s,toPixels:l};m(g,{ResizingUtils:y})}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/resizing/table-element-resizing.min",["editor/main.min","kendo.resizable.min","editor/resizing/resizing-utils.min"],e)}(function(){!function(e,t){var n=e.jQuery,i=n.extend,r=n.noop,o=n.proxy,a=e.ui.editor,s=e.Class,l="keydown",d="mousedown",c="mouseenter",u="mouseleave",h="mousemove",f="mouseup",p=",",m=".",g=":last-child",v="table",_=s.extend({init:function(e,t){var r=this;r.options=i({},r.options,t),r.options.tags=n.isArray(r.options.tags)?r.options.tags:[r.options.tags],n(e).is(v)&&(r.element=e,r._attachEventHandlers())},destroy:function(){var e=this,t=e.options.eventNamespace;e.element&&(n(e.element).off(t),e.element=null),n(e.options.rootElement).off(l+t),e._destroyResizeHandle()},options:{tags:[],min:0,rootElement:null,eventNamespace:"",rtl:!1,handle:{dataAttribute:"",height:0,width:0,classNames:{},template:""}},_attachEventHandlers:function(){var e=this,t=e.options;n(e.element).on(h+t.eventNamespace,t.tags.join(p),o(e.detectElementBorderHovering,e))},resizingInProgress:function(){var e=this,t=e._resizable;return!!t&&!!t.resizing},resize:r,detectElementBorderHovering:function(e){var t=this,i=t.options,r=i.handle,o=n(e.currentTarget),a=t.resizeHandle,s=r.dataAttribute;t.resizingInProgress()||(!o.is(g)&&t.elementBorderHovered(o,e)?a?a.data(s)&&a.data(s)!==o[0]&&t.showResizeHandle(o,e):t.showResizeHandle(o,e):a&&t._destroyResizeHandle())},elementBorderHovered:r,showResizeHandle:function(e,t){var n=this;0===t.buttons&&(n._initResizeHandle(),n.setResizeHandlePosition(e),n.setResizeHandleDimensions(),n.setResizeHandleDataAttributes(e[0]),n._attachResizeHandleEventHandlers(),n._initResizable(e),n._hideResizeMarker(),n.resizeHandle.show())},_initResizeHandle:function(){var e=this,t=e.options;e._destroyResizeHandle(),e.resizeHandle=n(t.handle.template).appendTo(t.rootElement)},setResizeHandlePosition:r,setResizeHandleDimensions:r,setResizeHandleDataAttributes:function(e){var t=this;t.resizeHandle.data(t.options.handle.dataAttribute,e)},_attachResizeHandleEventHandlers:function(){var e=this,t=e.options,n=t.eventNamespace,i=t.handle.classNames.marker,r=e.resizeHandle;e.resizeHandle.on(d+n,function(){r.find(m+i).show()}).on(f+n,function(){r.find(m+i).hide()})},_hideResizeMarker:function(){var e=this;e.resizeHandle.find(m+e.options.handle.classNames.marker).hide()},_destroyResizeHandle:function(){var e=this;e.resizeHandle&&(e._destroyResizable(),e.resizeHandle.off(e.options.eventNamespace).remove(),e.resizeHandle=null)},_initResizable:function(t){var n=this;n.resizeHandle&&(n._destroyResizable(),n._resizable=new e.ui.Resizable(t,{draggableElement:n.resizeHandle[0],start:o(n.onResizeStart,n),resize:o(n.onResize,n),resizeend:o(n.onResizeEnd,n)}))},_destroyResizable:function(){var e=this;e._resizable&&(e._resizable.destroy(),e._resizable=null)},onResizeStart:function(){this._disableKeyboard()},onResize:function(e){this.setResizeHandleDragPosition(e)},setResizeHandleDragPosition:r,onResizeEnd:function(e){var t=this;t.resize(e),t._destroyResizeHandle(),t._enableKeyboard()},_enableKeyboard:function(){var e=this.options;n(e.rootElement).off(l+e.eventNamespace)},_disableKeyboard:function(){var e=this.options;n(e.rootElement).on(l+e.eventNamespace,function(e){e.preventDefault()})},_forceResizing:function(e){var t=this._resizable;t&&t.userEvents&&t.userEvents._end(e)}}),b=s.extend({create:function(e,t){var i=this,r=t.name,o=t.eventNamespace;n(e.body).on(c+o,v,function(n){var o=n.currentTarget,a=e[r];n.stopPropagation(),a?a.element===o||a.resizingInProgress()||(i._destroyResizing(e,t),i._initResizing(e,o,t)):i._initResizing(e,o,t)}).on(u+o,v,function(o){var a,s=e[r];o.stopPropagation(),!s||s.resizingInProgress()||s.resizeHandle||(a=n(s.element).parents(v)[0],a&&(i._destroyResizing(e,t),i._initResizing(e,a,t)))}).on(u+o,function(){var n=e[r];n&&!n.resizingInProgress()&&i._destroyResizing(e,t)}).on(f+o,function(o){var a,s=e[r];s&&s.resizingInProgress()&&(a=n(o.target).parents(v)[0],a&&(s._forceResizing(o),i._destroyResizing(e,t),i._initResizing(e,a,t)))})},dispose:function(e,t){n(e.body).off(t.eventNamespace)},_initResizing:function(t,n,i){var r=i.name,o=i.type;t[r]=new o(n,{rtl:e.support.isRtl(t.element),rootElement:t.body})},_destroyResizing:function(e,t){var n=t.name;e[n]&&(e[n].destroy(),e[n]=null)}});b.current=new b,_.create=function(e,t){b.current.create(e,t)},_.dispose=function(e,t){b.current.dispose(e,t)},i(a,{TableElementResizing:_})}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/resizing/column-resizing.min",["editor/main.min","editor/resizing/resizing-utils.min","editor/resizing/table-element-resizing.min"],e)}(function(){!function(e,t){var n=window,i=n.Math,r=i.abs,o=e.jQuery,a=o.extend,s=e.ui.editor,l=s.TableElementResizing,d=s.ResizingUtils,c=d.constrain,u=d.calculatePercentageRatio,h=d.getScrollBarWidth,f=d.inPercentages,p=d.toPercentages,m=d.toPixels,g=e._outerWidth,v=".kendoEditorColumnResizing",_="k-column-resize-handle",b="k-column-resize-marker",k="body",w="tbody",y="td",x="th",C="tr",T=",",S="width",D=l.extend({options:{tags:[y,x],min:20,rootElement:null,eventNamespace:v,rtl:!1,handle:{dataAttribute:"column",width:10,height:0,classNames:{handle:_,marker:b},template:'<div class="k-column-resize-handle-wrapper" unselectable="on" contenteditable="false"><div class="'+_+'"><div class="'+b+'"></div></div></div>'}},elementBorderHovered:function(e,t){var n=this,i=n.options,r=i.handle.width,a=e.offset().left+(i.rtl?0:g(e)),s=t.clientX+o(e[0].ownerDocument).scrollLeft();return s>a-r&&s<a+r},setResizeHandlePosition:function(e){var t=this,n=o(t.element).children(w),i=t.options,r=i.rtl,a=i.handle.width,s=o(i.rootElement),l=s.is(k)?0:s.scrollTop(),d=s.is(k)?0:s.scrollLeft(),c=r?0:g(e),u=r?h(s[0]):0;t.resizeHandle.css({top:n.position().top+l,left:e.position().left+c+(d-u)-a/2,position:"absolute"})},setResizeHandleDimensions:function(){var e=this,t=o(e.element).children(w);e.resizeHandle.css({width:e.options.handle.width,height:t.height()})},setResizeHandleDragPosition:function(e){var t=this,n=o(o(e.currentTarget).data(t.options.handle.dataAttribute)),i=t.options,r=i.handle?i.handle.width:0,a=i.min,s=i.rtl,l=g(n),d=n.position().left,u=g(n.next()),f=o(t.resizeHandle),p=o(i.rootElement),m=p.is(k)?0:p.scrollLeft(),v=s?h(p[0]):0,_=c({value:f.position().left+(m-v)+e.x.delta,min:d+(m-v)-(s?u:0)+a,max:d+l+(m-v)+(s?0:u)-r-a});f.css({left:_})},resize:function(e){var t,n,i,r=this,a=o(o(e.currentTarget).data(r.options.handle.dataAttribute)),s=r.options,l=s.rtl?-1:1,d=s.min,u=l*e.x.initialDelta;r._setTableComputedWidth(),r._setColumnsComputedWidth(),i=g(a),n=g(a.next()),t=c({value:i+u,min:d,max:i+n-d}),r._resizeColumn(a[0],t),r._resizeTopAndBottomColumns(a[0],t),r._resizeAdjacentColumns(a.index(),n,i,i-t)},_setTableComputedWidth:function(){var e=this.element;""===e.style[S]&&(e.style[S]=m(g(o(e))))},_setColumnsComputedWidth:function(){var e,t=this,n=o(t.element).children(w),i=g(n),r=n.children(C).children(y),a=r.length,s=r.map(function(){return g(o(this))});for(e=0;e<a;e++)r[e].style[S]=f(r[e].style[S])?p(u(s[e],i)):m(s[e])},_resizeTopAndBottomColumns:function(e,t){var n,i=this,r=o(e).index(),a=o(i.element).children(w).children(C).children(i.options.tags.join(T)).filter(function(){var t=this;return o(t).index()===r&&t!==e}),s=a.length;for(n=0;n<s;n++)i._resizeColumn(a[n],t)},_resizeColumn:function(e,t){e.style[S]=f(e.style[S])?p(u(t,g(o(this.element).children(w)))):m(t)},_resizeAdjacentColumns:function(e,t,n,i){var r,a=this,s=o(a.element).children(w).children(C).children(a.options.tags.join(T)).filter(function(){return o(this).index()===e+1}),l=s.length;for(r=0;r<l;r++)a._resizeAdjacentColumn(s[r],t,n,i)},_resizeAdjacentColumn:function(e,t,n,i){var o=this,a=o.options.min,s=c({value:t+i,min:a,max:r(n+t-a)});o._resizeColumn(e,s)}});D.create=function(e){l.create(e,{name:"columnResizing",type:D,eventNamespace:v})},D.dispose=function(e){l.dispose(e,{eventNamespace:v})},a(s,{ColumnResizing:D})}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/resizing/row-resizing.min",["editor/main.min","editor/resizing/resizing-utils.min","editor/resizing/table-element-resizing.min"],e)}(function(){!function(e,t){var n=window.Math,i=n.abs,r=e.jQuery,o=r.extend,a=e.ui.editor,s=a.TableElementResizing,l=a.ResizingUtils,d=l.getScrollBarWidth,c=l.constrain,u=l.calculatePercentageRatio,h=l.inPercentages,f=l.toPercentages,p=l.toPixels,m=e._outerHeight,g=".kendoEditorRowResizing",v="k-row-resize-handle",_="k-row-resize-marker-wrapper",b="k-row-resize-marker",k="body",w="tr",y="tbody",x="height",C=s.extend({options:{tags:[w],min:20,rootElement:null,eventNamespace:g,rtl:!1,handle:{dataAttribute:"row",width:0,height:10,classNames:{handle:v,marker:b},template:'<div class="k-row-resize-handle-wrapper" unselectable="on" contenteditable="false"><div class="'+v+'"><div class="'+_+'"><div class="'+b+'"></div></div></div></div>'
}},elementBorderHovered:function(e,t){var n=this,i=n.options.handle[x],o=e.offset().top+m(e),a=t.clientY+r(e[0].ownerDocument).scrollTop();return a>o-i&&a<o+i},setResizeHandlePosition:function(e){var t=this,n=t.options,i=n.handle[x],o=e.position(),a=r(n.rootElement),s=a.is(k)?0:a.scrollTop(),l=a.is(k)?0:a.scrollLeft(),c=n.rtl?d(a[0]):0;t.resizeHandle.css({top:o.top+m(e)+s-i/2,left:o.left+(l-c),position:"absolute"})},setResizeHandleDimensions:function(){var e=this;e.resizeHandle.css({width:r(e.element).children(y).width(),height:e.options.handle[x]})},setResizeHandleDragPosition:function(e){var t=this,n=t.options,i=n.min,o=r(t.element).children(y),a=o.position().top,s=r(t.resizeHandle),l=r(e.currentTarget).data(n.handle.dataAttribute),d=r(n.rootElement),u=d.is(k)?0:d.scrollTop(),h=c({value:s.position().top+u+e.y.delta,min:r(l).position().top+u+i,max:a+m(o)+u-n.handle[x]-i});s.css({top:h})},resize:function(e){var t=this,n=t.options,o=r(e.currentTarget).data(n.handle.dataAttribute),a=m(r(o)),s=r(t.element),l=m(s),d=s.children(y),u=d.height(),f=o.style[x],g=c({value:a+e.y.initialDelta,min:n.min,max:i(u-n.min)});t._setRowsHeightInPixels(),o.style[x]=p(g),t._setTableHeight(l+(g-a)),h(f)&&t._setRowsHeightInPercentages()},_setRowsHeightInPixels:function(){var e,t=this,n=r(t.element).children(y).children(w),i=n.length,o=n.map(function(){return m(r(this))});for(e=0;e<i;e++)n[e].style[x]=p(o[e])},_setRowsHeightInPercentages:function(){var e,t=this,n=r(t.element).children(y),i=n.height(),o=n.children(w),a=o.length,s=o.map(function(){return m(r(this))});for(e=0;e<a;e++)o[e].style[x]=f(u(s[e],i))},_setTableHeight:function(e){var t=this.element;t.style[x]=h(t.style[x])?f(u(e,r(t).parent().height())):p(e)}});C.create=function(e){s.create(e,{name:"rowResizing",type:C,eventNamespace:g})},C.dispose=function(e){s.dispose(e,{eventNamespace:g})},o(a,{RowResizing:C})}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/resizing/table-resize-handle.min",["editor/main.min","kendo.draganddrop.min","editor/resizing/resizing-utils.min"],e)}(function(){!function(e,t){var n,i,r,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,k,w,y,x,C=e.jQuery,T=C.extend,S=C.noop,D=C.proxy,E=e.ui.editor,F=e.Class,R=e.ui.Draggable,I=e.Observable,A=E.ResizingUtils.getScrollBarWidth,M=e._outerWidth,z=e._outerHeight,H=".kendoEditorTableResizeHandle",N="k-table-resize-handle",P="dragStart",L="drag",B="dragEnd",O="halfInside",V="mouseover",W="mouseout",U="body",q="table",j="east",$="north",G="northeast",Y="northwest",K="south",Q="southeast",X="southwest",J="west",Z=".",ee=I.extend({init:function(e){var t=this;I.fn.init.call(t),t.options=T({},t.options,e),t.element=C(t.options.template).appendTo(t.options.appendTo)[0],t._attachEventHandlers(),t._addStyles(),t._initDraggable(),t._initPositioningStrategy(),t._initDraggingStrategy(),C(t.element).data(q,t.options.resizableElement)},destroy:function(){var e=this;C(e.element).off(H).remove(),e.element=null,e._destroyDraggable(),e.unbind()},options:{appendTo:null,direction:Q,resizableElement:null,rtl:!1,template:"<div class='k-table-resize-handle-wrapper' unselectable='on' contenteditable='false'><div class='"+N+"'></div></div>"},events:[P,L,B,V,W],show:function(){this._setPosition()},_setPosition:function(){var e=this,t=e._positioningStrategy.getPosition();C(e.element).css({top:t.top,left:t.left,position:"absolute"})},_attachEventHandlers:function(){var e=this;C(e.element).on(V+H,D(e._onMouseOver,e)).on(W+H,D(e._onMouseOut,e))},_onMouseOver:function(){this.trigger(V)},_onMouseOut:function(){this.trigger(W)},_addStyles:function(){var e=this;C(e.element).children(Z+N).addClass("k-resize-"+e.options.direction)},_initPositioningStrategy:function(){var e=this,t=e.options;e._positioningStrategy=n.create({name:t.direction,handle:e.element,resizableElement:t.resizableElement,rootElement:t.rootElement,rtl:t.rtl})},_initDraggable:function(){var e=this,t=e.element;!e._draggable&&t&&(e._draggable=new R(t,{dragstart:D(e._onDragStart,e),drag:D(e._onDrag,e),dragend:D(e._onDragEnd,e)}))},_onDragStart:function(){this.trigger(P)},_onDrag:function(e){var t=this;t.trigger(L,t._draggingStrategy.adjustDragDelta({deltaX:e.x.delta,deltaY:e.y.delta,initialDeltaX:e.x.initialDelta,initialDeltaY:e.y.initialDelta}))},_onDragEnd:function(){this.trigger(B)},_destroyDraggable:function(){var e=this;e._draggable&&(e._draggable.destroy(),e._draggable=null)},_initDraggingStrategy:function(){var e=this;e._draggingStrategy=h.create({name:e.options.direction})}}),te=F.extend({init:function(){this._items=[]},register:function(e,t){this._items.push({name:e,type:t})},create:function(e){var t,n,i,r=this._items,o=r.length,a=e.name?e.name.toLowerCase():"";for(i=0;i<o;i++)if(n=r[i],n.name.toLowerCase()===a){t=n;break}if(t)return new t.type(e)}}),ne=te.extend({});ne.current=new ne,n=F.extend({init:function(e){var t=this;t.options=T({},t.options,e)},options:{handle:null,offset:O,resizableElement:null,rootElement:null,rtl:!1},getPosition:function(){var e=this,t=e.calculatePosition(),n=e.applyHandleOffset(t),i=e.applyScrollOffset(n);return i},calculatePosition:S,applyHandleOffset:function(e){var t=this.options,n=C(t.handle);return t.offset===O?{top:e.top-z(n)/2,left:e.left-M(n)/2}:e},applyScrollOffset:function(e){var t=this.options,n=C(t.rootElement),i=t.rtl?A(n[0]):0;return n.is(U)?e:{top:e.top+(n.scrollTop()||0),left:e.left+(n.scrollLeft()||0)-i}}}),n.create=function(e){return ne.current.create(e)},i=n.extend({calculatePosition:function(){var e=C(this.options.resizableElement),t=e.position();return{top:t.top+z(e)/2,left:t.left+M(e)}}}),ne.current.register(j,i),r=n.extend({calculatePosition:function(){var e=C(this.options.resizableElement),t=e.position();return{top:t.top,left:t.left+M(e)/2}}}),ne.current.register($,r),o=n.extend({calculatePosition:function(){var e=C(this.options.resizableElement),t=e.position();return{top:t.top,left:t.left+M(e)}}}),ne.current.register(G,o),a=n.extend({calculatePosition:function(){var e=C(this.options.resizableElement),t=e.position();return{top:t.top,left:t.left}}}),ne.current.register(Y,a),s=n.extend({calculatePosition:function(){var e=C(this.options.resizableElement),t=e.position();return{top:t.top+z(e),left:t.left+M(e)/2}}}),ne.current.register(K,s),l=n.extend({calculatePosition:function(){var e=C(this.options.resizableElement),t=e.position();return{top:t.top+z(e),left:t.left+M(e)}}}),ne.current.register(Q,l),d=n.extend({calculatePosition:function(){var e=C(this.options.resizableElement),t=e.position();return{top:t.top+z(e),left:t.left}}}),ne.current.register(X,d),c=n.extend({calculatePosition:function(){var e=C(this.options.resizableElement),t=e.position();return{top:t.top+z(e)/2,left:t.left}}}),ne.current.register(J,c),u=te.extend({}),u.current=new u,h=F.extend({init:function(e){var t=this;t.options=T({},t.options,e)},options:{deltaX:{adjustment:null,modifier:null},deltaY:{adjustment:null,modifier:null}},adjustDragDelta:function(e){var t=this.options,n=t.deltaX.adjustment*t.deltaX.modifier,i=t.deltaY.adjustment*t.deltaY.modifier;return{deltaX:e.deltaX*n,deltaY:e.deltaY*i,initialDeltaX:e.initialDeltaX*n,initialDeltaY:e.initialDeltaY*i}}}),h.create=function(e){return u.current.create(e)},f=h.extend({options:{deltaX:{adjustment:1,modifier:1},deltaY:{adjustment:0,modifier:0}}}),p=f.extend({options:{deltaX:{modifier:1}}}),u.current.register(j,p),m=f.extend({options:{deltaX:{modifier:-1}}}),u.current.register(J,m),g=h.extend({options:{deltaX:{adjustment:0,modifier:0},deltaY:{adjustment:1,modifier:1}}}),v=g.extend({options:{deltaY:{modifier:-1}}}),u.current.register($,v),_=g.extend({options:{deltaY:{modifier:1}}}),u.current.register(K,_),b=h.extend({options:{deltaX:{adjustment:1,modifier:1},deltaY:{adjustment:1,modifier:1}}}),k=b.extend({options:{deltaX:{modifier:1},deltaY:{modifier:-1}}}),u.current.register(G,k),w=b.extend({options:{deltaX:{modifier:-1},deltaY:{modifier:-1}}}),u.current.register(Y,w),y=b.extend({options:{deltaX:{modifier:1},deltaY:{modifier:1}}}),u.current.register(Q,y),x=b.extend({options:{deltaX:{modifier:-1},deltaY:{modifier:1}}}),u.current.register(X,x),T(E,{TableResizeHandle:ee})}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/resizing/table-resizing.min",["editor/main.min","editor/resizing/table-resize-handle.min","editor/resizing/resizing-utils.min"],e)}(function(){!function(e,t){function n(e){return t===e}var i=window,r=i.Math,o=r.min,a=r.max,s=e.jQuery,l=s.contains,d=s.extend,c=s.proxy,u=e.support.browser,h=e.ui.editor,f=e.Class,p=h.TableResizeHandle,m=h.ResizingUtils,g=m.calculatePercentageRatio,v=m.constrain,_=m.inPercentages,b=m.inPixels,k=m.toPercentages,w=m.toPixels,y=e._outerWidth,x=e._outerHeight,C=".kendoEditorTableResizing",T="k-table-resize-handle-wrapper",S="k-table",D="k-table-resizing",E="dragStart",F="drag",R="dragEnd",I="keydown",A="mousedown",M="mouseover",z="mouseout",H="td",N="tr",P="tbody",L="table",B="width",O="height",V="east",W="north",U="northeast",q="northwest",j="south",$="southeast",G="southwest",Y="west",K=".",Q=f.extend({init:function(e,t){var n=this;n.options=d({},n.options,t),n.handles=[],s(e).is(L)&&(n.element=e)},destroy:function(){var e=this;s(e.element).off(C),e.element=null,s(e.options.rootElement).off(I+C),e._destroyResizeHandles()},options:{appendHandlesTo:null,rtl:!1,rootElement:null,minWidth:10,minHeight:10,handles:[{direction:q},{direction:W},{direction:U},{direction:V},{direction:$},{direction:j},{direction:G},{direction:Y}]},resize:function(e){var t=this,n=d({},{deltaX:0,deltaY:0,initialDeltaX:0,initialDeltaY:0},e);t._resizeWidth(n.deltaX,n.initialDeltaX),t._resizeHeight(n.deltaY,n.initialDeltaY),t.showResizeHandles()},_resizeWidth:function(e,t){var i,r,l,d,c=this,u=s(c.element),h=u[0].style[B],f=y(u),p=u.parent().width(),m=c._getMaxDimensionValue(B);0!==e&&(n(c._initialElementWidth)&&(c._initialElementWidth=f),d=v({value:c._initialElementWidth+t,min:c.options.minWidth,max:m}),_(h)?(f+e>p?(r=a(d,p),l=o(d,p)):(r=o(d,p),l=a(d,p)),i=k(g(r,l))):i=w(d),c._setColumnsWidth(),u[0].style[B]=i)},_resizeHeight:function(e,t){var i,r,l,d,c=this,u=s(c.element),h=u[0].style[O],f=x(u),p=u.parent(),m=p.height(),b=c._getMaxDimensionValue(O),y=c.options.minHeight,C=c._hasRowsInPixels();0!==e&&(n(c._initialElementHeight)&&(c._initialElementHeight=f),d=v({value:c._initialElementHeight+t,min:y,max:b}),C&&e<0&&c._setRowsHeightInPercentages(),_(h)?(f+e>m?(r=a(d,m),l=o(d,m)):(r=o(d,m),l=a(d,m)),i=k(g(r,l))):i=w(d),u[0].style[O]=i,C&&e<0&&c._setRowsHeightInPixels())},_getMaxDimensionValue:function(e){var t=this,n=s(t.element),i=e.toLowerCase(),r=t.options.rtl?-1:1,o=s(t.element).parent(),a=o[0],l=o[i](),d=r*(e===B?o.scrollLeft():o.scrollTop());return a===n.closest(H)[0]?""!==a.style[i]||_(t.element.style[i])?l+d:1/0:l+d},_setColumnsWidth:function(){function e(e){var t=e.style.width;return""!==t?!!_(t):!!s(e).hasClass(S)}var t,n=this,i=s(n.element),r=i.parent()[0],o=i.closest(H),a=o.closest(N).children(),l=a.length;if(e(i[0])&&r===o[0]&&""===r.style[B])for(t=0;t<l;t++)a[t].style[B]=w(s(a[t]).width())},_hasRowsInPixels:function(){var e,t=this,n=s(t.element).children(P).children(N);for(e=0;e<n.length;e++)if(""===n[e].style.height||b(n[e].style.height))return!0;return!1},_setRowsHeightInPercentages:function(){var e,t=this,n=s(t.element).children(P),i=n.height(),r=n.children(N),o=r.length,a=r.map(function(){return x(s(this))});for(e=0;e<o;e++)r[e].style[O]=k(g(a[e],i))},_setRowsHeightInPixels:function(){var e,t=this,n=s(t.element).children(P).children(N),i=n.length,r=n.map(function(){return x(s(this))});for(e=0;e<i;e++)n[e].style[O]=w(r[e])},showResizeHandles:function(){var e=this;e._initResizeHandles(),e._showResizeHandles()},_initResizeHandles:function(){var e,t=this,n=t.handles,i=t.options,r=t.options.handles,o=r.length;if(!(n&&n.length>0)){for(e=0;e<o;e++)t.handles.push(new p(d({appendTo:i.appendHandlesTo,resizableElement:t.element,rootElement:i.rootElement,rtl:i.rtl},r[e])));t._bindToResizeHandlesEvents()}},_destroyResizeHandles:function(){var e,t=this,n=t.handles?t.handles.length:0;for(e=0;e<n;e++)t.handles[e].destroy()},_showResizeHandles:function(){var e,t=this,n=t.handles||[],i=n.length;for(e=0;e<i;e++)t.handles[e].show()},_bindToResizeHandlesEvents:function(){var e,t,n=this,i=n.handles||[],r=i.length;for(e=0;e<r;e++)t=i[e],t.bind(E,c(n._onResizeHandleDragStart,n)),t.bind(F,c(n._onResizeHandleDrag,n)),t.bind(R,c(n._onResizeHandleDragEnd,n)),t.bind(M,c(n._onResizeHandleMouseOver,n)),t.bind(z,c(n._onResizeHandleMouseOut,n))},_onResizeHandleDragStart:function(){var e=this,t=s(e.element);t.addClass(D),e._initialElementHeight=x(t),e._initialElementWidth=y(t),e._disableKeyboard()},_onResizeHandleDrag:function(e){this.resize(e)},_onResizeHandleDragEnd:function(){var e=this;s(e.element).removeClass(D),e._enableKeyboard()},_enableKeyboard:function(){s(this.options.rootElement).off(I+C)},_disableKeyboard:function(){s(this.options.rootElement).on(I+C,function(e){e.preventDefault()})}}),X=f.extend({create:function(e){var t=this;s(e.body).on(A+C,L,function(n){var i=n.target,r=n.currentTarget,o=e.tableResizing,a=o?o.element:null;if(o){if(a&&r!==a){if(l(r,a)&&a!==i&&l(a,i))return;a!==i&&(e._destroyTableResizing(),t._initResizing(e,r))}}else t._initResizing(e,r);e._showTableResizeHandles()}).on(A+C,function(t){var n=e.tableResizing,i=n?n.element:null,r=t.target,o=s(r).hasClass(T)||s(r).parents(K+T).length>0;!n||i===r||l(i,r)||o||e._destroyTableResizing()})},dispose:function(e){s(e.body).off(C)},_initResizing:function(t,n){u.msie||u.mozilla||(t.tableResizing=new Q(n,{appendHandlesTo:t.body,rtl:e.support.isRtl(t.element),rootElement:t.body}))}});X.current=new X,Q.create=function(e){X.current.create(e)},Q.dispose=function(e){X.current.dispose(e)},d(h,{TableResizing:Q})}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/immutables.min",["editor/tables.min"],e)}(function(){!function(e,t){var n=window.kendo,i=n.Class,r=n.ui.editor,o=r.Dom,a=n.template,s=r.RangeUtils,l=["ul","ol","tbody","thead","table"],d=["bold","italic","underline","strikethrough","superscript","subscript","forecolor","backcolor","fontname","fontsize","createlink","unlink","autolink","addcolumnleft","addcolumnright","addrowabove","addrowbelow","deleterow","deletecolumn","mergecells","formatting","cleanformatting"],c="k-immutable",u="["+c+"]",h="[contenteditable='false']",f=function(t){return e(t).is("body,.k-editor")},p=function(e){return e.getAttribute&&"false"==e.getAttribute("contenteditable")},m=function(e){return o.closestBy(e,p,f)},g=function(e){var t=m(e.startContainer),n=m(e.endContainer);(t||n)&&(t&&e.setStartBefore(t),n&&e.setEndAfter(n))},v=function(e){if(m(e.commonAncestorContainer))return!0;if(m(e.startContainer)||m(e.endContainer)){var t=s.editableTextNodes(e);if(0===t.length)return!0}return!1},_=function(e){var t,n="",i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(t=e||10;t>0;--t)n+=i.charAt(Math.round(Math.random()*(i.length-1)));return n},b=function(t){var n,i,r,a={empty:!0};return e(t).find(h).each(function(t,s){n=o.name(s),i=_(),r="<"+n+" "+c+"='"+i+"'></"+n+">",a[i]={node:s,style:e(s).attr("style")},a.empty=!1,e(s).replaceWith(r)}),a},k=function(t,n){var i,r;e(t).find(u).each(function(t,o){i=o.getAttribute(c),r=n[i],e(o).replaceWith(r.node),r.style!=e(r.node).attr("style")&&e(r.node).removeAttr("style").attr("style",r.style)})},w=function(e){var t=n.keys;return e===t.BACKSPACE||e==t.DELETE},y=function(e){var n=e?e.options:t;n&&n.finder&&n.finder._initOptions({immutables:!0})},x=i.extend({init:function(t){this.editor=t,this.serializedImmutables={},this.options=e.extend({},t&&t.options&&t.options.immutables);var n=t.toolbar.tools;y(n.justifyLeft),y(n.justifyCenter),y(n.justifyRight),y(n.justifyFull)},serialize:function(e){var t,n=this._toHtml(e);return n.indexOf(c)===-1?(t=this.randomId(),n=n.replace(/>/," "+c+'="'+t+'">')):t=n.match(/k-immutable\s*=\s*['"](.*)['"]/)[1],this.serializedImmutables[t]=e,n},_toHtml:function(e){var t,n=this.options.serialization,i=typeof n;switch(i){case"string":return a(n)(e);case"function":return n(e);default:return t=o.name(e),"<"+t+"></"+t+">"}},deserialize:function(t){var i=this,r=this.options.deserialization;e(u,t).each(function(){var t=this.getAttribute(c),o=i.serializedImmutables[t];n.isFunction(r)&&r(this,o),e(this).replaceWith(o)}),i.serializedImmutables={}},randomId:function(e){return _(e)},keydown:function(e,t){var n=w(e.keyCode),i=n&&this._cancelDeleting(e,t)||!n&&this._cancelTyping(e,t);if(i)return e.preventDefault(),!0},_cancelTyping:function(e,t){var n=this.editor,i=n.keyboard;return t.collapsed&&!i.typingInProgress&&i.isTypingKey(e)&&v(t)},_cancelDeleting:function(e,t){var i,r,a,s,d=n.keys,c=e.keyCode===d.BACKSPACE,u=e.keyCode==d.DELETE;if(!c&&!u)return!1;if(i=!1,t.collapsed){if(v(t))return!0;if(r=this.nextImmutable(t,u),r&&c&&(a=o.closest(t.commonAncestorContainer,"li"),a&&(s=o.closest(r,"li"),s&&s!==a)))return i;if(r&&!o.tableCell(r)){if(o.parentOfType(r,l)===o.parentOfType(t.commonAncestorContainer,l)){for(;r&&1==r.parentNode.childNodes.length;)r=r.parentNode;if(o.tableCell(r))return i;this._removeImmutable(r,t)}i=!0}}return i},nextImmutable:function(e,t){var n,i=e.commonAncestorContainer;if(o.isBom(i)||t&&s.isEndOf(e,i)||!t&&s.isStartOf(e,i)){if(n=this._nextNode(i,t),n&&o.isBlock(n)&&!m(n))for(;n&&n.children&&n.children[t?0:n.children.length-1];)n=n.children[t?0:n.children.length-1];return m(n)}},_removeImmutable:function(e,t){var n=this.editor,i=new r.RestorePoint(t,n.body);o.remove(e),r._finishUpdate(n,i)},_nextNode:function(e,t){for(var n,i=t?"nextSibling":"previousSibling",r=e;r&&!n;)n=r[i],n&&o.isDataNode(n)&&/^\s|[\ufeff]$/.test(n.nodeValue)&&(r=n,n=r[i]),n||(r=r.parentNode);return n}});x.immutable=p,x.immutableParent=m,x.expandImmutablesIn=g,x.immutablesContext=v,x.toolsToBeUpdated=d,x.removeImmutables=b,x.restoreImmutables=k,r.Immutables=x}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/table-wizard/table-wizard-command.min",["editor/tables.min"],e)}(function(){!function(e,t){var n=window.kendo,i=n.ui.editor,r=i.EditorUtils,o=i.RangeUtils,a=i.Dom,s=r.registerTool,l=i.ToolTemplate,d=i.Command,c=new i.BlockFormatFinder([{tags:["table"]}]),u=new i.BlockFormatFinder([{tags:["td","th"]}]),h=/([a-z]+|%)$/i,f=d.extend({exec:function(){var r=this,o=r.editor,a=r.range=r.lockRange(),s=r._sourceTable=r.options.insertNewTable?t:r._selectedTable(a),l=r._selectedTableCells=s?r._selectedCells(a):t,d={visible:!1,messages:o.options.messages,closeCallback:e.proxy(r.onDialogClose,r),table:r.parseTable(s,l),dialogOptions:o.options.dialogOptions,isRtl:n.support.isRtl(o.wrapper)},c=new i.TableWizardDialog(d);c.open()},onDialogClose:function(e){var t=this;t.releaseRange(t.range),e&&(t.options.insertNewTable?t.insertTable(t.createNewTable(e)):t.updateTable(e,t._sourceTable,t._selectedTableCells))},releaseRange:function(e){var t=this,n=t.editor.document;a.windowFromDocument(n).focus(),d.fn.releaseRange.call(t,e)},insertTable:function(e){var t=this.range;t.insertNode(e),t.collapse(!0),this.editor.selectRange(t)},updateTable:function(t,n,i){for(var r,o,s,l,d,c,u,h,f=this,p=e(n.rows).toArray(),m=t.tableProperties,g=m.rows,v=m.columns,_=function(e){return e[e.length-1]};i.length>1;)i.pop();if(r=i.length?_(i).parentNode:_(p),f._deleteTableRows(p,p.length-g),p.length<g)for(l=e(r).index(),d=r.cells.length,c=g-p.length,s=r.parentNode;c;)o=s.insertRow(l+1),f._insertCells(d-o.cells.length,o),c--;p[0].cells.length>v&&e(p).each(function(e,t){for(;t.cells.length>v;)t.deleteCell(-1)}),p[0].cells.length<v&&(u=e(_(i)||_(r.cells)).index(),e(p).each(function(e,t){f._insertCells(v-t.cells.length,t,u+1)})),f._updateTableProperties(n,m),h=t.cellProperties,i[0]&&a.attr(i[0],{id:h.id||null}),(h.selectAllCells?e(p).children():e(i)).each(function(e,t){f._updateCellProperties(t,h)}),f._updateCaption(n,m),m.cellsWithHeaders=m.cellsWithHeaders||!1,f.cellsWithHeadersAssociated(n)!=m.cellsWithHeaders&&f.associateCellsWithHeader(n,m.cellsWithHeaders)},_isHeadingRow:function(e){return a.is(e.parentNode,"thead")||a.is(e.cells[0],"th")},associateCellsWithHeader:function(t,n){var i,r,o,a=(new Date).getTime(),s=[],l=t.rows[0].cells.length,d=function(){for(var e=0;e<l;e++)s[e]="table"+ ++a},c=function(t,i){e(i)[n?"attr":"removeAttr"]("id",s[t])},u=function(t,i){e(i)[n?"attr":"removeAttr"]("headers",s[t])},h=this._isHeadingRow;e(t.rows).each(function(n,a){if(h(a))for(i=n,r=t.rows[++i],o=r&&!h(r),o&&(d(),e(a.cells).each(c));o;)e(r.cells).each(u),r=t.rows[++i],o=r&&!h(r)})},cellsWithHeadersAssociated:function(t){var n,i=e(t.rows).children(),r=this._isHeadingRow,o=[];return i.each(function(e,t){t.id&&r(t.parentNode)&&o.push(t.id)}),n=i.filter(function(t,n){var i=n.getAttribute("headers");return i&&!r(n.parentNode)&&e.inArray(i,o)>-1}),!!n.length},_insertCells:function(e,t,n){n=isNaN(n)?-1:n;for(var i,r=0;r<e;r++)i=t.insertCell(n),i.innerHTML="&nbsp;"},_deleteTableRows:function(e,t){for(var n,i,r=0;r<t;r++)n=e.pop(),i=n.parentNode,i.removeChild(n),i.rows.length||a.remove(i)},createNewTable:function(e){var t,n,i,r,o,s=this,l=s.editor.document,d=e.tableProperties,c=e.cellProperties,u=c.selectAllCells,h=a.create(l,"table");for(s._updateTableProperties(h,d),s._updateCaption(h,d),t=h.createTBody(),n=0;n<d.rows;n++)for(i=t.insertRow(),r=0;r<d.columns;r++)o=i.insertCell(),o.innerHTML="&nbsp;",0===n&&0===r&&c.id&&(o.id=c.id),s._updateCellProperties(o,u||0===n&&0===r?c:{});return d.cellsWithHeaders&&s.associateCellsWithHeader(h,d.cellsWithHeaders),h},_updateTableProperties:function(t,n){var i=this._getStylesData(n);a.attr(t,{cellSpacing:n.cellSpacing||null,cellPadding:n.cellPadding||null,className:n.className||null,id:n.id||null,summary:n.summary||null,style:i||null}),e(t).addClass("k-table")},_updateCellProperties:function(e,t){var n=this._getStylesData(t);n.padding=t.cellPadding||null,n.margin=t.cellMargin||null,a.attr(e,{style:n||null,className:t.className||null})},_updateCaption:function(e,t){var n,i;e.caption&&!t.captionContent?e.deleteCaption():t.captionContent&&(n=e.createCaption(),n.innerHTML=t.captionContent,i=this._getAlignmentData(t.captionAlignment),a.attr(n,{style:{textAlign:i.textAlign,verticalAlign:i.verticalAlign}}))},_getStylesData:function(e){var t=this._getAlignmentData(e.alignment),n="wrapText"in e?e.wrapText?"":"nowrap":null;return{width:e.width?e.width+e.widthUnit:null,height:e.height?e.height+e.heightUnit:null,textAlign:t.textAlign,verticalAlign:t.verticalAlign,backgroundColor:e.bgColor||null,borderWidth:e.borderWidth,borderStyle:e.borderStyle,borderColor:e.borderColor,borderCollapse:e.collapseBorders?"collapse":null,whiteSpace:n}},_getAlignmentData:function(e){var t,n="",i=n;return e&&(e.indexOf(" ")!=-1?(t=e.split(" "),n=t[0],i=t[1]):n=e),{textAlign:n,verticalAlign:i}},parseTable:function(n,i){var r,o,a,s,l,d,c,u,h,f;return n?(r=this,o=n.style,a=n.rows,s=n.caption,l=e(s?s.cloneNode(!0):t),l.find(".k-marker").remove(),d=n.className,d=d.replace(/^k-table\s|\sk-table$/,""),d=d.replace(/\sk-table\s/," "),d=d.replace(/^k-table$/,""),c=r._getAlignment(n,!0),u=s?r._getAlignment(s):t,h=r.cellsWithHeadersAssociated(n),f={tableProperties:{width:o.width||n.width?parseFloat(o.width||n.width):null,height:o.height||n.height?parseFloat(o.height||n.height):null,columns:a[0]?a[0].children.length:0,rows:a.length,widthUnit:r._getUnit(o.width),heightUnit:r._getUnit(o.height),cellSpacing:n.cellSpacing,cellPadding:n.cellPadding,alignment:c.textAlign,bgColor:o.backgroundColor||n.bgColor,className:d,id:n.id,borderWidth:o.borderWidth||n.border,borderColor:o.borderColor,borderStyle:o.borderStyle||"",collapseBorders:!!o.borderCollapse,summary:n.summary,captionContent:s?l.html():"",captionAlignment:s&&u.textAlign?u.textAlign+" "+u.verticalAlign:"",cellsWithHeaders:h},selectedCells:[]},f.rows=r.parseTableRows(a,i,f),f):{tableProperties:{},selectedCells:[]}},parseTableRows:function(t,n,i){var r,o,a,s,l,d,c,u=this,h=[];for(d=0;d<t.length;d++)for(r=t[d],o={cells:[]},a=r.cells,h.push(o),c=0;c<a.length;c++)s=a[c],l=u.parseCell(s),e.inArray(s,n)!=-1&&i.selectedCells.push(l),o.cells.push(l);return h},parseCell:function(e){var t,n=this,i=e.style,r=n._getAlignment(e);return r=r.textAlign?r.textAlign+" "+r.verticalAlign:"",t={width:i.width||e.width?parseFloat(i.width||e.width):null,height:i.height||e.height?parseFloat(i.height||e.height):null,widthUnit:n._getUnit(i.width),heightUnit:n._getUnit(i.height),cellMargin:i.margin,cellPadding:i.padding,alignment:r,bgColor:i.backgroundColor||e.bgColor,className:e.className,id:e.id,borderWidth:i.borderWidth||e.border,borderColor:i.borderColor,borderStyle:i.borderStyle,wrapText:"nowrap"!=i.whiteSpace}},_getAlignment:function(e,t){var n,i=e.style,r=i.textAlign||e.align||"";return t?{textAlign:r}:(n=i.verticalAlign||e.vAlign||"",r&&n?{textAlign:r,verticalAlign:n}:!r&&n?{textAlign:"left",verticalAlign:n}:r&&!n?{textAlign:r,verticalAlign:"top"}:{textAlign:"",verticalAlign:""})},_getUnit:function(e){var t=(e||"").match(h);return t?t[0]:"px"},_selectedTable:function(e){var t=a.filterBy(o.nodes(e),a.htmlIndentSpace,!0);return c.findSuitable(t)[0]},_selectedCells:function(e){var t=a.filterBy(o.nodes(e),a.htmlIndentSpace,!0);return u.findSuitable(t)}}),p=i.Tool.extend({command:function(e){return e.insertNewTable=this.options.insertNewTable,new f(e)}}),m=p.extend({update:function(e,t){var n=!c.isFormatted(t);e.toggleClass("k-state-disabled",n)}});n.ui.editor.TableWizardTool=p,n.ui.editor.TableWizardCommand=f,s("tableWizard",new m({command:f,insertNewTable:!1,template:new l({template:r.buttonTemplate,title:"Table Wizard"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/table-wizard/table-wizard-dialog.min",["editor/table-wizard/table-wizard-command.min"],e)}(function(){!function(e,t){var n=window.kendo,i={format:"0",min:0},r=["px","em"],o=["solid","dotted","dashed","double","groove","ridge","inset","outset","initial","inherit","none","hidden"],a={dataSource:[{className:"k-font-icon k-i-table-align-middle-left",value:"left"},{className:"k-font-icon k-i-table-align-middle-center",value:"center"},{className:"k-font-icon k-i-table-align-middle-right",value:"right"},{className:"k-font-icon k-i-justify-clear",value:""}],dataTextField:"className",dataValueField:"value",template:"<span class='#: className #' title='#: tooltip #'></span>",valueTemplate:"<span class='k-align-group #: className #' title='#: tooltip #'></span>"},s={dataSource:[{className:"k-font-icon k-i-table-align-top-left",value:"left top"},{className:"k-font-icon k-i-table-align-top-center",value:"center top"},{className:"k-font-icon k-i-table-align-top-right",value:"right top"},{className:"k-font-icon k-i-table-align-middle-left",value:"left middle"},{className:"k-font-icon k-i-table-align-middle-center",value:"center middle"},{className:"k-font-icon k-i-table-align-middle-right",value:"right middle"},{className:"k-font-icon k-i-table-align-bottom-left",value:"left bottom"},{className:"k-font-icon k-i-table-align-bottom-center",value:"center bottom"},{className:"k-font-icon k-i-table-align-bottom-right",value:"right bottom"},{className:"k-font-icon k-i-justify-clear",value:""}],dataTextField:"className",dataValueField:"value",template:"<span class='#: className #' title='#: tooltip #'></span>",valueTemplate:"<span class='k-align-group #: className #' title='#: tooltip #'></span>"},l={dataSource:[{className:"k-font-icon k-i-table-align-top-left",value:"left top"},{className:"k-font-icon k-i-table-align-top-center",value:"center top"},{className:"k-font-icon k-i-table-align-top-right",value:"right top"},{className:"k-font-icon k-i-table-align-bottom-left",value:"left bottom"},{className:"k-font-icon k-i-table-align-bottom-center",value:"center bottom"},{className:"k-font-icon k-i-table-align-bottom-right",value:"right bottom"},{className:"k-font-icon k-i-justify-clear",value:""}],dataTextField:"className",dataValueField:"value",template:"<span class='#: className #' title='#: tooltip #'></span>",valueTemplate:"<span class='k-align-group #: className #' title='#: tooltip #'></span>"},d='<div class="k-editor-dialog k-editor-table-wizard-dialog k-action-window k-edit-form-container k-popup-edit-form"><div id="k-table-wizard-tabs" class="k-root-tabs"><ul><li class="k-state-active">#= messages.tableTab #</li><li>#= messages.cellTab #</li><li>#= messages.accessibilityTab #</li></ul><div id="k-table-properties"><div class="k-edit-label"><label for="k-editor-table-width">#= messages.width #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-table-width" /><input id="k-editor-table-width-type" /></div><div class="k-edit-label"><label for="k-editor-table-height">#= messages.height #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-table-height" /><input id="k-editor-table-height-type" /></div><div class="k-edit-label"><label for="k-editor-table-columns">#= messages.columns #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-table-columns" /></div><div class="k-edit-label"><label for="k-editor-table-rows">#= messages.rows #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-table-rows" /></div><div class="k-edit-label"><label for="k-editor-table-cell-spacing">#= messages.cellSpacing #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-table-cell-spacing" /></div><div class="k-edit-label"><label for="k-editor-table-cell-padding">#= messages.cellPadding #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-table-cell-padding" /></div><div class="k-edit-label"><label for="k-editor-table-alignment">#= messages.alignment #</label></div><div class="k-edit-field"><input id="k-editor-table-alignment" class="k-align" /></div><div class="k-edit-label"><label for="k-editor-table-bg">#= messages.background #</label></div><div class="k-edit-field"><input id="k-editor-table-bg" /></div><div class="k-edit-label"><label for="k-editor-css-class">#= messages.cssClass #</label></div><div class="k-edit-field"><input id="k-editor-css-class" class="k-input k-textbox" type="text" /></div><div class="k-edit-label"><label for="k-editor-id">#= messages.id #</label></div><div class="k-edit-field"><input id="k-editor-id" class="k-input k-textbox" type="text" /></div><div class="k-edit-label"><label for="k-editor-border-width">#= messages.border #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-border-width" /><input id="k-editor-border-color" /></div><div class="k-edit-label"><label for="k-editor-border-style">#= messages.borderStyle #</label></div><div class="k-edit-field"><input id="k-editor-border-style" /></div><div class="k-edit-label">&nbsp;</div><div class="k-edit-field"><input id="k-editor-collapse-borders" type="checkbox" class="k-checkbox" /><label for="k-editor-collapse-borders" class="k-checkbox-label">#= messages.collapseBorders #</label></div></div><div id="k-cell-properties"><div class="k-edit-field"><input id="k-editor-selectAllCells" type="checkbox" class="k-checkbox" /><label for="k-editor-selectAllCells" class="k-checkbox-label">#= messages.selectAllCells #</label></div><div class="k-edit-label"><label for="k-editor-cell-width">#= messages.width #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-cell-width" /><input id="k-editor-cell-width-type" /></div><div class="k-edit-label"><label for="k-editor-cell-height">#= messages.height #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-cell-height" /><input id="k-editor-cell-height-type" /></div><div class="k-edit-label"><label for="k-editor-table-cell-margin">#= messages.cellMargin #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-table-cell-margin" /></div><div class="k-edit-label"><label for="k-editor-table-cells-padding">#= messages.cellPadding #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-table-cells-padding" /></div><div class="k-edit-label"><label for="k-editor-cell-alignment">#= messages.alignment #</label></div><div class="k-edit-field"><input id="k-editor-cell-alignment" class="k-align" /></div><div class="k-edit-label"><label for="k-editor-cell-bg">#= messages.background #</label></div><div class="k-edit-field"><input id="k-editor-cell-bg" /></div><div class="k-edit-label"><label for="k-editor-cell-css-class">#= messages.cssClass #</label></div><div class="k-edit-field"><input id="k-editor-cell-css-class" class="k-input k-textbox" type="text" /></div><div class="k-edit-label"><label for="k-editor-cell-id">#= messages.id #</label></div><div class="k-edit-field"><input id="k-editor-cell-id" class="k-input k-textbox" type="text" /></div><div class="k-edit-label"><label for="k-editor-cell-border-width">#= messages.border #</label></div><div class="k-edit-field"><input type="numeric" id="k-editor-cell-border-width" /><input id="k-editor-cell-border-color" /></div><div class="k-edit-label"><label for="k-editor-cell-border-style">#= messages.borderStyle #</label></div><div class="k-edit-field"><input id="k-editor-cell-border-style" /></div><div class="k-edit-label">&nbsp;</div><div class="k-edit-field"><input id="k-editor-wrap-text" type="checkbox" class="k-checkbox" /><label for="k-editor-wrap-text" class="k-checkbox-label">#= messages.wrapText #</label></div></div><div id="k-accessibility-properties"><div class="k-edit-label"><label for="k-editor-table-caption">#= messages.caption #</label></div><div class="k-edit-field"><input id="k-editor-table-caption" class="k-input k-textbox" type="text" /></div><div class="k-edit-label"><label for="k-editor-accessibility-alignment">#= messages.alignment #</label></div><div class="k-edit-field"><input id="k-editor-accessibility-alignment" class="k-align" /></div><div class="k-edit-label"><label for="k-editor-accessibility-summary">#= messages.summary #</label></div><div class="k-edit-field"><textarea id="k-editor-accessibility-summary" class="k-input k-textbox"></textarea></div><div class="k-edit-label">&nbsp;</div><div class="k-edit-field"><input id="k-editor-cells-headers" type="checkbox" class="k-checkbox" /><label for="k-editor-cells-headers" class="k-checkbox-label">#= messages.associateCellsWithHeaders #</label></div></div></div><div class="k-edit-buttons k-state-default"><button class="k-button k-primary k-dialog-ok">#= messages.dialogOk #</button><button class="k-button k-dialog-close">#= messages.dialogCancel #</button></div></div>',c=n.Class.extend({
init:function(e){this.options=e},open:function(){function t(e){e.preventDefault(),a.destroy(),r.destroy()}function n(e){a.collectDialogValues(d),t(e),a.change&&a.change(),s.closeCallback(d)}function i(e){t(e),s.closeCallback()}var r,o,a=this,s=a.options,l=s.dialogOptions,d=s.table,c=s.messages;l.close=i,l.title=c.tableWizard,l.visible=s.visible,r=e(a._dialogTemplate(c)).appendTo(document.body).kendoWindow(l).closest(".k-window").toggleClass("k-rtl",s.isRtl).end().find(".k-dialog-ok").click(n).end().find(".k-dialog-close").click(i).end().data("kendoWindow"),o=r.element,a._initTabStripComponent(o),a._initTableViewComponents(o,d),a._initCellViewComponents(o,d),a._initAccessibilityViewComponents(o,d),r.center(),r.open()},_initTabStripComponent:function(e){var t=this.components={};t.tabStrip=e.find("#k-table-wizard-tabs").kendoTabStrip({animation:!1}).data("kendoTabStrip")},collectDialogValues:function(){var e=this,t=e.options.table;e._collectTableViewValues(t),e._collectCellViewValues(t),e._collectAccessibilityViewValues(t)},_collectTableViewValues:function(e){var t=this.components.tableView,n=e.tableProperties;n.width=t.width.value(),n.widthUnit=t.widthUnit.value(),n.height=t.height.value(),n.columns=t.columns.value(),n.rows=t.rows.value(),n.heightUnit=t.heightUnit.value(),n.cellSpacing=t.cellSpacing.value(),n.cellPadding=t.cellPadding.value(),n.alignment=t.alignment.value(),n.bgColor=t.bgColor.value(),n.className=t.className.value,n.id=t.id.value,n.borderWidth=t.borderWidth.value(),n.borderColor=t.borderColor.value(),n.borderStyle=t.borderStyle.value(),n.collapseBorders=t.collapseBorders.checked},_collectCellViewValues:function(e){var t=e.cellProperties={},n=this.components.cellView;t.selectAllCells=n.selectAllCells.checked,t.width=n.width.value(),t.widthUnit=n.widthUnit.value(),t.height=n.height.value(),t.heightUnit=n.heightUnit.value(),t.cellMargin=n.cellMargin.value(),t.cellPadding=n.cellPadding.value(),t.alignment=n.alignment.value(),t.bgColor=n.bgColor.value(),t.className=n.className.value,t.id=n.id.value,t.borderWidth=n.borderWidth.value(),t.borderColor=n.borderColor.value(),t.borderStyle=n.borderStyle.value(),t.wrapText=n.wrapText.checked},_collectAccessibilityViewValues:function(e){var t=e.tableProperties,n=this.components.accessibilityView;t.captionContent=n.captionContent.value,t.captionAlignment=n.captionAlignment.value(),t.summary=n.summary.value,t.cellsWithHeaders=n.cellsWithHeaders.checked},_addUnit:function(t,n){n&&e.inArray(n,t)==-1&&t.push(n)},_initTableViewComponents:function(e,t){var n=this.components,i=n.tableView={},a=t.tableProperties=t.tableProperties||{};a.borderStyle=a.borderStyle||"",this._addUnit(r,a.widthUnit),this._addUnit(r,a.heightUnit),this._initNumericTextbox(e.find("#k-editor-table-width"),"width",a,i),this._initNumericTextbox(e.find("#k-editor-table-height"),"height",a,i),this._initNumericTextbox(e.find("#k-editor-table-columns"),"columns",a,i,{min:1,value:4}),this._initNumericTextbox(e.find("#k-editor-table-rows"),"rows",a,i,{min:1,value:4}),this._initDropDownList(e.find("#k-editor-table-width-type"),"widthUnit",a,i,r),this._initDropDownList(e.find("#k-editor-table-height-type"),"heightUnit",a,i,r),this._initNumericTextbox(e.find("#k-editor-table-cell-spacing"),"cellSpacing",a,i),this._initNumericTextbox(e.find("#k-editor-table-cell-padding"),"cellPadding",a,i),this._initTableAlignmentDropDown(e.find("#k-editor-table-alignment"),a),this._initColorPicker(e.find("#k-editor-table-bg"),"bgColor",a,i),this._initInput(e.find("#k-editor-css-class"),"className",a,i),this._initInput(e.find("#k-editor-id"),"id",a,i),this._initNumericTextbox(e.find("#k-editor-border-width"),"borderWidth",a,i),this._initColorPicker(e.find("#k-editor-border-color"),"borderColor",a,i),this._initDropDownList(e.find("#k-editor-border-style"),"borderStyle",a,i,o),this._initCheckbox(e.find("#k-editor-collapse-borders"),"collapseBorders",a,i)},_initCellViewComponents:function(e,t){var n,i=this.components,a=i.cellView={};t.selectedCells=t.selectedCells=t.selectedCells||[],n=t.selectedCells[0]||{borderStyle:"",wrapText:!0},this._addUnit(r,n.widthUnit),this._addUnit(r,n.heightUnit),this._initCheckbox(e.find("#k-editor-selectAllCells"),"selectAllCells",t.tableProperties,a),this._initNumericTextbox(e.find("#k-editor-cell-width"),"width",n,a),this._initNumericTextbox(e.find("#k-editor-cell-height"),"height",n,a),this._initDropDownList(e.find("#k-editor-cell-width-type"),"widthUnit",n,a,r),this._initDropDownList(e.find("#k-editor-cell-height-type"),"heightUnit",n,a,r),this._initNumericTextbox(e.find("#k-editor-table-cell-margin"),"cellMargin",n,a),this._initNumericTextbox(e.find("#k-editor-table-cells-padding"),"cellPadding",n,a),this._initCellAlignmentDropDown(e.find("#k-editor-cell-alignment"),n),this._initColorPicker(e.find("#k-editor-cell-bg"),"bgColor",n,a),this._initInput(e.find("#k-editor-cell-css-class"),"className",n,a),this._initInput(e.find("#k-editor-cell-id"),"id",n,a),this._initNumericTextbox(e.find("#k-editor-cell-border-width"),"borderWidth",n,a),this._initColorPicker(e.find("#k-editor-cell-border-color"),"borderColor",n,a),this._initDropDownList(e.find("#k-editor-cell-border-style"),"borderStyle",n,a,o),this._initCheckbox(e.find("#k-editor-wrap-text"),"wrapText",n,a)},_initAccessibilityViewComponents:function(e,t){var n=this.components,i=n.accessibilityView={},r=t.tableProperties;this._initInput(e.find("#k-editor-table-caption"),"captionContent",r,i),this._initAccessibilityAlignmentDropDown(e.find("#k-editor-accessibility-alignment"),r),this._initInput(e.find("#k-editor-accessibility-summary"),"summary",r,i),this._initCheckbox(e.find("#k-editor-cells-headers"),"cellsWithHeaders",r,i)},_initNumericTextbox:function(t,n,r,o,a){var s=o[n]=t.kendoNumericTextBox(a?e.extend({},i,a):i).data("kendoNumericTextBox");n in r&&s.value(parseInt(r[n],10))},_initDropDownList:function(e,t,n,i,r){var o=i[t]=e.kendoDropDownList({dataSource:r}).data("kendoDropDownList");this._setComponentValue(o,n,t)},_initTableAlignmentDropDown:function(e,t){var n=this.options.messages,i=this.components.tableView,r=a.dataSource;r[0].tooltip=n.alignLeft,r[1].tooltip=n.alignCenter,r[2].tooltip=n.alignRight,r[3].tooltip=n.alignRemove,this._initAlignmentDropDown(e,a,"alignment",t,i)},_initCellAlignmentDropDown:function(e,t){var n=this.options.messages,i=this.components.cellView,r=s.dataSource;r[0].tooltip=n.alignLeftTop,r[1].tooltip=n.alignCenterTop,r[2].tooltip=n.alignRightTop,r[3].tooltip=n.alignLeftMiddle,r[4].tooltip=n.alignCenterMiddle,r[5].tooltip=n.alignRightMiddle,r[6].tooltip=n.alignLeftBottom,r[7].tooltip=n.alignCenterBottom,r[8].tooltip=n.alignRightBottom,r[9].tooltip=n.alignRemove,this._initAlignmentDropDown(e,s,"alignment",t,i)},_initAccessibilityAlignmentDropDown:function(e,t){var n=this.options.messages,i=this.components.accessibilityView,r=l.dataSource;r[0].tooltip=n.alignLeftTop,r[1].tooltip=n.alignCenterTop,r[2].tooltip=n.alignRightTop,r[3].tooltip=n.alignLeftBottom,r[4].tooltip=n.alignCenterBottom,r[5].tooltip=n.alignRightBottom,r[6].tooltip=n.alignRemove,this._initAlignmentDropDown(e,l,"captionAlignment",t,i)},_initAlignmentDropDown:function(e,t,n,i,r){var o=r[n]=e.kendoDropDownList(t).data("kendoDropDownList");o.list.addClass("k-align").css("width","110px"),this._setComponentValue(o,i,n)},_setComponentValue:function(e,t,n){n in t&&e.value(t[n])},_initColorPicker:function(e,t,n,i){var r=i[t]=e.kendoColorPicker().data("kendoColorPicker");n[t]&&r.value(n[t])},_initInput:function(e,t,n,i){var r=i[t]=e.get(0);t in n&&(r.value=n[t])},_initCheckbox:function(e,t,n,i){var r=i[t]=e.get(0);t in n&&(r.checked=n[t])},destroy:function(){this._destroyComponents(this.components.tableView),this._destroyComponents(this.components.cellView),this._destroyComponents(this.components.accessibilityView),this._destroyComponents(this.components),delete this.components},_destroyComponents:function(e){for(var t in e)e[t].destroy&&e[t].destroy(),delete e[t]},_dialogTemplate:function(e){return n.template(d)({messages:e})}});n.ui.editor.TableWizardDialog=c}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.editor.min",["kendo.combobox.min","kendo.dropdownlist.min","kendo.resizable.min","kendo.window.min","kendo.colorpicker.min","kendo.imagebrowser.min","util/undoredostack.min","editor/main.min","editor/dom.min","editor/serializer.min","editor/range.min","editor/system.min","editor/inlineformat.min","editor/formatblock.min","editor/linebreak.min","editor/lists.min","editor/link.min","editor/file.min","editor/image.min","editor/components.min","editor/indent.min","editor/viewhtml.min","editor/formatting.min","editor/toolbar.min","editor/tables.min","editor/resizing/column-resizing.min","editor/resizing/row-resizing.min","editor/resizing/table-resizing.min","editor/resizing/table-resize-handle.min","editor/immutables.min","editor/table-wizard/table-wizard-command.min","editor/table-wizard/table-wizard-dialog.min"],e)}(function(){return window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.maskedtextbox.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.caret,r=n.keys,o=n.ui,a=o.Widget,s=".kendoMaskedTextBox",l=e.proxy,d=(n.support.propertyChangeEvent?"propertychange":"input")+s,c="k-state-disabled",u="disabled",h="readonly",f="change",p=a.extend({init:function(t,r){var o,l,d=this;a.fn.init.call(d,t,r),d._rules=e.extend({},d.rules,d.options.rules),t=d.element,o=t[0],d.wrapper=t,d._tokenize(),d._form(),d.element.addClass("k-textbox").attr("autocomplete","off").on("focus"+s,function(){var e=o.value;e?d._togglePrompt(!0):o.value=d._old=d._emptyMask,d._oldValue=e,d._timeoutId=setTimeout(function(){i(t,0,e?d._maskLength:0)})}).on("focusout"+s,function(){var e=t.val();clearTimeout(d._timeoutId),o.value=d._old="",e!==d._emptyMask&&(o.value=d._old=e),d._change(),d._togglePrompt()}),l=t.is("[disabled]")||e(d.element).parents("fieldset").is(":disabled"),l?d.enable(!1):d.readonly(t.is("[readonly]")),d.value(d.options.value||t.val()),n.notify(d)},options:{name:"MaskedTextBox",clearPromptChar:!1,unmaskOnPost:!1,promptChar:"_",culture:"",rules:{},value:"",mask:""},events:[f],rules:{0:/\d/,9:/\d|\s/,"#":/\d|\s|\+|\-/,L:/[a-zA-Z]/,"?":/[a-zA-Z]|\s/,"&":/\S/,C:/./,A:/[a-zA-Z0-9]/,a:/[a-zA-Z0-9]|\s/},setOptions:function(t){var n=this;a.fn.setOptions.call(n,t),n._rules=e.extend({},n.rules,n.options.rules),n._tokenize(),this._unbindInput(),this._bindInput(),n.value(n.element.val())},destroy:function(){var e=this;e.element.off(s),e._formElement&&(e._formElement.off("reset",e._resetHandler),e._formElement.off("submit",e._submitHandler)),a.fn.destroy.call(e)},raw:function(){var e=this._unmask(this.element.val(),0);return e.replace(RegExp(this.options.promptChar,"g"),"")},value:function(e){var i=this.element,r=this._emptyMask;return e===t?this.element.val():(null===e&&(e=""),r?(e=this._unmask(e+""),i.val(e?r:""),this._mask(0,this._maskLength,e),e=i.val(),this._oldValue=e,n._activeElement()!==i&&(e===r?i.val(""):this._togglePrompt()),t):(i.val(e),t))},_togglePrompt:function(e){var t=this.element[0],n=t.value;this.options.clearPromptChar&&(n=e?this._oldValue:n.replace(RegExp(this.options.promptChar,"g")," "),t.value=this._old=n)},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},_bindInput:function(){var e=this;e._maskLength&&e.element.on("keydown"+s,l(e._keydown,e)).on("keypress"+s,l(e._keypress,e)).on("paste"+s,l(e._paste,e)).on(d,l(e._propertyChange,e))},_unbindInput:function(){this.element.off("keydown"+s).off("keypress"+s).off("paste"+s).off(d)},_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly;t._unbindInput(),r||i?n.attr(u,i).attr(h,r).toggleClass(c,i):(n.removeAttr(u).removeAttr(h).removeClass(c),t._bindInput())},_change:function(){var e=this,t=e.value();t!==e._oldValue&&(e._oldValue=t,e.trigger(f),e.element.trigger(f))},_propertyChange:function(){var e,t,r=this,o=r.element[0],a=o.value;n._activeElement()===o&&(a===r._old||r._pasting||(t=i(o)[0],e=r._unmask(a.substring(t),t),o.value=r._old=a.substring(0,t)+r._emptyMask.substring(t),r._mask(t,t,e),i(o,t)))},_paste:function(e){var t=this,n=e.target,r=i(n),o=r[0],a=r[1],s=t._unmask(n.value.substring(a),a);t._pasting=!0,setTimeout(function(){var e=n.value,r=e.substring(o,i(n)[0]);n.value=t._old=e.substring(0,o)+t._emptyMask.substring(o),t._mask(o,o,r),o=i(n)[0],t._mask(o,o,s),i(n,o),t._pasting=!1})},_form:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value)})},t._submitHandler=function(){t.element[0].value=t._old=t.raw()},t.options.unmaskOnPost&&r.on("submit",t._submitHandler),t._formElement=r.on("reset",t._resetHandler))},_keydown:function(e){var n,o=e.keyCode,a=this.element[0],s=i(a),l=s[0],d=s[1],c=o===r.BACKSPACE;c||o===r.DELETE?(l===d&&(c?l-=1:d+=1,n=this._find(l,c)),n!==t&&n!==l?(c&&(n+=1),i(a,n)):l>-1&&this._mask(l,d,"",c),e.preventDefault()):o===r.ENTER&&this._change()},_keypress:function(e){var t,n;0===e.which||e.metaKey||e.ctrlKey||e.keyCode===r.ENTER||(t=String.fromCharCode(e.which),n=i(this.element),this._mask(n[0],n[1],t),(e.keyCode===r.BACKSPACE||t)&&e.preventDefault())},_find:function(e,t){var n=this.element.val()||this._emptyMask,i=1;for(t===!0&&(i=-1);e>-1||e<=this._maskLength;){if(n.charAt(e)!==this.tokens[e])return e;e+=i}return-1},_mask:function(e,r,o,a){var s,l,d,c,u=this.element[0],h=u.value||this._emptyMask,f=this.options.promptChar,p=0;for(e=this._find(e,a),e>r&&(r=e),l=this._unmask(h.substring(r),r),o=this._unmask(o,e),s=o.length,o&&(l=l.replace(RegExp("^_{0,"+s+"}"),"")),o+=l,h=h.split(""),d=o.charAt(p);e<this._maskLength;)h[e]=d||f,d=o.charAt(++p),c===t&&p>s&&(c=e),e=this._find(e+1);u.value=this._old=h.join(""),n._activeElement()===u&&(c===t&&(c=this._maskLength),i(u,c))},_unmask:function(t,n){var i,r,o,a,s,l,d,c;if(!t)return"";for(t=(t+"").split(""),o=0,a=n||0,s=this.options.promptChar,l=t.length,d=this.tokens.length,c="";a<d&&(i=t[o],r=this.tokens[a],i===r||i===s?(c+=i===s?s:"",o+=1,a+=1):"string"!=typeof r?((r.test&&r.test(i)||e.isFunction(r)&&r(i))&&(c+=i,a+=1),o+=1):a+=1,!(o>=l)););return c},_tokenize:function(){for(var e,t,i,r,o=[],a=0,s=this.options.mask||"",l=s.split(""),d=l.length,c=0,u="",h=this.options.promptChar,f=n.getCulture(this.options.culture).numberFormat,p=this._rules;c<d;c++)if(e=l[c],t=p[e])o[a]=t,u+=h,a+=1;else for("."===e||","===e?e=f[e]:"$"===e?e=f.currency.symbol:"\\"===e&&(c+=1,e=l[c]),e=e.split(""),i=0,r=e.length;i<r;i++)o[a]=e[i],u+=e[i],a+=1;this.tokens=o,this._emptyMask=u,this._maskLength=u.length}});o.plugin(p)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.toolbar.min",["kendo.core.min","kendo.userevents.min","kendo.popup.min"],e)}(function(){return function(e,t){function n(){var e,t=this.options.anchor,n=F(t);x.wrap(this.element).addClass("k-split-wrapper"),e="border-box"!==this.element.css("box-sizing")?n-(F(this.element)-this.element.width()):n,this.element.css({fontFamily:t.css("font-family"),"min-width":e})}function i(e){e.target.is(".k-toggle-button")||e.target.toggleClass(B,"press"==e.type)}function r(t){return t=e(t),t.hasClass("km-actionsheet")?t.closest(".km-popup-wrapper"):t.addClass("km-widget km-actionsheet").wrap('<div class="km-actionsheet-wrapper km-actionsheet-tablet km-widget km-popup"></div>').parent().wrap('<div class="km-popup-wrapper k-popup"></div>').parent()}function o(e){e.preventDefault()}function a(t,n){var i="next"===n?e.fn.next:e.fn.prev,r="next"===n?e.fn.first:e.fn.last,o=i.call(t);return o.is(":kendoFocusable")||!o.length?o:o.find(":kendoFocusable").length?r.call(o.find(":kendoFocusable")):a(o,n)}var s,l,d,c,u,h,f,p,m,g,v,_,b,k,w,y,x=window.kendo,C=x.Class,T=x.ui.Widget,S=e.proxy,D=x.isFunction,E=x.keys,F=x._outerWidth,R="k-toolbar",I="k-button",A="k-overflow-button",M="k-toggle-button",z="k-button-group",H="k-split-button",N="k-separator",P="k-popup",L="k-toolbar-resizable",B="k-state-active",O="k-state-disabled",V="k-state-hidden",W="k-group-start",U="k-group-end",q="k-primary",j="k-icon",$="k-i-",G="k-button-icon",Y="k-button-icontext",K="k-list-container k-split-container",Q="k-split-button-arrow",X="k-overflow-anchor",J="k-overflow-container",Z="k-toolbar-first-visible",ee="k-toolbar-last-visible",te="click",ne="toggle",ie="open",re="close",oe="overflowOpen",ae="overflowClose",se="never",le="auto",de="always",ce="k-overflow-hidden",ue=x.attr("uid");x.toolbar={},s={overflowAnchor:'<div tabindex="0" class="k-overflow-anchor"></div>',overflowContainer:'<ul class="k-overflow-container k-list-container"></ul>'},x.toolbar.registerComponent=function(e,t,n){s[e]={toolbar:t,overflow:n}},l=x.Class.extend({addOverflowAttr:function(){this.element.attr(x.attr("overflow"),this.options.overflow||le)},addUidAttr:function(){this.element.attr(ue,this.options.uid)},addIdAttr:function(){this.options.id&&this.element.attr("id",this.options.id)},addOverflowIdAttr:function(){this.options.id&&this.element.attr("id",this.options.id+"_overflow")},attributes:function(){this.options.attributes&&this.element.attr(this.options.attributes)},show:function(){this.element.removeClass(V).show(),this.options.hidden=!1},hide:function(){this.element.addClass(V).hide(),this.options.hidden=!0},remove:function(){this.element.remove()},enable:function(e){e===t&&(e=!0),this.element.toggleClass(O,!e),this.options.enable=e},twin:function(){var e=this.element.attr(ue);return this.overflow?this.toolbar.element.find("["+ue+"='"+e+"']").data(this.options.type):this.toolbar.options.resizable?this.toolbar.popup.element.find("["+ue+"='"+e+"']").data(this.options.type):t}}),x.toolbar.Item=l,d=l.extend({init:function(n,i){var r=e(n.useButtonTag?'<button tabindex="0"></button>':'<a href tabindex="0"></a>');this.element=r,this.options=n,this.toolbar=i,this.attributes(),n.primary&&r.addClass(q),n.togglable&&(r.addClass(M),this.toggle(n.selected)),n.url===t||n.useButtonTag||(r.attr("href",n.url),n.mobile&&r.attr(x.attr("role"),"button")),n.group&&(r.attr(x.attr("group"),n.group),this.group=this.toolbar.addToGroup(this,n.group)),!n.togglable&&n.click&&D(n.click)&&(this.clickHandler=n.click),n.togglable&&n.toggle&&D(n.toggle)&&(this.toggleHandler=n.toggle)},toggle:function(e,t){e=!!e,this.group&&e?this.group.select(this):this.group||this.select(e),t&&this.twin()&&this.twin().toggle(e)},getParentGroup:function(){if(this.options.isChild)return this.element.closest("."+z).data("buttonGroup")},_addGraphics:function(){var t,n,i,r=this.element,o=this.options.icon,a=this.options.spriteCssClass,s=this.options.imageUrl;(a||s||o)&&(t=!0,r.contents().filter(function(){return!e(this).hasClass("k-sprite")&&!e(this).hasClass(j)&&!e(this).hasClass("k-image")}).each(function(n,i){(1==i.nodeType||3==i.nodeType&&e.trim(i.nodeValue).length>0)&&(t=!1)}),r.addClass(t?G:Y)),o?(n=r.children("span."+j).first(),n[0]||(n=e('<span class="'+j+'"></span>').prependTo(r)),n.addClass($+o)):a?(n=r.children("span.k-sprite").first(),n[0]||(n=e('<span class="k-sprite"></span>').prependTo(r)),n.addClass(a)):s&&(i=r.children("img.k-image").first(),i[0]||(i=e('<img alt="icon" class="k-image" />').prependTo(r)),i.attr("src",s))}}),x.toolbar.Button=d,c=d.extend({init:function(e,t){d.fn.init.call(this,e,t);var n=this.element;n.addClass(I),this.addIdAttr(),e.align&&n.addClass("k-align-"+e.align),"overflow"!=e.showText&&e.text&&n.html(e.mobile?'<span class="km-text">'+e.text+"</span>":e.text),e.hasIcon="overflow"!=e.showIcon&&(e.icon||e.spriteCssClass||e.imageUrl),e.hasIcon&&this._addGraphics(),this.addUidAttr(),this.addOverflowAttr(),this.enable(e.enable),e.hidden&&this.hide(),this.element.data({type:"button",button:this})},select:function(e){e===t&&(e=!1),this.element.toggleClass(B,e),this.options.selected=e}}),x.toolbar.ToolBarButton=c,u=d.extend({init:function(e,t){this.overflow=!0,d.fn.init.call(this,e,t);var n=this.element;"toolbar"!=e.showText&&e.text&&n.html(e.mobile?'<span class="km-text">'+e.text+"</span>":'<span class="k-text">'+e.text+"</span>"),e.hasIcon="toolbar"!=e.showIcon&&(e.icon||e.spriteCssClass||e.imageUrl),e.hasIcon&&this._addGraphics(),e.isChild||this._wrap(),this.addOverflowIdAttr(),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.enable(e.enable),n.addClass(A+" "+I),e.hidden&&this.hide(),this.element.data({type:"button",button:this})},_wrap:function(){this.element=this.element.wrap("<li></li>").parent()},overflowHidden:function(){this.element.addClass(ce)},select:function(e){e===t&&(e=!1),this.options.isChild?this.element.toggleClass(B,e):this.element.find(".k-button").toggleClass(B,e),this.options.selected=e}}),x.toolbar.OverflowButton=u,x.toolbar.registerComponent("button",c,u),h=l.extend({createButtons:function(t){var n,i,r=this.options,o=r.buttons||[];for(i=0;i<o.length;i++)o[i].uid||(o[i].uid=x.guid()),n=new t(e.extend({mobile:r.mobile,isChild:!0,type:"button"},o[i]),this.toolbar),n.element.appendTo(this.element)},refresh:function(){this.element.children().filter(":not('."+V+"'):first").addClass(W),this.element.children().filter(":not('."+V+"'):last").addClass(U)}}),x.toolbar.ButtonGroup=h,f=h.extend({init:function(t,n){var i=this.element=e("<div></div>");this.options=t,this.toolbar=n,this.addIdAttr(),t.align&&i.addClass("k-align-"+t.align),this.createButtons(c),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.refresh(),i.addClass(z),this.element.data({type:"buttonGroup",buttonGroup:this})}}),x.toolbar.ToolBarButtonGroup=f,p=h.extend({init:function(t,n){var i=this.element=e("<li></li>");this.options=t,this.toolbar=n,this.overflow=!0,this.addOverflowIdAttr(),this.createButtons(u),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.refresh(),i.addClass((t.mobile?"":z)+" k-overflow-group"),this.element.data({type:"buttonGroup",buttonGroup:this})},overflowHidden:function(){this.element.addClass(ce)}}),x.toolbar.OverflowButtonGroup=p,x.toolbar.registerComponent("buttonGroup",f,p),m=l.extend({init:function(t,n){var i=this.element=e('<div class="'+H+'" tabindex="0"></div>');this.options=t,this.toolbar=n,this.mainButton=new c(e.extend({},t,{hidden:!1}),n),this.arrowButton=e('<a class="'+I+" "+Q+'"><span class="'+(t.mobile?"km-icon km-arrowdown":"k-icon k-i-arrow-s")+'"></span></a>'),this.popupElement=e('<ul class="'+K+'"></ul>'),this.mainButton.element.removeAttr("href tabindex").appendTo(i),this.arrowButton.appendTo(i),this.popupElement.appendTo(i),t.align&&i.addClass("k-align-"+t.align),t.id||(t.id=t.uid),i.attr("id",t.id+"_wrapper"),this.addOverflowAttr(),this.addUidAttr(),this.createMenuButtons(),this.createPopup(),this._navigatable(),this.mainButton.main=!0,this.enable(t.enable),t.hidden&&this.hide(),i.data({type:"splitButton",splitButton:this,kendoPopup:this.popup})},_navigatable:function(){var t=this;t.popupElement.on("keydown","."+I,function(n){var i=e(n.target).parent();n.preventDefault(),n.keyCode===E.ESC||n.keyCode===E.TAB||n.altKey&&n.keyCode===E.UP?(t.toggle(),t.focus()):n.keyCode===E.DOWN?a(i,"next").focus():n.keyCode===E.UP?a(i,"prev").focus():n.keyCode!==E.SPACEBAR&&n.keyCode!==E.ENTER||t.toolbar.userEvents.trigger("tap",{target:e(n.target)})})},createMenuButtons:function(){var t,n,i=this.options,r=i.menuButtons;for(n=0;n<r.length;n++)t=new c(e.extend({mobile:i.mobile,type:"button",click:i.click},r[n]),this.toolbar),t.element.wrap("<li></li>").parent().appendTo(this.popupElement)},createPopup:function(){var t=this.options,i=this.element;this.popupElement.attr("id",t.id+"_optionlist").attr(ue,t.rootUid),t.mobile&&(this.popupElement=r(this.popupElement)),this.popup=this.popupElement.kendoPopup({appendTo:t.mobile?e(t.mobile).children(".km-pane"):null,anchor:i,isRtl:this.toolbar._isRtl,copyAnchorStyles:!1,animation:t.animation,open:n,activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(){i.focus()}}).data("kendoPopup"),this.popup.element.on(te,"a.k-button",o)},remove:function(){this.popup.element.off(te,"a.k-button"),this.popup.destroy(),this.element.remove()},toggle:function(){this.popup.toggle()},enable:function(e){e===t&&(e=!0),this.mainButton.enable(e),this.options.enable=e},focus:function(){this.element.focus()},hide:function(){this.popup&&this.popup.close(),this.element.addClass(V).hide(),this.options.hidden=!0},show:function(){this.element.removeClass(V).hide(),this.options.hidden=!1}}),x.toolbar.ToolBarSplitButton=m,g=l.extend({init:function(t,n){var i,r,o=this.element=e('<li class="'+H+'"></li>'),a=t.menuButtons;for(this.options=t,this.toolbar=n,this.overflow=!0,this.mainButton=new u(e.extend({isChild:!0},t)),this.mainButton.element.appendTo(o),r=0;r<a.length;r++)i=new u(e.extend({mobile:t.mobile,isChild:!0},a[r]),this.toolbar),i.element.appendTo(o);this.addUidAttr(),this.addOverflowAttr(),this.mainButton.main=!0,o.data({type:"splitButton",splitButton:this})},overflowHidden:function(){this.element.addClass(ce)}}),x.toolbar.OverflowSplitButton=g,x.toolbar.registerComponent("splitButton",m,g),v=l.extend({init:function(t,n){var i=this.element=e("<div>&nbsp;</div>");this.element=i,this.options=t,this.toolbar=n,this.attributes(),this.addIdAttr(),this.addUidAttr(),this.addOverflowAttr(),i.addClass(N),i.data({type:"separator",separator:this})}}),_=l.extend({init:function(t,n){var i=this.element=e("<li>&nbsp;</li>");this.element=i,this.options=t,this.toolbar=n,this.overflow=!0,this.attributes(),this.addUidAttr(),this.addOverflowIdAttr(),i.addClass(N),i.data({type:"separator",separator:this})},overflowHidden:function(){this.element.addClass(ce)}}),x.toolbar.registerComponent("separator",v,_),b=l.extend({init:function(t,n,i){var r=D(t)?t(n):t;r=r instanceof jQuery?r.wrap("<div></div>").parent():e("<div></div>").html(r),this.element=r,this.options=n,this.options.type="template",this.toolbar=i,this.attributes(),this.addUidAttr(),this.addIdAttr(),this.addOverflowAttr(),r.data({type:"template",template:this})}}),x.toolbar.TemplateItem=b,k=l.extend({init:function(t,n,i){var r=e(D(t)?t(n):t);r=r instanceof jQuery?r.wrap("<li></li>").parent():e("<li></li>").html(r),this.element=r,this.options=n,this.options.type="template",this.toolbar=i,this.overflow=!0,this.attributes(),this.addUidAttr(),this.addOverflowIdAttr(),this.addOverflowAttr(),r.data({type:"template",template:this})},overflowHidden:function(){this.element.addClass(ce)}}),x.toolbar.OverflowTemplateItem=k,w=C.extend({init:function(e){this.name=e,this.buttons=[]},add:function(e){this.buttons[this.buttons.length]=e},remove:function(t){var n=e.inArray(t,this.buttons);this.buttons.splice(n,1)},select:function(e){var t,n;for(n=0;n<this.buttons.length;n++)t=this.buttons[n],t.select(!1);e.select(!0),e.twin()&&e.twin().select(!0)}}),y=T.extend({init:function(t,n){var r,a=this;if(T.fn.init.call(a,t,n),n=a.options,t=a.wrapper=a.element,t.addClass(R+" k-widget"),this.uid=x.guid(),this._isRtl=x.support.isRtl(t),this._groups={},t.attr(ue,this.uid),a.isMobile="boolean"==typeof n.mobile?n.mobile:a.element.closest(".km-root")[0],a.animation=a.isMobile?{open:{effects:"fade"}}:{},a.isMobile&&(t.addClass("km-widget"),j="km-icon",$="km-",I="km-button",z="km-buttongroup km-widget",B="km-state-active",O="km-state-disabled"),n.resizable?(a._renderOverflow(),t.addClass(L),a.overflowUserEvents=new x.UserEvents(a.element,{threshold:5,allowSelection:!0,filter:"."+X,tap:S(a._toggleOverflow,a)}),a._resizeHandler=x.onResize(function(){a.resize()})):a.popup={element:e([])},n.items&&n.items.length)for(r=0;r<n.items.length;r++)a.add(n.items[r]);a.userEvents=new x.UserEvents(document,{threshold:5,allowSelection:!0,filter:"["+ue+"="+this.uid+"] a."+I+", ["+ue+"="+this.uid+"] ."+A,tap:S(a._buttonClick,a),press:i,release:i}),a.element.on(te,"a.k-button",o),a._navigatable(),n.resizable&&a.popup.element.on(te,NaN,o),n.resizable&&this._toggleOverflowAnchor(),x.notify(a)},events:[te,ne,ie,re,oe,ae],options:{name:"ToolBar",items:[],resizable:!0,mobile:null},addToGroup:function(e,t){var n;return n=this._groups[t]?this._groups[t]:this._groups[t]=new w,n.add(e),n},destroy:function(){var t=this;t.element.find("."+H).each(function(t,n){e(n).data("kendoPopup").destroy()}),t.element.off(te,"a.k-button"),t.userEvents.destroy(),t.options.resizable&&(x.unbindResize(t._resizeHandler),t.overflowUserEvents.destroy(),t.popup.element.off(te,"a.k-button"),t.popup.destroy()),T.fn.destroy.call(t)},add:function(t){var n,i,r,o=s[t.type],a=t.template,l=this,d=l.isMobile?"":"k-item k-state-default",c=t.overflowTemplate;if(e.extend(t,{uid:x.guid(),animation:l.animation,mobile:l.isMobile,rootUid:l.uid}),t.menuButtons)for(r=0;r<t.menuButtons.length;r++)e.extend(t.menuButtons[r],{uid:x.guid()});a&&!c?t.overflow=se:t.overflow||(t.overflow=le),t.overflow!==se&&l.options.resizable&&(c?i=new k(c,t,l):o&&(i=new o.overflow(t,l),i.element.addClass(d)),i&&(t.overflow===le&&i.overflowHidden(),i.element.appendTo(l.popup.container),l.angular("compile",function(){return{elements:i.element.get()}}))),t.overflow!==de&&(a?n=new b(a,t,l):o&&(n=new o.toolbar(t,l)),n&&(l.options.resizable?(n.element.appendTo(l.element).css("visibility","hidden"),l._shrink(l.element.innerWidth()),n.element.css("visibility","visible")):n.element.appendTo(l.element),l.angular("compile",function(){return{elements:n.element.get()}})))},_getItem:function(t){var n,i,r,o,a=this.options.resizable;return n=this.element.find(t),n.length||(n=e(".k-split-container[data-uid="+this.uid+"]").find(t)),o=n.length?n.data("type"):"",i=n.data(o),i?(i.main&&(n=n.parent("."+H),o="splitButton",i=n.data(o)),a&&(r=i.twin())):a&&(n=this.popup.element.find(t),o=n.length?n.data("type"):"",r=n.data(o),r&&r.main&&(n=n.parent("."+H),o="splitButton",r=n.data(o))),{type:o,toolbar:i,overflow:r}},remove:function(e){var t=this._getItem(e);t.toolbar&&t.toolbar.remove(),t.overflow&&t.overflow.remove(),this.resize(!0)},hide:function(e){var t=this._getItem(e);t.toolbar&&("button"===t.toolbar.options.type&&t.toolbar.options.isChild?(t.toolbar.hide(),t.toolbar.getParentGroup().refresh()):t.toolbar.options.hidden||t.toolbar.hide()),t.overflow&&("button"===t.overflow.options.type&&t.overflow.options.isChild?(t.overflow.hide(),t.overflow.getParentGroup().refresh()):t.overflow.options.hidden||t.overflow.hide()),this.resize(!0)},show:function(e){var t=this._getItem(e);t.toolbar&&("button"===t.toolbar.options.type&&t.toolbar.options.isChild?(t.toolbar.show(),t.toolbar.getParentGroup().refresh()):t.toolbar.options.hidden&&t.toolbar.show()),t.overflow&&("button"===t.overflow.options.type&&t.overflow.options.isChild?(t.toolbar.show(),t.overflow.getParentGroup().refresh()):t.overflow.options.hidden&&t.overflow.show()),this.resize(!0)},enable:function(e,n){var i=this._getItem(e);t===n&&(n=!0),i.toolbar&&i.toolbar.enable(n),i.overflow&&i.overflow.enable(n)},getSelectedFromGroup:function(e){return this.element.find("."+M+"[data-group='"+e+"']").filter("."+B)},toggle:function(n,i){var r=e(n),o=r.data("button");o.options.togglable&&(i===t&&(i=!0),o.toggle(i,!0))},_renderOverflow:function(){var t=this,n=s.overflowContainer,i=t._isRtl,o=i?"left":"right";t.overflowAnchor=e(s.overflowAnchor).addClass(I),t.element.append(t.overflowAnchor),t.isMobile?(t.overflowAnchor.append('<span class="km-icon km-more"></span>'),n=r(n)):t.overflowAnchor.append('<span class="k-icon k-i-arrow-s"></span>'),t.popup=new x.ui.Popup(n,{origin:"bottom "+o,position:"top "+o,anchor:t.overflowAnchor,isRtl:i,animation:t.animation,appendTo:t.isMobile?e(t.isMobile).children(".km-pane"):null,copyAnchorStyles:!1,open:function(n){var r=x.wrap(t.popup.element).addClass("k-overflow-wrapper");t.isMobile?t.popup.container.css("max-height",parseFloat(e(".km-content:visible").innerHeight())-15+"px"):r.css("margin-left",(i?-1:1)*((F(r)-r.width())/2+1)),t.trigger(oe)&&n.preventDefault()},activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(e){t.trigger(ae)&&e.preventDefault(),this.element.focus();
}}),t.popup.element.on("keydown","."+I,function(n){var i,r=e(n.target),o=r.parent(),s=o.is("."+z)||o.is("."+H);n.preventDefault(),n.keyCode===E.ESC||n.keyCode===E.TAB||n.altKey&&n.keyCode===E.UP?(t._toggleOverflow(),t.overflowAnchor.focus()):n.keyCode===E.DOWN?(i=!s||s&&r.is(":last-child")?o:r,a(i,"next").focus()):n.keyCode===E.UP?(i=!s||s&&r.is(":first-child")?o:r,a(i,"prev").focus()):n.keyCode!==E.SPACEBAR&&n.keyCode!==E.ENTER||t.userEvents.trigger("tap",{target:e(n.target)})}),t.popup.container=t.isMobile?t.popup.element.find("."+J):t.popup.element,t.popup.container.attr(ue,this.uid)},_toggleOverflowAnchor:function(){var e=!1;e=this.options.mobile?this.popup.element.find("."+J).children(":not(."+ce+", ."+P+")").length>0:this.popup.element.children(":not(."+ce+", ."+P+")").length>0,this.overflowAnchor.css(e?{visibility:"visible",width:""}:{visibility:"hidden",width:"1px"})},_buttonClick:function(n){var i,r,o,a,s,l,d,c=this,u=n.target.closest("."+Q).length;return n.preventDefault(),u?(c._toggle(n),t):(r=e(n.target).closest("."+I,c.element),r.hasClass(X)||(o=r.data("button"),!o&&c.popup&&(r=e(n.target).closest("."+A,c.popup.container),o=r.parent("li").data("button")),o&&o.options.enable&&(o.options.togglable?(s=D(o.toggleHandler)?o.toggleHandler:null,o.toggle(!o.options.selected,!0),l={target:r,group:o.options.group,checked:o.options.selected,id:o.options.id},s&&s.call(c,l),c.trigger(ne,l)):(s=D(o.clickHandler)?o.clickHandler:null,l={sender:c,target:r,id:o.options.id},s&&s.call(c,l),c.trigger(te,l)),o.options.url&&(o.options.attributes&&o.options.attributes.target&&(d=o.options.attributes.target),window.open(o.options.url,d||"_self")),r.hasClass(A)&&c.popup.close(),a=r.closest(".k-split-container"),a[0]&&(i=a.data("kendoPopup"),(i?i:a.parents(".km-popup-wrapper").data("kendoPopup")).close()))),t)},_navigatable:function(){var t=this;t.element.attr("tabindex",0).focus(function(){var t=e(this).find(":kendoFocusable:first");t.is("."+X)&&(t=a(t,"next")),t[0].focus()}).on("keydown",S(t._keydown,t))},_keydown:function(n){var i,r,o,a,s,l,d,c=e(n.target),u=n.keyCode,h=this.element.children(":not(.k-separator):visible");return u===E.TAB&&(i=c.parentsUntil(this.element).last(),r=!1,o=!1,i.length||(i=c),i.is("."+X)&&(n.shiftKey&&n.preventDefault(),h.last().is(":kendoFocusable")?h.last().focus():h.last().find(":kendoFocusable").last().focus()),n.shiftKey||h.index(i)!==h.length-1||(r=!i.is("."+z)||c.is(":last-child")),a=h.index(i)===h.not(".k-overflow-anchor").first().index(),n.shiftKey&&a&&(o=!i.is("."+z)||c.is(":first-child")),r&&this.overflowAnchor&&"hidden"!==this.overflowAnchor.css("visibility")&&(n.preventDefault(),this.overflowAnchor.focus()),o&&(n.preventDefault(),s=this._getPrevFocusable(this.wrapper),s&&s.focus())),n.altKey&&u===E.DOWN?(l=e(document.activeElement).data("splitButton"),d=e(document.activeElement).is("."+X),l?l.toggle():d&&this._toggleOverflow(),t):u!==E.SPACEBAR&&u!==E.ENTER||c.is("input, checkbox")?t:(n.preventDefault(),c.is("."+H)&&(c=c.children().first()),this.userEvents.trigger("tap",{target:c}),t)},_getPrevFocusable:function(n){if(n.is("html"))return n;var i,r,o=n.prevAll();return o.each(function(){return r=e(this),r.is(":kendoFocusable")?(i=r,!1):r.find(":kendoFocusable").length>0?(i=r.find(":kendoFocusable").last(),!1):t}),i?i:this._getPrevFocusable(n.parent())},_toggle:function(t){var n,i=e(t.target).closest("."+H).data("splitButton");t.preventDefault(),i.options.enable&&(n=i.popup.element.is(":visible")?this.trigger(re,{target:i.element}):this.trigger(ie,{target:i.element}),n||i.toggle())},_toggleOverflow:function(){this.popup.toggle()},_resize:function(e){var t=e.width;this.options.resizable&&(this.popup.close(),this._shrink(t),this._stretch(t),this._markVisibles(),this._toggleOverflowAnchor())},_childrenWidth:function(){var t=0;return this.element.children(":visible:not('."+V+"')").each(function(){t+=F(e(this),!0)}),Math.ceil(t)},_shrink:function(e){var t,n,i;if(e<this._childrenWidth())for(n=this.element.children(":visible:not([data-overflow='never'], ."+X+")"),i=n.length-1;i>=0&&(t=n.eq(i),!(e>this._childrenWidth()));i--)this._hideItem(t)},_stretch:function(e){var t,n,i;if(e>this._childrenWidth())for(n=this.element.children(":hidden:not('."+V+"')"),i=0;i<n.length&&(t=n.eq(i),!(e<this._childrenWidth())&&this._showItem(t,e));i++);},_hideItem:function(e){e.hide(),this.popup&&this.popup.container.find(">li[data-uid='"+e.data("uid")+"']").removeClass(ce)},_showItem:function(e,t){return!!(e.length&&t>this._childrenWidth()+F(e,!0))&&(e.show(),this.popup&&this.popup.container.find(">li[data-uid='"+e.data("uid")+"']").addClass(ce),!0)},_markVisibles:function(){var e=this.popup.container.children(),t=this.element.children(":not(.k-overflow-anchor)"),n=e.filter(":not(.k-overflow-hidden)"),i=t.filter(":visible");e.add(t).removeClass(Z+" "+ee),n.first().add(i.first()).addClass(Z),n.last().add(i.last()).addClass(ee)}}),x.ui.plugin(y)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.mediaplayer.min",["kendo.slider.min","kendo.toolbar.min","kendo.dropdownlist.min","kendo.tooltip.min"],e)}(function(){return function(e,t){var n=window.kendo,i="end",r="pause",o="play",a="ready",s="timeChange",l="volumeChange",d="k-i-fullscreen-enter",c="k-i-fullscreen-exit",u="k-i-volume-mute",h="k-i-volume-low",f="k-i-volume-high",p="k-mediaplayer-quality",m="k-i-play",g="k-i-pause",v="k-mediaplayer-titlebar",_="k-title",b="k-mediaplayer-toolbar",k="k-mediaplayer-seekbar",w="k-mediaplayer-volume",y="k-mediaplayer-media",x="k-mediaplayer-overlay",C="k-mediaplayer-yt",T=".",S=n.ui,D=".kendoMediaPlayer",E=new Date(1970,0,1),F=60*E.getTimezoneOffset(),R=n.ui.Widget,I=e.isArray,A={shortTime:"mm:ss",longTime:"HH:mm:ss"},M=n.template,z=e.proxy,H=n.keys,N={htmlPlayer:"<video class='"+y+"'> </video>",titleBar:M("<div class='"+v+"' role='heading'><span class='"+_+"'>Video Title</span></div>"),toolBar:"<div class='"+b+"'> </div>",youtubePlayer:"<div class='"+C+"'> </div>",toolBarTime:"<span class='k-mediaplayer-currenttime'>00:00:00</span> / <span class='k-mediaplayer-duration'>00:00:00</span>",slider:"<input class='"+k+"' value='0' title='seekbar' />",volumeSlider:"<input class='"+w+"' title='volume'/>",qualityDropDown:"<input class='"+p+"' title='video quality' />",toolTip:"#= kendo.toString(new Date(value), 'HH:mm:ss') #"},P=R.extend({init:function(t,i){this.wrapper=e(t),R.fn.init.call(this,t,i),this.wrapper.addClass("k-mediaplayer k-widget"),i=this.options,this._currentIndex=0,this._createTitlebar(),this._createToolbar(),this._createDropDown(),this._createSlider(),this._createVolumeSlider(),this._timers={},this._aria(),this._navigatable(),i.media&&this.media(this.options.media),n.notify(this)},events:[i,r,o,a,s,l],options:{name:"MediaPlayer",autoPlay:!1,autoRepeat:!1,volume:100,fullScreen:!1,mute:!1,navigatable:!1,forwardSeek:!0,media:null,messages:{pause:"Pause",play:"Play",mute:"Mute",unmute:"Unmute",quality:"Quality",fullscreen:"Full Screen"}},_msToTime:function(e){var t=new Date(E.getTime());return t.setSeconds(e),t},_timeToSec:function(e){var t=new Date(e).getTime();return t/1e3},_createTitlebar:function(){this._titleBar=this.wrapper.find(T+v),0===this._titleBar.length&&(this._titleBar=this.wrapper.find(T+v),this.wrapper.append(N.titleBar),this._titleBar=this.wrapper.find(T+v))},_createSlider:function(){var e=this.wrapper.find(T+k);this._slider||(this._sliderDragChangeHandler=z(this._sliderDragChange,this),this._sliderDraggingHandler=z(this._sliderDragging,this),e=this.wrapper.find(T+k),this._slider=new S.Slider(e[0],{smallStep:1e3,tickPlacement:"none",showButtons:!1,change:this._sliderDragChangeHandler,slide:this._sliderDraggingHandler,tooltip:{template:N.toolTip},dragHandleTitle:""}))},_createVolumeSlider:function(){var t=this.wrapper.find(T+w);this._volumeSlider||(this._volumeDraggingHandler=z(this._volumeDragging,this),this._volumeChangeHandler=z(this._volumeChange,this),t=e(T+w),t.width(87),this._volumeSlider=new S.Slider(t[0],{smallStep:1,min:0,max:100,value:this.options.volume,slide:this._volumeDraggingHandler,change:this._volumeChangeHandler,tickPlacement:"none",showButtons:!1,tooltip:{enabled:!1},dragHandleTitle:""}))},_resetTime:function(){this._youTubeVideo?this._ytmedia.seekTo(0,!0):this._media.currentTime=0,this._mediaTimeUpdate(),e.grep(this._toolBar.options.items,function(e){return!!e.template}).template=N.toolBarTime},_currentUrl:function(){var e=this.media();return I(e.source)?e.source[this._currentIndex].url:e.source},_isYouTubeUrl:function(){return!!this._currentUrl().match("youtube.com/|youtu.be/")},_setPlayerUrl:function(){var e,t=this._youTubeVideo;this.stop(),this._youTubeVideo=this._isYouTubeUrl(),t!==this._youTubeVideo&&(this.wrapper.find(T+C).toggle(),this.wrapper.find(T+y).toggle()),e=this._media||this._ytmedia,this._initializePlayer(),e&&(this.mute(this.mute()),this.volume(this.volume())),this._youTubeVideo?this._ytmedia&&(this._videoOverlay&&this._videoOverlay.hide(),this.options.autoPlay?(this._ytmedia.loadVideoById(this._getMediaId()),this._playStateToggle(!0)):(this._ytmedia.cueVideoById(this._getMediaId()),this._playStateToggle(!0))):(this._videoOverlay.show(),this.wrapper.find(T+y+" > source").remove(),this.wrapper.find(T+y).attr("src",this._currentUrl()),this.options.autoPlay&&this.play())},_createToolbar:function(){var t,n,i=this.wrapper.find(T+b);0===i.length&&(this._toolbarClickHandler=z(this._toolbarClick,this),this.wrapper.append(N.toolBar),i=e(T+b),i.width(e(T+y).width()),this._toolBar=new S.ToolBar(i,{click:this._toolbarClickHandler,resizable:!1,items:[{template:N.slider},{type:"button",spriteCssClass:"k-icon k-font-icon k-i-play"},{template:N.toolBarTime},{type:"button",spriteCssClass:"k-icon k-font-icon k-i-volume-high"},{template:N.volumeSlider},{template:N.qualityDropDown},{type:"button",spriteCssClass:"k-icon k-font-icon k-i-fullscreen-enter"}]}),t=i.find('span[class*="k-i-volume"]'),this._volumeButton=t.parent("a"),n=i.find('span[class*="k-i-fullscreen"]'),this._fullscreenButton=n.parent("a"),this._volumeButton.attr("title",this.options.mute?this.options.messages.unmute:this.options.messages.mute),this._volumeButton.attr("aria-label",this.options.mute?this.options.messages.unmute:this.options.messages.mute),this._fullscreenButton.attr("title",this.options.messages.fullscreen),this._fullscreenButton.attr("aria-label",this.options.messages.fullscreen),i.width("auto"),this._currentTimeElement=i.find(".k-mediaplayer-currenttime"),this._durationElement=i.find(".k-mediaplayer-duration"),this._playButtonSpan=i.find('span[class*="k-i-play"]'),this._playButton=this._playButtonSpan.parent("a"),this.options.autoPlay&&this._playStateToggle(!0),e([this._volumeButton[0],i.find(".k-mediaplayer-volume").parent()[0],i.find(".k-mediaplayer-quality").parent()[0],this._fullscreenButton[0]]).wrapAll("<div class='k-align-right' />"),e(".k-button",i).addClass("k-button-bare"))},_createDropDown:function(){var e=this.wrapper.find(T+p),n=this.media();t===e.data("kendoDropDownList")&&(this._dropDownSelectHandler=z(this._dropDownSelect,this),this._dropDown=new S.DropDownList(e,{dataTextField:"quality",dataValueField:"url",popup:{position:"bottom",origin:"top",appendTo:this.wrapper},animation:{open:{effects:"slideIn:up",duration:1}},select:this._dropDownSelectHandler}),n&&I(n.source)&&(this._dropDown.setDataSource(n.source),this._dropDown.select(0)),this._dropDown.wrapper.addClass("k-button k-button-bare"),this._dropDown.wrapper.attr("title",this.options.messages.quality).hide(),this._dropDown.wrapper.find("span.k-i-arrow-s").removeClass("k-i-arrow-s").addClass("k-font-icon k-i-HD"),this._dropDown.list.addClass("k-quality-list"))},_dropDownSelect:function(e){this._currentIndex!==e.item.index()&&(this._currentIndex=e.item.index(),this._setPlayerUrl())},_toolbarClick:function(t){var n,i=e(t.target).children().first(),r=i.hasClass(m);this.media()&&((i.hasClass(m)||i.hasClass(g))&&(r?this.play():this.pause()),(i.hasClass(d)||i.hasClass(c))&&(this._isInFullScreen?(i.removeClass(c).addClass(d),this.fullScreen(!1)):(i.removeClass(d).addClass(c),this.fullScreen(!0))),(i.hasClass(u)||i.hasClass(h)||i.hasClass(f))&&(n=this.mute(),this.mute(!n)))},_sliderDragging:function(){this.media()&&(this._isDragging=!0)},_sliderDragChange:function(e){var t=this,n=e.sender,i=1e3*F;this.media()&&(t._sliderChangeFired=!0,t._isDragging=!1,!this.options.forwardSeek&&n.value()>this._seekBarLastPosition?setTimeout(function(){n.value(t._seekBarLastPosition)},1):this._youTubeVideo?t._ytmedia.seekTo(t._timeToSec(e.value-i)):t._media.currentTime=t._timeToSec(e.value-i),t.trigger(s),t._preventPlay=!0)},_changeVolumeButtonImage:function(e){var t=this._volumeButton,n=t.find("span"),i=n.attr("class");i=i.substring(0,i.lastIndexOf(" ")),0===e?(n.attr("class",i+" "+u),t.attr("title",this.options.messages.unmute),t.attr("aria-label",this.options.messages.unmute)):e>0&&e<51?(n.attr("class",i+" "+h),t.attr("title",this.options.messages.mute),t.attr("aria-label",this.options.messages.mute)):(n.attr("class",i+" "+f),t.attr("title",this.options.messages.mute),t.attr("aria-label",this.options.messages.mute))},_volumeDragging:function(e){this.media()&&(this.volume(e.value),this._changeVolumeButtonImage(e.value),this.trigger(l))},_volumeChange:function(e){this.media()&&(this.volume(e.value),this._changeVolumeButtonImage(e.value),this.trigger(l))},_mediaTimeUpdate:function(){var e=this._youTubeVideo?this._ytmedia.getCurrentTime():this._media.currentTime,t=this._msToTime(e);return this._currentTimeElement.text(n.toString(t,this._timeFormat)),this._isDragging||(this._seekBarLastPosition=1e3*(e+F),this._slider.value(this._seekBarLastPosition)),this.isPlaying()},_playStateToggle:function(e){t===e&&(e=this._playButtonSpan.is(T+m)),e?(this._playButtonSpan.removeClass(m).addClass(g),this._playButton.attr("title",this.options.messages.pause),this._playButton.attr("aria-label",this.options.messages.pause)):(this._playButtonSpan.removeClass(g).addClass(m),this._playButton.attr("title",this.options.messages.play),this._playButton.attr("aria-label",this.options.messages.play))},_mediaEnded:function(){this._playStateToggle(!1),this._currentTimeElement.text(n.toString(this._msToTime(0),this._timeFormat)),this._slider.value(1e3*(0+F)),this.trigger(i)},_mediaPlay:function(){this.trigger(o)},_mediaReady:function(){this.trigger(a)},_mediaDurationChange:function(){var e=this._msToTime(this._youTubeVideo?this._ytmedia.getDuration():this._media.duration);this._timeFormat=0===e.getHours()?A.shortTime:A.longTime,this._durationElement.text(n.toString(e,this._timeFormat)),this._slider.setOptions({min:E.getTime(),max:e.getTime()}),this._slider._distance=Math.round(this._slider.options.max-this._slider.options.min),this._slider._resize(),this._isFirstRun||(this._resetTime(),this._isFirstRun=!0)},_createYoutubePlayer:function(){this._mediaTimeUpdateHandler=z(this._mediaTimeUpdate,this),this._mediaDurationChangeHandler=z(this._mediaDurationChange,this),this.wrapper.prepend(N.youtubePlayer),this._ytPlayer=this.wrapper.find(T+C)[0],e(this._ytPlayer).css({width:this.wrapper.width(),height:this.wrapper.height()}),window.YT&&window.YT.Player?this._configurePlayer():(e.getScript("https://www.youtube.com/iframe_api"),this._youtubeApiReadyHandler=z(this._youtubeApiReady,this),window.onYouTubeIframeAPIReady=this._youtubeApiReadyHandler)},_poll:function(e,t,n,i){var r=this;return null!==r._timers[e]&&clearTimeout(r._timers[e]),r._timers[e]=setTimeout(function(i){return function o(){t.call(i)&&(r._timers[e]=setTimeout(o,n))}}(i),n)},_youtubeApiReady:function(){this._configurePlayer()},_configurePlayer:function(){var e,t={autoplay:+this.options.autoPlay,wmode:"transparent",controls:0,rel:0,showinfo:0};this._onYouTubePlayerReady=z(this._onYouTubePlayerReady,this),window.onYouTubePlayerReady=this._onYouTubePlayerReady,this._onPlayerStateChangeHandler=z(this._onPlayerStateChange,this),window.onPlayerStateChange=this._onPlayerStateChange,e=new window.YT.Player(this.wrapper.find(T+C)[0],{height:this.wrapper.height(),width:this.wrapper.width(),videoId:this._getMediaId(),playerVars:t,events:{onReady:this._onYouTubePlayerReady,onStateChange:this._onPlayerStateChangeHandler}})},_onYouTubePlayerReady:function(e){this._ytmedia=e.target,this._ytmedia.getIframe().style.width="100%",this._ytmedia.getIframe().style.height="100%",this._youTubeVideo=!0,this._mediaDurationChangeHandler(),this.options.autoPlay?(this._playStateToggle(!0),this._ytmedia.loadVideoById(this._getMediaId())):this._ytmedia.cueVideoById(this._getMediaId()),this.options.mute&&this.mute(!0),this.trigger(a)},_updateTitle:function(){this.titlebar().text(this.media().title||this.media().source)},_onPlayerStateChange:function(e){0===e.data?(this._slider.value(0),this._paused=!1,this._playStateToggle(!0),this.trigger(i),this.options.autoRepeat&&this.play()):1===e.data?(this._ytmedia.setVolume(this.volume()),this._sliderChangeFired?this._sliderChangeFired=!1:this._uiDisplay(!1),this.trigger(o),this._playStateToggle(!0),this._poll("progress",this._mediaTimeUpdate,500,this),this._paused=!1):2===e.data&&(this._paused||(this._uiDisplay(!0),this._playStateToggle(!1),this.trigger(r),this._paused=!0))},_getMediaId:function(){var e=this._currentUrl(),t=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,n=e.match(t);return n&&11===n[7].length&&(e=n[7]),e},_mouseClick:function(){this.isPaused()?this.play():this.pause()},_initializePlayer:function(){this._mouseMoveHandler||(this._mouseMoveHandler=z(this._mouseMove,this),this._mouseInHandler=z(this._mouseIn,this),this._mouseOutHandler=z(this._mouseOut,this),e(this.wrapper).on("mouseenter"+D,this._mouseInHandler).on("mouseleave"+D,this._mouseOutHandler).on("mousemove"+D,this._mouseMoveHandler)),!this._ytmedia&&this._youTubeVideo?this._createYoutubePlayer():this._media||this._youTubeVideo||this._createHtmlPlayer()},_createHtmlPlayer:function(){this._videoOverlay||(this._mouseClickHanlder=z(this._mouseClick,this),this.wrapper.append("<div class='"+x+"'></div>"),this._videoOverlay=this.wrapper.find(".k-mediaplayer-overlay").on("click"+D,this._mouseClickHanlder)),this._mediaTimeUpdateHandler=z(this._mediaTimeUpdate,this),this._mediaDurationChangeHandler=z(this._mediaDurationChange,this),this._mediaEndedHandler=z(this._mediaEnded,this),this._mediaCanPlayHandler=z(this._mediaReady,this),this._mediaPlayHandler=z(this._mediaPlay,this),this._videoOverlay.after(N.htmlPlayer),this._media=this.wrapper.find(T+y)[0],e(this._media).css({width:"100%",height:"100%"}),this.options.mute&&this.mute(!0),this._media.ontimeupdate=this._mediaTimeUpdateHandler,this._media.ondurationchange=this._mediaDurationChangeHandler,this._media.oncanplay=this._mediaCanPlayHandler,this._media.onplay=this._mediaPlayHandler,this._media.onended=this._mediaEndedHandler},_mouseIn:function(){this._uiDisplay(!0)},_mouseOut:function(){this._poll("mouseIdle",this._mouseIdle,3e3,this)},_mouseIdle:function(){return this._uiDisplay(!1),!1},_mouseMove:function(){this._titleBar.is(":animated")||this._toolBar.element.is(":animated")||this._slider.wrapper.is(":animated")||this._uiDisplay(!0),this._poll("mouseIdle",this._mouseIdle,3e3,this)},_uiDisplay:function(e){var t="slow",n=this._titleBar.add(this._toolBar.element).add(this._slider.wrapper);e?n.fadeIn(t):n.fadeOut(t)},setOptions:function(e){R.fn.setOptions.call(this,e)},destroy:function(){R.fn.destroy.call(this),this.isPaused()||this.pause(),this.element.off(D),this.element.find(T+x).off(D),this._timers=null,this._mouseMoveHandler=null,this._mouseOutHandler=null,this._mouseInHandler=null,this._mouseClickHanlder=null,this._keyDownHandler=null,this._fullscreenHandler=null,this._toolbarClickHandler=null,this._sliderDragChangeHandler=null,this._sliderDraggingHandler=null,this._volumeDraggingHandler=null,this._volumeChangeHandler=null,this._youtubeApiReadyHandler=null,this._onYouTubePlayerReady=null,this._onPlayerStateChangeHandler=null,this._dropDownSelectHandler=null,this._media.ontimeupdate=this._mediaTimeUpdateHandler=null,this._media.ondurationchange=this._mediaDurationChangeHandler=null,this._media.oncanplay=this._mediaCanPlayHandler=null,this._media.onplay=this._mediaPlayHandler=null,this._media.onended=this._mediaEndedHandler=null,this._youTubeVideo?this._ytmedia.destroy():(this._media.src="",this._media.remove()),this._mouseMoveTimer=null,clearTimeout(this._mouseMoveTimer),n.destroy(this.element)},seek:function(e){if(t===e)return 1e3*this._youTubeVideo?this._ytmedia.getCurrentTime():this._media?this._media.currentTime:0;var n=e/1e3;return this._youTubeVideo?n+3>=this._ytmedia.getDuration()|0?this._ytmedia.seekTo(this._ytmedia.getDuration()-3|0,!0):this._ytmedia.seekTo(n,!0):this._media.currentTime=n,this},play:function(){return this._youTubeVideo?this._ytmedia.playVideo():(this._uiDisplay(!1),this._media.play()),this._paused=!1,this._playStateToggle(!0),this},stop:function(){return this._youTubeVideo&&this._ytmedia?this._ytmedia.stopVideo():this._media&&!this._youTubeVideo&&(this._uiDisplay(!0),this._media.pause(),this._media.currentTime=0),this._paused=!0,this._playStateToggle(!1),this},pause:function(){return this._youTubeVideo?this._ytmedia.pauseVideo():(this._uiDisplay(!0),this._media.pause()),this._paused=!0,this._playStateToggle(!1),this.trigger(r),this},toolbar:function(){return this._toolBar},dropdown:function(){return this._dropDown},titlebar:function(){return this._titleBar},fullScreen:function(e){if(t===e)return this._isInFullScreen||!1;var n=this.element.get(0);e?(this._width=this.element.width(),this._height=this.element.height(),this.element.width("100%").height("100%").css({position:"fixed",top:0,left:0}),n.requestFullscreen?n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen&&n.msRequestFullscreen(),this._isInFullScreen=!0):(document.cancelFullscreen?document.cancelFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msCancelFullscreen?document.msCancelFullscreen():document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),this.element.css({position:"relative",top:null,left:null}),this.element.width(this._width),this.element.height(this._height),this._isInFullScreen=!1)},volume:function(e){return t===e?t!==this._volume?this._volume:this._volume=this.options.volume:(this._volume=e,this.mute(e<=0),this._youTubeVideo?this._ytmedia.setVolume(this._volume):this._media.volume=this._volume/100,this._volumeSlider.value(e),t)},mute:function(e){return t===e?this._youTubeVideo?this._ytmedia&&this._ytmedia.isMuted():this._media&&this._media.muted:(this._youTubeVideo?e?this._ytmedia.mute():this._ytmedia.unMute():this._media.muted=e,this._volumeSlider.value(e?0:this._media&&100*this._media.volume||this._ytmedia&&this._ytmedia.getVolume()),this.trigger(l),this._changeVolumeButtonImage(this._volumeSlider.value()),t)},isEnded:function(){return this._youTubeVideo?0===this._ytmedia.getPlayerState():this._media.ended},media:function(e){var n=this.dropdown();return t===e?t!==this._mediaData?this._mediaData:this._mediaData=this.options.media:(I(e.source)?(n.setDataSource(e.source),n.wrapper.show()):n.wrapper.hide(),this._mediaData=e,this._updateTitle(),this._setPlayerUrl(),t)},isPaused:function(){return this._paused},isPlaying:function(){return!this.isEnded()&&!this._paused},_aria:function(){this.wrapper.attr("role","region")},_navigatable:function(){this._fullscreenHandler=z(this._fullscreen,this),e(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange"+D,this._fullscreenHandler),this.options.navigatable&&(this.wrapper.attr("tabIndex",0),this._keyDownHandler=z(this._keyDown,this),this.wrapper.on("keydown"+D,this._keyDownHandler)),this._fullscreenHandler=z(this._fullscreen,this),e(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange"+D,this._fullscreenHandler)},_fullscreen:function(){var e=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;this._uiDisplay(!0),this._slider.resize(),e||(this.wrapper.find('span[class*="k-i-fullscreen"]').removeClass(c).addClass(d),this.fullScreen(!1))},_keyDown:function(e){if(e.preventDefault(),e.keyCode===H.SPACEBAR&&(this.isPlaying()?this.pause():this.play()),e.keyCode===H.ENTER&&(this.wrapper.find('span[class*="k-i-fullscreen"]').removeClass(d).addClass(c),this.fullScreen(!0)),77===e.keyCode){var t=this.mute();this.mute(!t)}},_error:function(){},_progress:function(){}});S.plugin(P)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.pivotgrid.min",["kendo.dom.min","kendo.data.min"],e)}(function(){return function(e,t){function n(e){var n="string"==typeof e?[{name:e}]:e,i="[object Array]"===ke.call(n)?n:n!==t?[n]:[];return ye(i,function(e){return"string"==typeof e?{name:e}:{name:e.name,type:e.type}})}function i(e){var n="string"==typeof e?[{name:[e],expand:!1}]:e,i="[object Array]"===ke.call(n)?n:n!==t?[n]:[];return ye(i,function(e){return"string"==typeof e?{name:[e],expand:!1}:{name:"[object Array]"===ke.call(e.name)?e.name.slice():[e.name],expand:e.expand}})}function r(e){return e.indexOf(" ")!==-1&&(e='["'+e+'"]'),e}function o(e,t,n,i){var r,a,s,l;if(n||(n=t),i||(i=0),l=n.members[i],l&&!l.measure){if(s=l.children,a=s.length,n===t?e[fe.stringify([l.name])]=!!a:a&&(e[fe.stringify(se(n,i))]=!0),a)for(r=0;r<a;r++)o(e,t,s[r],i);o(e,t,n,i+1)}}function a(t){var n,i,r={};t.length&&o(r,t[0]),n=[];for(i in r)n.push({name:e.parseJSON(i),expand:r[i]});return n}function s(e,t){var n,i,r,o,a=t.tuples||[],s=a[0];if(s&&e.length<s.members.length)for(n=s.members,i=0;i<n.length;i++)if(!n[i].measure){for(r=!1,o=0;o<e.length;o++)if(0===L(e[o]).indexOf(n[i].hierarchy)){r=!0;break}r||e.push({name:[n[i].name],expand:!1})}}function l(e){var t,n=[],i=e.members;for(t=0;t<i.length;t++)i[t].measure||n.push({name:[i[t].name],expand:i[t].children.length>0});return n}function d(e,t,n){var r,o;return e=e||{},s(t,e),n.length>1&&t.push({name:De,measure:!0,children:i(n)}),r={members:t},e.tuples&&(o=x(e.tuples,r),o.tuple&&(t=l(o.tuple))),t}function c(e){var t=fe.getter(e.field,!0);return function(n,i){return e.aggregate(t(n.dataItem),i,n)}}function u(e){return"number"==typeof e&&!isNaN(e)}function h(e){return e&&e.getTime}function f(e){return e[e.length]={value:"",fmtValue:"",ordinal:e.length},e}function p(e,t,n){if(e.tuples.length<_(t.tuples,n))return t}function m(e,t,n,i,r){var o,a,s,l=e.length,d=_(t,i),c=i.length||1;for(a=0;a<n;a++)for(o=0;o<l;o++)s=v(e[o],t)*c,s+=o%c,r[a*l+o].ordinal=a*d+s}function g(e,t,n,i,r){var o,a,s,l=e.length,d=i.length||1;for(a=0;a<l;a++)for(s=v(e[a],t),s*=d,s+=a%d,o=0;o<n;o++)r[a*n+o].ordinal=s*n+o}function v(e,t){return x(t,e).index}function _(e,t){var n,i,r;if(!e.length)return 0;for(n=e.slice(),i=n.shift(),r=1;i;)i.members?[].push.apply(n,i.members):i.children&&(i.measure||(r+=i.children.length),[].push.apply(n,i.children)),i=n.shift();return t.length&&(r*=t.length),r}function b(e){return e||(e={tuples:[]}),e.tuples||(e.tuples=[]),e}function k(e,t,n){var i,r,o,a;if(!e)return 0;for(i=Math.max(n.length,1),r=e.members.slice(0,t),o=i,a=r.shift(),i>1&&(i+=1);a;)a.name===De?o+=i:a.children?[].push.apply(r,a.children):(o++,[].push.apply(r,a.members)),a=r.shift();return o}function w(e,t,n){var i,r,o,a,s,l;if(!t[0])return{parsedRoot:null,tuples:e,memberIndex:0,index:0};if(i=x(e,t[0]),!i.tuple)return{parsedRoot:null,tuples:t,memberIndex:0,index:0};if(r=i.tuple.members,o=t[0].members,a=-1,r.length!==o.length)return{parsedRoot:null,tuples:t,memberIndex:0,index:0};for(s=0,l=r.length;s<l;s++)!r[s].measure&&o[s].children[0]&&(a==-1&&o[s].children.length&&(a=s),r[s].children=o[s].children);return n=Math.max(n.length,1),{parsedRoot:i.tuple,index:i.index*n,memberIndex:a,tuples:e}}function y(e,t){var n,i,r=!0;for(e=e.members,t=t.members,n=0,i=e.length;n<i;n++)e[n].measure||t[n].measure||(r=r&&L(e[n])===L(t[n]));return r}function x(e,t){var n,i,r,o,a,s,l,d=0;for(n=0,i=e.length;n<i;n++){if(r=e[n],y(r,t))return{tuple:r,index:d};for(d++,a=0,s=r.members.length;a<s;a++)if(l=r.members[a],!l.measure&&(o=x(l.children,t),d+=o.index,o.tuple))return{tuple:o.tuple,index:d}}return{index:d}}function C(e,t){var n,i,r,o="";for(i=0,r=e.length;i<r;i++)n=e[i],o+=n.name,t[o]||(t[o]=n)}function T(e,t){var n,i,r,o,a=e.members,s="",l="";for(n=0,i=a.length;n<i;n++){if(r=a[n],o){if(t[s+r.name]){s+=r.name,o=t[s];continue}return t[s+r.parentName]?t[s+r.parentName]:t[l+r.parentName]?t[l+r.parentName]:t[l]}if(s+=r.name,o=t[r.parentName],!o&&(o=t[s],!o))return null;o&&(l+=o.name)}return o}function S(e,t){var n,i,r,o;if(0===t.length)return-1;for(n=t[0],i=e.members,r=0,o=i.length;r<o;r++)if(i[r].name==n.name)return r}function D(n,i){if(!(i<0)){var r={name:De,measure:!0,children:[e.extend({members:[],dataIndex:n.dataIndex},n.members[i])]};n.members.splice(i,1,r),n.dataIndex=t}}function E(e,t){var n,i,r,o,a,s;if(e.length<1)return[];for(n=[],i={},r=S(e[0],t),o=0;o<e.length;o++)a=e[o],a.dataIndex=o,D(a,r),s=T(a,i),s?s.children.push(r<0||!s.measure?a:a.members[r].children[0]):n.push(a),C(a.members,i);return n}function F(e,t){var n,i,r,o,a,s,l,d,c;if(!e||!e.length)return t;for(n=[],i=I(e),r=i.length,o=Math.max(t.length/r,1),a=0;a<r;a++)for(l=o*a,d=o*i[a],s=0;s<o;s++)c=parseInt(d+s,10),n[parseInt(l+s,10)]=t[c]||{value:"",fmtValue:"",ordinal:c};return n}function R(e,t){var n,i,r,o,a,s,l,d;if(!e||!e.length)return t;for(n=[],i=I(e),r=i.length,o=Math.max(t.length/r,1),s=0;s<o;s++)for(l=r*s,a=0;a<r;a++)d=i[a]+l,n[l+a]=t[d]||{value:"",fmtValue:"",ordinal:d};return n}function I(e){var n,i,r,o,a,s,l;for(e=e.slice(),n=[],i=e.shift();i;){for(i.dataIndex!==t&&n.push(i.dataIndex),a=0,r=0,o=i.members.length;r<o;r++)l=i.members[r],s=l.children,l.measure?[].splice.apply(e,[0,0].concat(s)):[].splice.apply(e,[a,0].concat(s)),a+=s.length;i=e.shift()}return n}function A(e){var t=e.split(".");return t.length>2?t[0]+"."+t[1]:e}function M(e,t){var n=e.length-1,i=e[n],r=z(t,i);return r&&r.dir?i="ORDER("+i+".Children,"+r.field+".CurrentMember.MEMBER_CAPTION,"+r.dir+")":i+=".Children",e[n]=i,e}function z(e,t){for(var n=0,i=e.length;n<i;n++)if(0===t.indexOf(e[n].field))return e[n];return null}function H(e){var t,n="CROSSJOIN({";return e.length>2?(t=e.pop(),n+=H(e)):(n+=e.shift(),t=e.pop()),n+="},{",n+=t,n+="})"}function N(e,t){var n=e.slice(0);return t.length>1&&n.push("{"+P(t).join(",")+"}"),H(n)}function P(e){for(var n,i=0,r=e.length,o=[];i<r;i++)n=e[i],o.push(n.name!==t?n.name:n);return o}function L(e){return e=e.name||e,"[object Array]"===ke.call(e)&&(e=e[e.length-1]),e}function B(e){for(var t=e.length,n=[],i=0;i<t;i++)n.push(e[i].name[0]);return n}function O(e,t){var n,i,r,o=0,a=e.length,s=t.length;for(t=t.slice(0);o<a;o++)for(n=e[o],r=0;r<s;r++)if(i=A(t[r]),n.indexOf(i)!==-1){t[r]=n;break}return{names:t,expandedIdx:r,uniquePath:t.slice(0,r+1).join("")}}function V(e){for(var t,n,i,r,o,a,s=[],l=[],d=[],c=0,u=e.length;c<u;c++)if(t=e[c],r=t.name,a=!1,"[object Array]"!==ke.call(r)&&(t.name=r=[r]),r.length>1)l.push(t);else{for(o=A(r[0]),n=0,i=d.length;n<i;n++)if(0===d[n].name[0].indexOf(o)){a=!0;break}a||d.push(t),t.expand&&s.push(t)}return s=s.concat(l),{root:d,expanded:s}}function W(e,t,n){var i,r,o,a,s,l,d,c,u="";if(e=e||[],i=V(e),r=i.root,o=B(r),a=[],i=i.expanded,s=i.length,l=0,c=[],o.length>1||t.length>1){for(a.push(N(o,t));l<s;l++)d=M(i[l].name,n),c=O(d,o).names,a.push(N(c,t));u+=a.join(",")}else{for(;l<s;l++)d=M(i[l].name,n),c.push(d[0]);u+=o.concat(c).join(",")}return u}function U(e){var t="",n=e.value,i=e.field,r=e.operator;return"in"==r?(t+="{",t+=n,t+="}"):(t+="Filter(",t+=i+".MEMBERS",t+=fe.format(Y[r],i,n),t+=")"),t}function q(e,t){var n,i,r="",o=e.filters,a=o.length;for(i=a-1;i>=0;i--)n="SELECT (",n+=U(o[i]),n+=") ON 0",i==a-1?(n+=" FROM ["+t+"]",r=n):r=n+" FROM ( "+r+" )";
return r}function j(e,t,n){var i,r,o="";if(t){o+="<"+e+">";for(r in t)i=t[r],n&&(r=r.replace(/([A-Z]+(?=$|[A-Z][a-z])|[A-Z]?[a-z]+)/g,"$1_").toUpperCase().replace(/_$/,"")),o+="<"+r+">"+i+"</"+r+">";o+="</"+e+">"}else o+="<"+e+"/>";return o}function $(e){if(null==e)return[];var t=ke.call(e);return"[object Array]"!==t?[e]:e}function G(e){var t,n,i,r,o={tuples:[]},a=$(fe.getter("Tuples.Tuple",!0)(e)),s=fe.getter("Caption['#text']"),l=fe.getter("UName['#text']"),d=fe.getter("LName['#text']"),c=fe.getter("LNum['#text']"),u=fe.getter("CHILDREN_CARDINALITY['#text']",!0),h=fe.getter("['@Hierarchy']"),f=fe.getter("PARENT_UNIQUE_NAME['#text']",!0);for(t=0;t<a.length;t++){for(n=[],i=$(a[t].Member),r=0;r<i.length;r++)n.push({children:[],caption:s(i[r]),name:l(i[r]),levelName:d(i[r]),levelNum:c(i[r]),hasChildren:parseInt(u(i[r]),10)>0,parentName:f(i[r]),hierarchy:h(i[r])});o.tuples.push({members:n})}return o}var Y,K,Q,X,J,Z,ee,te,ne,ie,re,oe,ae,se,le,de,ce,ue,he,fe=window.kendo,pe=fe.ui,me=fe.Class,ge=pe.Widget,ve=fe.data.DataSource,_e=fe._outerWidth,be=fe._outerHeight,ke={}.toString,we=function(e){return e},ye=e.map,xe=e.extend,Ce=fe.isFunction,Te="change",Se="error",De="Measures",Ee="progress",Fe="stateReset",Re="auto",Ie="<div/>",Ae=".kendoPivotGrid",Me="__row_total__",ze="dataBinding",He="dataBound",Ne="expandMember",Pe="collapseMember",Le="k-i-arrow-s",Be="k-i-arrow-e",Oe="<span>#: data.member.caption || data.member.name #</span>",Ve='<span class="k-icon k-i-kpi-#=data.dataItem.value > 0 ? "open" : data.dataItem.value < 0 ? "denied" : "hold"#">#:data.dataItem.value#</span>',We='<span class="k-icon k-i-kpi-#=data.dataItem.value > 0 ? "increase" : data.dataItem.value < 0 ? "decrease" : "equal"#">#:data.dataItem.value#</span>',Ue='#= data.dataItem ? kendo.htmlEncode(data.dataItem.fmtValue || data.dataItem.value) || "&nbsp;" : "&nbsp;" #',qe='<table class="k-pivot-layout"><tr><td><div class="k-pivot-rowheaders"></div></td><td><div class="k-pivot-table k-state-default"></div></td></tr></table>',je={sum:function(e,t){var n=t.accumulator;return u(n)?u(e)&&(n+=e):n=e,n},count:function(e,t){return(t.accumulator||0)+1},average:{aggregate:function(e,n){var i=n.accumulator;return n.count===t&&(n.count=0),u(i)?u(e)&&(i+=e):i=e,u(e)&&n.count++,i},result:function(e){var t=e.accumulator;return u(t)&&(t/=e.count),t}},max:function(e,t){var n=t.accumulator;return u(n)||h(n)||(n=e),n<e&&(u(e)||h(e))&&(n=e),n},min:function(e,t){var n=t.accumulator;return u(n)||h(n)||(n=e),n>e&&(u(e)||h(e))&&(n=e),n}},$e=me.extend({init:function(e){this.options=xe({},this.options,e),this.dimensions=this._normalizeDescriptors("field",this.options.dimensions),this.measures=this._normalizeDescriptors("name",this.options.measures)},_normalizeDescriptors:function(e,t){var n,i,r,o;if(t=t||{},n={},"[object Array]"===ke.call(t)){for(r=0,o=t.length;r<o;r++)i=t[r],"string"==typeof i?n[i]={}:i[e]&&(n[i[e]]=i);t=n}return t},_rootTuples:function(e,n){var i,r,o,a,s=n.length||1,l=this.dimensions||[],d=0,c=e.length,u=[],h=[];if(c||n.length){for(d=0;d<s;d++){for(i={members:[]},a=0;a<c;a++)r=e[a],o=r.split("&"),i.members[i.members.length]={children:[],caption:(l[r]||{}).caption||"All",name:r,levelName:r,levelNum:"0",hasChildren:!0,parentName:o.length>1?o[0]:t,hierarchy:r};s>1&&(i.members[i.members.length]={children:[],caption:n[d].caption,name:n[d].descriptor.name,levelName:"MEASURES",levelNum:"0",hasChildren:!1,parentName:t,hierarchy:"MEASURES"}),u[u.length]=i}h.push(Me)}return{keys:h,tuples:u}},_expandedTuples:function(e,n,i){var r,o,a,s,l,d,c,u,h,f,p,m=i.length||1,g=this.dimensions||[],v=[],_=[];for(a in e){for(s=e[a],c=this._findExpandedMember(n,s.uniquePath),l=v[c.index]||[],d=_[c.index]||[],u=c.member.names,r=0;r<m;r++){for(o={members:[]},p=0;p<u.length;p++)p===c.member.expandedIdx?(o.members[o.members.length]={children:[],caption:s.value,name:s.name,hasChildren:!1,levelNum:1,levelName:s.parentName+s.name,parentName:s.parentName,hierarchy:s.parentName+s.name},0===r&&d.push(se(o,p).join(""))):(f=u[p],h=f.split("&"),o.members[o.members.length]={children:[],caption:(g[f]||{}).caption||"All",name:f,levelName:f,levelNum:"0",hasChildren:!0,parentName:h.length>1?h[0]:t,hierarchy:f});m>1&&(o.members[o.members.length]={children:[],caption:i[r].caption,name:i[r].descriptor.name,levelName:"MEASURES",levelNum:"0",hasChildren:!0,parentName:t,hierarchy:"MEASURES"}),l[l.length]=o}v[c.index]=l,_[c.index]=d}return{keys:_,tuples:v}},_findExpandedMember:function(e,t){for(var n=0;n<e.length;n++)if(e[n].uniquePath===t)return{member:e[n],index:n}},_asTuples:function(e,t,n){var i,r;return n=n||[],i=this._rootTuples(t.root,n),r=this._expandedTuples(e,t.expanded,n),{keys:[].concat.apply(i.keys,r.keys),tuples:[].concat.apply(i.tuples,r.tuples)}},_measuresInfo:function(e,t){for(var n,i,r=0,o=e&&e.length,a=[],s={},l={},d=this.measures||{};r<o;r++)i=e[r].descriptor.name,n=d[i]||{},a.push(i),n.result&&(s[i]=n.result),n.format&&(l[i]=n.format);return{names:a,formats:l,resultFuncs:s,rowAxis:t}},_toDataArray:function(e,t,n,i){var r,o,a,s,l,d,c,u,h,f,p=[],m=1,g=[],v=n.length||1,_=i.length||1;for(t.rowAxis?(g=t.names,m=g.length):f=t.names,a=0;a<v;a++)for(c=e[n[a]||Me],d=0;d<m;d++)for(t.rowAxis&&(f=[g[d]]),s=0;s<_;s++)for(h=i[s]||Me,u=c.items[h],r=h===Me?c.aggregates:u?u.aggregates:{},l=0;l<f.length;l++)o=f[l],this._addData(p,r[o],t.formats[o],t.resultFuncs[o]);return p},_addData:function(e,t,n,i){var r,o="";t&&(t=i?i(t):t.accumulator,o=n?fe.format(n,t):t),r=e.length,e[r]={ordinal:r,value:t||"",fmtValue:o}},_matchDescriptors:function(e,n,i){for(var r,o,a,s,l=n.names,d=n.expandedIdx;d>0;)if(r=l[--d].split("&"),r.length>1&&(o=r[0],a=r[1],s=i[o](e),s=s!==t&&null!==s?""+s:s,s!=a))return!1;return!0},_calculateAggregate:function(e,t,n){var i,r,o,a={};for(o=0;o<e.length;o++)r=e[o].descriptor.name,i=n.aggregates[r]||{},i.accumulator=e[o].aggregator(t,i),a[r]=i;return a},_processColumns:function(e,n,i,r,o,a,s,l){for(var d,c,u,h,f,p,m,g,v=o.dataItem,_=0;_<n.length;_++)c=n[_],this._matchDescriptors(v,c,i)&&(g=c.names.slice(0,c.expandedIdx).join(""),p=c.names[c.expandedIdx],d=i[p](v),d=d!==t&&null!==d?""+d:d,m=p,p=p+"&"+d,f=g+p,u=r[f]||{index:s.columnIndex,parentName:m,name:p,uniquePath:g+m,value:d},h=a.items[f]||{aggregates:{}},a.items[f]={index:u.index,aggregates:this._calculateAggregate(e,o,h)},l&&(r[f]||s.columnIndex++,r[f]=u))},_measureAggregators:function(e){var t,n,i,r,o,a,s=e.measures||[],l=this.measures||{},d=[];if(s.length){for(i=0,r=s.length;i<r;i++)if(t=s[i],n=l[t.name],o=null,n){if(a=n.aggregate,"string"==typeof a){if(o=je[a.toLowerCase()],!o)throw Error("There is no such aggregate function");n.aggregate=o.aggregate||o,n.result=o.result}d.push({descriptor:t,caption:n.caption,result:n.result,aggregator:c(n)})}}else d.push({descriptor:{name:"default"},caption:"default",aggregator:function(){return 1}});return d},_buildGetters:function(e){var t,n,i,o={};for(i=0;i<e.length;i++)n=e[i],t=n.split("&"),t.length>1?o[t[0]]=fe.getter(t[0],!0):o[n]=fe.getter(r(n),!0);return o},_parseDescriptors:function(e){var t,n=V(e),i=B(n.root),r=n.expanded,o=[];for(t=0;t<r.length;t++)o.push(O(r[t].name,i));return{root:i,expanded:o}},_filter:function(e,t){var n,i,r;if(!t)return e;for(i=0,r=t.filters;i<r.length;i++)n=r[i],"in"===n.operator&&(r[i]=this._normalizeFilter(n));return new fe.data.Query(e).filter(t).data},_normalizeFilter:function(e){var t,n=e.value.split(","),i=[];if(!n.length)return n;for(t=0;t<n.length;t++)i.push({field:e.field,operator:"eq",value:n[t]});return{logic:"or",filters:i}},process:function(e,n){var r,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,k,w,y,x,C,T,S,D,E,F,R,I,A,M;if(e=e||[],n=n||{},e=this._filter(e,n.filter),r=n.measures||[],o="rows"===n.measuresAxis,a=n.columns||[],s=n.rows||[],!a.length&&s.length&&(!r.length||r.length&&o)&&(a=s,s=[],o=!1),a.length||s.length||(o=!1),!a.length&&r.length&&(a=i(n.measures)),a=this._parseDescriptors(a),s=this._parseDescriptors(s),l={},d={},c={},h={columnIndex:0},f=this._measureAggregators(n),p=this._buildGetters(a.root),m=this._buildGetters(s.root),g=!1,v=a.expanded,_=s.expanded,w=0!==_.length,A=e.length,M=0,a.root.length||s.root.length)for(g=!0,M=0;M<A;M++)for(b=e[M],k={dataItem:b,index:M},T=l[Me]||{items:{},aggregates:{}},this._processColumns(f,v,p,d,k,T,h,!w),T.aggregates=this._calculateAggregate(f,k,T),l[Me]=T,y=0;y<_.length;y++)x=_[y],this._matchDescriptors(b,x,m)?(D=x.names.slice(0,x.expandedIdx).join(""),C=x.names[x.expandedIdx],E=C,u=m[C](b),u=u!==t?""+u:u,C=C+"&"+u,S=D+C,c[S]={uniquePath:D+E,parentName:E,name:C,value:u},F=l[S]||{items:{},aggregates:{}},this._processColumns(f,v,p,d,k,F,h,!0),F.aggregates=this._calculateAggregate(f,k,F),l[S]=F):this._processColumns(f,v,p,d,k,{items:{},aggregates:{}},h,!0);return g&&A?(!(f.length>1)||n.columns&&n.columns.length||(a={root:[],expanded:[]}),R=this._asTuples(d,a,o?[]:f),I=this._asTuples(c,s,o?f:[]),d=R.tuples,c=I.tuples,l=this._toDataArray(l,this._measuresInfo(f,o),I.keys,R.keys)):l=d=c=[],{axes:{columns:{tuples:d},rows:{tuples:c}},data:l}}}),Ge=me.extend({init:function(e,t){this.transport=t,this.options=t.options||{},this.transport.discover||Ce(e.discover)&&(this.discover=e.discover)},read:function(e){return this.transport.read(e)},update:function(e){return this.transport.update(e)},create:function(e){return this.transport.create(e)},destroy:function(e){return this.transport.destroy(e)},discover:function(e){return this.transport.discover?this.transport.discover(e):(e.success({}),t)},catalog:function(n){var i,r=this.options||{};return n===t?(r.connection||{}).catalog:(i=r.connection||{},i.catalog=n,this.options.connection=i,e.extend(this.transport.options,{connection:i}),t)},cube:function(e){var n,i=this.options||{};return e===t?(i.connection||{}).cube:(n=i.connection||{},n.cube=e,this.options.connection=n,xe(!0,this.transport.options,{connection:n}),t)}}),Ye=ve.extend({init:function(t){var r,o=((t||{}).schema||{}).cube,a="columns",s={axes:we,cubes:we,catalogs:we,measures:we,dimensions:we,hierarchies:we,levels:we,members:we};o&&(s=e.extend(s,this._cubeSchema(o)),this.cubeBuilder=new $e(o)),ve.fn.init.call(this,xe(!0,{},{schema:s},t)),this.transport=new Ge(this.options.transport||{},this.transport),this._columns=i(this.options.columns),this._rows=i(this.options.rows),r=this.options.measures||[],"[object Object]"===ke.call(r)&&(a=r.axis||"columns",r=r.values||[]),this._measures=n(r),this._measuresAxis=a,this._skipNormalize=0,this._axes={}},_cubeSchema:function(t){return{dimensions:function(){var e,n=[],i=t.dimensions;for(e in i)n.push({name:e,caption:i[e].caption||e,uniqueName:e,defaultHierarchy:e,type:1});return t.measures&&n.push({name:De,caption:De,uniqueName:De,type:2}),n},hierarchies:function(){return[]},measures:function(){var e,n=[],i=t.measures;for(e in i)n.push({name:e,caption:e,uniqueName:e,aggregator:e});return n},members:e.proxy(function(e,n){var i,o,a=n.levelUniqueName||n.memberUniqueName,s=this.options.schema.data,l=Ce(s)?s:fe.getter(s,!0),d=this.options.data&&l(this.options.data)||this._rawData||[],c=[],u=0,h={};if(a&&(a=a.split(".")[0]),!n.treeOp)return c.push({caption:t.dimensions[a].caption||a,childrenCardinality:"1",dimensionUniqueName:a,hierarchyUniqueName:a,levelUniqueName:a,name:a,uniqueName:a}),c;for(i=fe.getter(r(a),!0);u<d.length;u++)o=i(d[u]),!o&&0!==o||h[o]||(h[o]=!0,c.push({caption:o,childrenCardinality:"0",dimensionUniqueName:a,hierarchyUniqueName:a,levelUniqueName:a,name:o,uniqueName:o}));return c},this)}},options:{serverSorting:!0,serverPaging:!0,serverFiltering:!0,serverGrouping:!0,serverAggregates:!0},catalog:function(e){return e===t?this.transport.catalog():(this.transport.catalog(e),this._mergeState({}),this._axes={},this.data([]),t)},cube:function(e){return e===t?this.transport.cube():(this.transport.cube(e),this._axes={},this._mergeState({}),this.data([]),t)},axes:function(){return this._axes},columns:function(e){return e===t?this._columns:(this._skipNormalize+=1,this._clearAxesData=!0,this._columns=i(e),this.query({columns:e,rows:this.rowsAxisDescriptors(),measures:this.measures()}),t)},rows:function(e){return e===t?this._rows:(this._skipNormalize+=1,this._clearAxesData=!0,this._rows=i(e),this.query({columns:this.columnsAxisDescriptors(),rows:e,measures:this.measures()}),t)},measures:function(e){return e===t?this._measures:(this._skipNormalize+=1,this._clearAxesData=!0,this.query({columns:this.columnsAxisDescriptors(),rows:this.rowsAxisDescriptors(),measures:n(e)}),t)},measuresAxis:function(){return this._measuresAxis||"columns"},_expandPath:function(e,t){var n,r,o,a="columns"===t?"columns":"rows",s="columns"===t?"rows":"columns",l=i(e),c=L(l[l.length-1]);for(this._lastExpanded=a,l=d(this.axes()[a],l,this.measures()),n=0;n<l.length;n++)if(r=L(l[n]),r===c){if(l[n].expand)return;l[n].expand=!0}else l[n].expand=!1;o={},o[a]=l,o[s]=this._descriptorsForAxis(s),this._query(o)},_descriptorsForAxis:function(e){var t=this.axes(),n=this[e]()||[];return t&&t[e]&&t[e].tuples&&t[e].tuples[0]&&(n=a(t[e].tuples||[])),n},columnsAxisDescriptors:function(){return this._descriptorsForAxis("columns")},rowsAxisDescriptors:function(){return this._descriptorsForAxis("rows")},_process:function(e,t){this._view=e,t=t||{},t.items=t.items||this._view,this.trigger(Te,t)},_query:function(e){var t=this;return e||(this._skipNormalize+=1,this._clearAxesData=!0),t.query(xe({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate(),columns:this.columnsAxisDescriptors(),rows:this.rowsAxisDescriptors(),measures:this.measures()},e))},query:function(t){var n=this._mergeState(t);return this._data.length&&this.cubeBuilder?(this._params(n),this._updateLocalData(this._pristineData),e.Deferred().resolve().promise()):this.read(n)},_mergeState:function(e){return e=ve.fn._mergeState.call(this,e),e!==t&&(this._measures=n(e.measures),e.columns?e.columns=i(e.columns):e.columns||(this._columns=[]),e.rows?e.rows=i(e.rows):e.rows||(this._rows=[])),e},filter:function(e){return e===t?this._filter:(this._skipNormalize+=1,this._clearAxesData=!0,this._query({filter:e,page:1}),t)},expandColumn:function(e){this._expandPath(e,"columns")},expandRow:function(e){this._expandPath(e,"rows")},success:function(e){var t;this.cubeBuilder&&(t=(this.reader.data(e)||[]).slice(0)),ve.fn.success.call(this,e),t&&(this._pristineData=t)},_processResult:function(e,t){var n,i,r,o,a,s,l,d,c,u,h;return this.cubeBuilder&&(n=this.cubeBuilder.process(e,this._requestData),e=n.data,t=n.axes),d=this.columns(),c=this.rows(),u=t.columns&&t.columns.tuples,d.length||!c.length||!u||!this._rowMeasures().length&&this.measures().length||(t={columns:{},rows:t.columns}),d.length||c.length||"rows"!==this.measuresAxis()||!u||(t={columns:{},rows:t.columns}),this._axes={columns:b(this._axes.columns),rows:b(this._axes.rows)},t={columns:b(t.columns),rows:b(t.rows)},i=this._normalizeTuples(t.columns.tuples,this._axes.columns.tuples,d,this._columnMeasures()),r=this._normalizeTuples(t.rows.tuples,this._axes.rows.tuples,c,this._rowMeasures()),this._skipNormalize-=1,this.cubeBuilder||(e=this._normalizeData({columnsLength:t.columns.tuples.length,rowsLength:t.rows.tuples.length,columnIndexes:i,rowIndexes:r,data:e})),"rows"==this._lastExpanded?(o=t.columns.tuples,s=this._columnMeasures(),a=p(t.columns,this._axes.columns,s),a&&(l="columns",t.columns=a,m(o,a.tuples,t.rows.tuples.length,s,e),this.cubeBuilder||(e=this._normalizeData({columnsLength:_(t.columns.tuples,s),rowsLength:t.rows.tuples.length,data:e})))):"columns"==this._lastExpanded&&(o=t.rows.tuples,s=this._rowMeasures(),a=p(t.rows,this._axes.rows,s),a&&(l="rows",t.rows=a,g(o,a.tuples,t.columns.tuples.length,s,e),this.cubeBuilder||(e=this._normalizeData({columnsLength:_(t.rows.tuples,s),rowsLength:t.columns.tuples.length,data:e})))),this._lastExpanded=null,h=this._mergeAxes(t,e,l),this._axes=h.axes,h.data},_readData:function(e){var t=this.reader.axes(e),n=this.reader.data(e);return this.cubeBuilder&&(this._rawData=n),this._processResult(n,t)},_createTuple:function(e,t,n){var i,r,o,a,s,l,d,c,u=e.members,h=u.length,f={members:[]},p=0;for(t&&(h-=1);p<h;p++)c=u[p],r=+c.levelNum,o=c.name,a=c.parentName,d=c.caption||o,s=c.hasChildren,l=c.hierarchy,i=c.levelName,n&&(d="All",0===r?a=c.name:r-=1,s=!0,o=l=i=a),f.members.push({name:o,children:[],caption:d,levelName:i,levelNum:""+r,hasChildren:s,hierarchy:l,parentName:n?"":a});return t&&f.members.push({name:t.name,children:[]}),f},_hasRoot:function(e,t,n){var i,r,o,a,s,l,d;if(t.length)return x(t,e).tuple;for(i=e.members,a=!0,l=0,d=i.length;l<d;l++)if(r=i[l],s=+r.levelNum||0,o=n[l],!(0===s||o&&r.name===L(o))){a=!1;break}return a},_mergeAxes:function(e,t,n){var i,r,o,a,s,l=this._columnMeasures(),d=this._rowMeasures(),c=this.axes(),u=_(c.rows.tuples,d),h=e.rows.tuples.length,f=_(c.columns.tuples,l),p=e.columns.tuples.length;return"columns"==n?(p=f,r=e.columns.tuples):(r=E(e.columns.tuples,l),t=R(r,t)),o=w(c.columns.tuples,r,l),"rows"==n?(h=_(e.rows.tuples,d),r=e.rows.tuples):(r=E(e.rows.tuples,d),t=F(r,t)),a=w(c.rows.tuples,r,d),c.columns.tuples=o.tuples,c.rows.tuples=a.tuples,f!==_(c.columns.tuples,l)?(i=o.index+k(o.parsedRoot,o.memberIndex,l),s=f+p,t=this._mergeColumnData(t,i,h,p,s)):u!==_(c.rows.tuples,d)&&(i=a.index+k(a.parsedRoot,a.memberIndex,d),t=this._mergeRowData(t,i,h,p)),0===c.columns.tuples.length&&0===c.rows.tuples.length&&(t=[]),{axes:c,data:t}},_mergeColumnData:function(e,t,n,i,r){var o,a,s,l=this.data().toJSON(),d=0,c=Math.max(this._columnMeasures().length,1);for(n=Math.max(n,1),l.length>0&&(d=c,r-=c),o=0;o<n;o++)a=t+o*r,s=e.splice(0,i),s.splice(0,d),[].splice.apply(l,[a,0].concat(s));return l},_mergeRowData:function(e,t,n,i){var r,o,a,s=this.data().toJSON(),l=Math.max(this._rowMeasures().length,1);for(i=Math.max(i,1),s.length>0&&(n-=l,e.splice(0,i*l)),r=0;r<n;r++)a=e.splice(0,i),o=t*i+r*i,[].splice.apply(s,[o,0].concat(a));return s},_columnMeasures:function(){var e=this.measures(),t=[];return"columns"===this.measuresAxis()&&(0===this.columns().length?t=e:e.length>1&&(t=e)),t},_rowMeasures:function(){var e=this.measures(),t=[];return"rows"===this.measuresAxis()&&(0===this.rows().length?t=e:e.length>1&&(t=e)),t},_updateLocalData:function(e,t){this.cubeBuilder&&(t&&(this._requestData=t),e=this._processResult(e)),this._data=this._observe(e),this._ranges=[],this._addRange(this._data),this._total=this._data.length,this._pristineTotal=this._total,this._process(this._data)},data:function(e){var n=this;return e===t?n._data:(this._pristineData=e.slice(0),this._updateLocalData(e,{columns:this.columns(),rows:this.rows(),measures:this.measures()}),t)},_normalizeTuples:function(e,t,n,i){var r,o,a,s=i.length||1,l=0,d=[],c={},u=0;if(e.length){if(this._skipNormalize<=0&&!this._hasRoot(e[0],t,n)){for(this._skipNormalize=0;l<s;l++)d.push(this._createTuple(e[0],i[l],!0)),c[l]=l;e.splice.apply(e,[0,e.length].concat(d).concat(e)),l=s}if(i.length)for(a=r=e[l],o=r.members.length-1;r;){if(u>=s&&(u=0),r.members[o].name!==i[u].name&&(e.splice(l,0,this._createTuple(r,i[u])),c[l]=l),l+=1,u+=1,r=e[l],s>u&&(!r||le(a,o-1)!==le(r,o-1))){for(;u<s;u++)e.splice(l,0,this._createTuple(a,i[u])),c[l]=l,l+=1;r=e[l]}a=r}return c}},_addMissingDataItems:function(e,n){for(;n.rowIndexes[parseInt(e.length/n.columnsLength,10)]!==t;)for(var i=0;i<n.columnsLength;i++)e=f(e);for(;n.columnIndexes[e.length%n.columnsLength]!==t;)e=f(e);return e},_normalizeOrdinals:function(e,t,n){var i=n.lastOrdinal;if(!t)return f(e);if(t.ordinal-i>1)for(i+=1;i<t.ordinal&&e.length<n.length;)e=this._addMissingDataItems(f(e),n),i+=1;return t.ordinal=e.length,e[e.length]=t,e},_normalizeData:function(e){var t,n,i,r=e.data,o=0,a=[];if(e.lastOrdinal=0,e.columnIndexes=e.columnIndexes||{},e.rowIndexes=e.rowIndexes||{},e.columnsLength=e.columnsLength||1,e.rowsLength=e.rowsLength||1,e.length=e.columnsLength*e.rowsLength,i=e.length,r.length===i)return r;for(;a.length<i;)t=r[o++],t&&(n=t.ordinal),a=this._normalizeOrdinals(this._addMissingDataItems(a,e),t,e),e.lastOrdinal=n;return a},discover:function(t,n){var i=this,r=i.transport;return e.Deferred(function(e){r.discover(xe({success:function(t){t=i.reader.parse(t),i._handleCustomErrors(t)||(n&&(t=n(t)),e.resolve(t))},error:function(t,n,r){e.reject(t),i.error(t,n,r)}},t))}).promise().done(function(){i.trigger("schemaChange")})},schemaMeasures:function(){var e=this;return e.discover({data:{command:"schemaMeasures",restrictions:{catalogName:e.transport.catalog(),cubeName:e.transport.cube()}}},function(t){return e.reader.measures(t)})},schemaKPIs:function(){var e=this;return e.discover({data:{command:"schemaKPIs",restrictions:{catalogName:e.transport.catalog(),cubeName:e.transport.cube()}}},function(t){return e.reader.kpis(t)})},schemaDimensions:function(){var e=this;return e.discover({data:{command:"schemaDimensions",restrictions:{catalogName:e.transport.catalog(),cubeName:e.transport.cube()}}},function(t){return e.reader.dimensions(t)})},schemaHierarchies:function(e){var t=this;return t.discover({data:{command:"schemaHierarchies",restrictions:{catalogName:t.transport.catalog(),cubeName:t.transport.cube(),dimensionUniqueName:e}}},function(e){return t.reader.hierarchies(e)})},schemaLevels:function(e){var t=this;return t.discover({data:{command:"schemaLevels",restrictions:{catalogName:t.transport.catalog(),cubeName:t.transport.cube(),hierarchyUniqueName:e}}},function(e){return t.reader.levels(e)})},schemaCubes:function(){var e=this;return e.discover({data:{command:"schemaCubes",restrictions:{catalogName:e.transport.catalog()}}},function(t){return e.reader.cubes(t)})},schemaCatalogs:function(){var e=this;return e.discover({data:{command:"schemaCatalogs"}},function(t){return e.reader.catalogs(t)})},schemaMembers:function(e){var t=this,n=function(e){return function(n){return t.reader.members(n,e)}}(e);return t.discover({data:{command:"schemaMembers",restrictions:xe({catalogName:t.transport.catalog(),cubeName:t.transport.cube()},e)}},n)},_params:function(e){this._clearAxesData&&(this._axes={},this._data=this._observe([]),this._clearAxesData=!1,this.trigger(Fe));var t=ve.fn._params.call(this,e);return t=xe({measures:this.measures(),measuresAxis:this.measuresAxis(),columns:this.columns(),rows:this.rows()},t),this.cubeBuilder&&(this._requestData=t),t}});Ye.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},n=t.data;if(t.data=n,!(t instanceof Ye)&&t instanceof fe.data.DataSource)throw Error("Incorrect DataSource type. Only PivotDataSource instances are supported");return t instanceof Ye?t:new Ye(t)},Y={contains:', InStr({0}.CurrentMember.MEMBER_CAPTION,"{1}") > 0',doesnotcontain:', InStr({0}.CurrentMember.MEMBER_CAPTION,"{1}") = 0',startswith:', Left({0}.CurrentMember.MEMBER_CAPTION,Len("{1}"))="{1}"',endswith:', Right({0}.CurrentMember.MEMBER_CAPTION,Len("{1}"))="{1}"',eq:', {0}.CurrentMember.MEMBER_CAPTION = "{1}"',neq:', NOT {0}.CurrentMember.MEMBER_CAPTION = "{1}"'},K={schemaCubes:"MDSCHEMA_CUBES",schemaCatalogs:"DBSCHEMA_CATALOGS",schemaMeasures:"MDSCHEMA_MEASURES",schemaDimensions:"MDSCHEMA_DIMENSIONS",schemaHierarchies:"MDSCHEMA_HIERARCHIES",schemaLevels:"MDSCHEMA_LEVELS",schemaMembers:"MDSCHEMA_MEMBERS",schemaKPIs:"MDSCHEMA_KPIS"},Q={read:function(e){var t,n,i,r,o,a='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Execute xmlns="urn:schemas-microsoft-com:xml-analysis"><Command><Statement>';return a+="SELECT NON EMPTY {",t=e.columns||[],n=e.rows||[],i=e.measures||[],r="rows"===e.measuresAxis,o=e.sort||[],!t.length&&n.length&&(!i.length||i.length&&r)&&(t=n,n=[],r=!1),t.length||n.length||(r=!1),t.length?a+=W(t,r?[]:i,o):i.length&&!r&&(a+=P(i).join(",")),a+="} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS",(n.length||r&&i.length>1)&&(a+=", NON EMPTY {",a+=n.length?W(n,r?i:[],o):P(i).join(","),a+="} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON ROWS"),e.filter?(a+=" FROM ",a+="(",a+=q(e.filter,e.connection.cube),a+=")"):a+=" FROM ["+e.connection.cube+"]",1==i.length&&t.length&&(a+=" WHERE ("+P(i).join(",")+")"),a+="</Statement></Command><Properties><PropertyList><Catalog>"+e.connection.catalog+"</Catalog><Format>Multidimensional</Format></PropertyList></Properties></Execute></Body></Envelope>",a.replace(/\&/g,"&amp;")},discover:function(t){t=t||{};var n='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis">';return n+="<RequestType>"+(K[t.command]||t.command)+"</RequestType>",n+="<Restrictions>"+j("RestrictionList",t.restrictions,!0)+"</Restrictions>",t.connection&&t.connection.catalog&&(t.properties=e.extend({},{Catalog:t.connection.catalog},t.properties)),n+="<Properties>"+j("PropertyList",t.properties)+"</Properties>",n+="</Discover></Body></Envelope>"}},X=fe.data.RemoteTransport.extend({init:function(e){var t=e;e=this.options=xe(!0,{},this.options,e),fe.data.RemoteTransport.call(this,e),Ce(t.discover)?this.discover=t.discover:"string"==typeof t.discover?this.options.discover={url:t.discover}:t.discover||(this.options.discover=this.options.read)},setup:function(t,n){return t.data=t.data||{},e.extend(!0,t.data,{connection:this.options.connection}),fe.data.RemoteTransport.fn.setup.call(this,t,n)},options:{read:{dataType:"text",contentType:"text/xml",type:"POST"},discover:{dataType:"text",contentType:"text/xml",type:"POST"},parameterMap:function(e,t){return Q[t](e,t)}},discover:function(t){return e.ajax(this.setup(t,"discover"))}}),J={cubes:{name:fe.getter("CUBE_NAME['#text']",!0),caption:fe.getter("CUBE_CAPTION['#text']",!0),description:fe.getter("DESCRIPTION['#text']",!0),type:fe.getter("CUBE_TYPE['#text']",!0)},catalogs:{name:fe.getter("CATALOG_NAME['#text']",!0),description:fe.getter("DESCRIPTION['#text']",!0)},measures:{name:fe.getter("MEASURE_NAME['#text']",!0),caption:fe.getter("MEASURE_CAPTION['#text']",!0),uniqueName:fe.getter("MEASURE_UNIQUE_NAME['#text']",!0),description:fe.getter("DESCRIPTION['#text']",!0),aggregator:fe.getter("MEASURE_AGGREGATOR['#text']",!0),groupName:fe.getter("MEASUREGROUP_NAME['#text']",!0),displayFolder:fe.getter("MEASURE_DISPLAY_FOLDER['#text']",!0),defaultFormat:fe.getter("DEFAULT_FORMAT_STRING['#text']",!0)},kpis:{name:fe.getter("KPI_NAME['#text']",!0),caption:fe.getter("KPI_CAPTION['#text']",!0),value:fe.getter("KPI_VALUE['#text']",!0),goal:fe.getter("KPI_GOAL['#text']",!0),status:fe.getter("KPI_STATUS['#text']",!0),trend:fe.getter("KPI_TREND['#text']",!0),statusGraphic:fe.getter("KPI_STATUS_GRAPHIC['#text']",!0),trendGraphic:fe.getter("KPI_TREND_GRAPHIC['#text']",!0),description:fe.getter("KPI_DESCRIPTION['#text']",!0),groupName:fe.getter("MEASUREGROUP_NAME['#text']",!0)},dimensions:{name:fe.getter("DIMENSION_NAME['#text']",!0),caption:fe.getter("DIMENSION_CAPTION['#text']",!0),description:fe.getter("DESCRIPTION['#text']",!0),uniqueName:fe.getter("DIMENSION_UNIQUE_NAME['#text']",!0),defaultHierarchy:fe.getter("DEFAULT_HIERARCHY['#text']",!0),type:fe.getter("DIMENSION_TYPE['#text']",!0)},hierarchies:{name:fe.getter("HIERARCHY_NAME['#text']",!0),caption:fe.getter("HIERARCHY_CAPTION['#text']",!0),description:fe.getter("DESCRIPTION['#text']",!0),uniqueName:fe.getter("HIERARCHY_UNIQUE_NAME['#text']",!0),dimensionUniqueName:fe.getter("DIMENSION_UNIQUE_NAME['#text']",!0),displayFolder:fe.getter("HIERARCHY_DISPLAY_FOLDER['#text']",!0),origin:fe.getter("HIERARCHY_ORIGIN['#text']",!0),defaultMember:fe.getter("DEFAULT_MEMBER['#text']",!0)},levels:{name:fe.getter("LEVEL_NAME['#text']",!0),caption:fe.getter("LEVEL_CAPTION['#text']",!0),description:fe.getter("DESCRIPTION['#text']",!0),uniqueName:fe.getter("LEVEL_UNIQUE_NAME['#text']",!0),dimensionUniqueName:fe.getter("DIMENSION_UNIQUE_NAME['#text']",!0),displayFolder:fe.getter("LEVEL_DISPLAY_FOLDER['#text']",!0),orderingProperty:fe.getter("LEVEL_ORDERING_PROPERTY['#text']",!0),origin:fe.getter("LEVEL_ORIGIN['#text']",!0),hierarchyUniqueName:fe.getter("HIERARCHY_UNIQUE_NAME['#text']",!0)},members:{name:fe.getter("MEMBER_NAME['#text']",!0),caption:fe.getter("MEMBER_CAPTION['#text']",!0),uniqueName:fe.getter("MEMBER_UNIQUE_NAME['#text']",!0),dimensionUniqueName:fe.getter("DIMENSION_UNIQUE_NAME['#text']",!0),hierarchyUniqueName:fe.getter("HIERARCHY_UNIQUE_NAME['#text']",!0),levelUniqueName:fe.getter("LEVEL_UNIQUE_NAME['#text']",!0),childrenCardinality:fe.getter("CHILDREN_CARDINALITY['#text']",!0)}},Z=["axes","catalogs","cubes","dimensions","hierarchies","levels","measures"],ee=fe.data.XmlDataReader.extend({init:function(e){fe.data.XmlDataReader.call(this,e),this._extend(e)},_extend:function(e){for(var t,n,i=0,r=Z.length;i<r;i++)t=Z[i],n=e[t],n&&n!==we&&(this[t]=n)},parse:function(e){var t=fe.data.XmlDataReader.fn.parse(e.replace(/<(\/?)(\w|-)+:/g,"<$1"));return fe.getter("['Envelope']['Body']",!0)(t)},errors:function(e){var t=fe.getter("['Fault']",!0)(e);return t?[{faultstring:fe.getter("faultstring['#text']",!0)(t),faultcode:fe.getter("faultcode['#text']",!0)(t)}]:null},axes:function(e){var t,n,i,r;for(e=fe.getter('ExecuteResponse["return"].root',!0)(e),t=$(fe.getter("Axes.Axis",!0)(e)),i={columns:{},rows:{}},r=0;r<t.length;r++)n=t[r],"sliceraxis"!==n["@name"].toLowerCase()&&(i.columns.tuples?i.rows=G(n):i.columns=G(n));return i},data:function(e){var t,n,i,r,o,a;for(e=fe.getter('ExecuteResponse["return"].root',!0)(e),t=$(fe.getter("CellData.Cell",!0)(e)),n=[],i=fe.getter("['@CellOrdinal']"),r=fe.getter("Value['#text']"),o=fe.getter("FmtValue['#text']"),a=0;a<t.length;a++)n.push({value:r(t[a]),fmtValue:o(t[a]),ordinal:parseInt(i(t[a]),10)});return n},_mapSchema:function(e,t){var n,i,r,o,a;for(e=fe.getter('DiscoverResponse["return"].root',!0)(e),n=$(fe.getter("row",!0)(e)),i=[],r=0;r<n.length;r++){o={};for(a in t)o[a]=t[a](n[r]);i.push(o)}return i},measures:function(e){return this._mapSchema(e,J.measures)},kpis:function(e){return this._mapSchema(e,J.kpis)},hierarchies:function(e){return this._mapSchema(e,J.hierarchies)},levels:function(e){return this._mapSchema(e,J.levels)},dimensions:function(e){return this._mapSchema(e,J.dimensions)},cubes:function(e){return this._mapSchema(e,J.cubes)},catalogs:function(e){return this._mapSchema(e,J.catalogs)},members:function(e){return this._mapSchema(e,J.members)}}),xe(!0,fe.data,{PivotDataSource:Ye,XmlaTransport:X,XmlaDataReader:ee,PivotCubeBuilder:$e,transports:{xmla:X},readers:{xmla:ee}}),te=function(e,t){if(!e)return null;for(var n=0,i=e.length;n<i;n++)if(e[n].field===t)return e[n];return null},ne=function(e,t){var n,i,r=[];for(n=0,i=e.length;n<i;n++)e[n].field!==t&&r.push(e[n]);return r},fe.ui.PivotSettingTarget=ge.extend({init:function(t,n){var i=this;ge.fn.init.call(i,t,n),i.element.addClass("k-pivot-setting"),i.dataSource=fe.data.PivotDataSource.create(n.dataSource),i._refreshHandler=e.proxy(i.refresh,i),i.dataSource.first(Te,i._refreshHandler),n.template||(i.options.template="<div data-"+fe.ns+'name="${data.name || data}">${data.name || data}'+(i.options.enabled?'<a class="k-button k-button-icon k-button-bare"><span class="k-icon k-setting-delete"></span></a>':"")+"</div>"),i.template=fe.template(i.options.template),i.emptyTemplate=fe.template(i.options.emptyTemplate),i._sortable(),i.element.on("click"+Ae,".k-button,.k-item",function(t){var n=e(t.target),r=n.closest("["+fe.attr("name")+"]").attr(fe.attr("name"));r&&(n.hasClass("k-setting-delete")?i.remove(r):i.options.sortable&&n[0]===t.currentTarget&&i.sort({field:r,dir:n.find(".k-i-sort-asc")[0]?"desc":"asc"}))}),(n.filterable||n.sortable)&&(i.fieldMenu=new pe.PivotFieldMenu(i.element,{messages:i.options.messages.fieldMenu,filter:".k-setting-fieldmenu",filterable:n.filterable,sortable:n.sortable,dataSource:i.dataSource})),i.refresh()},options:{name:"PivotSettingTarget",template:null,filterable:!1,sortable:!1,emptyTemplate:"<div class='k-empty'>${data}</div>",setting:"columns",enabled:!0,messages:{empty:"Drop Fields Here"}},setDataSource:function(e){this.dataSource.unbind(Te,this._refreshHandler),this.dataSource=this.options.dataSource=e,this.fieldMenu&&this.fieldMenu.setDataSource(e),e.first(Te,this._refreshHandler),this.refresh()},
_sortable:function(){var e=this;e.options.enabled&&(this.sortable=this.element.kendoSortable({connectWith:this.options.connectWith,filter:">:not(.k-empty)",hint:e.options.hint,cursor:"move",start:function(e){e.item.focus().blur()},change:function(t){var n=t.item.attr(fe.attr("name"));"receive"==t.action?e.add(n):"remove"==t.action?e.remove(n):"sort"==t.action&&e.move(n,t.newIndex)}}).data("kendoSortable"))},_indexOf:function(e,t){var n,i,r=-1;for(n=0,i=t.length;n<i;n++)if(L(t[n])===e){r=n;break}return r},_isKPI:function(e){return"kpi"===e.type||e.measure},validate:function(e){var t,n,i=2==e.type||"aggregator"in e||this._isKPI(e);return i?"measures"===this.options.setting:"measures"===this.options.setting?i:(t=this.dataSource[this.options.setting](),n=e.defaultHierarchy||e.uniqueName,!(this._indexOf(n,t)>-1)&&(t=this.dataSource["columns"===this.options.setting?"rows":"columns"](),!(this._indexOf(n,t)>-1)))},add:function(t){var n,i,r=this.dataSource[this.options.setting]();for(t=e.isArray(t)?t.slice(0):[t],n=0,i=t.length;n<i;n++)this._indexOf(t[n],r)!==-1&&(t.splice(n,1),n-=1,i-=1);t.length&&(r=r.concat(t),this.dataSource[this.options.setting](r))},move:function(e,t){var n=this.dataSource[this.options.setting](),i=this._indexOf(e,n);i>-1&&(e=n.splice(i,1)[0],n.splice(t,0,e),this.dataSource[this.options.setting](n))},remove:function(e){var t=this.dataSource[this.options.setting](),n=this._indexOf(e,t);n>-1&&(t.splice(n,1),this.dataSource[this.options.setting](t))},sort:function(e){var t=this.options.sortable,n=t===!0||t.allowUnsort,i=n&&"asc"===e.dir,r=this.dataSource.sort()||[],o=ne(r,e.field);i&&r.length!==o.length&&(e=null),e&&o.push(e),this.dataSource.sort(o)},refresh:function(){var e,n="",i=this.dataSource[this.options.setting](),r=i.length,o=0;if(r)for(;o<r;o++)e=i[o],e=e.name===t?{name:e}:e,n+=this.template(xe({sortIcon:this._sortIcon(e.name)},e));else n=this.emptyTemplate(this.options.messages.empty);this.element.html(n)},destroy:function(){ge.fn.destroy.call(this),this.dataSource.unbind(Te,this._refreshHandler),this.element.off(Ae),this.sortable&&this.sortable.destroy(),this.fieldMenu&&this.fieldMenu.destroy(),this.element=null,this._refreshHandler=null},_sortIcon:function(e){var t=this.dataSource.sort(),n=te(t,L(e)),i="";return n&&(i="k-i-sort-"+n.dir),i}}),ie=ge.extend({init:function(n,i){var r,o,a=this;ge.fn.init.call(a,n,i),a._dataSource(),a._bindConfigurator(),a._wrapper(),a._createLayout(),a._columnBuilder=r=new de,a._rowBuilder=o=new ce,a._contentBuilder=new ue,a._templates(),a.columnsHeader.add(a.rowsHeader).on("click","span.k-icon",function(){var n,i,s,l,d=e(this),c=r,u="expandColumn",h=d.attr(fe.attr("path")),f={axis:"columns",path:e.parseJSON(h)};d.parent().is("td")&&(c=o,u="expandRow",f.axis="rows"),i=d.hasClass(Le),s=c.metadata[h],l=s.expanded===t,n=i?Pe:Ne,f.childrenLoaded=s.maxChildren>s.children,a.trigger(n,f)||(c.metadata[h].expanded=!i,d.toggleClass(Le,!i).toggleClass(Be,i),!i&&l?a.dataSource[u](f.path):a.refresh())}),a._scrollable(),a.options.autoBind&&a.dataSource.fetch(),fe.notify(a)},events:[ze,He,Ne,Pe],options:{name:"PivotGrid",autoBind:!0,reorderable:!0,filterable:!1,sortable:!1,height:null,columnWidth:100,configurator:"",columnHeaderTemplate:null,rowHeaderTemplate:null,dataCellTemplate:null,kpiStatusTemplate:null,kpiTrendTemplate:null,messages:{measureFields:"Drop Data Fields Here",columnFields:"Drop Column Fields Here",rowFields:"Drop Rows Fields Here"}},_templates:function(){var e=this.options.columnHeaderTemplate,t=this.options.rowHeaderTemplate,n=this.options.dataCellTemplate,i=this.options.kpiStatusTemplate,r=this.options.kpiTrendTemplate;this._columnBuilder.template=fe.template(e||Oe,{useWithBlock:!!e}),this._contentBuilder.dataTemplate=fe.template(n||Ue,{useWithBlock:!!n}),this._contentBuilder.kpiStatusTemplate=fe.template(i||Ve,{useWithBlock:!!i}),this._contentBuilder.kpiTrendTemplate=fe.template(r||We,{useWithBlock:!!r}),this._rowBuilder.template=fe.template(t||Oe,{useWithBlock:!!t})},_bindConfigurator:function(){var t=this.options.configurator;t&&e(t).kendoPivotConfigurator("setDataSource",this.dataSource)},cellInfoByElement:function(t){return t=e(t),this.cellInfo(t.index(),t.parent("tr").index())},cellInfo:function(e,t){var n,i=this._contentBuilder,r=i.columnIndexes[e||0],o=i.rowIndexes[t||0];return r&&o?(n=o.index*i.rowLength+r.index,{columnTuple:r.tuple,rowTuple:o.tuple,measure:r.measure||o.measure,dataItem:this.dataSource.view()[n]}):null},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.measuresTarget&&this.measuresTarget.setDataSource(e),this.rowsTarget&&this.rowsTarget.setDataSource(e),this.columnsTarget&&this.columnsTarget.setDataSource(e),this._bindConfigurator(),this.options.autoBind&&e.fetch()},setOptions:function(e){ge.fn.setOptions.call(this,e),this._templates()},destroy:function(){ge.fn.destroy.call(this),clearTimeout(this._headerReflowTimeout)},_dataSource:function(){var t=this,n=t.options.dataSource;n=e.isArray(n)?{data:n}:n,t.dataSource&&this._refreshHandler?t.dataSource.unbind(Te,t._refreshHandler).unbind(Fe,t._stateResetHandler).unbind(Ee,t._progressHandler).unbind(Se,t._errorHandler):(t._refreshHandler=e.proxy(t.refresh,t),t._progressHandler=e.proxy(t._requestStart,t),t._stateResetHandler=e.proxy(t._stateReset,t),t._errorHandler=e.proxy(t._error,t)),t.dataSource=fe.data.PivotDataSource.create(n).bind(Te,t._refreshHandler).bind(Ee,t._progressHandler).bind(Fe,t._stateResetHandler).bind(Se,t._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_stateReset:function(){this._columnBuilder.reset(),this._rowBuilder.reset()},_wrapper:function(){var e=this.options.height;this.wrapper=this.element.addClass("k-widget k-pivot"),e&&this.wrapper.css("height",e)},_measureFields:function(){this.measureFields=e(Ie).addClass("k-pivot-toolbar k-header k-settings-measures"),this.measuresTarget=this._createSettingTarget(this.measureFields,{setting:"measures",messages:{empty:this.options.messages.measureFields}})},_createSettingTarget:function(t,n){var i='<span tabindex="0" class="k-button" data-'+fe.ns+'name="${data.name}">${data.name}',r=n.sortable,o="";return r&&(o+="#if (data.sortIcon) {#",o+='<span class="k-icon ${data.sortIcon} k-setting-sort"></span>',o+="#}#"),(n.filterable||r)&&(o+='<span class="k-icon k-i-arrowhead-s k-setting-fieldmenu"></span>'),this.options.reorderable&&(o+='<span class="k-icon k-si-close k-setting-delete"></span>'),o&&(i+='<span class="k-field-actions">'+o+"</span>"),i+="</span>",new fe.ui.PivotSettingTarget(t,e.extend({template:i,emptyTemplate:'<span class="k-empty">${data}</span>',enabled:this.options.reorderable,dataSource:this.dataSource},n))},_initSettingTargets:function(){this.columnsTarget=this._createSettingTarget(this.columnFields,{connectWith:this.rowFields,setting:"columns",filterable:this.options.filterable,sortable:this.options.sortable,messages:{empty:this.options.messages.columnFields,fieldMenu:this.options.messages.fieldMenu}}),this.rowsTarget=this._createSettingTarget(this.rowFields,{connectWith:this.columnFields,setting:"rows",filterable:this.options.filterable,sortable:this.options.sortable,messages:{empty:this.options.messages.rowFields,fieldMenu:this.options.messages.fieldMenu}})},_createLayout:function(){var t=this,n=e(qe),i=n.find(".k-pivot-rowheaders"),r=n.find(".k-pivot-table"),o=e(Ie).addClass("k-grid k-widget");t._measureFields(),t.columnFields=e(Ie).addClass("k-pivot-toolbar k-header k-settings-columns"),t.rowFields=e(Ie).addClass("k-pivot-toolbar k-header k-settings-rows"),t.columnsHeader=e('<div class="k-grid-header-wrap" />').wrap('<div class="k-grid-header" />'),t.columnsHeader.parent().css("padding-right",fe.support.scrollbar()),t.rowsHeader=e('<div class="k-grid k-widget k-alt"/>'),t.content=e('<div class="k-grid-content" />'),i.append(t.measureFields),i.append(t.rowFields),i.append(t.rowsHeader),o.append(t.columnsHeader.parent()),o.append(t.content),r.append(t.columnFields),r.append(o),t.wrapper.append(n),t.columnsHeaderTree=new fe.dom.Tree(t.columnsHeader[0]),t.rowsHeaderTree=new fe.dom.Tree(t.rowsHeader[0]),t.contentTree=new fe.dom.Tree(t.content[0]),t._initSettingTargets()},_progress:function(e){fe.ui.progress(this.wrapper,e)},_resize:function(){this.content[0].firstChild&&(this._setSectionsWidth(),this._setSectionsHeight(),this._setContentWidth(),this._setContentHeight(),this._columnHeaderReflow())},_columnHeaderReflow:function(){var e=this.columnsHeader.children("table");fe.support.browser.mozilla&&(clearTimeout(this._headerReflowTimeout),e.css("table-layout","auto"),this._headerReflowTimeout=setTimeout(function(){e.css("table-layout","")}))},_setSectionsWidth:function(){var e=this.rowsHeader,t=e.parent(".k-pivot-rowheaders").width(Re),n=Math.max(_e(this.measureFields),_e(this.rowFields));n=Math.max(e.children("table").width(),n),t.width(n)},_setSectionsHeight:function(){var e=this.measureFields.height(Re).height(),t=this.columnFields.height(Re).height(),n=this.rowFields.height(Re).innerHeight(),i=this.columnsHeader.height(Re).innerHeight(),r=n-this.rowFields.height(),o=t>e?t:e,a=i>n?i:n;this.measureFields.height(o),this.columnFields.height(o),this.rowFields.height(a-r),this.columnsHeader.height(a)},_setContentWidth:function(){var e=this.content.find("table"),t=this.columnsHeader.children("table"),n=e.children("colgroup").children().length,i=n*this.options.columnWidth,r=Math.ceil(i/this.content.width()*100);r<100&&(r=100),e.add(t).css("width",r+"%"),this._resetColspan(t)},_setContentHeight:function(){var e=this,n=e.content,i=e.rowsHeader,r=e.wrapper.innerHeight(),o=fe.support.scrollbar(),a=n[0].offsetHeight===n[0].clientHeight,s=e.options.height;if(e.wrapper.is(":visible")){if(!r||!s)return a&&(o=0),n.height("auto"),i.height(n.height()-o),t;r-=be(e.columnFields),r-=be(e.columnsHeader),r<=2*o&&(r=2*o+1,a||(r+=o)),n.height(r),a&&(o=0),i.height(r-o)}},_resetColspan:function(e){var n=this,i=e.children("tbody").children(":first").children(":first");n._colspan===t&&(n._colspan=i.attr("colspan")),i.attr("colspan",1),clearTimeout(n._layoutTimeout),n._layoutTimeout=setTimeout(function(){i.attr("colspan",n._colspan),n._colspan=t})},_axisMeasures:function(e){var t=[],n=this.dataSource,i=n.measures(),r=i.length>1||i[0]&&i[0].type;return n.measuresAxis()===e&&(0===n[e]().length||r)&&(t=i),t},items:function(){return[]},refresh:function(){var e,t=this,n=t.dataSource,i=n.axes(),r=(i.columns||{}).tuples||[],o=(i.rows||{}).tuples||[],a=t._columnBuilder,s=t._rowBuilder,l={},d={};t.trigger(ze,{action:"rebind"})||(a.measures=t._axisMeasures("columns"),t.columnsHeaderTree.render(a.build(r)),t.rowsHeaderTree.render(s.build(o)),l={indexes:a._indexes,measures:a.measures,metadata:a.metadata},d={indexes:s._indexes,measures:this._axisMeasures("rows"),metadata:s.metadata},t.contentTree.render(t._contentBuilder.build(n.view(),l,d)),t._resize(),t.touchScroller?t.touchScroller.contentResized():(e=fe.touchScroller(t.content),e&&e.movable&&(t.touchScroller=e,e.movable.bind("change",function(e){t.columnsHeader.scrollLeft(-e.sender.x),t.rowsHeader.scrollTop(-e.sender.y)}))),t._progress(!1),t.trigger(He))},_scrollable:function(){var t=this,n=t.columnsHeader,i=t.rowsHeader;t.content.scroll(function(){n.scrollLeft(this.scrollLeft),i.scrollTop(this.scrollTop)}),i.bind("DOMMouseScroll"+Ae+" mousewheel"+Ae,e.proxy(t._wheelScroll,t))},_wheelScroll:function(t){var n,i;t.ctrlKey||(n=fe.wheelDeltaY(t),i=this.content.scrollTop(),n&&(t.preventDefault(),e(t.currentTarget).one("wheel"+Ae,!1),this.rowsHeader.scrollTop(i+-n),this.content.scrollTop(i+-n)))}}),re=fe.dom.element,oe=fe.dom.html,ae=function(e,t){return{maxChildren:0,children:0,maxMembers:0,members:0,measures:1,levelNum:e,parentMember:0!==t}},se=function(e,t){for(var n=[],i=0;i<=t;i++)n.push(e.members[i].name);return n},le=function(e,t){for(var n="",i=0;i<=t;i++)n+=e.members[i].name;return n},de=me.extend({init:function(){this.measures=1,this.metadata={}},build:function(e){var t=this._tbody(e),n=this._colGroup();return[re("table",null,[n,t])]},reset:function(){this.metadata={}},_colGroup:function(){for(var e=this._rowLength(),t=[],n=0;n<e;n++)t.push(re("col",null));return re("colgroup",null,t)},_tbody:function(e){var t=e[0];return this.map={},this.rows=[],this.rootTuple=t,this._indexes=[],t?(this._buildRows(t,0),this._normalize()):this.rows.push(re("tr",null,[re("th",null,[oe("&nbsp;")])])),re("tbody",null,this.rows)},_normalize:function(){for(var e,t,n,i,r,o=this.rows,a=o.length,s=0;s<a;s++)if(e=o[s],1!==e.rowSpan)for(i=e.children,n=0,t=i.length;n<t;n++)r=i[n],r.tupleAll&&(r.attr.rowSpan=e.rowSpan)},_rowIndex:function(e){for(var t=this.rows,n=t.length,i=0;i<n&&t[i]!==e;i++);return i},_rowLength:function(){var e=this.rows[0]?this.rows[0].children:[],t=e.length,n=0,i=0;if(t)for(;i<t;i++)n+=e[i].attr.colSpan||1;return n||(n=this.measures),n},_row:function(e,t,n){var i,r,o=this.rootTuple.members[t].name,a=e.members[t].levelNum,s=o+a,l=this.map,d=l[s];return d?(d.notFirst=!1,d.parentMember&&d.parentMember===n||(d.parentMember=n,d.collapsed=0,d.colSpan=0)):(d=re("tr",null,[]),d.parentMember=n,d.collapsed=0,d.colSpan=0,d.rowSpan=1,l[s]=d,i=l[o+(+a-1)],i&&(r=i.children,d.notFirst=!(!r[1]||r[1].attr.className.indexOf("k-alt")!==-1)||i.notFirst),this.rows.splice(this._rowIndex(i)+1,0,d)),d},_measures:function(e,t,n){var i,r,o,a=this.map,s=a.measureRow;for(s||(s=re("tr",null,[]),a.measureRow=s,this.rows.push(s)),r=0,o=e.length;r<o;r++)i=e[r],s.children.push(this._cell(n||"",[this._content(i,t)],i));return o},_content:function(e,t){return oe(this.template({member:e,tuple:t}))},_cell:function(e,t,n){var i=re("th",{className:"k-header"+e},t);return i.value=n.caption||n.name,i},_buildRows:function(e,n,i){var r,o,a,s,l,d,c,u,h,f,p=e.members,m=p[n],g=p[n+1],v=[],_=0,b=0,k=0;if(m.measure)return this._measures(m.children,e),t;if(u=fe.stringify(se(e,n)),r=this._row(e,n,i),a=m.children,s=a.length,h=this.metadata[u],h||(this.metadata[u]=h=ae(+m.levelNum,n),h.rootLevelNum=+this.rootTuple.members[n].levelNum),this._indexes.push({path:u,tuple:e}),m.hasChildren&&(h.expanded===!1&&(b=h.maxChildren,r.collapsed+=b,h.children=0,s=0),c={className:"k-icon "+(s?Le:Be)},c[fe.attr("path")]=u,v.push(re("span",c))),v.push(this._content(m,e)),l=this._cell(r.notFirst?" k-first":"",v,m),r.children.push(l),r.colSpan+=1,s){for(d=this._cell(" k-alt",[this._content(m,e)],m),r.children.push(d);_<s;_++)o=this._buildRows(a[_],n,m);f=o.colSpan,b=o.collapsed,l.attr.colSpan=f,h.children=f,h.members=1,r.colSpan+=f,r.collapsed+=b,r.rowSpan=o.rowSpan+1,g&&(g.measure?f=this._measures(g.children,e," k-alt"):(o=this._buildRows(e,n+1),f=o.colSpan,r.collapsed+=o.collapsed,k=o.collapsed),d.attr.colSpan=f,f-=1,h.members+=f,r.colSpan+=f)}else g&&(g.measure?f=this._measures(g.children,e):(o=this._buildRows(e,n+1),f=o.colSpan,r.collapsed+=o.collapsed,k=o.collapsed),h.members=f,f>1&&(l.attr.colSpan=f,r.colSpan+=f-1));return h.maxMembers<h.members+k&&(h.maxMembers=h.members+k),a=h.children+b,h.maxChildren<a&&(h.maxChildren=a),(d||l).tupleAll=!0,r}}),ce=me.extend({init:function(){this.metadata={}},build:function(e){var t=this._tbody(e),n=this._colGroup();return[re("table",null,[n,t])]},reset:function(){this.metadata={}},_rowLength:function(){for(var e=this.rows[0].children,t=0,n=0,i=e[n];i;)t+=i.attr.colSpan||1,i=e[++n];return t},_colGroup:function(){for(var e=this._rowLength(),t=[],n=0;n<e;n++)t.push(re("col",null));return re("colgroup",null,t)},_tbody:function(e){var t=e[0];return this.rootTuple=t,this.rows=[],this.map={},this._indexes=[],t?(this._buildRows(t,0),this._normalize()):this.rows.push(re("tr",null,[re("td",null,[oe("&nbsp;")])])),re("tbody",null,this.rows)},_normalize:function(){for(var e,t,n,i,r=this.rows,o=r.length,a=0,s=this.rootTuple.members,l=s[0].name,d=s.length,c=0,u=this.map;a<o;a++)for(e=r[a],c=0;c<d;c++)n=this[s[c].name],t=e.colSpan["dim"+c],t&&t.colSpan<n&&(t.attr.colSpan=n-t.colSpan+1);e=u[l],i=u[l+"all"],e&&(e.children[0].attr.className="k-first"),i&&(i.children[0].attr.className+=" k-first")},_row:function(e){var t=re("tr",null,e);return t.rowSpan=1,t.colSpan={},this.rows.push(t),t},_content:function(e,t){return oe(this.template({member:e,tuple:t}))},_cell:function(e,t,n){var i=re("td",{className:e},t);return i.value=n.caption||n.name,i},_buildRows:function(e,t){var n,i,r,o,a,s,l,d,c,u=this.map,h=e.members,f=h[t],p=h[t+1],m=f.children,g=m.length,v=+f.levelNum,_=this.rootTuple.members[t].name,b=se(e,t-1).join(""),k=+this.rootTuple.members[t].levelNum,w=b+(k===v?"":f.parentName||""),y=u[w+"all"]||u[w],x=v+1,C=[];if(!y||y.hasChild?y=this._row():y.hasChild=!0,f.measure){for(l=y.allCell?"k-grid-footer":"",y.children.push(this._cell(l,[this._content(m[0],e)],m[0])),y.rowSpan=g,c=1;c<g;c++)this._row([this._cell(l,[this._content(m[c],e)],m[c])]);return y}if(u[b+f.name]=y,n=fe.stringify(se(e,t)),s=this.metadata[n],s||(this.metadata[n]=s=ae(v,t),s.rootLevelNum=k),this._indexes.push({path:n,tuple:e}),f.hasChildren&&(s.expanded===!1&&(g=0,s.children=0),d={className:"k-icon "+(g?Le:Be)},d[fe.attr("path")]=n,C.push(re("span",d))),C.push(this._content(f,e)),l=y.allCell&&!g?"k-grid-footer":"",i=this._cell(l,C,f),i.colSpan=x,y.children.push(i),y.colSpan["dim"+t]=i,(!this[_]||this[_]<x)&&(this[_]=x),g){for(y.allCell=!1,y.hasChild=!1,c=0;c<g;c++)o=this._buildRows(m[c],t),y!==o&&(y.rowSpan+=o.rowSpan);y.rowSpan>1&&(i.attr.rowSpan=y.rowSpan),s.children=y.rowSpan,r=this._cell("k-grid-footer",[this._content(f,e)],f),r.colSpan=x,a=this._row([r]),a.colSpan["dim"+t]=r,a.allCell=!0,u[b+f.name+"all"]=a,p&&(o=this._buildRows(e,t+1),r.attr.rowSpan=o.rowSpan),y.rowSpan+=a.rowSpan,s.members=a.rowSpan}else p&&(y.hasChild=!1,this._buildRows(e,t+1),(r||i).attr.rowSpan=y.rowSpan,s.members=y.rowSpan);return s.maxChildren<s.children&&(s.maxChildren=s.children),s.maxMembers<s.members&&(s.maxMembers=s.members),y}}),ue=me.extend({init:function(){this.columnAxis={},this.rowAxis={}},build:function(e,n,i){var r,o,a=n.indexes[0],s=n.metadata[a?a.path:t];return this.columnAxis=n,this.rowAxis=i,this.data=e,this.rowLength=s?s.maxChildren+s.maxMembers:n.measures.length||1,this.rowLength||(this.rowLength=1),r=this._tbody(),o=this._colGroup(),[re("table",null,[o,r])]},_colGroup:function(){var e=this.columnAxis.measures.length||1,t=[],n=0;for(this.rows[0]&&(e=this.rows[0].children.length);n<e;n++)t.push(re("col",null));return re("colgroup",null,t)},_tbody:function(){return this.rows=[],this.data[0]?(this.columnIndexes=this._indexes(this.columnAxis,this.rowLength),this.rowIndexes=this._indexes(this.rowAxis,Math.ceil(this.data.length/this.rowLength)),this._buildRows()):this.rows.push(re("tr",null,[re("td",null,[oe("&nbsp;")])])),re("tbody",null,this.rows)},_indexes:function(e,n){var i,r,o,a,s,l,d=[],c=e.indexes,u=e.metadata,h=e.measures,f=h.length||1,p=0,m=0,g=0,v=c.length;if(!v){for(o=0;o<f;o++)d[o]={index:o,measure:h[o],tuple:null};return d}for(;g<v;g++){if(i=c[g],r=u[i.path],s=r.children+r.members,l=0,s&&(s-=f),r.expanded===!1&&r.children!==r.maxChildren&&(l=r.maxChildren),r.parentMember&&r.levelNum===r.rootLevelNum&&(s=-1),s>-1){for(o=0;o<f;o++)a=s+o,r.children||(a+=m),d[s+m+o]={children:s,index:p,measure:h[o],tuple:i.tuple},p+=1;for(;d[m]!==t;)m+=1}if(m===n)break;p+=l}return d},_buildRows:function(){for(var e=this.rowIndexes,t=e.length,n=0;n<t;n++)this.rows.push(this._buildRow(e[n]))},_buildRow:function(e){for(var t,n,i,r,o,a,s,l=e.index*this.rowLength,d=this.columnIndexes,c=d.length,u=[],h=0;h<c;h++)t=d[h],o={},t.children&&(o.className="k-alt"),r="",a=this.data[l+t.index],s=t.measure||e.measure,n={columnTuple:t.tuple,rowTuple:e.tuple,measure:s,dataItem:a},""!==a.value&&s&&s.type&&("status"===s.type?r=this.kpiStatusTemplate(n):"trend"===s.type&&(r=this.kpiTrendTemplate(n))),r||(r=this.dataTemplate(n)),i=re("td",o,[oe(r)]),i.value=a.value,u.push(i);return o={},e.children&&(o.className="k-grid-footer"),re("tr",o,u)}}),pe.plugin(ie),fe.PivotExcelExporter=fe.Class.extend({init:function(e){this.options=e,this.widget=e.widget,this.dataSource=this.widget.dataSource},_columns:function(){var e,t=this.widget.columnsHeaderTree.children[0],n=this.widget.rowsHeaderTree.children[0],i=t.children[0].children.length,r=n.children[0].children.length,o=this.widget.options.columnWidth,a=[];if(r&&this.dataSource.data()[0])for(e=0;e<r;e++)a.push({autoWidth:!0});for(e=0;e<i;e++)a.push({autoWidth:!1,width:o});return a},_cells:function(e,t,n){for(var i,r,o,a,s,l=[],d=0,c=e.length;d<c;d++){for(r=[],o=e[d].children,i=o.length,a=0;a<i;a++)s=o[a],r.push({background:"#7a7a7a",color:"#fff",value:s.value,colSpan:s.attr.colSpan||1,rowSpan:s.attr.rowSpan||1});n&&n(r,d),l.push({cells:r,type:t})}return l},_rows:function(){var e,t,n=this.widget.columnsHeaderTree.children[0],i=this.widget.rowsHeaderTree.children[0],r=n.children[0].children.length,o=i.children[0].children.length,a=n.children[1].children,s=i.children[1].children,l=this.widget.contentTree.children[0].children[1].children,d=this._cells(a,"header");return o&&d[0].cells.splice(0,0,{background:"#7a7a7a",color:"#fff",value:"",colSpan:o,rowSpan:a.length}),e=function(e,t){for(var n,i,o=0,a=l[t].children;o<r;o++)n=a[o],i=+n.value,isNaN(i)&&(i=n.value),e.push({background:"#dfdfdf",color:"#333",value:i,colSpan:1,rowSpan:1})},t=this._cells(s,"data",e),d.concat(t)},_freezePane:function(){var e=this.widget.columnsHeaderTree.children[0],t=this.widget.rowsHeaderTree.children[0],n=t.children[0].children.length,i=e.children[1].children;return{colSplit:n,rowSplit:i.length}},workbook:function(){var t;return this.dataSource.view()[0]?(t=e.Deferred(),t.resolve()):t=this.dataSource.fetch(),t.then(e.proxy(function(){return{sheets:[{columns:this._columns(),rows:this._rows(),freezePane:this._freezePane(),filter:null}]}},this))}}),he={extend:function(t){t.events.push("excelExport"),t.options.excel=e.extend(t.options.excel,this.options),t.saveAsExcel=this.saveAsExcel},options:{proxyURL:"",filterable:!1,fileName:"Export.xlsx"},saveAsExcel:function(){var t=this.options.excel||{},n=new fe.PivotExcelExporter({widget:this});n.workbook().then(e.proxy(function(e){if(!this.trigger("excelExport",{workbook:e})){var n=new fe.ooxml.Workbook(e);fe.saveAs({dataURI:n.toDataURL(),fileName:e.fileName||t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy})}},this))}},fe.PivotExcelMixin=he,fe.ooxml&&fe.ooxml.Workbook&&he.extend(ie.prototype),fe.PDFMixin&&(fe.PDFMixin.extend(ie.prototype),ie.fn._drawPDF=function(){return this._drawPDFShadow({width:this.wrapper.width()},{avoidLinks:this.options.pdf.avoidLinks})})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.treeview.draganddrop.min",["kendo.data.min","kendo.draganddrop.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui,r=e.proxy,o=e.extend,a="visibility",s="k-state-hover",l="input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,button.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse";i.HierarchicalDragAndDrop=n.Class.extend({init:function(t,a){this.element=t,this.hovered=t,this.options=o({dragstart:e.noop,drag:e.noop,drop:e.noop,dragend:e.noop},a),this._draggable=new i.Draggable(t,{ignore:l,filter:a.filter,autoScroll:a.autoScroll,cursorOffset:{left:10,top:n.support.mobileOS?-40/n.support.zoomLevel():10},hint:r(this._hint,this),dragstart:r(this.dragstart,this),dragcancel:r(this.dragcancel,this),drag:r(this.drag,this),dragend:r(this.dragend,this),$angular:a.$angular})},_hint:function(e){return"<div class='k-header k-drag-clue'><span class='k-icon k-drag-status' />"+this.options.hintText(e)+"</div>"},_removeTouchHover:function(){n.support.touch&&this.hovered&&(this.hovered.find("."+s).removeClass(s),this.hovered=!1)},_hintStatus:function(n){var i=this._draggable.hint.find(".k-drag-status")[0];return n?(i.className="k-icon k-drag-status "+n,t):e.trim(i.className.replace(/k-(icon|drag-status)/g,""))},dragstart:function(t){this.source=t.currentTarget.closest(this.options.itemSelector),this.options.dragstart(this.source)&&t.preventDefault(),this.dropHint=this.options.reorderable?e("<div class='k-drop-hint' />").css(a,"hidden").appendTo(this.element):e()},drag:function(t){var i,r,o,l,d,c,u,h,f,p,m,g=this.options,v=this.source,_=this.dropTarget=e(n.eventTarget(t)),b=_.closest(g.allowedContainers);b.length?v[0]==_[0]||g.contains(v[0],_[0])?m="k-i-denied":(m="k-i-insert-middle",f=g.itemFromTarget(_),i=f.item,i.length?(this._removeTouchHover(),r=n._outerHeight(i),l=f.content,g.reorderable?(d=r/(l.length>0?4:2),o=n.getOffset(i).top,c=t.y.location<o+d,u=o+r-d<t.y.location,h=l.length&&!c&&!u):(h=!0,c=!1,u=!1),this.hovered=!!h&&b,this.dropHint.css(a,h?"hidden":"visible"),this._lastHover&&this._lastHover[0]!=l[0]&&this._lastHover.removeClass(s),this._lastHover=l.toggleClass(s,h),h?m="k-i-add":(p=i.position(),p.top+=c?0:r,this.dropHint.css(p)[c?"prependTo":"appendTo"](g.dropHintContainer(i)),c&&f.first&&(m="k-i-insert-top"),u&&f.last&&(m="k-i-insert-bottom"))):_[0]!=this.dropHint[0]&&(this._lastHover&&this._lastHover.removeClass(s),m=e.contains(this.element[0],b[0])?"k-i-denied":"k-i-add")):(m="k-i-denied",this._removeTouchHover()),this.options.drag({originalEvent:t.originalEvent,source:v,target:_,pageY:t.y.location,pageX:t.x.location,status:m.substring(2),setStatus:function(e){m=e}}),0!==m.indexOf("k-i-insert")&&this.dropHint.css(a,"hidden"),this._hintStatus(m)},dragcancel:function(){this.dropHint.remove()},dragend:function(e){var n,i,r,o="over",l=this.source,d=this.dropHint,c=this.dropTarget;return"visible"==d.css(a)?(o=this.options.dropPositionFrom(d),n=d.closest(this.options.itemSelector)):c&&(n=c.closest(this.options.itemSelector),n.length||(n=c.closest(this.options.allowedContainers))),i={originalEvent:e.originalEvent,source:l[0],destination:n[0],valid:"k-i-denied"!=this._hintStatus(),setValid:function(e){this.valid=e},dropTarget:c[0],position:o},r=this.options.drop(i),d.remove(),this._removeTouchHover(),this._lastHover&&this._lastHover.removeClass(s),!i.valid||r?(this._draggable.dropped=i.valid,t):(this._draggable.dropped=!0,this.options.dragend({originalEvent:e.originalEvent,source:l,destination:n,position:o}),t)},destroy:function(){this._lastHover=this.hovered=null,this._draggable.destroy()}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.treeview.min",["kendo.data.min","kendo.treeview.draganddrop.min"],e)}(function(){return function(e,t){function n(e){return function(t){var n=t.children(".k-animation-container");return n.length||(n=t),n.children(e)}}function i(e){return f.template(e,{useWithBlock:!1})}function r(e){return e.find("> div .k-checkbox-wrapper [type=checkbox]")}function o(e){return function(t,n){n=n.closest(U);var i,r=n.parent();return r.parent().is("li")&&(i=r.parent()),this._dataSourceMove(t,r,i,function(t,i){return this._insert(t.data(),i,n.index()+e)})}}function a(t,n){for(var i;t&&"ul"!=t.nodeName.toLowerCase();)i=t,t=t.nextSibling,3==i.nodeType&&(i.nodeValue=e.trim(i.nodeValue)),h.test(i.className)?n.insertBefore(i,n.firstChild):n.appendChild(i)}function s(t){var n=t.children("div"),i=t.children("ul"),r=n.children(".k-icon"),o=t.children(":checkbox"),s=n.children(".k-in");t.hasClass("k-treeview")||(n.length||(n=e("<div />").prependTo(t)),!r.length&&i.length?r=e("<span class='k-icon' />").prependTo(n):i.length&&i.children().length||(r.remove(),i.remove()),o.length&&e("<span class='k-checkbox-wrapper' />").appendTo(n).append(o),s.length||(s=t.children("a").eq(0).addClass("k-in k-link"),s.length||(s=e("<span class='k-in' />")),s.appendTo(n),n.length&&a(n[0].nextSibling,s[0])))}var l,d,c,u,h,f=window.kendo,p=f.ui,m=f.data,g=e.extend,v=f.template,_=e.isArray,b=p.Widget,k=m.HierarchicalDataSource,w=e.proxy,y=f.keys,x=".kendoTreeView",C="select",T="check",S="navigate",D="expand",E="change",F="error",R="checked",I="indeterminate",A="collapse",M="dragstart",z="drag",H="drop",N="dragend",P="dataBound",L="click",B="undefined",O="k-state-hover",V="k-treeview",W=":visible",U=".k-item",q="string",j="aria-selected",$="aria-disabled",G={text:"dataTextField",url:"dataUrlField",spriteCssClass:"dataSpriteCssClassField",imageUrl:"dataImageUrlField"},Y=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&typeof e.nodeName===q};d=n(".k-group"),c=n(".k-group,.k-content"),u=function(e){return e.children("div").children(".k-icon")},h=/k-sprite/,l=f.ui.DataBoundWidget.extend({init:function(e,t){var n,i=this,r=!1,o=t&&!!t.dataSource;_(t)&&(t={dataSource:t}),t&&typeof t.loadOnDemand==B&&_(t.dataSource)&&(t.loadOnDemand=!1),b.prototype.init.call(i,e,t),e=i.element,t=i.options,n=e.is("ul")&&e||e.hasClass(V)&&e.children("ul"),r=!o&&n.length,r&&(t.dataSource.list=n),i._animation(),i._accessors(),i._templates(),e.hasClass(V)?(i.wrapper=e,i.root=e.children("ul").eq(0)):(i._wrapper(),n&&(i.root=e,i._group(i.wrapper))),i._tabindex(),i.root.attr("role","tree"),i._dataSource(r),i._attachEvents(),i._dragging(),r?i._syncHtmlAndDataSource():t.autoBind&&(i._progress(!0),i.dataSource.fetch()),t.checkboxes&&t.checkboxes.checkChildren&&i.updateIndeterminate(),i.element[0].id&&(i._ariaId=f.format("{0}_tv_active",i.element[0].id)),f.notify(i)},_attachEvents:function(){var t=this,n=".k-in:not(.k-state-selected,.k-state-disabled)",i="mouseenter";t.wrapper.on(i+x,".k-in.k-state-selected",function(e){e.preventDefault()}).on(i+x,n,function(){e(this).addClass(O)}).on("mouseleave"+x,n,function(){e(this).removeClass(O)}).on(L+x,n,w(t._click,t)).on("dblclick"+x,".k-in:not(.k-state-disabled)",w(t._toggleButtonClick,t)).on(L+x,".k-i-expand,.k-i-collapse",w(t._toggleButtonClick,t)).on("keydown"+x,w(t._keydown,t)).on("focus"+x,w(t._focus,t)).on("blur"+x,w(t._blur,t)).on("mousedown"+x,".k-in,.k-checkbox-wrapper :checkbox,.k-i-expand,.k-i-collapse",w(t._mousedown,t)).on("change"+x,".k-checkbox-wrapper :checkbox",w(t._checkboxChange,t)).on("click"+x,".k-checkbox-wrapper :checkbox",w(t._checkboxClick,t)).on("click"+x,".k-request-retry",w(t._retryRequest,t)).on("click"+x,function(n){e(n.target).is(":kendoFocusable")||t.focus()})},_checkboxClick:function(t){var n=e(t.target);n.data(I)&&(n.data(I,!1).prop(I,!1).prop(R,!0),this._checkboxChange(t))},_syncHtmlAndDataSource:function(e,t){e=e||this.root,t=t||this.dataSource;var n,i,o,a,s,l=t.view(),d=f.attr("uid"),c=f.attr("expanded"),u=this.options.checkboxes,h=e.children("li");for(n=0;n<h.length;n++)o=l[n],a=o.uid,i=h.eq(n),i.attr("role","treeitem").attr(d,a),o.expanded="true"===i.attr(c),u&&(s=r(i),o.checked=s.prop(R),s.attr("id","_"+a),s.next(".k-checkbox-label").attr("for","_"+a)),this._syncHtmlAndDataSource(i.children("ul"),o.children)},_animation:function(){var e=this.options,t=e.animation;t===!1?t={expand:{effects:{}},collapse:{hide:!0,effects:{}}}:t.collapse&&"effects"in t.collapse||(t.collapse=g({reverse:!0},t.expand)),g(t.collapse,{hide:!0}),e.animation=t},_dragging:function(){var t,n=this.options.dragAndDrop,i=this.dragging;n&&!i?(t=this,this.dragging=new p.HierarchicalDragAndDrop(this.element,{reorderable:!0,$angular:this.options.$angular,autoScroll:this.options.autoScroll,filter:"div:not(.k-state-disabled) .k-in",allowedContainers:".k-treeview",itemSelector:".k-treeview .k-item",hintText:w(this._hintText,this),contains:function(t,n){return e.contains(t,n)},dropHintContainer:function(e){return e},itemFromTarget:function(e){var t=e.closest(".k-top,.k-mid,.k-bot");return{item:t,content:e.closest(".k-in"),first:t.hasClass("k-top"),last:t.hasClass("k-bot")}},dropPositionFrom:function(e){return e.prevAll(".k-in").length>0?"after":"before"},dragstart:function(e){return t.trigger(M,{sourceNode:e[0]})},drag:function(e){t.trigger(z,{originalEvent:e.originalEvent,sourceNode:e.source[0],dropTarget:e.target[0],pageY:e.pageY,pageX:e.pageX,statusClass:e.status,setStatusClass:e.setStatus})},drop:function(e){return t.trigger(H,{originalEvent:e.originalEvent,sourceNode:e.source,destinationNode:e.destination,
valid:e.valid,setValid:function(t){this.valid=t,e.setValid(t)},dropTarget:e.dropTarget,dropPosition:e.position})},dragend:function(e){function n(n){t.updateIndeterminate(),t.trigger(N,{originalEvent:e.originalEvent,sourceNode:n&&n[0],destinationNode:r[0],dropPosition:o})}var i=e.source,r=e.destination,o=e.position;"over"==o?t.append(i,r,n):("before"==o?i=t.insertBefore(i,r):"after"==o&&(i=t.insertAfter(i,r)),n(i))}})):!n&&i&&(i.destroy(),this.dragging=null)},_hintText:function(e){return this.templates.dragClue({item:this.dataItem(e),treeview:this.options})},_templates:function(){var e=this,t=e.options,n=w(e._fieldAccessor,e);t.template&&typeof t.template==q?t.template=v(t.template):t.template||(t.template=i("# var text = "+n("text")+"(data.item); ## if (typeof data.item.encoded != 'undefined' && data.item.encoded === false) {##= text ## } else { ##: text ## } #")),e._checkboxes(),e.templates={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),n},cssClass:function(e,t){var n="",i=t.index,r=e.length-1;return e.firstLevel&&0===i&&(n+="k-top "),n+=0===i&&i!=r?"k-top":i==r?"k-bot":"k-mid"},textClass:function(e,t){var n="k-in";return t&&(n+=" k-link"),e.enabled===!1&&(n+=" k-state-disabled"),e.selected===!0&&(n+=" k-state-selected"),n},toggleButtonClass:function(e){var t="k-icon";return t+=e.expanded!==!0?" k-i-expand":" k-i-collapse"},groupAttributes:function(e){var t="";return e.firstLevel||(t="role='group'"),t+(e.expanded!==!0?" style='display:none'":"")},groupCssClass:function(e){var t="k-group";return e.firstLevel&&(t+=" k-treeview-lines"),t},dragClue:i("#= data.treeview.template(data) #"),group:i("<ul class='#= data.r.groupCssClass(data.group) #'#= data.r.groupAttributes(data.group) #>#= data.renderItems(data) #</ul>"),itemContent:i("# var imageUrl = "+n("imageUrl")+"(data.item); ## var spriteCssClass = "+n("spriteCssClass")+"(data.item); ## if (imageUrl) { #<img class='k-image' alt='' src='#= imageUrl #'># } ## if (spriteCssClass) { #<span class='k-sprite #= spriteCssClass #' /># } ##= data.treeview.template(data) #"),itemElement:i("# var item = data.item, r = data.r; ## var url = "+n("url")+"(item); #<div class='#= r.cssClass(data.group, item) #'># if (item.hasChildren) { #<span class='#= r.toggleButtonClass(item) #'/># } ## if (data.treeview.checkboxes) { #<span class='k-checkbox-wrapper' role='presentation'>#= data.treeview.checkboxes.template(data) #</span># } ## var tag = url ? 'a' : 'span'; ## var textAttr = url ? ' href=\\'' + url + '\\'' : ''; #<#=tag# class='#= r.textClass(item, !!url) #'#= textAttr #>#= r.itemContent(data) #</#=tag#></div>"),item:i("# var item = data.item, r = data.r; #<li role='treeitem' class='#= r.wrapperCssClass(data.group, item) #' "+f.attr("uid")+"='#= item.uid #' aria-selected='#= item.selected ? \"true\" : \"false \" #' #=item.enabled === false ? \"aria-disabled='true'\" : ''## if (item.expanded) { #data-expanded='true' aria-expanded='true'# } #>#= r.itemElement(data) #</li>"),loading:i("<div class='k-icon k-i-loading' /> #: data.messages.loading #"),retry:i("#: data.messages.requestFailed # <button class='k-button k-request-retry'>#: data.messages.retry #</button>")}},items:function(){return this.element.find(".k-item > div:first-child")},setDataSource:function(t){var n=this.options;n.dataSource=t,this._dataSource(),n.checkboxes&&n.checkboxes.checkChildren&&this.dataSource.one("change",e.proxy(this.updateIndeterminate,this,null)),this.options.autoBind&&this.dataSource.fetch()},_bindDataSource:function(){this._refreshHandler=w(this.refresh,this),this._errorHandler=w(this._error,this),this.dataSource.bind(E,this._refreshHandler),this.dataSource.bind(F,this._errorHandler)},_unbindDataSource:function(){var e=this.dataSource;e&&(e.unbind(E,this._refreshHandler),e.unbind(F,this._errorHandler))},_dataSource:function(e){function t(e){for(var n=0;n<e.length;n++)e[n]._initChildren(),e[n].children.fetch(),t(e[n].children.view())}var n=this,i=n.options,r=i.dataSource;r=_(r)?{data:r}:r,n._unbindDataSource(),r.fields||(r.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]),n.dataSource=r=k.create(r),e&&(r.fetch(),t(r.view())),n._bindDataSource()},events:[M,z,H,N,P,D,A,C,E,S,T],options:{name:"TreeView",dataSource:{},animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:100}},messages:{loading:"Loading...",requestFailed:"Request failed.",retry:"Retry"},dragAndDrop:!1,checkboxes:!1,autoBind:!0,autoScroll:!1,loadOnDemand:!0,template:"",dataTextField:null},_accessors:function(){var e,t,n,i=this,r=i.options,o=i.element;for(e in G)t=r[G[e]],n=o.attr(f.attr(e+"-field")),!t&&n&&(t=n),t||(t=e),_(t)||(t=[t]),r[G[e]]=t},_fieldAccessor:function(t){var n=this.options[G[t]],i=n.length,r="(function(item) {";return 0===i?r+="return item['"+t+"'];":(r+="var levels = ["+e.map(n,function(e){return"function(d){ return "+f.expr(e)+"}"}).join(",")+"];",r+="return levels[Math.min(item.level(), "+i+"-1)](item)"),r+="})"},setOptions:function(e){b.fn.setOptions.call(this,e),this._animation(),this._dragging(),this._templates()},_trigger:function(e,t){return this.trigger(e,{node:t.closest(U)[0]})},_setChecked:function(t,n){if(t&&e.isFunction(t.view))for(var i=0,r=t.view();i<r.length;i++)r[i][R]=n,r[i].children&&this._setChecked(r[i].children,n)},_setIndeterminate:function(e){var t,n,i,o=d(e),a=!0;if(o.length&&(t=r(o.children()),n=t.length)){if(n>1){for(i=1;i<n;i++)if(t[i].checked!=t[i-1].checked||t[i].indeterminate||t[i-1].indeterminate){a=!1;break}}else a=!t[0].indeterminate;return r(e).data(I,!a).prop(I,!a).prop(R,a&&t[0].checked)}},updateIndeterminate:function(e){var t,n,i;if(e=e||this.wrapper,t=d(e).children(),t.length){for(n=0;n<t.length;n++)this.updateIndeterminate(t.eq(n));i=this._setIndeterminate(e),i&&i.prop(R)&&(this.dataItem(e).checked=!0)}},_bubbleIndeterminate:function(e){if(e.length){var t,n=this.parent(e);n.length&&(this._setIndeterminate(n),t=n.children("div").find(".k-checkbox-wrapper :checkbox"),t.prop(I)===!1?this.dataItem(n).set(R,t.prop(R)):delete this.dataItem(n).checked,this._bubbleIndeterminate(n))}},_checkboxChange:function(t){var n=e(t.target),i=n.prop(R),r=n.closest(U),o=this.dataItem(r);o.checked!=i&&(o.set(R,i),this._trigger(T,r))},_toggleButtonClick:function(t){var n=e(t.currentTarget).closest(U);n.is("[aria-disabled='true']")||this.toggle(e(t.target).closest(U))},_mousedown:function(t){var n=e(t.currentTarget).closest(U);n.is("[aria-disabled='true']")||(this._clickTarget=n,this.current(n))},_focusable:function(e){return e&&e.length&&e.is(":visible")&&!e.find(".k-in:first").hasClass("k-state-disabled")},_focus:function(){var t=this.select(),n=this._clickTarget;f.support.touch||(n&&n.length&&(t=n),this._focusable(t)||(t=this.current()),this._focusable(t)||(t=this._nextVisible(e())),this.current(t))},focus:function(){var e,t=this.wrapper,n=t[0],i=[],r=[],o=document.documentElement;do n=n.parentNode,n.scrollHeight>n.clientHeight&&(i.push(n),r.push(n.scrollTop));while(n!=o);for(t.focus(),e=0;e<i.length;e++)i[e].scrollTop=r[e]},_blur:function(){this.current().find(".k-in:first").removeClass("k-state-focused")},_enabled:function(e){return!e.children("div").children(".k-in").hasClass("k-state-disabled")},parent:function(t){var n,i,r=/\bk-treeview\b/,o=/\bk-item\b/;typeof t==q&&(t=this.element.find(t)),Y(t)||(t=t[0]),i=o.test(t.className);do t=t.parentNode,o.test(t.className)&&(i?n=t:i=!0);while(!r.test(t.className)&&!n);return e(n)},_nextVisible:function(e){function t(e){for(;e.length&&!e.next().length;)e=i.parent(e);return e.next().length?e.next():e}var n,i=this,r=i._expanded(e);return e.length&&e.is(":visible")?r?(n=d(e).children().first(),n.length||(n=t(e))):n=t(e):n=i.root.children().eq(0),i._enabled(n)||(n=i._nextVisible(n)),n},_previousVisible:function(e){var t,n,i=this;if(!e.length||e.prev().length)for(n=e.length?e.prev():i.root.children().last();i._expanded(n)&&(t=d(n).children().last(),t.length);)n=t;else n=i.parent(e)||e;return i._enabled(n)||(n=i._previousVisible(n)),n},_keydown:function(n){var i,r=this,o=n.keyCode,a=r.current(),s=r._expanded(a),l=a.find(".k-checkbox-wrapper:first :checkbox"),d=f.support.isRtl(r.element);n.target==n.currentTarget&&(!d&&o==y.RIGHT||d&&o==y.LEFT?s?i=r._nextVisible(a):r.expand(a):!d&&o==y.LEFT||d&&o==y.RIGHT?s?r.collapse(a):(i=r.parent(a),r._enabled(i)||(i=t)):o==y.DOWN?i=r._nextVisible(a):o==y.UP?i=r._previousVisible(a):o==y.HOME?i=r._nextVisible(e()):o==y.END?i=r._previousVisible(e()):o==y.ENTER?a.find(".k-in:first").hasClass("k-state-selected")||r._trigger(C,a)||r.select(a):o==y.SPACEBAR&&l.length&&(l.prop(R,!l.prop(R)).data(I,!1).prop(I,!1),r._checkboxChange({target:l}),i=a),i&&(n.preventDefault(),a[0]!=i[0]&&(r._trigger(S,i),r.current(i))))},_click:function(t){var n,i=this,r=e(t.currentTarget),o=c(r.closest(U)),a=r.attr("href");n=a?"#"==a||a.indexOf("#"+this.element.id+"-")>=0:o.length&&!o.children().length,n&&t.preventDefault(),r.hasClass(".k-state-selected")||i._trigger(C,r)||i.select(r)},_wrapper:function(){var e,t,n=this,i=n.element,r="k-widget k-treeview";i.is("ul")?(e=i.wrap("<div />").parent(),t=i):(e=i,t=e.children("ul").eq(0)),n.wrapper=e.addClass(r),n.root=t},_group:function(e){var t=this,n=e.hasClass(V),i={firstLevel:n,expanded:n||t._expanded(e)},r=e.children("ul");r.addClass(t.templates.groupCssClass(i)).css("display",i.expanded?"":"none"),t._nodes(r,i)},_nodes:function(t,n){var i,r=this,o=t.children("li");n=g({length:o.length},n),o.each(function(t,o){o=e(o),i={index:t,expanded:r._expanded(o)},s(o),r._updateNodeClasses(o,n,i),r._group(o)})},_checkboxes:function(){var e,t=this.options,n=t.checkboxes;n&&(e="<input type='checkbox' tabindex='-1' #= (item.enabled === false) ? 'disabled' : '' # #= item.checked ? 'checked' : '' #",n.name&&(e+=" name='"+n.name+"'"),e+=" id='_#= item.uid #' class='k-checkbox' /><label for='_#= item.uid #' class='k-checkbox-label'></label>",n=g({template:e},t.checkboxes),typeof n.template==q&&(n.template=v(n.template)),t.checkboxes=n)},_updateNodeClasses:function(e,t,n){var i,r,o=e.children("div"),a=e.children("ul"),s=this.templates;e.hasClass("k-treeview")||(n=n||{},n.expanded=typeof n.expanded!=B?n.expanded:this._expanded(e),n.index=typeof n.index!=B?n.index:e.index(),n.enabled=typeof n.enabled!=B?n.enabled:!o.children(".k-in").hasClass("k-state-disabled"),t=t||{},t.firstLevel=typeof t.firstLevel!=B?t.firstLevel:e.parent().parent().hasClass(V),t.length=typeof t.length!=B?t.length:e.parent().children().length,e.removeClass("k-first k-last").addClass(s.wrapperCssClass(t,n)),o.removeClass("k-top k-mid k-bot").addClass(s.cssClass(t,n)),i=o.children(".k-in"),r=i[0]&&"a"==i[0].nodeName.toLowerCase(),i.removeClass("k-in k-link k-state-default k-state-disabled").addClass(s.textClass(n,r)),(a.length||"true"==e.attr("data-hasChildren"))&&(o.children(".k-icon").removeClass("k-i-expand k-i-collapse").addClass(s.toggleButtonClass(n)),a.addClass("k-group")))},_processNodes:function(t,n){var i=this;i.element.find(t).each(function(t,r){n.call(i,t,e(r).closest(U))})},dataItem:function(t){var n=e(t).closest(U).attr(f.attr("uid")),i=this.dataSource;return i&&i.getByUid(n)},_insertNode:function(t,n,i,r,o){var a,l,c,u,h=this,f=d(i),p=f.children().length+1,m={firstLevel:i.hasClass(V),expanded:!o,length:p},g="",v=function(e,t){e.appendTo(t)};for(c=0;c<t.length;c++)u=t[c],u.index=n+c,g+=h._renderItem({group:m,item:u});if(l=e(g),l.length){for(h.angular("compile",function(){return{elements:l.get(),data:t.map(function(e){return{dataItem:e}})}}),f.length||(f=e(h._renderGroup({group:m})).appendTo(i)),r(l,f),i.hasClass("k-item")&&(s(i),h._updateNodeClasses(i)),h._updateNodeClasses(l.prev().first()),h._updateNodeClasses(l.next().last()),c=0;c<t.length;c++)u=t[c],u.hasChildren&&(a=u.children.data(),a.length&&h._insertNode(a,u.index,l.eq(c),v,!h._expanded(l.eq(c))));return l}},_updateNodes:function(t,n){function i(e,t){e.find(".k-checkbox-wrapper :checkbox").prop(R,t).data(I,!1).prop(I,!1)}var r,o,a,s,l,d,u,h=this,f={treeview:h.options,item:s},m="expanded"!=n&&"checked"!=n;if("selected"==n)s=t[0],o=h.findByUid(s.uid).find(".k-in:first").removeClass("k-state-hover").toggleClass("k-state-selected",s[n]).end(),s[n]&&h.current(o),o.attr(j,!!s[n]);else{for(u=e.map(t,function(e){return h.findByUid(e.uid).children("div")}),m&&h.angular("cleanup",function(){return{elements:u}}),r=0;r<t.length;r++)f.item=s=t[r],a=u[r],o=a.parent(),m&&a.children(".k-in").html(h.templates.itemContent(f)),n==R?(l=s[n],i(a,l),h.options.checkboxes.checkChildren&&(i(o.children(".k-group"),l),h._setChecked(s.children,l),h._bubbleIndeterminate(o))):"expanded"==n?h._toggle(o,s,s[n]):"enabled"==n&&(o.find(".k-checkbox-wrapper :checkbox").prop("disabled",!s[n]),d=!c(o).is(W),o.removeAttr($),s[n]||(s.selected&&s.set("selected",!1),s.expanded&&s.set("expanded",!1),d=!0,o.attr(j,!1).attr($,!0)),h._updateNodeClasses(o,{},{enabled:s[n],expanded:!d})),a.length&&this.trigger("itemChange",{item:a,data:s,ns:p});m&&h.angular("compile",function(){return{elements:u,data:e.map(t,function(e){return[{dataItem:e}]})}})}},_appendItems:function(e,t,n){var i=d(n),r=i.children(),o=!this._expanded(n);typeof e==B&&(e=r.length),this._insertNode(t,e,n,function(t,n){e>=r.length?t.appendTo(n):t.insertBefore(r.eq(e))},o),this._expanded(n)&&(this._updateNodeClasses(n),d(n).css("display","block"))},_refreshChildren:function(e,t,n){var i,r,o,a=this.options,l=a.loadOnDemand,c=a.checkboxes&&a.checkboxes.checkChildren;if(d(e).empty(),t.length)for(this._appendItems(n,t,e),r=d(e).children(),l&&c&&this._bubbleIndeterminate(r.last()),i=0;i<r.length;i++)o=r.eq(i),this.trigger("itemChange",{item:o.children("div"),data:this.dataItem(o),ns:p});else s(e)},_refreshRoot:function(t){var n,i,r,o=this._renderGroup({items:t,group:{firstLevel:!0,expanded:!0}});for(this.root.length?(this._angularItems("cleanup"),n=e(o),this.root.attr("class",n.attr("class")).html(n.html())):this.root=this.wrapper.html(o).children("ul"),this.root.attr("role","tree"),i=this.root.children(".k-item"),r=0;r<t.length;r++)this.trigger("itemChange",{item:i.eq(r),data:t[r],ns:p});this._angularItems("compile")},refresh:function(e){var n,i,r=e.node,o=e.action,a=e.items,s=this.wrapper,l=this.options,d=l.loadOnDemand,c=l.checkboxes&&l.checkboxes.checkChildren;if(e.field){if(!a[0]||!a[0].level)return;return this._updateNodes(a,e.field)}if(r&&(s=this.findByUid(r.uid),this._progress(s,!1)),c&&"remove"!=o){for(i=!1,n=0;n<a.length;n++)if("checked"in a[n]){i=!0;break}if(!i&&r&&r.checked)for(n=0;n<a.length;n++)a[n].checked=!0}if("add"==o?this._appendItems(e.index,a,s):"remove"==o?this._remove(this.findByUid(a[0].uid),!1):"itemchange"==o?this._updateNodes(a):"itemloaded"==o?this._refreshChildren(s,a,e.index):this._refreshRoot(a),"remove"!=o)for(n=0;n<a.length;n++)d&&!a[n].expanded||a[n].load();this.trigger(P,{node:r?s:t})},_error:function(e){var t=e.node&&this.findByUid(e.node.uid),n=this.templates.retry({messages:this.options.messages});t?(this._progress(t,!1),this._expanded(t,!1),u(t).addClass("k-i-refresh"),e.node.loaded(!1)):(this._progress(!1),this.element.html(n))},_retryRequest:function(e){e.preventDefault(),this.dataSource.fetch()},expand:function(e){this._processNodes(e,function(e,t){this.toggle(t,!0)})},collapse:function(e){this._processNodes(e,function(e,t){this.toggle(t,!1)})},enable:function(e,t){t=2!=arguments.length||!!t,this._processNodes(e,function(e,n){this.dataItem(n).set("enabled",t)})},current:function(n){var i=this,r=i._current,o=i.element,a=i._ariaId;return arguments.length>0&&n&&n.length?(r&&(r[0].id===a&&r.removeAttr("id"),r.find(".k-in:first").removeClass("k-state-focused")),r=i._current=e(n,o).closest(U),r.find(".k-in:first").addClass("k-state-focused"),a=r[0].id||a,a&&(i.wrapper.removeAttr("aria-activedescendant"),r.attr("id",a),i.wrapper.attr("aria-activedescendant",a)),t):(r||(r=i._nextVisible(e())),r)},select:function(n){var i=this,r=i.element;return arguments.length?(n=e(n,r).closest(U),r.find(".k-state-selected").each(function(){var t=i.dataItem(this);t?(t.set("selected",!1),delete t.selected):e(this).removeClass("k-state-selected")}),n.length&&(i.dataItem(n).set("selected",!0),i._clickTarget=n),i.trigger(E),t):r.find(".k-state-selected").closest(U)},_toggle:function(e,t,n){var i,r=this.options,o=c(e),a=n?"expand":"collapse";o.data("animating")||this._trigger(a,e)||(this._expanded(e,n),i=t&&t.loaded(),n&&!i?(r.loadOnDemand&&this._progress(e,!0),o.remove(),t.load()):(this._updateNodeClasses(e,{},{expanded:n}),n||o.css("height",o.height()).css("height"),o.kendoStop(!0,!0).kendoAnimate(g({reset:!0},r.animation[a],{complete:function(){n&&o.css("height","")}}))))},toggle:function(t,n){t=e(t),u(t).is(".k-i-expand, .k-i-collapse")&&(1==arguments.length&&(n=!this._expanded(t)),this._expanded(t,n))},destroy:function(){var e=this;b.fn.destroy.call(e),e.wrapper.off(x),e._unbindDataSource(),e.dragging&&e.dragging.destroy(),f.destroy(e.element),e.root=e.wrapper=e.element=null},_expanded:function(e,n){var i=f.attr("expanded"),r=this.dataItem(e),o=n;return 1==arguments.length?"true"===e.attr(i)||r&&r.expanded:(c(e).data("animating")||(r&&(r.set("expanded",o),o=r.expanded),o?(e.attr(i,"true"),e.attr("aria-expanded","true")):(e.removeAttr(i),e.attr("aria-expanded","false"))),t)},_progress:function(e,t){var n=this.element,i=this.templates.loading({messages:this.options.messages});1==arguments.length?(t=e,t?n.html(i):n.empty()):u(e).toggleClass("k-i-loading",t).removeClass("k-i-refresh")},text:function(e,n){var i=this.dataItem(e),r=this.options[G.text],o=i.level(),a=r.length,s=r[Math.min(o,a-1)];return n?(i.set(s,n),t):i[s]},_objectOrSelf:function(t){return e(t).closest("[data-role=treeview]").data("kendoTreeView")||this},_dataSourceMove:function(t,n,i,r){var o,a=this._objectOrSelf(i||n),s=a.dataSource,l=e.Deferred().resolve().promise();return i&&i[0]!=a.element[0]&&(o=a.dataItem(i),o.loaded()||(a._progress(i,!0),l=o.load()),i!=this.root&&(s=o.children,s&&s instanceof k||(o._initChildren(),o.loaded(!0),s=o.children))),t=this._toObservableData(t),r.call(a,s,t,l)},_toObservableData:function(t){var n,i,r=t;return(t instanceof window.jQuery||Y(t))&&(n=this._objectOrSelf(t).dataSource,i=e(t).attr(f.attr("uid")),r=n.getByUid(i),r&&(r=n.remove(r))),r},_insert:function(e,t,n){t instanceof f.data.ObservableArray?t=t.toJSON():_(t)||(t=[t]);var i=e.parent();return i&&i._initChildren&&(i.hasChildren=!0,i._initChildren()),e.splice.apply(e,[n,0].concat(t)),this.findByUid(e[n].uid)},insertAfter:o(1),insertBefore:o(0),append:function(t,n,i){var r=this.root;return n&&(r=d(n)),this._dataSourceMove(t,r,n,function(t,r,o){function a(){n&&l._expanded(n,!0);var e=t.data(),i=Math.max(e.length,0);return l._insert(e,r,i)}var s,l=this;return o.done(function(){s=a(),(i=i||e.noop)(s)}),s||null})},_remove:function(t,n){var i,r,o,a=this;return t=e(t,a.element),this.angular("cleanup",function(){return{elements:t.get()}}),i=t.parent().parent(),r=t.prev(),o=t.next(),t[n?"detach":"remove"](),i.hasClass("k-item")&&(s(i),a._updateNodeClasses(i)),a._updateNodeClasses(r),a._updateNodeClasses(o),t},remove:function(e){var t=this.dataItem(e);t&&this.dataSource.remove(t)},detach:function(e){return this._remove(e,!0)},findByText:function(t){return e(this.element).find(".k-in").filter(function(n,i){return e(i).text()==t}).closest(U)},findByUid:function(t){var n,i,r=this.element.find(".k-item"),o=f.attr("uid");for(i=0;i<r.length;i++)if(r[i].getAttribute(o)==t){n=r[i];break}return e(n)},expandPath:function(t,n){function i(){a.shift(),a.length?r(a[0]).then(i):s.call(o)}function r(t){var n=e.Deferred(),i=o.dataSource.get(t);return i?i.loaded()?(i.set("expanded",!0),n.resolve()):(o._progress(o.findByUid(i.uid),!0),i.load().then(function(){i.set("expanded",!0),n.resolve()})):n.resolve(),n.promise()}var o=this,a=t.slice(0),s=n||e.noop;r(a[0]).then(i)},_parentIds:function(e){for(var t=e&&e.parentNode(),n=[];t&&t.parentNode;)n.unshift(t.id),t=t.parentNode();return n},expandTo:function(e){e instanceof f.data.Node||(e=this.dataSource.get(e));var t=this._parentIds(e);this.expandPath(t)},_renderItem:function(e){return e.group||(e.group={}),e.treeview=this.options,e.r=this.templates,this.templates.item(e)},_renderGroup:function(e){var t=this;return e.renderItems=function(e){var n="",i=0,r=e.items,o=r?r.length:0,a=e.group;for(a.length=o;i<o;i++)e.group=a,e.item=r[i],e.item.index=i,n+=t._renderItem(e);return n},e.r=t.templates,t.templates.group(e)}}),p.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.pivot.fieldmenu.min",["kendo.pivotgrid.min","kendo.menu.min","kendo.window.min","kendo.treeview.min","kendo.dropdownlist.min"],e)}(function(){return function(e,t){function n(e,t){var n,i,r=[];for(n=0,i=e.length;n<i;n++)e[n].field!==t&&r.push(e[n]);return r}function i(e,t,n){var i,r,o,a;if(!e)return[];for(e=e.filters,i=0,r=[],o=e.length;i<o;i++)a=e[i].operator,(n||"in"===a)&&a!==n||e[i].field!==t||r.push(e[i]);return r}function r(t,n,r){var o,a=0,s=r.length;if(t=i(t,n,"in")[0])for(o=t.value.split(",");a<s;a++)r[a].checked=e.inArray(r[a].uniqueName,o)>=0;else for(;a<s;a++)r[a].checked=!0}function o(e,t){var n,i=e.length;for(n=0;n<i;n++)e[n].checked&&0!==e[n].level()&&t.push(e[n].uniqueName),e[n].hasChildren&&o(e[n].children.view(),t)}var a=window.kendo,s=a.ui,l="kendoContextMenu",d=e.proxy,c=".kendoPivotFieldMenu",u=s.Widget,h=u.extend({init:function(e,t){u.fn.init.call(this,e,t),this._dataSource(),this._layout(),a.notify(this)},events:[],options:{name:"PivotFieldMenu",filter:null,filterable:!0,sortable:!0,messages:{info:"Show items with value that:",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filterFields:"Fields Filter",filter:"Filter",include:"Include Fields...",title:"Fields to include",clear:"Clear",ok:"OK",cancel:"Cancel",operators:{contains:"Contains",doesnotcontain:"Does not contain",startswith:"Starts with",endswith:"Ends with",eq:"Is equal to",neq:"Is not equal to"}}},_layout:function(){var t=this.options;this.wrapper=e(a.template(p)({ns:a.ns,filterable:t.filterable,sortable:t.sortable,messages:t.messages})),this.menu=this.wrapper[l]({filter:t.filter,target:this.element,orientation:"vertical",showOn:"click",closeOnClick:!1,open:d(this._menuOpen,this),select:d(this._select,this),copyAnchorStyles:!1}).data(l),this._createWindow(),t.filterable&&this._initFilterForm()},_initFilterForm:function(){var e=this.menu.element.find(".k-filter-item"),t=d(this._filter,this);this._filterOperator=new a.ui.DropDownList(e.find("select")),this._filterValue=e.find(".k-textbox"),e.on("submit"+c,t).on("click"+c,".k-button-filter",t).on("click"+c,".k-button-clear",d(this._reset,this))},_setFilterForm:function(e){var t=this._filterOperator,n="",i="";e&&(n=e.operator,i=e.value),t.value(n),t.value()||t.select(0),this._filterValue.val(i)},_clearFilters:function(e){var t,n,r=this.dataSource.filter()||{},o=0;for(r.filters=r.filters||[],t=i(r,e),n=t.length;o<n;o++)r.filters.splice(r.filters.indexOf(t[o]),1);return r},_convert:function(t){var n=this.dataSource.options.schema,i=((n.model||{}).fields||{})[this.currentMember];return i&&("number"===i.type?t=parseFloat(t):"boolean"===i.type&&(t=!!e.parseJSON(t))),t},_filter:function(e){var n,i,r=this,o=r._convert(r._filterValue.val());return e.preventDefault(),""===o?(r.menu.close(),t):(n={field:r.currentMember,operator:r._filterOperator.value(),value:o},i=r._clearFilters(r.currentMember),i.filters.push(n),r.dataSource.filter(i),r.menu.close(),t)},_reset:function(e){var t=this,n=t._clearFilters(t.currentMember);e.preventDefault(),n.filters[0]||(n={}),t.dataSource.filter(n),t._setFilterForm(null),t.menu.close()},_sort:function(e){var t=this.currentMember,i=this.dataSource.sort()||[];i=n(i,t),i.push({field:t,dir:e}),this.dataSource.sort(i),this.menu.close()},setDataSource:function(e){this.options.dataSource=e,this._dataSource()},_dataSource:function(){this.dataSource=a.data.PivotDataSource.create(this.options.dataSource)},_createWindow:function(){var t=this.options.messages;this.includeWindow=e(a.template(m)({messages:t})).on("click"+c,".k-button-ok",d(this._applyIncludes,this)).on("click"+c,".k-button-cancel",d(this._closeWindow,this)),this.includeWindow=new s.Window(this.includeWindow,{title:t.title,visible:!1,resizable:!1,open:d(this._windowOpen,this)})},_applyIncludes:function(e){var t,n=[],r=this.treeView.dataSource.view(),a=r[0].checked,s=this.dataSource.filter(),l=i(s,this.currentMember,"in")[0];o(r,n),l&&(a?(s.filters.splice(s.filters.indexOf(l),1),s.filters.length||(s={})):l.value=n.join(","),t=s),n.length&&(t||a||(t={field:this.currentMember,operator:"in",value:n.join(",")},s&&(s.filters.push(t),t=s))),t&&this.dataSource.filter(t),this._closeWindow(e)},_closeWindow:function(e){e.preventDefault(),this.includeWindow.close()},_treeViewDataSource:function(){var e=this;return a.data.HierarchicalDataSource.create({schema:{model:{id:"uniqueName",hasChildren:function(e){return parseInt(e.childrenCardinality,10)>0}}},transport:{read:function(t){var n={},i=e.treeView.dataSource.get(t.data.uniqueName),o=t.data.uniqueName;o?(n.memberUniqueName=i.uniqueName.replace(/\&/g,"&amp;"),n.treeOp=1):n.levelUniqueName=e.currentMember+".[(ALL)]",e.dataSource.schemaMembers(n).done(function(n){r(e.dataSource.filter(),e.currentMember,n),t.success(n)}).fail(t.error)}}})},_createTreeView:function(e){var t=this;t.treeView=new s.TreeView(e,{autoBind:!1,dataSource:t._treeViewDataSource(),dataTextField:"caption",template:"#: data.item.caption || data.item.name #",checkboxes:{checkChildren:!0},dataBound:function(){s.progress(t.includeWindow.element,!1)}})},_menuOpen:function(t){if(t.event){var n=a.attr("name");this.currentMember=e(t.event.target).closest("["+n+"]").attr(n),this.options.filterable&&this._setFilterForm(i(this.dataSource.filter(),this.currentMember)[0])}},_select:function(t){var n=e(t.item);e(".k-pivot-filter-window").not(this.includeWindow.element).kendoWindow("close"),n.hasClass("k-include-item")?this.includeWindow.center().open():n.hasClass("k-sort-asc")?this._sort("asc"):n.hasClass("k-sort-desc")&&this._sort("desc")},_windowOpen:function(){this.treeView||this._createTreeView(this.includeWindow.element.find(".k-treeview")),s.progress(this.includeWindow.element,!0),this.treeView.dataSource.read()},destroy:function(){u.fn.destroy.call(this),this.menu&&(this.menu.destroy(),this.menu=null),this.treeView&&(this.treeView.destroy(),this.treeView=null),this.includeWindow&&(this.includeWindow.destroy(),this.includeWindow=null),this.wrapper=null,this.element=null}}),f='<div class="k-filterable k-content" tabindex="-1" data-role="fieldmenu"><form class="k-filter-menu"><div><div class="k-filter-help-text">#=messages.info#</div><select>#for(var op in messages.operators){#<option value="#=op#">#=messages.operators[op]#</option>#}#</select><input class="k-textbox" type="text" /><div><a class="k-button k-primary k-button-filter" href="\\#">#=messages.filter#</a><a class="k-button k-button-clear" href="\\#">#=messages.clear#</a></div></div></form></div>',p='<ul class="k-pivot-fieldmenu"># if (sortable) {#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-icon k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-icon k-i-sort-desc"></span>${messages.sortDescending}</span></li># if (filterable) {#<li class="k-separator"></li># } ## } ## if (filterable) {#<li class="k-item k-include-item"><span class="k-link"><span class="k-icon k-i-filter"></span>${messages.include}</span></li><li class="k-separator"></li><li class="k-item k-filter-item"><span class="k-link"><span class="k-icon k-i-filter"></span>${messages.filterFields}</span><ul><li>'+f+"</li></ul></li># } #</ul>",m='<div class="k-popup-edit-form k-pivot-filter-window"><div class="k-edit-form-container"><div class="k-treeview"></div><div class="k-edit-buttons k-state-default"><a class="k-button k-primary k-button-ok" href="\\#">${messages.ok}</a><a class="k-button k-button-cancel" href="\\#">${messages.cancel}</a></div></div>';s.plugin(h)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.filtercell.min",["kendo.autocomplete.min","kendo.datepicker.min","kendo.numerictextbox.min","kendo.combobox.min","kendo.dropdownlist.min"],e)}(function(){return function(e,t){function n(t){var n="string"==typeof t?t:t.operator;return e.inArray(n,v)>-1}function i(t,n){var r,o,a=[];if(e.isPlainObject(t))if(t.hasOwnProperty("filters"))a=t.filters;else if(t.field==n)return t;for(e.isArray(t)&&(a=t),r=0;r<a.length;r++)if(o=i(a[r],n))return o}function r(t,n){t.filters&&(t.filters=e.grep(t.filters,function(e){return r(e,n),e.filters?e.filters.length:e.field!=n}))}function o(e,t){var n=a.getter(t,!0);return function(t){for(var i,r,o=e(t),a=[],s=0,l={};s<o.length;)i=o[s++],r=n(i),l.hasOwnProperty(r)||(a.push(i),l[r]=!0);return a}}var a=window.kendo,s=a.ui,l=a.data.DataSource,d=s.Widget,c="change",u="boolean",h="enums",f="string",p="Is equal to",m="Is not equal to",g=e.proxy,v=["isnull","isnotnull","isempty","isnotempty"],_=d.extend({init:function(i,r){var o,s,l,p,m,v,_,b,k,w,y,x,C;if(i=e(i).addClass("k-filtercell"),o=this.wrapper=e("<span/>").appendTo(i),s=this,m=r,b=s.operators=r.operators||{},k=s.input=e("<input/>").attr(a.attr("bind"),"value: value").appendTo(o),w=r?r.suggestDataSource:null,w&&(r=e.extend({},r,{suggestDataSource:{}})),d.fn.init.call(s,i[0],r),w&&(s.options.suggestDataSource=w),r=s.options,l=s.dataSource=r.dataSource,s.model=l.reader.model,_=r.type=f,y=a.getter("reader.model.fields",!0)(l)||{},x=y[r.field],x&&x.type&&(_=r.type=x.type),r.values&&(r.type=_=h),b=b[_]||r.operators[_],!m.operator)for(v in b){r.operator=v;break}s._parse=function(e){return null!=e?e+"":e},s.model&&s.model.fields&&(C=s.model.fields[r.field],C&&C.parse&&(s._parse=g(C.parse,C))),s.defaultOperator=r.operator,s.viewModel=p=a.observable({operator:r.operator,value:null,operatorVisible:function(){var e=this.get("value");return null!==e&&e!==t&&"undefined"!=e||n(this.get("operator"))&&!s._clearInProgress}}),p.bind(c,g(s.updateDsFilter,s)),_==f&&s.initSuggestDataSource(r),null!==r.inputWidth&&k.width(r.inputWidth),s._setInputType(r,_),_!=u&&r.showOperators!==!1?s._createOperatorDropDown(b):o.addClass("k-operator-hidden"),s._createClearIcon(),a.bind(this.wrapper,p),_==f&&(r.template||s.setAutoCompleteSource()),_==h&&s.setComboBoxSource(s.options.values),s._refreshUI(),s._refreshHandler=g(s._refreshUI,s),s.dataSource.bind(c,s._refreshHandler)},_setInputType:function(t,n){var i,r,o,s,l,d=this,c=d.input;"function"==typeof t.template?(t.template.call(d.viewModel,{element:d.input,dataSource:d.suggestDataSource}),d._angularItems("compile")):n==f?c.attr(a.attr("role"),"autocomplete").attr(a.attr("text-field"),t.dataTextField||t.field).attr(a.attr("filter"),t.suggestionOperator).attr(a.attr("delay"),t.delay).attr(a.attr("min-length"),t.minLength).attr(a.attr("value-primitive"),!0):"date"==n?c.attr(a.attr("role"),"datepicker"):n==u?(c.remove(),i=e("<input type='radio'/>"),r=d.wrapper,o=a.guid(),s=e("<label/>").text(t.messages.isTrue).append(i),i.attr(a.attr("bind"),"checked:value").attr("name",o).val("true"),l=s.clone().text(t.messages.isFalse),i.clone().val("false").appendTo(l),r.append([s,l])):"number"==n?c.attr(a.attr("role"),"numerictextbox"):n==h&&c.attr(a.attr("role"),"combobox").attr(a.attr("text-field"),"text").attr(a.attr("suggest"),!0).attr(a.attr("filter"),"contains").attr(a.attr("value-field"),"value").attr(a.attr("value-primitive"),!0)},_createOperatorDropDown:function(t){var n,i,r=[];for(n in t)r.push({text:t[n],value:n});i=e('<input class="k-dropdown-operator" '+a.attr("bind")+'="value: operator"/>').appendTo(this.wrapper),this.operatorDropDown=i.kendoDropDownList({dataSource:r,dataTextField:"text",dataValueField:"value",open:function(){this.popup.element.width(150)},valuePrimitive:!0}).data("kendoDropDownList"),
this.operatorDropDown.wrapper.find(".k-i-arrow-s").removeClass("k-i-arrow-s").addClass("k-i-filter")},initSuggestDataSource:function(e){var n=e.suggestDataSource;n instanceof l||(!e.customDataSource&&n&&(n.group=t),n=this.suggestDataSource=l.create(n)),e.customDataSource||(n._pageSize=t,n.reader.data=o(n.reader.data,this.options.field)),this.suggestDataSource=n},setAutoCompleteSource:function(){var e=this.input.data("kendoAutoComplete");e&&e.setDataSource(this.suggestDataSource)},setComboBoxSource:function(e){var t=l.create({data:e}),n=this.input.data("kendoComboBox");n&&n.setDataSource(t)},_refreshUI:function(){var t=this,n=i(t.dataSource.filter(),this.options.field)||{},r=t.viewModel;t.manuallyUpdatingVM=!0,n=e.extend(!0,{},n),t.options.type==u&&r.value!==n.value&&t.wrapper.find(":radio").prop("checked",!1),n.operator&&r.set("operator",n.operator),r.set("value",n.value),t.manuallyUpdatingVM=!1},updateDsFilter:function(i){var r,o,a,s,l=this,d=l.viewModel;l.manuallyUpdatingVM||"operator"==i.field&&d.value===t&&!n(d)||(r=e.extend({},l.viewModel.toJSON(),{field:l.options.field}),o={logic:"and",filters:[]},a=!1,(r.value!==t&&null!==r.value||n(r)&&!this._clearInProgress)&&(o.filters.push(r),a=l.trigger(c,{filter:o,field:l.options.field})),l._clearInProgress&&(a=l.trigger(c,{filter:null,field:l.options.field})),a||(s=l._merge(o),l.dataSource.filter(s.filters.length?s:{})))},_merge:function(t){var i,o,a,s=this,l=t.logic||"and",d=t.filters,c=s.dataSource.filter()||{filters:[],logic:"and"};for(r(c,s.options.field),o=0,a=d.length;o<a;o++)i=d[o],i.value=s._parse(i.value);return d=e.grep(d,function(e){return""!==e.value&&null!==e.value||n(e)}),d.length&&(c.filters.length?(t.filters=d,"and"!==c.logic&&(c.filters=[{logic:c.logic,filters:c.filters}],c.logic="and"),c.filters.push(d.length>1?t:d[0])):(c.filters=d,c.logic=l)),c},_createClearIcon:function(){var t=this;e("<button type='button' class='k-button k-button-icon' title = "+t.options.messages.clear+"/>").attr(a.attr("bind"),"visible:operatorVisible").html("<span class='k-icon k-i-close'/>").click(g(t.clearFilter,t)).appendTo(t.wrapper)},clearFilter:function(){this._clearInProgress=!0,n(this.viewModel.operator)&&this.viewModel.set("operator",this.defaultOperator),this.viewModel.set("value",null),this._clearInProgress=!1},_angularItems:function(e){var t=this.wrapper.closest("th").get(),n=this.options.column;this.angular(e,function(){return{elements:t,data:[{column:n}]}})},destroy:function(){var e=this;e.filterModel=null,e.operatorDropDown=null,e._angularItems("cleanup"),e._refreshHandler&&(e.dataSource.bind(c,e._refreshHandler),e._refreshHandler=null),a.unbind(e.element),d.fn.destroy.call(e),a.destroy(e.element)},events:[c],options:{name:"FilterCell",delay:200,minLength:1,inputWidth:null,values:t,customDataSource:!1,field:"",dataTextField:"",type:"string",suggestDataSource:null,suggestionOperator:"startswith",operator:"eq",showOperators:!0,template:null,messages:{isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",operator:"Operator"},operators:{string:{eq:p,neq:m,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with",isnull:"Is null",isnotnull:"Is not null",isempty:"Is empty",isnotempty:"Is not empty"},number:{eq:p,neq:m,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than",isnull:"Is null",isnotnull:"Is not null"},date:{eq:p,neq:m,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before",isnull:"Is null",isnotnull:"Is not null"},enums:{eq:p,neq:m,isnull:"Is null",isnotnull:"Is not null"}}}});s.plugin(_)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.panelbar.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(t){t=e(t),t.children(v).children(".k-icon").remove(),t.filter(":has(.k-panel),:has(.k-content)").children(".k-link:not(:has([class*=k-i-arrow]))").each(function(){var t=e(this),n=t.parent();t.append("<span class='k-icon "+(n.hasClass(A)?"k-i-arrow-n k-panelbar-collapse":"k-i-arrow-s k-panelbar-expand")+"'/>")})}function i(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(x),t.filter(".k-last:not(:last-child)").removeClass(m),t.filter(":first-child").addClass(x),t.filter(":last-child").addClass(m)}var r=window.kendo,o=r.ui,a=r.keys,s=e.extend,l=e.each,d=r.template,c=o.Widget,u=/^(ul|a|div)$/i,h=".kendoPanelBar",f="img",p="href",m="k-last",g="k-link",v="."+g,_="error",b=".k-item",k=".k-group",w=k+":visible",y="k-image",x="k-first",C="expand",T="select",S="k-content",D="activate",E="collapse",F="mouseenter",R="mouseleave",I="contentLoad",A="k-state-active",M="> .k-panel",z="> .k-content",H="k-state-focused",N="k-state-disabled",P="k-state-selected",L="."+P,B="k-state-highlight",O=b+":not(.k-state-disabled)",V="> "+O+" > "+v+", .k-panel > "+O+" > "+v,W=b+".k-state-disabled > .k-link",U="> li > "+L+", .k-panel > li > "+L,q="k-state-default",j="aria-disabled",$="aria-expanded",G="aria-hidden",Y="aria-selected",K=":visible",Q=":empty",X="single",J={content:d("<div role='region' class='k-content'#= contentAttributes(data) #>#= content(item) #</div>"),group:d("<ul role='group' aria-hidden='true' class='#= groupCssClass(group) #'#= groupAttributes(group) #>#= renderItems(data) #</ul>"),itemWrapper:d("<#= tag(item) # class='#= textClass(item, group) #' #= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:d("<li role='menuitem' #=aria(item)#class='#= wrapperCssClass(group, item) #'>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, panelBar: panelBar, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:d("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:d("<span class='#= arrowClass(item) #'></span>"),sprite:d("<span class='k-sprite #= spriteCssClass #'></span>"),empty:d("")},Z={aria:function(e){var t="";return(e.items||e.content||e.contentUrl)&&(t+=$+"='"+(e.expanded?"true":"false")+"' "),e.enabled===!1&&(t+=j+"='true'"),t},wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" "+N:t.expanded===!0?" "+A:" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(e,t){var n=g;return t.firstLevel&&(n+=" k-header"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e){var t="k-icon";return t+=e.expanded?" k-i-arrow-n k-panelbar-collapse":" k-i-arrow-s k-panelbar-expand"},text:function(e){return e.encoded===!1?e.text:r.htmlEncode(e.text)},tag:function(e){return e.url||e.contentUrl?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-panel"},contentAttributes:function(e){return e.item.expanded!==!0?" style='display:none'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?'href="'+e.contentUrl+'"':""}},ee=c.extend({init:function(t,n){var i,o=this;c.fn.init.call(o,t,n),t=o.wrapper=o.element.addClass("k-widget k-reset k-header k-panelbar"),n=o.options,t[0].id&&(o._itemId=t[0].id+"_pb_active"),o._tabindex(),o._initData(n),o._updateClasses(),o._animations(n),t.on("click"+h,V,function(t){o._click(e(t.currentTarget))&&t.preventDefault()}).on(F+h+" "+R+h,V,o._toggleHover).on("click"+h,W,!1).on("keydown"+h,e.proxy(o._keydown,o)).on("focus"+h,function(){var e=o.select();o._current(e[0]?e:o._first())}).on("blur"+h,function(){o._current(null)}).attr("role","menu"),i=t.find("li."+A+" > ."+S),i[0]&&o.expand(i.parent(),!1),n.dataSource&&o._angularCompile(),r.notify(o)},events:[C,E,T,D,_,I],options:{name:"PanelBar",animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:200}},expandMode:"multiple"},_angularCompile:function(){var e=this;e.angular("compile",function(){return{elements:e.element.children("li"),data:[{dataItem:e.options.$angular}]}})},_angularCleanup:function(){var e=this;e.angular("cleanup",function(){return{elements:e.element.children("li")}})},destroy:function(){c.fn.destroy.call(this),this.element.off(h),this._angularCleanup(),r.destroy(this.element)},_initData:function(e){var t=this;e.dataSource&&(t.element.empty(),t.append(e.dataSource,t.element))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=s(!0,t,e.animation),"dataSource"in e&&this._initData(e),c.fn.setOptions.call(this,e)},expand:function(n,i){var r=this,o={};return n=this.element.find(n),r._animating&&n.find("ul").is(":visible")?(r.one("complete",function(){setTimeout(function(){r.expand(n)})}),t):(r._animating=!0,i=i!==!1,n.each(function(t,a){a=e(a);var s=a.find(M).add(a.find(z));if(!a.hasClass(N)&&s.length>0){if(r.options.expandMode==X&&r._collapseAllExpanded(a))return r;n.find("."+B).removeClass(B),a.addClass(B),i||(o=r.options.animation,r.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),r._triggerEvent(C,a)||r._toggleItem(a,!1),i||(r.options.animation=o)}}),r)},collapse:function(t,n){var i=this,r={};return i._animating=!0,n=n!==!1,t=i.element.find(t),t.each(function(t,o){o=e(o);var a=o.find(M).add(o.find(z));!o.hasClass(N)&&a.is(K)&&(o.removeClass(B),n||(r=i.options.animation,i.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),i._triggerEvent(E,o)||i._toggleItem(o,!0),n||(i.options.animation=r))}),i},_toggleDisabled:function(e,t){e=this.element.find(e),e.toggleClass(q,t).toggleClass(N,!t).attr(j,!t)},select:function(n){var i=this;return n===t?i.element.find(U).parent():(n=i.element.find(n),n.length?n.each(function(){var n=e(this),r=n.children(v);return n.hasClass(N)?i:(i._triggerEvent(T,n)||i._updateSelected(r),t)}):this._updateSelected(n),i)},clearSelection:function(){this.select(e())},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var r=this._insert(e,t,t.length?t.find(M):null);return l(r.items,function(){r.group.append(this),i(this)}),n(t),i(r.group.find(".k-first, .k-last")),r.group.height("auto"),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return l(n.items,function(){t.before(this),i(this)}),i(t),n.group.height("auto"),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return l(n.items,function(){t.after(this),i(this)}),i(t),n.group.height("auto"),this},remove:function(e){e=this.element.find(e);var t=this,r=e.parentsUntil(t.element,b),o=e.parent("ul");return e.remove(),!o||o.hasClass("k-panelbar")||o.children(b).length||o.remove(),r.length&&(r=r.eq(0),n(r),i(r)),t},reload:function(t){var n=this;t=n.element.find(t),t.each(function(){var t=e(this);n._ajaxRequest(t,t.children("."+S),!t.is(K))})},_first:function(){return this.element.children(O).first()},_last:function(){var e=this.element.children(O).last(),t=e.children(w);return t[0]?t.children(O).last():e},_current:function(n){var i=this,r=i._focused,o=i._itemId;return n===t?r:(i.element.removeAttr("aria-activedescendant"),r&&r.length&&(r[0].id===o&&r.removeAttr("id"),r.children(v).removeClass(H)),e(n).length&&(o=n[0].id||o,n.attr("id",o).children(v).addClass(H),i.element.attr("aria-activedescendant",o)),i._focused=n,t)},_keydown:function(e){var t=this,n=e.keyCode,i=t._current();e.target==e.currentTarget&&(n==a.DOWN||n==a.RIGHT?(t._current(t._nextItem(i)),e.preventDefault()):n==a.UP||n==a.LEFT?(t._current(t._prevItem(i)),e.preventDefault()):n==a.ENTER||n==a.SPACEBAR?(t._click(i.children(v)),e.preventDefault()):n==a.HOME?(t._current(t._first()),e.preventDefault()):n==a.END&&(t._current(t._last()),e.preventDefault()))},_nextItem:function(e){if(!e)return this._first();var t=e.children(w),n=e.nextAll(":visible").first();return t[0]&&(n=t.children("."+x)),n[0]||(n=e.parent(w).parent(b).next()),n[0]||(n=this._first()),n.hasClass(N)&&(n=this._nextItem(n)),n},_prevItem:function(e){if(!e)return this._last();var t,n=e.prevAll(":visible").first();if(n[0])for(t=n;t[0];)t=t.children(w).children("."+m),t[0]&&(n=t);else n=e.parent(w).parent(b),n[0]||(n=this._last());return n.hasClass(N)&&(n=this._prevItem(n)),n},_insert:function(t,n,i){var o,a,l=this,d=e.isPlainObject(t),c=n&&n[0];return c||(i=l.element),a={firstLevel:i.hasClass("k-panelbar"),expanded:i.parent().hasClass(A),length:i.children().length},c&&!i.length&&(i=e(ee.renderGroup({group:a})).appendTo(n)),t instanceof r.Observable&&(t=t.toJSON()),d||e.isArray(t)?(o=e.map(d?[t]:t,function(t,n){return e("string"==typeof t?t:ee.renderItem({group:a,item:s(t,{index:n})}))}),c&&n.attr($,!1)):(o="string"==typeof t&&"<"!=t.charAt(0)?l.element.find(t):e(t),l._updateItemsClasses(o)),{items:o,group:i}},_toggleHover:function(t){var n=e(t.currentTarget);n.parents("li."+N).length||n.toggleClass("k-state-hover",t.type==F)},_updateClasses:function(){var t,r,o=this;t=o.element.find("li > ul").not(function(){return e(this).parentsUntil(".k-panelbar","div").length}).addClass("k-group k-panel").attr("role","group"),t.parent().attr($,!1).not("."+A).children("ul").attr(G,!0).hide(),r=o.element.add(t).children(),o._updateItemsClasses(r),n(r),i(r)},_updateItemsClasses:function(e){for(var t=e.length,n=0;n<t;n++)this._updateItemClasses(e[n],n)},_updateItemClasses:function(t,n){var i,o,a=this._selected,s=this.options.contentUrls,l=s&&s[n],d=this.element[0];t=e(t).addClass("k-item").attr("role","menuitem"),r.support.browser.msie&&t.css("list-style-position","inside").css("list-style-position",""),t.children(f).addClass(y),o=t.children("a").addClass(g),o[0]&&(o.attr("href",l),o.children(f).addClass(y)),t.filter(":not([disabled]):not([class*=k-state])").addClass("k-state-default"),t.filter("li[disabled]").addClass("k-state-disabled").attr(j,!0).removeAttr("disabled"),t.children("div").addClass(S).attr("role","region").attr(G,!0).hide().parent().attr($,!1),o=t.children(L),o[0]&&(a&&a.removeAttr(Y).children(L).removeClass(P),o.addClass(P),this._selected=t.attr(Y,!0)),t.children(v)[0]||(i="<span class='"+g+"'/>",s&&s[n]&&t[0].parentNode==d&&(i='<a class="k-link k-header" href="'+s[n]+'"/>'),t.contents().filter(function(){return!(this.nodeName.match(u)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll(i)),t.parent(".k-panelbar")[0]&&t.children(v).addClass("k-header")},_click:function(e){var t,n,i,r,o,a,s,l=this,d=l.element;if(!e.parents("li."+N).length&&e.closest(".k-widget")[0]==d[0]){if(o=e.closest(v),a=o.closest(b),l._updateSelected(o),n=a.find(M).add(a.find(z)),i=o.attr(p),r=i&&("#"==i.charAt(i.length-1)||i.indexOf("#"+l.element[0].id+"-")!=-1),t=!(!r&&!n.length),n.data("animating"))return t;if(l._triggerEvent(T,a)&&(t=!0),t!==!1)return l.options.expandMode==X&&l._collapseAllExpanded(a)?t:(n.length&&(s=n.is(K),l._triggerEvent(s?E:C,a)||(t=l._toggleItem(a,s))),t)}},_toggleItem:function(e,n){var i,r,o=this,a=e.find(M),s=e.find(v),l=s.attr(p);return a.length?(this._toggleGroup(a,n),i=!0):(r=e.children("."+S),r.length&&(i=!0,r.is(Q)&&l!==t?o._ajaxRequest(e,r,n):o._toggleGroup(r,n))),i},_toggleGroup:function(e,n){var i=this,r=i.options.animation,o=r.expand,a=s({},r.collapse),l=a&&"effects"in a;return e.is(K)!=n?(i._animating=!1,t):(e.parent().attr($,!n).attr(G,n).toggleClass(A,!n).find("> .k-link > .k-icon").toggleClass("k-i-arrow-n",!n).toggleClass("k-panelbar-collapse",!n).toggleClass("k-i-arrow-s",n).toggleClass("k-panelbar-expand",n),n?(o=s(l?a:s({reverse:!0},o),{hide:!0}),o.complete=function(){i._animationCallback()}):o=s({complete:function(e){i._triggerEvent(D,e.closest(b)),i._animationCallback()}},o),e.kendoStop(!0,!0).kendoAnimate(o),t)},_animationCallback:function(){var e=this;e.trigger("complete"),e._animating=!1},_collapseAllExpanded:function(t){var n,i=this,r=!1,o=t.find(M).add(t.find(z));return o.is(K)&&(r=!0),o.is(K)||0===o.length||(n=t.siblings(),n.find(M).add(n.find(z)).filter(function(){return e(this).is(K)}).each(function(t,n){n=e(n),r=i._triggerEvent(E,n.closest(b)),r||i._toggleGroup(n,!0)})),r},_ajaxRequest:function(t,n,i){var r=this,o=t.find(".k-panelbar-collapse, .k-panelbar-expand"),a=t.find(v),s=setTimeout(function(){o.addClass("k-i-loading")},100),l={},d=a.attr(p);e.ajax({type:"GET",cache:!1,url:d,dataType:"html",data:l,error:function(e,t){o.removeClass("k-i-loading"),r.trigger(_,{xhr:e,status:t})&&this.complete()},complete:function(){clearTimeout(s),o.removeClass("k-i-loading")},success:function(e){function o(){return{elements:n.get()}}try{r.angular("cleanup",o),n.html(e),r.angular("compile",o)}catch(a){var s=window.console;s&&s.error&&s.error(a.name+": "+a.message+" in "+d),this.error(this.xhr,"error")}r._toggleGroup(n,i),r.trigger(I,{item:t[0],contentElement:n[0]})}})},_triggerEvent:function(e,t){var n=this;return n.trigger(e,{item:t[0]})},_updateSelected:function(e){var t=this,n=t.element,i=e.parent(b),r=t._selected;r&&r.removeAttr(Y),t._selected=i.attr(Y,!0),n.find(U).removeClass(P),n.find("> ."+B+", .k-panel > ."+B).removeClass(B),e.addClass(P),e.parentsUntil(n,b).filter(":has(.k-header)").addClass(B),t._current(i[0]?i:null)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}})}});s(ee,{renderItem:function(e){e=s({panelBar:{},group:{}},e);var t=J.empty,n=e.item;return J.item(s(e,{image:n.imageUrl?J.image:t,sprite:n.spriteCssClass?J.sprite:t,itemWrapper:J.itemWrapper,renderContent:ee.renderContent,arrow:n.items||n.content||n.contentUrl?J.arrow:t,subGroup:ee.renderGroup},Z))},renderGroup:function(e){return J.group(s({renderItems:function(e){for(var t="",n=0,i=e.items,r=i?i.length:0,o=s({length:r},e.group);n<r;n++)t+=ee.renderItem(s(e,{group:o,item:s({index:n},i[n])}));return t}},e,Z))},renderContent:function(e){return J.content(s(e,Z))}}),r.ui.plugin(ee)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.responsivepanel.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=e.proxy,i=".kendoResponsivePanel",r="open",o="close",a="click"+i+" touchstart"+i,s=kendo.ui.Widget,l=s.extend({init:function(t,r){s.fn.init.call(this,t,r),this._guid="_"+kendo.guid(),this._toggleHandler=n(this._toggleButtonClick,this),this._closeHandler=n(this._close,this),e(document.documentElement).on(a,this.options.toggleButton,this._toggleHandler),this._registerBreakpoint(),this.element.addClass("k-rpanel k-rpanel-"+this.options.orientation+" "+this._guid),this._resizeHandler=n(this.resize,this,!0),e(window).on("resize"+i,this._resizeHandler)},_mediaQuery:"@media (max-width: #= breakpoint-1 #px) {.#= guid #.k-rpanel-animate.k-rpanel-left,.#= guid #.k-rpanel-animate.k-rpanel-right {-webkit-transition: -webkit-transform .2s ease-out;-ms-transition: -ms-transform .2s ease-out;transition: transform .2s ease-out;} .#= guid #.k-rpanel-top {overflow: hidden;}.#= guid #.k-rpanel-animate.k-rpanel-top {-webkit-transition: max-height .2s linear;-ms-transition: max-height .2s linear;transition: max-height .2s linear;}} @media (min-width: #= breakpoint #px) {#= toggleButton # { display: none; } .#= guid #.k-rpanel-left { float: left; } .#= guid #.k-rpanel-right { float: right; } .#= guid #.k-rpanel-left, .#= guid #.k-rpanel-right {position: relative;-webkit-transform: translateX(0);-ms-transform: translateX(0);transform: translateX(0);-webkit-transform: translateX(0) translateZ(0);-ms-transform: translateX(0) translateZ(0);transform: translateX(0) translateZ(0);} .k-ie9 .#= guid #.k-rpanel-left { left: 0; } .#= guid #.k-rpanel-top { max-height: none; }}",_registerBreakpoint:function(){var e=this.options;this._registerStyle(kendo.template(this._mediaQuery)({breakpoint:e.breakpoint,toggleButton:e.toggleButton,guid:this._guid}))},_registerStyle:function(t){var n=e("head,body")[0],i=document.createElement("style");n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))},options:{name:"ResponsivePanel",orientation:"left",toggleButton:".k-rpanel-toggle",breakpoint:640,autoClose:!0},events:[r,o],_resize:function(){this.element.removeClass("k-rpanel-animate k-rpanel-expanded"),e(document.documentElement).off(a,this._closeHandler)},_toggleButtonClick:function(e){e.preventDefault(),this.element.hasClass("k-rpanel-expanded")?this.close():this.open()},open:function(){this.trigger(r)||(this.element.addClass("k-rpanel-animate k-rpanel-expanded"),this.options.autoClose&&e(document.documentElement).on(a,this._closeHandler))},close:function(){this.trigger(o)||(this.element.addClass("k-rpanel-animate").removeClass("k-rpanel-expanded"),e(document.documentElement).off(a,this._closeHandler))},_close:function(t){var n=t.isDefaultPrevented(),i=e(t.target).closest(this.options.toggleButton+",.k-rpanel");i.length||n||this.close()},destroy:function(){s.fn.destroy.call(this),e(window).off("resize"+i,this._resizeHandler),e(document.documentElement).off(a,this._closeHandler)}});kendo.ui.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.tabstrip.min",["kendo.data.min"],e)}(function(){return function(e,t){function n(t){t.children(_).addClass(D),t.children("a").addClass(y).children(_).addClass(D),t.filter(":not([disabled]):not([class*=k-state-disabled])").addClass(P),t.filter("li[disabled]").addClass(N).removeAttr("disabled"),t.filter(":not([class*=k-state])").children("a").filter(":focus").parent().addClass(L+" "+V),t.attr("role","tab"),t.filter("."+L).attr("aria-selected",!0),t.each(function(){var t=e(this);t.children("."+y).length||t.contents().filter(function(){return!(this.nodeName.match(g)||3==this.nodeType&&!c(this.nodeValue))}).wrapAll("<span class='"+y+"'/>")})}function i(e){var t=e.children(".k-item");t.filter(".k-first:not(:first-child)").removeClass(E),t.filter(".k-last:not(:last-child)").removeClass(x),t.filter(":first-child").addClass(E),t.filter(":last-child").addClass(x)}function r(e,t){return"<span class='k-button k-button-icon k-button-bare k-tabstrip-"+e+"' unselectable='on'><span class='k-icon "+t+"'></span></span>"}var o=window.kendo,a=o.ui,s=o.keys,l=e.map,d=e.each,c=e.trim,u=e.extend,h=o.template,f=o._outerWidth,p=o._outerHeight,m=a.Widget,g=/^(a|div)$/i,v=".kendoTabStrip",_="img",b="href",k="prev",w="show",y="k-link",x="k-last",C="click",T="error",S=":empty",D="k-image",E="k-first",F="select",R="activate",I="k-content",A="contentUrl",M="mouseenter",z="mouseleave",H="contentLoad",N="k-state-disabled",P="k-state-default",L="k-state-active",B="k-state-focused",O="k-state-hover",V="k-tab-on-top",W=".k-item:not(."+N+")",U=".k-tabstrip-items > "+W+":not(."+L+")",q={content:h("<div class='k-content'#= contentAttributes(data) # role='tabpanel'>#= content(item) #</div>"),itemWrapper:h("<#= tag(item) # class='k-link'#= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) #</#= tag(item) #>"),item:h("<li class='#= wrapperCssClass(group, item) #' role='tab' #=item.active ? \"aria-selected='true'\" : ''#>#= itemWrapper(data) #</li>"),image:h("<img class='k-image' alt='' src='#= imageUrl #' />"),sprite:h("<span class='k-sprite #= spriteCssClass #'></span>"),empty:h("")},j={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},text:function(e){return e.encoded===!1?e.text:o.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},contentAttributes:function(e){return e.active!==!0?" style='display:none' aria-hidden='true' aria-expanded='false'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?o.attr("content-url")+'="'+e.contentUrl+'"':""}},$=m.extend({init:function(t,n){var i,r,a,s=this;m.fn.init.call(s,t,n),s._animations(s.options),n=s.options,s._wrapper(),s._isRtl=o.support.isRtl(s.wrapper),s._tabindex(),s._updateClasses(),s._dataSource(),n.dataSource&&s.dataSource.fetch(),s._tabPosition(),s._scrollable(),s.options.contentUrls&&s.wrapper.find(".k-tabstrip-items > .k-item").each(function(t,n){e(n).find(">."+y).data(A,s.options.contentUrls[t])}),s.wrapper.on(M+v+" "+z+v,U,s._toggleHover).on("focus"+v,e.proxy(s._active,s)).on("blur"+v,function(){s._current(null)}),s._keyDownProxy=e.proxy(s._keydown,s),n.navigatable&&s.wrapper.on("keydown"+v,s._keyDownProxy),s.options.value&&(i=s.options.value),s.wrapper.children(".k-tabstrip-items").on(C+v,".k-state-disabled .k-link",!1).on(C+v," > "+W,function(t){var n,i=s.wrapper[0];if(i!==document.activeElement)if(n=o.support.browser.msie)try{i.setActive()}catch(r){i.focus()}else i.focus();s._click(e(t.currentTarget))&&t.preventDefault()}),r=s.tabGroup.children("li."+L),a=s.contentHolder(r.index()),r[0]&&a.length>0&&0===a[0].childNodes.length&&s.activateTab(r.eq(0)),s.element.attr("role","tablist"),s.element[0].id&&(s._ariaId=s.element[0].id+"_ts_active"),s.value(i),o.notify(s)},_active:function(){var e=this.tabGroup.children().filter("."+L);e=e[0]?e:this._endItem("first"),e[0]&&this._current(e)},_endItem:function(e){return this.tabGroup.children(W)[e]()},_item:function(e,t){var n;return n=t===k?"last":"first",e?(e=e[t](),e[0]||(e=this._endItem(n)),e.hasClass(N)&&(e=this._item(e,t)),e):this._endItem(n)},_current:function(e){var n=this,i=n._focused,r=n._ariaId;return e===t?i:(i&&(i[0].id===r&&i.removeAttr("id"),i.removeClass(B)),e&&(e.hasClass(L)||e.addClass(B),n.element.removeAttr("aria-activedescendant"),r=e[0].id||r,r&&(e.attr("id",r),n.element.attr("aria-activedescendant",r))),n._focused=e,t)},_keydown:function(e){var n,i=this,r=e.keyCode,o=i._current(),a=i._isRtl;if(e.target==e.currentTarget){if(r==s.DOWN||r==s.RIGHT)n=a?k:"next";else if(r==s.UP||r==s.LEFT)n=a?"next":k;else if(r==s.ENTER||r==s.SPACEBAR)i._click(o),e.preventDefault();else{if(r==s.HOME)return i._click(i._endItem("first")),e.preventDefault(),t;if(r==s.END)return i._click(i._endItem("last")),e.preventDefault(),t}n&&(i._click(i._item(o,n)),e.preventDefault())}},_dataSource:function(){var t=this;t.dataSource&&t._refreshHandler?t.dataSource.unbind("change",t._refreshHandler):t._refreshHandler=e.proxy(t.refresh,t),t.dataSource=o.data.DataSource.create(t.options.dataSource).bind("change",t._refreshHandler)},setDataSource:function(e){var t=this;t.options.dataSource=e,t._dataSource(),t.dataSource.fetch()},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{effects:{}}})},refresh:function(e){var t,n,i,r,a=this,s=a.options,l=o.getter(s.dataTextField),d=o.getter(s.dataContentField),c=o.getter(s.dataContentUrlField),u=o.getter(s.dataImageUrlField),h=o.getter(s.dataUrlField),f=o.getter(s.dataSpriteCssClass),p=[],m=a.dataSource.view();for(e=e||{},i=e.action,i&&(m=e.items),t=0,r=m.length;t<r;t++)n={text:l(m[t])},s.dataContentField&&(n.content=d(m[t])),s.dataContentUrlField&&(n.contentUrl=c(m[t])),s.dataUrlField&&(n.url=h(m[t])),s.dataImageUrlField&&(n.imageUrl=u(m[t])),s.dataSpriteCssClass&&(n.spriteCssClass=f(m[t])),p[t]=n;if("add"==e.action)e.index<a.tabGroup.children().length?a.insertBefore(p,a.tabGroup.children().eq(e.index)):a.append(p);else if("remove"==e.action)for(t=0;t<m.length;t++)a.remove(e.index);else"itemchange"==e.action?(t=a.dataSource.view().indexOf(m[0]),e.field===s.dataTextField&&a.tabGroup.children().eq(t).find(".k-link").text(m[0].get(e.field))):(a.trigger("dataBinding"),a.remove("li"),a.append(p),a.trigger("dataBound"))},value:function(n){var i=this;return n===t?i.select().text():(n!=i.value()&&i.tabGroup.children().each(function(){e.trim(e(this).text())==n&&i.select(this)}),t)},items:function(){return this.tabGroup[0].children},setOptions:function(e){var t=this,n=t.options.animation;t._animations(e),e.animation=u(!0,n,e.animation),e.navigatable?t.wrapper.on("keydown"+v,t._keyDownProxy):t.wrapper.off("keydown"+v,t._keyDownProxy),m.fn.setOptions.call(t,e)},events:[F,R,w,T,H,"change","dataBinding","dataBound"],options:{name:"TabStrip",dataTextField:"",dataContentField:"",dataImageUrlField:"",dataUrlField:"",dataSpriteCssClass:"",dataContentUrlField:"",tabPosition:"top",animation:{open:{effects:"expand:vertical fadeIn",duration:200},close:{duration:200}},collapsible:!1,navigatable:!0,contentUrls:!1,scrollable:{distance:200}},destroy:function(){var e=this,t=e.scrollWrap;m.fn.destroy.call(e),e._refreshHandler&&e.dataSource.unbind("change",e._refreshHandler),e.wrapper.off(v),e.wrapper.children(".k-tabstrip-items").off(v),e._scrollableModeActive&&(e._scrollPrevButton.off().remove(),e._scrollNextButton.off().remove()),o.destroy(e.wrapper),t.children(".k-tabstrip").unwrap()},select:function(t){var n=this;return 0===arguments.length?n.tabGroup.children("li."+L):(isNaN(t)||(t=n.tabGroup.children().get(t)),t=n.tabGroup.find(t),e(t).each(function(t,i){i=e(i),i.hasClass(L)||n.trigger(F,{item:i[0],contentElement:n.contentHolder(i.index())[0]})||n.activateTab(i)}),n)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},reload:function(t){t=this.tabGroup.find(t);var n=this;return t.each(function(){var t=e(this),i=t.find("."+y).data(A),r=n.contentHolder(t.index());i&&n.ajaxRequest(t,r,null,i)}),n},append:function(e){var t=this,n=t._create(e);return d(n.tabs,function(e){var i=n.contents[e];t.tabGroup.append(this),"bottom"==t.options.tabPosition?t.tabGroup.before(i):t._scrollableModeActive?t._scrollPrevButton.before(i):t.wrapper.append(i),t.angular("compile",function(){return{elements:[i]}})}),i(t.tabGroup),t._updateContentElements(),t.resize(!0),t},insertBefore:function(t,n){n=this.tabGroup.find(n);var r=this,o=r._create(t),a=e(r.contentElement(n.index()));return d(o.tabs,function(e){var t=o.contents[e];n.before(this),a.before(t),r.angular("compile",function(){return{elements:[t]}})}),i(r.tabGroup),r._updateContentElements(),r.resize(!0),r},insertAfter:function(t,n){n=this.tabGroup.find(n);var r=this,o=r._create(t),a=e(r.contentElement(n.index()));return d(o.tabs,function(e){var t=o.contents[e];n.after(this),a.after(t),r.angular("compile",function(){return{elements:[t]}})}),i(r.tabGroup),r._updateContentElements(),r.resize(!0),r},remove:function(t){var n,i=this,r=typeof t;return"string"===r?t=i.tabGroup.find(t):"number"===r&&(t=i.tabGroup.children().eq(t)),n=t.map(function(){var t=i.contentElement(e(this).index());return o.destroy(t),t}),t.remove(),n.remove(),i._updateContentElements(),i.resize(!0),i},_create:function(t){var i,r,o,a=e.isPlainObject(t),s=this;return a||e.isArray(t)?(t=e.isArray(t)?t:[t],i=l(t,function(t,n){return e($.renderItem({group:s.tabGroup,item:u(t,{index:n})}))}),r=l(t,function(t,n){if("string"==typeof t.content||t.contentUrl)return e($.renderContent({item:u(t,{index:n})}))})):(i="string"==typeof t&&"<"!=t[0]?s.element.find(t):e(t),r=e(),i.each(function(){if(o=e("<div class='"+I+"'/>"),/k-tabstrip-items/.test(this.parentNode.className)){var t=parseInt(this.getAttribute("aria-controls").replace(/^.*-/,""),10)-1;o=e(s.contentElement(t))}r=r.add(o)}),n(i)),{tabs:i,contents:r}},_toggleDisabled:function(t,n){t=this.tabGroup.find(t),t.each(function(){e(this).toggleClass(P,n).toggleClass(N,!n)})},_updateClasses:function(){var r,o,a,s=this;s.wrapper.addClass("k-widget k-header k-tabstrip"),s.tabGroup=s.wrapper.children("ul").addClass("k-tabstrip-items k-reset"),s.tabGroup[0]||(s.tabGroup=e("<ul class='k-tabstrip-items k-reset'/>").appendTo(s.wrapper)),r=s.tabGroup.find("li").addClass("k-item"),r.length&&(o=r.filter("."+L).index(),a=o>=0?o:t,s.tabGroup.contents().filter(function(){return 3==this.nodeType&&!c(this.nodeValue)}).remove()),o>=0&&r.eq(o).addClass(V),s.contentElements=s.wrapper.children("div"),s.contentElements.addClass(I).eq(a).addClass(L).css({
display:"block"}),r.length&&(n(r),i(s.tabGroup),s._updateContentElements())},_updateContentElements:function(){var t=this,n=t.options.contentUrls||[],i=t.tabGroup.find(".k-item"),r=(t.element.attr("id")||o.guid())+"-",a=t.wrapper.children("div");a.length&&i.length>a.length?(a.each(function(e){var t=parseInt(this.id.replace(r,""),10),n=i.filter("[aria-controls="+r+t+"]"),o=r+(e+1);n.data("aria",o),this.setAttribute("id",o)}),i.each(function(){var t=e(this);this.setAttribute("aria-controls",t.data("aria")),t.removeData("aria")})):i.each(function(i){var o=a.eq(i),s=r+(i+1);this.setAttribute("aria-controls",s),!o.length&&n[i]?e("<div class='"+I+"'/>").appendTo(t.wrapper).attr("id",s):(o.attr("id",s),e(this).children(".k-loading")[0]||n[i]||e("<span class='k-loading k-complete'/>").prependTo(this)),o.attr("role","tabpanel"),o.filter(":not(."+L+")").attr("aria-hidden",!0).attr("aria-expanded",!1),o.filter("."+L).attr("aria-expanded",!0)}),t.contentElements=t.contentAnimators=t.wrapper.children("div"),t.tabsHeight=p(t.tabGroup)+parseInt(t.wrapper.css("border-top-width"),10)+parseInt(t.wrapper.css("border-bottom-width"),10),o.kineticScrollNeeded&&o.mobile.ui.Scroller&&(o.touchScroller(t.contentElements),t.contentElements=t.contentElements.children(".km-scroll-container"))},_wrapper:function(){var e=this;e.wrapper=e.element.is("ul")?e.element.wrapAll("<div />").parent():e.element,e.scrollWrap=e.wrapper.parent(".k-tabstrip-wrapper"),e.scrollWrap[0]||(e.scrollWrap=e.wrapper.wrapAll("<div class='k-tabstrip-wrapper' />").parent())},_tabPosition:function(){var e=this,t=e.options.tabPosition;e.wrapper.addClass("k-floatwrap k-tabstrip-"+t),"bottom"==t&&e.tabGroup.appendTo(e.wrapper),e.resize(!0)},_setContentElementsDimensions:function(){var e,t,n,i,r,o,a=this,s=a.options.tabPosition;"left"!=s&&"right"!=s||(e=a.wrapper.children(".k-content"),t=e.filter(":visible"),n="margin-"+s,i=a.tabGroup,r=f(i),o=Math.ceil(i.height())-parseInt(t.css("padding-top"),10)-parseInt(t.css("padding-bottom"),10)-parseInt(t.css("border-top-width"),10)-parseInt(t.css("border-bottom-width"),10),setTimeout(function(){e.css(n,r).css("min-height",o)}))},_resize:function(){this._setContentElementsDimensions(),this._scrollable()},_sizeScrollWrap:function(e){var t,n;e.is(":visible")&&(t=this.options.tabPosition,n=Math.floor(p(e,!0))+("left"===t||"right"===t?2:this.tabsHeight),this.scrollWrap.css("height",n).css("height"))},_toggleHover:function(t){e(t.currentTarget).toggleClass(O,t.type==M)},_click:function(e){var t,n,i=this,r=e.find("."+y),o=r.attr(b),a=i.options.collapsible,s=i.contentHolder(e.index());if(e.closest(".k-widget")[0]==i.wrapper[0]){if(e.is("."+N+(a?"":",."+L)))return!0;if(n=r.data(A)||o&&("#"==o.charAt(o.length-1)||o.indexOf("#"+i.element[0].id+"-")!=-1),t=!o||n,i.tabGroup.children("[data-animating]").length)return t;if(i.trigger(F,{item:e[0],contentElement:s[0]}))return!0;if(t!==!1)return a&&e.is("."+L)?(i.deactivateTab(e),!0):(i.activateTab(e)&&(t=!0),t)}},_scrollable:function(){var e,t,n,i,a=this,s=a.options;a._scrollableAllowed()&&(a.wrapper.addClass("k-tabstrip-scrollable"),e=a.wrapper[0].offsetWidth,t=a.tabGroup[0].scrollWidth,t>e&&!a._scrollableModeActive?(a._nowScrollingTabs=!1,a._isRtl=o.support.isRtl(a.element),a.wrapper.append(r("prev","k-i-arrow-w")+r("next","k-i-arrow-e")),n=a._scrollPrevButton=a.wrapper.children(".k-tabstrip-prev"),i=a._scrollNextButton=a.wrapper.children(".k-tabstrip-next"),a.tabGroup.css({marginLeft:f(n)+9,marginRight:f(i)+12}),n.on("mousedown"+v,function(){a._nowScrollingTabs=!0,a._scrollTabsByDelta(s.scrollable.distance*(a._isRtl?1:-1))}),i.on("mousedown"+v,function(){a._nowScrollingTabs=!0,a._scrollTabsByDelta(s.scrollable.distance*(a._isRtl?-1:1))}),n.add(i).on("mouseup"+v,function(){a._nowScrollingTabs=!1}),a._scrollableModeActive=!0,a._toggleScrollButtons()):a._scrollableModeActive&&t<=e?(a._scrollableModeActive=!1,a.wrapper.removeClass("k-tabstrip-scrollable"),a._scrollPrevButton.off().remove(),a._scrollNextButton.off().remove(),a.tabGroup.css({marginLeft:"",marginRight:""})):a._scrollableModeActive?a._toggleScrollButtons():a.wrapper.removeClass("k-tabstrip-scrollable"))},_scrollableAllowed:function(){var e=this.options;return e.scrollable&&!isNaN(e.scrollable.distance)&&("top"==e.tabPosition||"bottom"==e.tabPosition)},_scrollTabsToItem:function(e){var t,n=this,i=n.tabGroup,r=i.scrollLeft(),o=f(e),a=n._isRtl?e.position().left:e.position().left-i.children().first().position().left,s=i[0].offsetWidth,l=Math.ceil(parseFloat(i.css("padding-left")));n._isRtl?a<0?t=r+a-(s-r)-l:a+o>s&&(t=r+a-o+2*l):r+s<a+o?t=a+o-s+2*l:r>a&&(t=a-l),i.finish().animate({scrollLeft:t},"fast","linear",function(){n._toggleScrollButtons()})},_scrollTabsByDelta:function(e){var t=this,n=t.tabGroup,i=n.scrollLeft();n.finish().animate({scrollLeft:i+e},"fast","linear",function(){t._nowScrollingTabs?t._scrollTabsByDelta(e):t._toggleScrollButtons()})},_toggleScrollButtons:function(){var e=this,t=e.tabGroup,n=t.scrollLeft();e._scrollPrevButton.toggle(e._isRtl?n<t[0].scrollWidth-t[0].offsetWidth-1:0!==n),e._scrollNextButton.toggle(e._isRtl?0!==n:n<t[0].scrollWidth-t[0].offsetWidth-1)},deactivateTab:function(e){var t=this,n=t.options.animation,i=n.open,r=u({},n.close),a=r&&"effects"in r;e=t.tabGroup.find(e),r=u(a?r:u({reverse:!0},i),{hide:!0}),o.size(i.effects)?(e.kendoAddClass(P,{duration:i.duration}),e.kendoRemoveClass(L,{duration:i.duration})):(e.addClass(P),e.removeClass(L)),e.removeAttr("aria-selected"),t.contentAnimators.filter("."+L).kendoStop(!0,!0).kendoAnimate(r).removeClass(L).attr("aria-hidden",!0)},activateTab:function(e){var t,n,i,r,a,s,l,d,c,h,f,m,g,v,_;if(!this.tabGroup.children("[data-animating]").length)return e=this.tabGroup.find(e),t=this,n=t.options.animation,i=n.open,r=u({},n.close),a=r&&"effects"in r,s=e.parent().children(),l=s.filter("."+L),d=s.index(e),r=u(a?r:u({reverse:!0},i),{hide:!0}),o.size(i.effects)?(l.kendoRemoveClass(L,{duration:r.duration}),e.kendoRemoveClass(O,{duration:r.duration})):(l.removeClass(L),e.removeClass(O)),c=t.contentAnimators,t.inRequest&&(t.xhr.abort(),t.inRequest=!1),0===c.length?(t.tabGroup.find("."+V).removeClass(V),e.addClass(V).css("z-index"),e.addClass(L),t._current(e),t.trigger("change"),t._scrollableModeActive&&t._scrollTabsToItem(e),!1):(h=c.filter("."+L),f=t.contentHolder(d),m=f.closest(".k-content"),t.tabsHeight=p(t.tabGroup)+parseInt(t.wrapper.css("border-top-width"),10)+parseInt(t.wrapper.css("border-bottom-width"),10),t._sizeScrollWrap(h),0===f.length?(h.removeClass(L).attr("aria-hidden",!0).kendoStop(!0,!0).kendoAnimate(r),!1):(e.attr("data-animating",!0),g=(e.children("."+y).data(A)||!1)&&f.is(S),v=function(){t.tabGroup.find("."+V).removeClass(V),e.addClass(V).css("z-index"),o.size(i.effects)?(l.kendoAddClass(P,{duration:i.duration}),e.kendoAddClass(L,{duration:i.duration})):(l.addClass(P),e.addClass(L)),l.removeAttr("aria-selected"),e.attr("aria-selected",!0),t._current(e),t._sizeScrollWrap(m),m.addClass(L).removeAttr("aria-hidden").kendoStop(!0,!0).attr("aria-expanded",!0).kendoAnimate(u({init:function(){t.trigger(w,{item:e[0],contentElement:f[0]}),o.resize(f)}},i,{complete:function(){e.removeAttr("data-animating"),t.trigger(R,{item:e[0],contentElement:f[0]}),o.resize(f),t.scrollWrap.css("height","").css("height")}}))},_=function(){g?(e.removeAttr("data-animating"),t.ajaxRequest(e,f,function(){e.attr("data-animating",!0),v(),t.trigger("change")})):(v(),t.trigger("change")),t._scrollableModeActive&&t._scrollTabsToItem(e)},h.removeClass(L),h.attr("aria-hidden",!0),h.attr("aria-expanded",!1),h.length?h.kendoStop(!0,!0).kendoAnimate(u({complete:_},r)):_(),!0))},contentElement:function(e){var n,i,r,a;if(isNaN(e-0))return t;if(n=this.contentElements&&this.contentElements[0]&&!o.kineticScrollNeeded?this.contentElements:this.contentAnimators,e=n&&e<0?n.length+e:e,i=RegExp("-"+(e+1)+"$"),n)for(r=0,a=n.length;r<a;r++)if(i.test(n.eq(r).closest(".k-content")[0].id))return n[r];return t},contentHolder:function(t){var n=e(this.contentElement(t)),i=n.children(".km-scroll-container");return o.support.touch&&i[0]?i:n},ajaxRequest:function(t,n,i,r){var a,s,l,d,c,u,h,f,p;t=this.tabGroup.find(t),a=this,s=e.ajaxSettings.xhr,l=t.find("."+y),d={},c=t.width()/2,u=!1,h=t.find(".k-loading").removeClass("k-complete"),h[0]||(h=e("<span class='k-loading'/>").prependTo(t)),f=2*c-h.width(),p=function(){h.animate({marginLeft:(parseInt(h.css("marginLeft"),10)||0)<c?f:0},500,p)},o.support.browser.msie&&o.support.browser.version<10&&setTimeout(p,40),r=r||l.data(A)||l.attr(b),a.inRequest=!0,a.xhr=e.ajax({type:"GET",cache:!1,url:r,dataType:"html",data:d,xhr:function(){var t=this,n=s(),i=t.progressUpload?"progressUpload":!!t.progress&&"progress";return n&&e.each([n,n.upload],function(){this.addEventListener&&this.addEventListener("progress",function(e){i&&t[i](e)},!1)}),t.noProgress=!(window.XMLHttpRequest&&"upload"in new XMLHttpRequest),n},progress:function(e){if(e.lengthComputable){var t=parseInt(e.loaded/e.total*100,10)+"%";h.stop(!0).addClass("k-progress").css({width:t,marginLeft:0})}},error:function(e,t){a.trigger("error",{xhr:e,status:t})&&this.complete()},stopProgress:function(){clearInterval(u),h.stop(!0).addClass("k-progress")[0].style.cssText=""},complete:function(e){a.inRequest=!1,this.noProgress?setTimeout(this.stopProgress,500):this.stopProgress(),"abort"==e.statusText&&h.remove()},success:function(e){var s,l,d;h.addClass("k-complete");try{s=this,l=10,s.noProgress&&(h.width(l+"%"),u=setInterval(function(){s.progress({lengthComputable:!0,loaded:Math.min(l,100),total:100}),l+=10},40)),a.angular("cleanup",function(){return{elements:n.get()}}),o.destroy(n),n.html(e)}catch(c){d=window.console,d&&d.error&&d.error(c.name+": "+c.message+" in "+r),this.error(this.xhr,"error")}i&&i.call(a,n),a.angular("compile",function(){return{elements:n.get()}}),a.trigger(H,{item:t[0],contentElement:n[0]})}})}});u($,{renderItem:function(e){e=u({tabStrip:{},group:{}},e);var t=q.empty,n=e.item;return q.item(u(e,{image:n.imageUrl?q.image:t,sprite:n.spriteCssClass?q.sprite:t,itemWrapper:q.itemWrapper},j))},renderContent:function(e){return q.content(u(e,j))}}),o.ui.plugin($)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.timepicker.min",["kendo.popup.min"],e)}(function(){return function(e,t){function n(e,t,n){var i,r=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(i=e.getTimezoneOffset()-r,e.setTime(e.getTime()+i*M))}function i(){var e=new $,t=new $(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),n=new $(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);return-1*(t.getTimezoneOffset()-n.getTimezoneOffset())}function r(e){return 60*e.getHours()*M+e.getMinutes()*M+1e3*e.getSeconds()+e.getMilliseconds()}function o(e,t,n){var i,o=r(t),a=r(n);return!e||o==a||(i=r(e),o>i&&(i+=z),a<o&&(a+=z),i>=o&&i<=a)}function a(e){var t=e.parseFormats;e.format=p(e.format||c.getCulture(e.culture).calendars.standard.patterns.t),t=U(t)?t:[t],t.splice(0,0,e.format),e.parseFormats=t}function s(e){e.preventDefault()}var l,d,c=window.kendo,u=c.keys,h=c.parseDate,f=c._activeElement,p=c._extractFormat,m=c.support,g=m.browser,v=c.ui,_=v.Widget,b="open",k="close",w="change",y=".kendoTimePicker",x="click"+y,C="k-state-default",T="disabled",S="readonly",D="li",E="<span/>",F="k-state-focused",R="k-state-hover",I="mouseenter"+y+" mouseleave"+y,A="mousedown"+y,M=6e4,z=864e5,H="k-state-selected",N="k-state-disabled",P="aria-selected",L="aria-expanded",B="aria-hidden",O="aria-disabled",V="aria-activedescendant",W="id",U=e.isArray,q=e.extend,j=e.proxy,$=Date,G=new $;G=new $(G.getFullYear(),G.getMonth(),G.getDate(),0,0,0),l=function(t){var n=this,i=t.id;n.options=t,n._dates=[],n.ul=e('<ul tabindex="-1" role="listbox" aria-hidden="true" unselectable="on" class="k-list k-reset"/>').css({overflow:m.kineticScrollNeeded?"":"auto"}).on(x,D,j(n._click,n)).on("mouseenter"+y,D,function(){e(this).addClass(R)}).on("mouseleave"+y,D,function(){e(this).removeClass(R)}),n.list=e("<div class='k-list-container k-list-scroller' unselectable='on'/>").append(n.ul).on(A,s),i&&(n._timeViewID=i+"_timeview",n._optionID=i+"_option_selected",n.ul.attr(W,n._timeViewID)),n._popup(),n._heightHandler=j(n._height,n),n.template=c.template('<li tabindex="-1" role="option" class="k-item" unselectable="on">#=data#</li>',{useWithBlock:!1})},l.prototype={current:function(n){var i=this,r=i.options.active;return n===t?i._current:(i._current&&i._current.removeClass(H).removeAttr(P).removeAttr(W),n&&(n=e(n).addClass(H).attr(W,i._optionID).attr(P,!0),i.scroll(n[0])),i._current=n,r&&r(n),t)},close:function(){this.popup.close()},destroy:function(){var e=this;e.ul.off(y),e.list.off(y),e.popup.destroy()},open:function(){var e=this;e.ul[0].firstChild||e.bind(),e.popup.open(),e._current&&e.scroll(e._current[0])},dataBind:function(e){for(var t,n=this,i=n.options,r=i.format,a=c.toString,s=n.template,l=e.length,d=0,u="";d<l;d++)t=e[d],o(t,i.min,i.max)&&(u+=s(a(t,r,i.culture)));n._html(u)},refresh:function(){var e,t,o,a=this,s=a.options,l=s.format,d=i(),u=d<0,h=s.min,f=s.max,p=r(h),m=r(f),g=s.interval*M,v=c.toString,_=a.template,b=new $((+h)),k=b.getDate(),w=0,y="";for(o=u?(z+d*M)/g:z/g,p!=m&&(p>m&&(m+=z),o=(m-p)/g+1),t=parseInt(o,10);w<o;w++)w&&n(b,g,u),m&&t==w&&(e=r(b),k<b.getDate()&&(e+=z),e>m&&(b=new $((+f)))),a._dates.push(r(b)),y+=_(v(b,l,s.culture));a._html(y)},bind:function(){var e=this,t=e.options.dates;t&&t[0]?e.dataBind(t):e.refresh()},_html:function(e){var t=this;t.ul[0].innerHTML=e,t.popup.unbind(b,t._heightHandler),t.popup.one(b,t._heightHandler),t.current(null),t.select(t._value)},scroll:function(e){if(e){var t=this.list[0],n=e.offsetTop,i=e.offsetHeight,r=t.scrollTop,o=t.clientHeight,a=n+i;r>n?r=n:a>r+o&&(r=a-o),t.scrollTop=r}},select:function(t){var n,i=this,r=i.options,o=i._current;t instanceof Date&&(t=c.toString(t,r.format,r.culture)),"string"==typeof t&&(o&&o.text()===t?t=o:(t=e.grep(i.ul[0].childNodes,function(e){return(e.textContent||e.innerText)==t}),t=t[0]?t:null)),n=i._distinctSelection(t),i.current(n)},_distinctSelection:function(t){var n,i,o=this;return t&&t.length>1&&(n=r(o._value),i=e.inArray(n,o._dates),t=o.ul.children()[i]),t},setOptions:function(e){var t=this.options;e.min=h(e.min),e.max=h(e.max),this.options=q(t,e,{active:t.active,change:t.change,close:t.close,open:t.open}),this.bind()},toggle:function(){var e=this;e.popup.visible()?e.close():e.open()},value:function(e){var t=this;t._value=e,t.ul[0].firstChild&&t.select(e)},_click:function(t){var n=this,i=e(t.currentTarget),r=i.text(),o=n.options.dates;o&&o.length>0&&(r=o[i.index()]),t.isDefaultPrevented()||(n.select(i),n.options.change(r,!0),n.close())},_height:function(){var e=this,t=e.list,n=t.parent(".k-animation-container"),i=e.options.height;e.ul[0].children.length&&t.add(n).show().height(e.ul[0].scrollHeight>i?i:"auto").hide()},_parse:function(e){var t=this,n=t.options,i=t._value||G;return e instanceof $?e:(e=h(e,n.parseFormats,n.culture),e&&(e=new $(i.getFullYear(),i.getMonth(),i.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),e)},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.options.anchor,o=c._outerWidth;!n.data("width")&&i||(e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):o(r),e&&(g.mozilla||g.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i=t-(o(n)-n.width()),n.css({fontFamily:r.css("font-family"),width:i}).data("width",i))},_popup:function(){var e=this,t=e.list,n=e.options,i=n.anchor;e.popup=new v.Popup(t,q(n.popup,{anchor:i,open:n.open,close:n.close,animation:n.animation,isRtl:m.isRtl(n.anchor)}))},move:function(e){var n=this,i=e.keyCode,r=n.ul[0],o=n._current,a=i===u.DOWN;if(i===u.UP||a){if(e.altKey)return n.toggle(a),t;o=a?o?o[0].nextSibling:r.firstChild:o?o[0].previousSibling:r.lastChild,o&&n.select(o),n.options.change(n._current.text()),e.preventDefault()}else i!==u.ENTER&&i!==u.TAB&&i!==u.ESC||(e.preventDefault(),o&&n.options.change(o.text(),!0),n.close())}},l.getMilliseconds=r,c.TimeView=l,d=_.extend({init:function(t,n){var i,r,o,s=this;_.fn.init.call(s,t,n),t=s.element,n=s.options,n.min=h(t.attr("min"))||h(n.min),n.max=h(t.attr("max"))||h(n.max),a(n),s._initialOptions=q({},n),s._wrapper(),s.timeView=r=new l(q({},n,{id:t.attr(W),anchor:s.wrapper,format:n.format,change:function(e,n){n?s._change(e):t.val(e)},open:function(e){s.timeView._adjustListWidth(),s.trigger(b)?e.preventDefault():(t.attr(L,!0),i.attr(B,!1))},close:function(e){s.trigger(k)?e.preventDefault():(t.attr(L,!1),i.attr(B,!0))},active:function(e){t.removeAttr(V),e&&t.attr(V,r._optionID)}})),i=r.ul,s._icon(),s._reset();try{t[0].setAttribute("type","text")}catch(d){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":r._timeViewID}),o=t.is("[disabled]")||e(s.element).parents("fieldset").is(":disabled"),o?s.enable(!1):s.readonly(t.is("[readonly]")),s._old=s._update(n.value||s.element.val()),s._oldText=t.val(),c.notify(s)},options:{name:"TimePicker",min:G,max:G,format:"",dates:[],parseFormats:[],value:null,interval:30,height:200,animation:{}},events:[b,k,w],setOptions:function(e){var t=this,n=t._value;_.fn.setOptions.call(t,e),e=t.options,a(e),t.timeView.setOptions(e),n&&t.element.val(c.toString(n,e.format,e.culture))},dataBind:function(e){U(e)&&this.timeView.dataBind(e)},_editable:function(e){var t=this,n=e.disable,i=e.readonly,r=t._arrow.off(y),o=t.element.off(y),a=t._inputWrapper.off(y);i||n?(a.addClass(n?N:C).removeClass(n?C:N),o.attr(T,n).attr(S,i).attr(O,n)):(a.addClass(C).removeClass(N).on(I,t._toggleHover),o.removeAttr(T).removeAttr(S).attr(O,!1).on("keydown"+y,j(t._keydown,t)).on("focusout"+y,j(t._blur,t)).on("focus"+y,function(){t._inputWrapper.addClass(F)}),r.on(x,j(t._click,t)).on(A,s))},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},destroy:function(){var e=this;_.fn.destroy.call(e),e.timeView.destroy(),e.element.off(y),e._arrow.off(y),e._inputWrapper.off(y),e._form&&e._form.off("reset",e._resetHandler)},close:function(){this.timeView.close()},open:function(){this.timeView.open()},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(F)},_click:function(){var e=this,t=e.element;e.timeView.toggle(),m.touch||t[0]===f()||t.focus()},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t._typing||t.element.trigger(w),t.trigger(w)),t._typing=!1},_icon:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-clock"></span></span>').insertAfter(i)),n._arrow=t.attr({role:"button","aria-controls":n.timeView._timeViewID})},_keydown:function(e){var t=this,n=e.keyCode,i=t.timeView,r=t.element.val();i.popup.visible()||e.altKey?i.move(e):n===u.ENTER&&r!==t._oldText?t._change(r):t._typing=!0},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=i.timeView._parse(n),n&&(n=new $((+n)),r[e]=n,i.timeView.options[e]=n,i.timeView.bind()),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(R,"mouseenter"===t.type)},_update:function(e){var t=this,n=t.options,i=t.timeView,r=i._parse(e);return o(r,n.min,n.max)||(r=null),t._value=r,t.element.val(c.toString(r||e,n.format,n.culture)),i.value(r),r},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-timepicker"),t[0]||(t=i.wrap(E).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(E).parent()),t[0].style.cssText=i[0].style.cssText,n.wrapper=t.addClass("k-widget k-timepicker k-header").addClass(i[0].className),i.css({width:"100%",height:i[0].style.height}),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue),t.max(t._initialOptions.max),t.min(t._initialOptions.min)},t._form=r.on("reset",t._resetHandler))}}),v.plugin(d)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.datetimepicker.min",["kendo.datepicker.min","kendo.timepicker.min"],e)}(function(){return function(e,t){function n(e){var t=new Date(2100,0,1);return t.setMinutes(-e),t}function i(e){e.preventDefault()}function r(t){var n,i=o.getCulture(t.culture).calendars.standard.patterns,r=!t.parseFormats.length;t.format=d(t.format||i.g),t.timeFormat=n=d(t.timeFormat||i.t),o.DateView.normalize(t),r&&t.parseFormats.unshift("yyyy-MM-ddTHH:mm:ss"),e.inArray(n,t.parseFormats)===-1&&t.parseFormats.splice(1,0,n)}var o=window.kendo,a=o.TimeView,s=o.parseDate,l=o._activeElement,d=o._extractFormat,c=o.calendar,u=c.isInRange,h=c.restrictValue,f=c.isEqualDatePart,p=a.getMilliseconds,m=o.ui,g=m.Widget,v="open",_="close",b="change",k=".kendoDateTimePicker",w="click"+k,y="disabled",x="readonly",C="k-state-default",T="k-state-focused",S="k-state-hover",D="k-state-disabled",E="mouseenter"+k+" mouseleave"+k,F="mousedown"+k,R="month",I="<span/>",A="aria-activedescendant",M="aria-expanded",z="aria-hidden",H="aria-owns",N="aria-disabled",P=Date,L=new P(1800,0,1),B=new P(2099,11,31),O={view:"date"},V={view:"time"},W=e.extend,U=g.extend({init:function(t,n){var i,a=this;g.fn.init.call(a,t,n),t=a.element,n=a.options,n.disableDates=o.calendar.disabled(n.disableDates),n.min=s(t.attr("min"))||s(n.min),n.max=s(t.attr("max"))||s(n.max),r(n),a._initialOptions=W({},n),a._wrapper(),a._views(),a._icons(),a._reset(),a._template();try{t[0].setAttribute("type","text")}catch(l){t[0].type="text"}t.addClass("k-input").attr({role:"combobox","aria-expanded":!1}),a._midnight=a._calculateMidnight(n.min,n.max),i=t.is("[disabled]")||e(a.element).parents("fieldset").is(":disabled"),i?a.enable(!1):a.readonly(t.is("[readonly]")),a._old=a._update(n.value||a.element.val()),a._oldText=t.val(),o.notify(a)},options:{name:"DateTimePicker",value:null,format:"",timeFormat:"",culture:"",parseFormats:[],dates:[],min:new P(L),max:new P(B),interval:30,height:200,footer:"",start:R,depth:R,animation:{},month:{},ARIATemplate:'Current focused date is #=kendo.toString(data.current, "d")#',dateButtonText:"Open the date view",timeButtonText:"Open the time view"},events:[v,_,b],setOptions:function(e){var t,n,i,a=this,l=a._value;g.fn.setOptions.call(a,e),e=a.options,e.min=t=s(e.min),e.max=n=s(e.max),r(e),a._midnight=a._calculateMidnight(e.min,e.max),i=e.value||a._value||a.dateView._current,t&&!f(t,i)&&(t=new P(L)),n&&!f(n,i)&&(n=new P(B)),a.dateView.setOptions(e),a.timeView.setOptions(W({},e,{format:e.timeFormat,min:t,max:n})),l&&(a.element.val(o.toString(l,e.format,e.culture)),a._updateARIA(l))},_editable:function(t){var n=this,r=n.element.off(k),a=n._dateIcon.off(k),s=n._timeIcon.off(k),d=n._inputWrapper.off(k),c=t.readonly,u=t.disable;c||u?(d.addClass(u?D:C).removeClass(u?C:D),r.attr(y,u).attr(x,c).attr(N,u)):(d.addClass(C).removeClass(D).on(E,n._toggleHover),r.removeAttr(y).removeAttr(x).attr(N,!1).on("keydown"+k,e.proxy(n._keydown,n)).on("focus"+k,function(){n._inputWrapper.addClass(T)}).on("focusout"+k,function(){n._inputWrapper.removeClass(T),r.val()!==n._oldText&&n._change(r.val()),n.close("date"),n.close("time")}),a.on(F,i).on(w,function(){n.toggle("date"),o.support.touch||r[0]===l()||r.focus()}),s.on(F,i).on(w,function(){n.toggle("time"),o.support.touch||r[0]===l()||r.focus()}))},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},destroy:function(){var e=this;g.fn.destroy.call(e),e.dateView.destroy(),e.timeView.destroy(),e.element.off(k),e._dateIcon.off(k),e._timeIcon.off(k),e._inputWrapper.off(k),e._form&&e._form.off("reset",e._resetHandler)},close:function(e){"time"!==e&&(e="date"),this[e+"View"].close()},open:function(e){"time"!==e&&(e="date"),this[e+"View"].open()},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},toggle:function(e){var t="timeView";"time"!==e?e="date":t="dateView",this[e+"View"].toggle(),this[t].close()},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_change:function(e){var t,n,i,r=this,o=r.element.val();e=r._update(e),t=+r._old!=+e,n=t&&!r._typing,i=o!==r.element.val(),(n||i)&&r.element.trigger(b),t&&(r._old=e,r._oldText=r.element.val(),r.trigger(b)),r._typing=!1},_option:function(e,i){var r,o,a=this,l=a.options,d=a.timeView,c=d.options,u=a._value||a._old;if(i===t)return l[e];if(i=s(i,l.parseFormats,l.culture)){if(l.min.getTime()===l.max.getTime()&&(c.dates=[]),l[e]=new P(i.getTime()),a.dateView[e](i),a._midnight=a._calculateMidnight(l.min,l.max),u&&(r=f(l.min,u),o=f(l.max,u)),r||o){if(c[e]=i,r&&!o&&(c.max=n(l.interval)),o){if(a._midnight)return d.dataBind([B]),t;r||(c.min=L)}}else c.max=B,c.min=L;d.bind()}},_toggleHover:function(t){e(t.currentTarget).toggleClass(S,"mouseenter"===t.type)},_update:function(t){var i,r,a,l,d,c=this,p=c.options,m=p.min,g=p.max,v=p.dates,_=c.timeView,k=c._value,w=s(t,p.parseFormats,p.culture),y=null===w&&null===k||w instanceof Date&&k instanceof Date;return p.disableDates&&p.disableDates(w)&&(w=null,c._old||c.element.val()||(t=null)),+w===+k&&y?(d=o.toString(w,p.format,p.culture),d!==t&&(c.element.val(null===w?t:d),t instanceof String&&c.element.trigger(b)),w):(null!==w&&f(w,m)?w=h(w,m,g):u(w,m,g)||(w=null),c._value=w,_.value(w),c.dateView.value(w),w&&(a=c._old,r=_.options,v[0]&&(v=e.grep(v,function(e){return f(w,e)}),v[0]&&(_.dataBind(v),l=!0)),l||(f(w,m)&&(r.min=m,r.max=n(p.interval),i=!0),f(w,g)&&(c._midnight?(_.dataBind([B]),l=!0):(r.max=g,i||(r.min=L),i=!0))),!l&&(!a&&i||a&&!f(a,w))&&(i||(r.max=B,r.min=L),_.bind())),c.element.val(o.toString(w||t,p.format,p.culture)),c._updateARIA(w),w)},_keydown:function(e){var t=this,n=t.dateView,i=t.timeView,r=t.element.val(),a=n.popup.visible();e.altKey&&e.keyCode===o.keys.DOWN?t.toggle(a?"time":"date"):a?(n.move(e),t._updateARIA(n._current)):i.popup.visible()?i.move(e):e.keyCode===o.keys.ENTER&&r!==t._oldText?t._change(r):t._typing=!0},_views:function(){var e,t,n,i,r,l,d=this,c=d.element,h=d.options,f=c.attr("id");d.dateView=e=new o.DateView(W({},h,{id:f,anchor:d.wrapper,change:function(){var t,n,i=e.calendar.value(),r=+i,a=+h.min,s=+h.max;r!==a&&r!==s||(t=r===a?a:s,t=new P(d._value||t),t.setFullYear(i.getFullYear(),i.getMonth(),i.getDate()),u(t,a,s)&&(i=t)),d._value&&(n=o.date.setHours(new Date(i),d._value),u(n,a,s)&&(i=n)),d._change(i),d.close("date")},close:function(e){d.trigger(_,O)?e.preventDefault():(c.attr(M,!1),n.attr(z,!0),t.popup.visible()||c.removeAttr(H))},open:function(t){d.trigger(v,O)?t.preventDefault():(c.val()!==d._oldText&&(l=s(c.val(),h.parseFormats,h.culture),d.dateView[l?"current":"value"](l)),n.attr(z,!1),c.attr(M,!0).attr(H,e._dateViewID),d._updateARIA(l))}})),n=e.div,r=h.min.getTime(),d.timeView=t=new a({id:f,value:h.value,anchor:d.wrapper,animation:h.animation,format:h.timeFormat,culture:h.culture,height:h.height,interval:h.interval,min:new P(L),max:new P(B),dates:r===h.max.getTime()?[new Date(r)]:[],parseFormats:h.parseFormats,change:function(n,i){n=t._parse(n),n<h.min?(n=new P((+h.min)),t.options.min=n):n>h.max&&(n=new P((+h.max)),t.options.max=n),i?(d._timeSelected=!0,d._change(n)):(c.val(o.toString(n,h.format,h.culture)),e.value(n),d._updateARIA(n))},close:function(t){d.trigger(_,V)?t.preventDefault():(i.attr(z,!0),c.attr(M,!1),e.popup.visible()||c.removeAttr(H))},open:function(e){t._adjustListWidth(),d.trigger(v,V)?e.preventDefault():(c.val()!==d._oldText&&(l=s(c.val(),h.parseFormats,h.culture),d.timeView.value(l)),i.attr(z,!1),c.attr(M,!0).attr(H,t._timeViewID),t.options.active(t.current()))},active:function(e){c.removeAttr(A),e&&c.attr(A,t._optionID)}}),i=t.ul},_icons:function(){var t=this,n=t.element,i=t.options,r=n.next("span.k-select");r[0]||(r=e('<span unselectable="on" class="k-select"><span class="k-link k-link-date" aria-label="'+i.dateButtonText+'"><span unselectable="on" class="k-icon k-i-calendar"></span></span><span class="k-link k-link-time" aria-label="'+i.timeButtonText+'"><span unselectable="on" class="k-icon k-i-clock"></span></span></span>').insertAfter(n)),r=r.children(),r=r.children(),t._dateIcon=r.eq(0).attr("aria-controls",t.dateView._dateViewID),t._timeIcon=r.eq(1).attr("aria-controls",t.timeView._timeViewID)},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-datetimepicker"),t[0]||(t=i.wrap(I).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(I).parent()),t[0].style.cssText=i[0].style.cssText,i.css({width:"100%",height:i[0].style.height}),n.wrapper=t.addClass("k-widget k-datetimepicker k-header").addClass(i[0].className),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue),t.max(t._initialOptions.max),t.min(t._initialOptions.min)},t._form=r.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=o.template(this.options.ARIATemplate)},_calculateMidnight:function(e,t){return p(e)+p(t)===0},_updateARIA:function(e){var t,n=this,i=n.dateView.calendar;n.element.removeAttr(A),i&&(t=i._cell,t.attr("aria-label",n._ariaTemplate({current:e||i.current()})),n.element.attr(A,t.attr("id")))}});m.plugin(U)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.splitter.min",["kendo.resizable.min"],e)}(function(){return function(e,t){function n(e){return v.test(e)}function i(e){return g.test(e)||/^\d+$/.test(e)}function r(e){return!n(e)&&!i(e)}function o(e,t){var i=parseInt(e,10);return n(e)&&(i=Math.floor(i*t/100)),i}function a(e,n){return function(i,r){var o,a=this.element.find(i).data(F);return 1==arguments.length?a[e]:(a[e]=r,n&&(o=this.element.data("kendo"+this.options.name),o.resize(!0)),t)}}function s(e){var t=this,n=e.orientation;t.owner=e,t._element=e.element,t.orientation=n,f(t,n===T?d:l),t._resizable=new c.ui.Resizable(e.element,{orientation:n,handle:".k-splitbar-draggable-"+n+"[data-marker="+e._marker+"]",hint:p(t._createHint,t),start:p(t._start,t),max:p(t._max,t),min:p(t._min,t),invalidClass:"k-restricted-size-"+n,resizeend:p(t._stop,t)})}var l,d,c=window.kendo,u=c.ui,h=c.keys,f=e.extend,p=e.proxy,m=u.Widget,g=/^\d+(\.\d+)?px$/i,v=/^\d+(\.\d+)?%$/i,_=".kendoSplitter",b="expand",k="collapse",w="contentLoad",y="error",x="resize",C="layoutChange",T="horizontal",S="vertical",D="mouseenter",E="click",F="pane",R="mouseleave",I="k-state-focused",A="k-"+F,M="."+A,z=m.extend({init:function(e,t){var n,i=this;m.fn.init.call(i,e,t),i.wrapper=i.element,n=i.options.orientation.toLowerCase()!=S,i.orientation=n?T:S,i._dimension=n?"width":"height",i._keys={decrease:n?h.LEFT:h.UP,increase:n?h.RIGHT:h.DOWN},i._resizeStep=10,i._marker=c.guid().substring(0,8),i._initPanes(),i.resizing=new s(i),i.element.triggerHandler("init"+_)},events:[b,k,w,y,x,C],_addOverlays:function(){this._panes().append("<div class='k-splitter-overlay k-overlay' />")},_removeOverlays:function(){this._panes().children(".k-splitter-overlay").remove()},_attachEvents:function(){var t=this,n=t.options.orientation;t.element.children(".k-splitbar-draggable-"+n).on("keydown"+_,p(t._keydown,t)).on("mousedown"+_,function(e){e.currentTarget.focus()}).on("focus"+_,function(t){e(t.currentTarget).addClass(I)}).on("blur"+_,function(n){e(n.currentTarget).removeClass(I),t.resizing&&t.resizing.end()}).on(D+_,function(){e(this).addClass("k-splitbar-"+t.orientation+"-hover")}).on(R+_,function(){e(this).removeClass("k-splitbar-"+t.orientation+"-hover");
}).on("mousedown"+_,p(t._addOverlays,t)).end().children(".k-splitbar").on("dblclick"+_,p(t._togglePane,t)).children(".k-collapse-next, .k-collapse-prev").on(E+_,t._arrowClick(k)).end().children(".k-expand-next, .k-expand-prev").on(E+_,t._arrowClick(b)).end().end(),e(window).on("resize"+_+t._marker,p(t.resize,t,!1)),e(document).on("mouseup"+_+t._marker,p(t._removeOverlays,t))},_detachEvents:function(){var t=this;t.element.children(".k-splitbar-draggable-"+t.orientation).off(_).end().children(".k-splitbar").off("dblclick"+_).children(".k-collapse-next, .k-collapse-prev, .k-expand-next, .k-expand-prev").off(_),e(window).off(_+t._marker),e(document).off(_+t._marker)},options:{name:"Splitter",orientation:T,panes:[]},destroy:function(){m.fn.destroy.call(this),this._detachEvents(),this.resizing&&this.resizing.destroy(),c.destroy(this.element),this.wrapper=this.element=null},_keydown:function(t){var n,i=this,r=t.keyCode,o=i.resizing,a=e(t.currentTarget),s=i._keys,l=r===s.increase,d=r===s.decrease;l||d?(t.ctrlKey?(n=a[d?"next":"prev"](),o&&o.isResizing()&&o.end(),n[i._dimension]()?i._triggerAction(k,a[d?"prev":"next"]()):i._triggerAction(b,n)):o&&o.move((d?-1:1)*i._resizeStep,a),t.preventDefault()):r===h.ENTER&&o&&(o.end(),t.preventDefault())},_initPanes:function(){var e=this.options.panes||[],t=this;this.element.addClass("k-widget").addClass("k-splitter").children().each(function(n,i){"script"!=i.nodeName.toLowerCase()&&t._initPane(i,e[n])}),this.resize()},_initPane:function(t,n){t=e(t).attr("role","group").addClass(A),t.data(F,n?n:{}).toggleClass("k-scrollable",!n||n.scrollable!==!1),this.ajaxRequest(t)},ajaxRequest:function(e,t,n){var i,r=this;e=r.element.find(e),i=e.data(F),t=t||i.contentUrl,t&&(e.append("<span class='k-icon k-i-loading k-pane-loading' />"),c.isLocalUrl(t)?jQuery.ajax({url:t,data:n||{},type:"GET",dataType:"html",success:function(t){r.angular("cleanup",function(){return{elements:e.get()}}),e.html(t),r.angular("compile",function(){return{elements:e.get()}}),r.trigger(w,{pane:e[0]})},error:function(t,n){r.trigger(y,{pane:e[0],status:n,xhr:t})}}):e.removeClass("k-scrollable").html("<iframe src='"+t+"' frameborder='0' class='k-content-frame'>This page requires frames in order to show content</iframe>"))},_triggerAction:function(e,t){this.trigger(e,{pane:t[0]})||this[e](t[0])},_togglePane:function(t){var n,i=this,r=e(t.target);r.closest(".k-splitter")[0]==i.element[0]&&(n=r.children(".k-icon:not(.k-resize-handle)"),1===n.length&&(n.is(".k-collapse-prev")?i._triggerAction(k,r.prev()):n.is(".k-collapse-next")?i._triggerAction(k,r.next()):n.is(".k-expand-prev")?i._triggerAction(b,r.prev()):n.is(".k-expand-next")&&i._triggerAction(b,r.next())))},_arrowClick:function(t){var n=this;return function(i){var r,o=e(i.target);o.closest(".k-splitter")[0]==n.element[0]&&(r=o.is(".k-"+t+"-prev")?o.parent().prev():o.parent().next(),n._triggerAction(t,r))}},_updateSplitBar:function(e,t,n){var i=function(e,t){return t?"<div class='k-icon "+e+"' />":""},r=this.orientation,o=t.resizable!==!1&&n.resizable!==!1,a=t.collapsible,s=t.collapsed,l=n.collapsible,d=n.collapsed;e.addClass("k-splitbar k-state-default k-splitbar-"+r).attr("role","separator").attr("aria-expanded",!(s||d)).removeClass("k-splitbar-"+r+"-hover").toggleClass("k-splitbar-draggable-"+r,o&&!s&&!d).toggleClass("k-splitbar-static-"+r,!o&&!a&&!l).html(i("k-collapse-prev k-i-sarrow-n",a&&!s&&!d&&r==S)+i("k-collapse-prev k-i-sarrow-w",a&&!s&&!d&&r==T)+i("k-expand-prev k-i-sarrow-n",a&&s&&!d&&r==S)+i("k-expand-prev k-i-sarrow-w",a&&s&&!d&&r==T)+i("k-resize-handle k-i-hbar",o&&r==S)+i("k-resize-handle k-i-vbar",o&&r==T)+i("k-collapse-next k-i-sarrow-s",l&&!d&&!s&&r==S)+i("k-collapse-next k-i-sarrow-e",l&&!d&&!s&&r==T)+i("k-expand-next k-i-sarrow-s",l&&d&&!s&&r==S)+i("k-expand-next k-i-sarrow-e",l&&d&&!s&&r==T)),o||a||l||e.removeAttr("tabindex")},_updateSplitBars:function(){var t=this;this.element.children(".k-splitbar").each(function(){var n=e(this),i=n.prevAll(M).first().data(F),r=n.nextAll(M).first().data(F);r&&t._updateSplitBar(n,i,r)})},_removeSplitBars:function(){this.element.children(".k-splitbar").remove()},_panes:function(){return this.element?this.element.children(M):e()},_resize:function(){var n,i,a,s,l,d,u,h,f,p,m=this,g=m.element,v=g.children(M),_=m.orientation==T,b=g.children(".k-splitbar"),k=b.length,w=_?"width":"height",y=g[w]();m.wrapper.addClass("k-splitter-resizing"),0===k?(k=v.length-1,v.slice(0,k).after("<div tabindex='0' class='k-splitbar' data-marker='"+m._marker+"' />"),m._updateSplitBars(),b=g.children(".k-splitbar")):m._updateSplitBars(),b.each(function(){y-=this[_?"offsetWidth":"offsetHeight"]}),n=0,i=0,a=e(),v.css({position:"absolute",top:0})[w](function(){var s,l=e(this),d=l.data(F)||{};if(l.removeClass("k-state-collapsed"),d.collapsed)s=d.collapsedSize?o(d.collapsedSize,y):0,l.css("overflow","hidden").addClass("k-state-collapsed");else{if(r(d.size))return a=a.add(this),t;s=o(d.size,y)}return i++,n+=s,s}),y-=n,s=a.length,l=Math.floor(y/s),a.slice(0,s-1).css(w,l).end().eq(s-1).css(w,y-(s-1)*l),d=0,u=_?"height":"width",h=_?"left":"top",f=_?"offsetWidth":"offsetHeight",0===s&&(p=v.filter(function(){return!(e(this).data(F)||{}).collapsed}).last(),p[w](y+p[0][f])),g.children().css(u,g[u]()).each(function(e,t){"script"!=t.tagName.toLowerCase()&&(t.style[h]=Math.floor(d)+"px",d+=t[f])}),m._detachEvents(),m._attachEvents(),m.wrapper.removeClass("k-splitter-resizing"),c.resize(v),m.trigger(C)},toggle:function(e,n){var i,r=this;e=r.element.find(e),i=e.data(F),(n||i.collapsible)&&(1==arguments.length&&(n=i.collapsed!==t&&i.collapsed),i.collapsed=!n,i.collapsed?e.css("overflow","hidden"):e.css("overflow",""),r.resize(!0))},collapse:function(e){this.toggle(e,!1)},expand:function(e){this.toggle(e,!0)},_addPane:function(e,t,n){var i=this;return n.length&&(i.options.panes.splice(t,0,e),i._initPane(n,e),i._removeSplitBars(),i.resize(!0)),n},append:function(t){t=t||{};var n=this,i=e("<div />").appendTo(n.element);return n._addPane(t,n.options.panes.length,i)},insertBefore:function(t,n){n=e(n),t=t||{};var i=this,r=i.wrapper.children(".k-pane").index(n),o=e("<div />").insertBefore(e(n));return i._addPane(t,r,o)},insertAfter:function(t,n){n=e(n),t=t||{};var i=this,r=i.wrapper.children(".k-pane").index(n),o=e("<div />").insertAfter(e(n));return i._addPane(t,r+1,o)},remove:function(t){t=e(t);var n=this;return t.length&&(c.destroy(t),t.each(function(t,i){n.options.panes.splice(n.wrapper.children(".k-pane").index(i),1),e(i).remove()}),n._removeSplitBars(),n.options.panes.length&&n.resize(!0)),n},size:a("size",!0),min:a("min"),max:a("max")});u.plugin(z),l={sizingProperty:"height",sizingDomProperty:"offsetHeight",alternateSizingProperty:"width",positioningProperty:"top",mousePositioningProperty:"pageY"},d={sizingProperty:"width",sizingDomProperty:"offsetWidth",alternateSizingProperty:"height",positioningProperty:"left",mousePositioningProperty:"pageX"},s.prototype={press:function(e){this._resizable.press(e)},move:function(e,t){this.pressed||(this.press(t),this.pressed=!0),this._resizable.target||this._resizable.press(t),this._resizable.move(e)},end:function(){this._resizable.end(),this.pressed=!1},destroy:function(){this._resizable.destroy(),this._resizable=this._element=this.owner=null},isResizing:function(){return this._resizable.resizing},_createHint:function(t){var n=this;return e("<div class='k-ghost-splitbar k-ghost-splitbar-"+n.orientation+" k-state-default' />").css(n.alternateSizingProperty,t[n.alternateSizingProperty]())},_start:function(t){var n=this,r=e(t.currentTarget),o=r.prev(),a=r.next(),s=o.data(F),l=a.data(F),d=parseInt(o[0].style[n.positioningProperty],10),c=parseInt(a[0].style[n.positioningProperty],10)+a[0][n.sizingDomProperty]-r[0][n.sizingDomProperty],u=parseInt(n._element.css(n.sizingProperty),10),h=function(e){var t=parseInt(e,10);return(i(e)?t:u*t/100)||0},f=h(s.min),p=h(s.max)||c-d,m=h(l.min),g=h(l.max)||c-d;n.previousPane=o,n.nextPane=a,n._maxPosition=Math.min(c-m,d+p),n._minPosition=Math.max(d+f,c-g)},_max:function(){return this._maxPosition},_min:function(){return this._minPosition},_stop:function(t){var n,i,o,a,s,l,d,u,h=this,f=e(t.currentTarget),p=h.owner;return p._panes().children(".k-splitter-overlay").remove(),t.keyCode!==c.keys.ESC&&(n=t.position,i=f.prev(),o=f.next(),a=i.data(F),s=o.data(F),l=n-parseInt(i[0].style[h.positioningProperty],10),d=parseInt(o[0].style[h.positioningProperty],10)+o[0][h.sizingDomProperty]-n-f[0][h.sizingDomProperty],u=h._element.children(M).filter(function(){return r(e(this).data(F).size)}).length,(!r(a.size)||u>1)&&(r(a.size)&&u--,a.size=l+"px"),(!r(s.size)||u>1)&&(s.size=d+"px"),p.resize(!0)),!1}}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.dialog.min",["kendo.core.min","kendo.popup.min"],e)}(function(){return function(e,t){function n(e){return t!==e}function i(e,t,n){return Math.max(Math.min(parseInt(e,10),n===1/0?n:parseInt(n,10)),parseInt(t,10))}function r(e){return e.keyCode==w.ENTER||e.keyCode==w.SPACEBAR}var o,a,s,l,d,c,u,h,f,p,m,g=window.kendo,v=g.Class,_=g.ui.Widget,b=e.proxy,k=g.template,w=g.keys,y=e.isFunction,x="kendoWindow",C=".k-dialog",T=".k-window",S=".k-dialog-close",D="k-content",E=".k-content",F="k-dialog-titleless",R=".k-dialog-title",I=".k-window-titlebar",A=".k-dialog-buttongroup",M=".k-button",z="k-alert",H="k-confirm",N="k-prompt",P=".k-textbox",L=".k-overlay",B=":visible",O="zIndex",V="body",W="initOpen",U="open",q="close",j="show",$="hide",G="width",Y=100,K={okText:"OK",cancel:"Cancel"},Q=Math.ceil,X=":not(link,meta,script,style)",J=_.extend({init:function(e,t){var n=this;_.fn.init.call(n,e,t),n._init(n.element,n.options),g.notify(n)},_init:function(i,r){var a,s=this;s._centerCallback=b(s._center,s),s.appendTo=e(V),n(r.visible)&&null!==r.visible||(r.visible=i.is(B)),s.wrapperTemplate===t&&(s.wrapperTemplate=o.wrapper),s._createDialog(),a=s.wrapper=i.closest(C),r._defaultFocus===t&&(s._defaultFocus=i[0]),s._tabindex(i),s._dimensions(),this._tabKeyTrap=new m(a),s.options.visible?(s.toFront(),s._triggerInitOpen(),s.trigger(U),r.modal&&(s._overlay(a.is(B)).css({opacity:.5}),s._focusDialog())):s.wrapper.hide(),r.closable&&(a.autoApplyNS(x),i.autoApplyNS(x),a.find(S).on("click",b(s._closeClick,s)).on("keydown",b(s._closeKeyHandler,s)),i.on("keydown",b(s._keydown,s)))},_dimensions:function(){var e,t,n=this,r=n.wrapper,o=n.options,a=o.width,s=o.height,l=["minWidth","minHeight","maxWidth","maxHeight"];for(e=0;e<l.length;e++)t=o[l[e]],t&&t!=1/0&&r.css(l[e],t);this._setElementMaxHeight(),a&&r.width((""+a).indexOf("%")>0?a:i(a,o.minWidth,o.maxWidth)),s&&(r.height((""+s).indexOf("%")>0?s:i(s,o.minHeight,o.maxHeight)),this._setElementHeight())},_setElementMaxHeight:function(){var e,t,n=this,i=n.element,r=n.options.maxHeight;r!=1/0&&(e=n._paddingBox(i),t=parseFloat(r,10)-n._uiHeight()-e.vertical,t>0&&i.css({maxHeight:Q(t)+"px",overflow:"hidden"}))},_paddingBox:function(e){var t=parseFloat(e.css("padding-top"),10),n=parseFloat(e.css("padding-left"),10),i=parseFloat(e.css("padding-bottom"),10),r=parseFloat(e.css("padding-right"),10);return{vertical:t+i,horizontal:n+r}},_setElementHeight:function(){var e=this,t=e.element,n=e.options.height,i=e._paddingBox(t),r=parseFloat(n,10)-e._uiHeight()-i.vertical;r>0&&e.element.css({height:Q(r)+"px",overflow:"hidden"})},_uiHeight:function(){var e=this,t=e.wrapper,n=t.children(A),i=n[0]&&n[0].offsetHeight||0,r=t.children(I),o=r[0]&&r[0].offsetHeight||0;return i+o},_overlay:function(t){var n=this.appendTo.children(L),i=this.wrapper;return n.length||(n=e(o.overlay)),n.insertBefore(i[0]).toggle(t).css(O,parseInt(i.css(O),10)-1),t?this._waiAriaOverlay():this._removeWaiAriaOverlay(),n},_waiAriaOverlay:function(){var t=this.wrapper;this._overlayedNodes=t.prevAll(X).add(t.nextAll(X)).each(function(){var t=e(this);t.data("ariaHidden",t.attr("aria-hidden")),t.attr("aria-hidden","true")})},_removeWaiAriaOverlay:function(){return this._overlayedNodes&&this._overlayedNodes.each(function(){var t=e(this),n=t.data("ariaHidden");n?t.attr("aria-hidden",n):t.removeAttr("aria-hidden")})},_closeClick:function(e){e.preventDefault(),this.close()},_closeKeyHandler:function(e){(r(e)||e.keyCode==w.ESC)&&this.close()},_keydown:function(e){var t=this,n=t.options,i=e.keyCode;i==w.ESC&&!t._closing&&n.closable&&t.close()},_createDialog:function(){var t=this,n=t.element,i=t.options,r=g.support.isRtl(n),a=e(o.titlebar(i)),s=(n.id||g.guid())+"_title",l=e(t.wrapperTemplate(i));l.toggleClass("k-rtl",r),n.addClass(D),t.appendTo.append(l),i.closable!==!1&&(i.title!==!1?a.append(o.close(i)):l.append(o.close(i))),i.title!==!1?(l.append(a),a.attr("id",s),l.attr("aria-labelledby",s)):l.addClass(F),l.append(n),i.content&&(g.destroy(n.children()),n.html(i.content)),i.actions.length&&t._createActionbar(l)},_createActionbar:function(t){var n="stretched"===this.options.buttonLayout,i=n?"stretched":"normal",r=e(o.actionbar({buttonLayout:i}));this._addButtons(r),n&&this._normalizeButtonSize(r),t.append(r)},_addButtons:function(t){var n,i,r,a,s=this,l=s.options,d=b(s._actionClick,s),c=b(s._actionKeyHandler,s),u=s.options.actions,h=u.length,f=Y/h;for(r=0;r<h;r++)n=u[r],i=s._mergeTextWithOptions(n),a=e(o.action(n)).autoApplyNS(x).html(i).appendTo(t).data("action",n.action).on("click",d).on("keydown",c),"stretched"===l.buttonLayout&&a.css(G,f+"%")},_mergeTextWithOptions:function(e){var t=e.text;return t?k(t)(this.options):""},_normalizeButtonSize:function(e){var t=this,n=t.options,i=e.children(M+":last"),r=parseFloat(i[0].style[G]),o=Y-n.actions.length*r;o>0&&i.css(G,r+o+"%")},_tabindex:function(e){var t,n=this,i=n.wrapper,r=i.find(S),o=i.find(A+" "+M);_.fn._tabindex.call(this,e),t=e.attr("tabindex"),r.attr("tabIndex",t),o.attr("tabIndex",t)},_actionClick:function(e){this._runActionBtn(e.currentTarget)},_actionKeyHandler:function(e){r(e)?this._runActionBtn(e.currentTarget):e.keyCode==w.ESC&&this.close()},_runActionBtn:function(t){var n,i,r=this;r._closing||(n=e(t).data("action"),i=y(n)&&n({sender:r})===!1,i||r.close())},open:function(){var e,t,n,i=this,r=i.wrapper,o=this._animationOptions(U),a=i.options;return this._triggerInitOpen(),i.trigger(U)||(i._closing&&r.kendoStop(!0,!0),i._closing=!1,i.toFront(),a.visible=!0,a.modal&&(t=!!i._modals().length,e=i._overlay(t),e.kendoStop(!0,!0),o.duration&&g.effects.Fade&&!t?(n=g.fx(e).fadeIn(),n.duration(o.duration||0),n.endValue(.5),n.play()):e.css("opacity",.5),e.show()),r.show().kendoStop().kendoAnimate({effects:o.effects,duration:o.duration,complete:b(i._openAnimationEnd,i)}),r.show()),i},_animationOptions:function(e){var t=this.options.animation,n={open:{effects:{}},close:{hide:!0,effects:{}}};return t&&t[e]||n[e]},_openAnimationEnd:function(){this.options.modal&&this._focusDialog(),this.trigger(j)},_triggerInitOpen:function(){n(this._initOpenTriggered)||(this._initOpenTriggered=!0,this.trigger(W))},toFront:function(){var t=this,n=t.wrapper,i=+n.css(O),r=i;return t.center(),e(T).each(function(t,n){var r=e(n),o=r.css(O);isNaN(o)||(i=Math.max(+o,i))}),(!n[0].style.zIndex||r<i)&&n.css(O,i+2),t.element.find("> .k-overlay").remove(),n=null,t},close:function(){return this._close(!0),this._stopCenterOnResize(),this},_close:function(e){var t=this,n=t.wrapper,i=t.options,r=this._animationOptions("open"),o=this._animationOptions("close");if(n.is(B)&&!t.trigger(q,{userTriggered:!e})){if(t._closing)return;t._closing=!0,i.visible=!1,this._removeOverlay(),n.kendoStop().kendoAnimate({effects:o.effects||r.effects,reverse:o.reverse===!0,duration:o.duration,complete:b(this._closeAnimationEnd,this)})}return t},center:function(){this._center(),this._centerOnResize()},_center:function(){var t=this,n=t.wrapper,i=e(window),r=0,o=0,a=o+Math.max(0,(i.width()-n.width())/2),s=r+Math.max(0,(i.height()-n.height()-parseInt(n.css("paddingTop"),10))/2);return n.css({left:a,top:s}),t},_centerOnResize:function(){this._trackResize||(g.onResize(this._centerCallback),this._trackResize=!0)},_stopCenterOnResize:function(){g.unbindResize(this._centerCallback),this._trackResize=!1},_removeOverlay:function(){var e=this._modals(),t=this.options,n=t.modal&&!e.length;n?this._overlay(!1).remove():e.length&&this._object(e.last())._overlay(!0)},_closeAnimationEnd:function(){var e,t=this;t._closing=!1,t.wrapper.hide().css("opacity",""),t.trigger($),t.options.modal&&(e=t._object(t._modals().last()),e&&e.toFront())},_modals:function(){var t=this,n=e(T).filter(function(){var n=e(this),i=t._object(n),r=i&&i.options;return r&&r.modal&&r.visible&&n.is(B)}).sort(function(t,n){return+e(t).css("zIndex")-+e(n).css("zIndex")});return t=null,n},_object:function(e){var n=e.children(E),i=g.widgetInstance(n);return i?i:t},destroy:function(){var t=this;t._destroy(),_.fn.destroy.call(t),t.wrapper.remove(),t.wrapper=t.element=e()},_destroy:function(){var e=this,t="."+x;e.wrapper.off(t),e.element.off(t),e.wrapper.find(S+","+A+" > "+M).off(t),e._stopCenterOnResize()},title:function(t){var n=this,i=n.wrapper,r=n.options,a=i.children(I),s=a.children(R);return arguments.length?(t===!1?(a.remove(),i.addClass(F)):(a.length||(a=e(o.titlebar(r)).prependTo(i),s=a.children(R),i.removeClass(F)),s.html(t)),n.options.title=t,n):s.html()},content:function(e,t){var i=this,r=i.wrapper.children(E);return n(e)?(this.angular("cleanup",function(){return{elements:r.children()}}),g.destroy(r.children()),r.html(e),this.angular("compile",function(){var e,n=[];for(e=r.length;--e>=0;)n.push({dataItem:t});return{elements:r.children(),data:n}}),i.options.content=e,i):r.html()},_focusDialog:function(){this._defaultFocus&&this._focus(this._defaultFocus),this._tabKeyTrap.trap()},_focus:function(e){e&&e.focus()},events:[W,U,q,j,$],options:{title:"",buttonLayout:"stretched",actions:[],modal:!0,width:null,height:null,minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,content:null,visible:null,closable:!0}}),Z=J.extend({options:{name:"Dialog",messages:{close:"Close"}}});g.ui.plugin(Z),a=J.extend({_init:function(e,t){var n=this;n.wrapperTemplate=o.alertWrapper,t._defaultFocus=null,n._ensureContentId(e),J.fn._init.call(n,e,t),n.bind($,b(n.destroy,n)),n._ariaDescribedBy(),n._initFocus()},_ensureContentId:function(t){var n=e(t);n.attr("id")||n.attr("id",g.guid()+"_k-popup")},_ariaDescribedBy:function(){this.wrapper.attr("aria-describedby",this.element.attr("id"))},_initFocus:function(){var e=this.options;this._defaultFocus=this._chooseEntryFocus(),this._defaultFocus&&e.visible&&e.modal&&this._focusDialog()},_chooseEntryFocus:function(){return this.wrapper.find(A+" > "+M)[0]},options:{title:window.location.host,closable:!1,messages:K}}),s=a.extend({_init:function(e,t){var n=this;a.fn._init.call(n,e,t),n.wrapper.addClass(z)},options:{name:"Alert",modal:!0,actions:[{text:"#= messages.okText #"}]}}),g.ui.plugin(s),l=function(t){return e(o.alert).kendoAlert({content:t}).data("kendoAlert").open()},d=a.extend({_init:function(t,n){var i=this;a.fn._init.call(i,t,n),i.wrapper.addClass(H),i.result=e.Deferred()},options:{name:"Confirm",modal:!0,actions:[{text:"#= messages.okText #",primary:!0,action:function(e){e.sender.result.resolve()}},{text:"#= messages.cancel #",action:function(e){e.sender.result.reject()}}]}}),g.ui.plugin(d),c=function(t){var n=e(o.confirm).kendoConfirm({content:t}).data("kendoConfirm").open();return n.result},u=a.extend({_init:function(t,n){var i=this;a.fn._init.call(i,t,n),i.wrapper.addClass(N),i._createPrompt(),i.result=e.Deferred()},_createPrompt:function(){var t=this.options.value,n=e(o.promptInputContainer).insertAfter(this.element);t&&n.children(P).val(t),this._defaultFocus=this._chooseEntryFocus(),this._focusDialog()},_chooseEntryFocus:function(){return this.wrapper.find(P)[0]},options:{name:"Prompt",modal:!0,value:"",actions:[{text:"#= messages.okText #",primary:!0,action:function(e){var t=e.sender,n=t.wrapper.find(P).val();t.result.resolve(n)}},{text:"#= messages.cancel #",action:function(e){var t=e.sender,n=t.wrapper.find(P).val();e.sender.result.reject(n)}}]}}),g.ui.plugin(u),h=function(t,n){var i=e(o.prompt).kendoPrompt({content:t,value:n}).data("kendoPrompt").open();return i.result},o={wrapper:k("<div class='k-widget k-dialog k-window' role='dialog' />"),action:k("<li class='k-button# if (data.primary) { # k-primary# } #' role='button'></li>"),titlebar:k("<div class='k-window-titlebar k-header'><span class='k-dialog-title'>#= title #</span></div>"),close:k("<a role='button' href='\\#' class='k-button-bare k-dialog-action k-dialog-close' title='#= messages.close #' aria-label='#= messages.close #' tabindex='-1'><span class='k-font-icon k-i-x'></span></a>"),actionbar:k("<ul class='k-dialog-buttongroup k-dialog-button-layout-#= buttonLayout #' role='toolbar' />"),overlay:"<div class='k-overlay' />",alertWrapper:k("<div class='k-widget k-dialog k-window k-dialog-centered' role='alertdialog' />"),alert:"<div />",confirm:"<div />",prompt:"<div />",promptInputContainer:"<div class='k-prompt-container'><input type='text' class='k-textbox' /></div>"},f="kendoTabKeyTrap",p="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], *[contenteditable]",m=v.extend({init:function(t){this.element=e(t),this.element.autoApplyNS(f)},trap:function(){this.element.on("keydown",b(this._keepInTrap,this))},removeTrap:function(){this.element.kendoDestroy(f)},destroy:function(){this.element.kendoDestroy(f),this.element=t},_keepInTrap:function(e){var t,n,i,r,o;9===e.which&&(t=e.target,n=this.element.find(p).filter(":visible[tabindex!=-1]"),i=n.length,r=i-1,o=n.index(t),e.shiftKey?0===o&&(n.get(r).focus(),e.preventDefault()):o===r&&(n.get(0).focus(),e.preventDefault()))}}),g.alert=l,g.confirm=c,g.prompt=h}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.virtuallist.min",["kendo.data.min"],e)}(function(){return function(e,t){function n(e){return e[e.length-1]}function i(e){return e instanceof Array?e:[e]}function r(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function o(e,t,n){return Math.ceil(e*t/n)}function a(e,t,n){var i=document.createElement(n||"div");return t&&(i.className=t),e.appendChild(i),i}function s(){var t,n=e('<div class="k-popup"><ul class="k-list"><li class="k-item"><li></ul></div>');return n.css({position:"absolute",left:"-200000px",visibility:"hidden"}),n.appendTo(document.body),t=parseFloat(_.getComputedStyles(n.find(".k-item")[0],["line-height"])["line-height"]),n.remove(),t}function l(e,t,n){return{down:e*n,up:e*(t-1-n)}}function d(e,t){var n=(e.listScreens-1-e.threshold)*t,i=e.threshold*t;return function(e,t,r){return t>r?t-e.top<n:0===e.top||t-e.top>i}}function c(e,t){return function(n){return t(e.scrollTop,n)}}function u(e){return function(t,n){return e(t.items,t.index,n),t}}function h(e,t){_.support.browser.msie&&_.support.browser.version<10?e.style.top=t+"px":(e.style.webkitTransform="translateY("+t+"px)",e.style.transform="translateY("+t+"px)")}function f(t,n){return function(i,r){for(var o=0,a=i.length;o<a;o++)t(i[o],r[o],n),r[o].item&&this.trigger(L,{item:e(i[o]),data:r[o].item,ns:_.ui})}}function p(e,t){var n;return t>0?(n=e.splice(0,t),e.push.apply(e,n)):(n=e.splice(t,-t),e.unshift.apply(e,n)),n}function m(n,i,r){var o=r.template;n=e(n),i.item||(o=r.placeholderTemplate),this.angular("cleanup",function(){return{elements:[n]}}),n.attr("data-uid",i.item?i.item.uid:"").attr("data-offset-index",i.index).html(o(i.item||{})),n.toggleClass(M,i.current),n.toggleClass(A,i.selected),n.toggleClass("k-first",i.newGroup),n.toggleClass("k-loading-item",!i.item),0!==i.index&&i.newGroup&&e("<div class="+I+"></div>").appendTo(n).html(r.groupTemplate(i.group)),i.top!==t&&h(n[0],i.top),this.angular("compile",function(){return{elements:[n],data:[{dataItem:i.item,group:i.group,newGroup:i.newGroup}]}})}function g(e,t){var n,i,r,o,a=t.length,s=e.length,l=[],d=[];if(s)for(r=0;r<s;r++){for(n=e[r],i=!1,o=0;o<a;o++)if(n===t[o]){i=!0,l.push({index:r,item:n});break}i||d.push(n)}return{changed:l,unchanged:d}}function v(e){return e&&"resolved"!==e.state()}var _=window.kendo,b=_.ui,k=b.Widget,w=b.DataBoundWidget,y=e.proxy,x="k-virtual-wrap",C="k-virtual-list",T="k-virtual-content",S="k-list",D="k-group-header",E="k-virtual-item",F="k-item",R="k-height-container",I="k-group",A="k-state-selected",M="k-state-focused",z="k-state-hover",H="change",N="click",P="listBound",L="itemChange",B="activate",O="deactivate",V=".VirtualList",W=w.extend({init:function(t,n){var r=this;r.bound(!1),r._fetching=!1,k.fn.init.call(r,t,n),r.options.itemHeight||(r.options.itemHeight=s()),n=r.options,r.element.addClass(S+" "+C).attr("role","listbox"),r.content=r.element.wrap("<div unselectable='on' class='"+T+"'></div>").parent(),r.wrapper=r.content.wrap("<div class='"+x+"'></div>").parent(),r.header=r.content.before("<div class='"+D+"'></div>").prev(),r.element.on("mouseenter"+V,"li:not(.k-loading-item)",function(){e(this).addClass(z)}).on("mouseleave"+V,"li",function(){e(this).removeClass(z)}),r._values=i(r.options.value),r._selectedDataItems=[],r._selectedIndexes=[],r._rangesList={},r._promisesList=[],r._optionID=_.guid(),r._templates(),r.setDataSource(n.dataSource),r.content.on("scroll"+V,_.throttle(function(){r._renderItems(),r._triggerListBound()},n.delay)),r._selectable()},options:{name:"VirtualList",autoBind:!0,delay:100,height:null,listScreens:4,threshold:.5,itemHeight:null,oppositeBuffer:1,type:"flat",selectable:!1,value:[],dataValueField:null,template:"#:data#",placeholderTemplate:"loading...",groupTemplate:"#:data#",fixedGroupTemplate:"fixed header template",mapValueTo:"index",valueMapper:null},events:[H,N,P,L,B,O],setOptions:function(e){k.fn.setOptions.call(this,e),this._selectProxy&&this.options.selectable===!1?this.element.off(N,"."+E,this._selectProxy):!this._selectProxy&&this.options.selectable&&this._selectable(),this._templates(),this.refresh()},items:function(){return e(this._items)},destroy:function(){this.wrapper.off(V),this.dataSource.unbind(H,this._refreshHandler),k.fn.destroy.call(this)},setDataSource:function(t){var n,i=this,r=t||{};r=e.isArray(r)?{data:r}:r,r=_.data.DataSource.create(r),i.dataSource?(i.dataSource.unbind(H,i._refreshHandler),i._clean(),i.bound(!1),i._deferValueSet=!0,n=i.value(),i.value([]),i.mute(function(){i.value(n)})):i._refreshHandler=e.proxy(i.refresh,i),i.dataSource=r.bind(H,i._refreshHandler),i.setDSFilter(r.filter()),0!==r.view().length?i.refresh():i.options.autoBind&&r.fetch()},skip:function(){return this.dataSource.currentRangeStart()},_triggerListBound:function(){var e=this,t=e.skip();e.bound()&&!e._selectingValue&&e._skip!==t&&(e._skip=t,e.trigger(P))},_getValues:function(t){var n=this._valueGetter;return e.map(t,function(e){return n(e)})},refresh:function(e){var t,n=this,i=e&&e.action,r="itemchange"===i,o=this.isFiltered();n._mute||(n._deferValueSet=!1,n._fetching?(n._renderItems&&n._renderItems(!0),n._triggerListBound()):(o&&n.focus(0),n._createList(),i||!n._values.length||o||n.options.skipUpdateOnBind?(n.bound(!0),n._triggerListBound()):(n._selectingValue=!0,n.value(n._values,!0).done(function(){n.bound(!0),n._selectingValue=!1,n._triggerListBound()}))),(r||"remove"===i)&&(t=g(n._selectedDataItems,e.items),t.changed.length&&(r?n.trigger("selectedItemChange",{items:t.changed}):n.value(n._getValues(t.unchanged)))),n._fetching=!1)},removeAt:function(e){return this._selectedIndexes.splice(e,1),this._values.splice(e,1),{position:e,dataItem:this._selectedDataItems.splice(e,1)[0]}},setValue:function(e){this._values=i(e)},value:function(n,r){var o,a=this;return n===t?a._values.slice():(null===n&&(n=[]),n=i(n),a._valueDeferred&&"resolved"!==a._valueDeferred.state()||(a._valueDeferred=e.Deferred()),o="multiple"===a.options.selectable&&a.select().length&&n.length,!o&&n.length||a.select(-1),a._values=n,(a.bound()&&!a._mute&&!a._deferValueSet||r)&&a._prefetchByValue(n),a._valueDeferred)},_prefetchByValue:function(e){var n,i,o,a=this,s=a._dataView,l=a._valueGetter,d=a.options.mapValueTo,c=!1,u=[];for(i=0;i<e.length;i++)for(o=0;o<s.length;o++)n=s[o].item,n&&(c=r(n)?e[i]===n:e[i]===l(n),c&&u.push(s[o].index));return u.length===e.length?(a._values=[],a.select(u),t):("function"==typeof a.options.valueMapper?a.options.valueMapper({value:"multiple"===this.options.selectable?e:e[0],success:function(e){"index"===d?a.mapValueToIndex(e):"dataItem"===d&&a.mapValueToDataItem(e)}}):a.select([-1]),t)},mapValueToIndex:function(e){if(e=e===t||e===-1||null===e?[]:i(e),e.length){var n=this._deselect([]).removed;n.length&&this._triggerChange(n,[])}else e=[-1];this.select(e)},mapValueToDataItem:function(n){var r,o,a;if(n=n===t||null===n?[]:i(n),n.length){for(r=e.map(this._selectedDataItems,function(e,t){return{index:t,dataItem:e}}),o=e.map(n,function(e,t){return{index:t,dataItem:e}}),this._selectedDataItems=n,this._selectedIndexes=[],a=0;a<this._selectedDataItems.length;a++)this._selectedIndexes.push(t);this._triggerChange(r,o),this._valueDeferred&&this._valueDeferred.resolve()}else this.select([-1])},deferredRange:function(t){var n=this.dataSource,i=this.itemCount,r=this._rangesList,o=e.Deferred(),a=[],s=Math.floor(t/i)*i,l=Math.ceil(t/i)*i,d=l===s?[l]:[s,l];return e.each(d,function(t,o){var s,l=o+i,d=r[o];d&&d.end===l?s=d.deferred:(s=e.Deferred(),r[o]={end:l,deferred:s},n._multiplePrefetch(o,i,function(){s.resolve()})),a.push(s)}),e.when.apply(e,a).then(function(){o.resolve()}),o},prefetch:function(t){var n=this,i=this.itemCount,r=!n._promisesList.length;return v(n._activeDeferred)||(n._activeDeferred=e.Deferred(),n._promisesList=[]),e.each(t,function(e,t){n._promisesList.push(n.deferredRange(n._getSkip(t,i)))}),r&&e.when.apply(e,n._promisesList).done(function(){n._promisesList=[],n._activeDeferred.resolve()}),n._activeDeferred},_findDataItem:function(e,t){var n,i;if("group"===this.options.type)for(i=0;i<e.length;i++){if(n=e[i].items,!(n.length<=t))return n[t];t-=n.length}return e[t]},_getRange:function(e,t){return this.dataSource._findRange(e,Math.min(e+t,this.dataSource.total()))},dataItemByIndex:function(e){var t=this.itemCount,n=this._getSkip(e,t),i=this._getRange(n,t);return this._findDataItem(i,[e-n])},selectedDataItems:function(){return this._selectedDataItems.slice()},scrollWith:function(e){this.content.scrollTop(this.content.scrollTop()+e)},scrollTo:function(e){this.content.scrollTop(e)},scrollToIndex:function(e){this.scrollTo(e*this.options.itemHeight)},focus:function(i){var r,o,a,s,l,d,c=this.options.itemHeight,u=this._optionID,h=!0;if(i===t)return s=this.element.find("."+M),s.length?s:null;if("function"==typeof i)for(a=this.dataSource.flatView(),l=0;l<a.length;l++)if(i(a[l])){i=l;break}return i instanceof Array&&(i=n(i)),isNaN(i)?(r=e(i),o=parseInt(e(r).attr("data-offset-index"),10)):(o=i,r=this._getElementByIndex(o)),o===-1?(this.element.find("."+M).removeClass(M),this._focusedIndex=t,t):(r.length?(r.hasClass(M)&&(h=!1),this._focusedIndex!==t&&(s=this._getElementByIndex(this._focusedIndex),s.removeClass(M).removeAttr("id"),h&&this.trigger(O)),this._focusedIndex=o,r.addClass(M).attr("id",u),d=this._getElementLocation(o),"top"===d?this.scrollTo(o*c):"bottom"===d?this.scrollTo(o*c+c-this._screenHeight):"outScreen"===d&&this.scrollTo(o*c),h&&this.trigger(B)):(this._focusedIndex=o,this.items().removeClass(M),this.scrollToIndex(o)),t)},focusIndex:function(){return this._focusedIndex},focusFirst:function(){this.scrollTo(0),this.focus(0)},focusLast:function(){var e=this.dataSource.total();this.scrollTo(this.heightContainer.offsetHeight),this.focus(e)},focusPrev:function(){var e,t=this._focusedIndex;return!isNaN(t)&&t>0?(t-=1,this.focus(t),e=this.focus(),e&&e.hasClass("k-loading-item")&&(t+=1,this.focus(t)),t):(t=this.dataSource.total()-1,this.focus(t),t)},focusNext:function(){var e,t=this._focusedIndex,n=this.dataSource.total()-1;return!isNaN(t)&&t<n?(t+=1,this.focus(t),e=this.focus(),e&&e.hasClass("k-loading-item")&&(t-=1,this.focus(t)),t):(t=0,this.focus(t),
t)},_triggerChange:function(e,t){e=e||[],t=t||[],(e.length||t.length)&&this.trigger(H,{removed:e,added:t})},select:function(i){var r,o,a,s,l,d=this,c="multiple"!==d.options.selectable,u=v(d._activeDeferred),h=this.isFiltered(),f=[];return i===t?d._selectedIndexes.slice():(d._selectDeferred&&"resolved"!==d._selectDeferred.state()||(d._selectDeferred=e.Deferred()),r=d._getIndecies(i),o=c&&!h&&n(r)===n(this._selectedIndexes),f=d._deselectCurrentValues(r),f.length||!r.length||o?(d._triggerChange(f),d._valueDeferred&&d._valueDeferred.resolve(),d._selectDeferred.resolve().promise()):(1===r.length&&r[0]===-1&&(r=[]),s=d._deselect(r),f=s.removed,r=s.indices,c&&(u=!1,r.length&&(r=[n(r)])),l=function(){var e=d._select(r);d.focus(r),d._triggerChange(f,e),d._valueDeferred&&d._valueDeferred.resolve(),d._selectDeferred.resolve()},a=d.prefetch(r),u||(a?a.done(l):l()),d._selectDeferred.promise()))},bound:function(e){return e===t?this._listCreated:(this._listCreated=e,t)},mute:function(e){this._mute=!0,y(e(),this),this._mute=!1},setDSFilter:function(t){this._lastDSFilter=e.extend({},t)},isFiltered:function(){return this._lastDSFilter||this.setDSFilter(this.dataSource.filter()),!_.data.Query.compareFilters(this.dataSource.filter(),this._lastDSFilter)},skipUpdate:e.noop,_getElementByIndex:function(t){return this.items().filter(function(n,i){return t===parseInt(e(i).attr("data-offset-index"),10)})},_getElementByDataItem:function(t){var n,i,o,a=this._dataView,s=this._valueGetter;for(o=0;o<a.length;o++)if(i=a[o].item&&r(a[o].item)?a[o].item===t:s(a[o].item)===s(t)){n=a[o];break}return n?this._getElementByIndex(n.index):e()},_clean:function(){this.result=t,this._lastScrollTop=t,this._skip=t,e(this.heightContainer).remove(),this.heightContainer=t,this.element.empty()},_height:function(){var e=!!this.dataSource.view().length,t=this.options.height,n=this.options.itemHeight,i=this.dataSource.total();return e?t/n>i&&(t=i*n):t=0,t},setScreenHeight:function(){var e=this._height();this.content.height(e),this._screenHeight=e},screenHeight:function(){return this._screenHeight},_getElementLocation:function(e){var t,n=this.content.scrollTop(),i=this._screenHeight,r=this.options.itemHeight,o=e*r,a=o+r,s=n+i;return t=o===n-r||a>n&&o<n?"top":o===s||o<s&&s<a?"bottom":o>=n&&o<=n+(i-r)?"inScreen":"outScreen"},_templates:function(){var e,t=this.options,n={template:t.template,placeholderTemplate:t.placeholderTemplate,groupTemplate:t.groupTemplate,fixedGroupTemplate:t.fixedGroupTemplate};for(e in n)"function"!=typeof n[e]&&(n[e]=_.template(n[e]||""));this.templates=n},_generateItems:function(e,t){for(var n,i=[],r=this.options.itemHeight+"px";t-- >0;)n=document.createElement("li"),n.tabIndex=-1,n.className=E+" "+F,n.setAttribute("role","option"),n.style.height=r,n.style.minHeight=r,e.appendChild(n),i.push(n);return i},_saveInitialRanges:function(){var t,n=this.dataSource._ranges,i=e.Deferred();for(i.resolve(),this._rangesList={},t=0;t<n.length;t++)this._rangesList[n[t].start]={end:n[t].end,deferred:i}},_createList:function(){var t=this,n=t.content.get(0),i=t.options,r=t.dataSource;t.bound()&&t._clean(),t._saveInitialRanges(),t._buildValueGetter(),t.setScreenHeight(),t.itemCount=o(t._screenHeight,i.listScreens,i.itemHeight),t.itemCount>r.total()&&(t.itemCount=r.total()),t._items=t._generateItems(t.element[0],t.itemCount),t._setHeight(i.itemHeight*r.total()),t.options.type=(r.group()||[]).length?"group":"flat","flat"===t.options.type?t.header.hide():t.header.show(),t.getter=t._getter(function(){t._renderItems(!0)}),t._onScroll=function(e,n){var i=t._listItems(t.getter);return t._fixedHeader(e,i(e,n))},t._renderItems=t._whenChanged(c(n,t._onScroll),u(t._reorderList(t._items,e.proxy(m,t)))),t._renderItems(),t._calculateGroupPadding(t._screenHeight)},_setHeight:function(e){var t,n,i=this.heightContainer;if(i?t=i.offsetHeight:i=this.heightContainer=a(this.content[0],R),e!==t)for(i.innerHTML="";e>0;)n=Math.min(e,25e4),a(i).style.height=n+"px",e-=n},_getter:function(){var e=null,t=this.dataSource,n=t.skip(),i=this.options.type,r=this.itemCount,o={};return t.pageSize()<r&&this.mute(function(){t.pageSize(r)}),function(a,s){var l,d,c,u,h,f,p,m,g=this;if(t.inRange(s,r)){if(n!==s&&this.mute(function(){t.range(s,r),n=s}),"group"===i){if(!o[s])for(d=o[s]=[],c=t.view(),u=0,h=c.length;u<h;u++)for(f=c[u],p=0,m=f.items.length;p<m;p++)d.push({item:f.items[p],group:f.value});l=o[s][a-s]}else l=t.view()[a-s];return l}return e!==s&&(e=s,n=s,g._getterDeferred&&g._getterDeferred.reject(),g._getterDeferred=g.deferredRange(s),g._getterDeferred.then(function(){var e=g._indexConstraint(g.content[0].scrollTop);g._getterDeferred=null,s<=e&&e<=s+r&&(g._fetching=!0,t.range(s,r))})),null}},_fixedHeader:function(e,t){var n,i=this.currentVisibleGroup,r=this.options.itemHeight,o=Math.floor((e-t.top)/r),a=t.items[o];return a&&a.item&&(n=a.group,n!==i&&(this.header[0].innerHTML=n||"",this.currentVisibleGroup=n)),t},_itemMapper:function(e,t,n){var i,o=this.options.type,a=this.options.itemHeight,s=this._focusedIndex,l=!1,d=!1,c=!1,u=null,h=!1,f=this._valueGetter;if("group"===o&&(e&&(c=0===t||this._currentGroup&&this._currentGroup!==e.group,this._currentGroup=e.group),u=e?e.group:null,e=e?e.item:null),!this.isFiltered()&&n.length&&e)for(i=0;i<n.length;i++)if(h=r(e)?n[i]===e:n[i]===f(e)){n.splice(i,1),l=!0;break}return s===t&&(d=!0),{item:e?e:null,group:u,newGroup:c,selected:l,current:d,index:t,top:t*a}},_range:function(e){var t,n,i,r=this.itemCount,o=this._values.slice(),a=[];for(this._view={},this._currentGroup=null,n=e,i=e+r;n<i;n++)t=this._itemMapper(this.getter(n,e),n,o),a.push(t),this._view[t.index]=t;return this._dataView=a,a},_getDataItemsCollection:function(e,t){var n=this._range(this._listIndex(e,t));return{index:n.length?n[0].index:0,top:n.length?n[0].top:0,items:n}},_listItems:function(){var t=this._screenHeight,n=this.options,i=d(n,t);return e.proxy(function(e,t){var n=this.result,r=this._lastScrollTop;return!t&&n&&i(n,e,r)||(n=this._getDataItemsCollection(e,r)),this._lastScrollTop=e,this.result=n,n},this)},_whenChanged:function(e,t){var n;return function(i){var r=e(i);r!==n&&(n=r,t(r,i))}},_reorderList:function(t,n){var i=this,r=t.length,o=-(1/0);return n=e.proxy(f(n,this.templates),this),function(e,a,s){var l,d,c=a-o;s||Math.abs(c)>=r?(l=t,d=e):(l=p(t,c),d=c>0?e.slice(-c):e.slice(0,-c)),n(l,d,i.bound()),o=a}},_bufferSizes:function(){var e=this.options;return l(this._screenHeight,e.listScreens,e.oppositeBuffer)},_indexConstraint:function(e){var t=this.itemCount,n=this.options.itemHeight,i=this.dataSource.total();return Math.min(Math.max(i-t,0),Math.max(0,Math.floor(e/n)))},_listIndex:function(e,t){var n,i=this._bufferSizes();return n=e-(e>t?i.down:i.up),this._indexConstraint(n)},_selectable:function(){this.options.selectable&&(this._selectProxy=e.proxy(this,"_clickHandler"),this.element.on(N+V,"."+E,this._selectProxy))},getElementIndex:function(e){return e instanceof jQuery?parseInt(e.attr("data-offset-index"),10):t},_getIndecies:function(e){var t,n,i,r=[];if("function"==typeof e)for(t=this.dataSource.flatView(),n=0;n<t.length;n++)if(e(t[n])){r.push(n);break}return"number"==typeof e&&r.push(e),i=this.getElementIndex(e),isNaN(i)||r.push(i),e instanceof Array&&(r=e),r},_deselect:function(n){var i,o,a,s,l,d,c,u=[],h=this._selectedIndexes,f=this._selectedDataItems,p=0,m=this.options.selectable,g=0,v=this._valueGetter,_=null;if(n=n.slice(),m!==!0&&n.length){if("multiple"===m)for(d=0;d<n.length;d++){if(_=null,p=e.inArray(n[d],h),o=this.dataItemByIndex(n[d]),p===-1&&o)for(c=0;c<f.length;c++)s=r(o)?f[c]===o:v(f[c])===v(o),s&&(a=this._getElementByIndex(n[d]),_=this._deselectSingleItem(a,c,n[d],g));else i=h[p],i!==t&&(a=this._getElementByIndex(i),_=this._deselectSingleItem(a,p,i,g));_&&(n.splice(d,1),u.push(_),g++,d--)}}else{for(l=0;l<h.length;l++)h[l]!==t?this._getElementByIndex(h[l]).removeClass(A):f[l]&&this._getElementByDataItem(f[l]).removeClass(A),u.push({index:h[l],position:l,dataItem:f[l]});this._values=[],this._selectedDataItems=[],this._selectedIndexes=[]}return{indices:n,removed:u}},_deselectSingleItem:function(e,t,n,i){var r;if(e.hasClass("k-state-selected"))return e.removeClass(A),this._values.splice(t,1),this._selectedIndexes.splice(t,1),r=this._selectedDataItems.splice(t,1)[0],{index:n,position:t+i,dataItem:r}},_deselectCurrentValues:function(t){var n,i,r,o,a=this.element[0].children,s=this._values,l=[],d=0;if("multiple"!==this.options.selectable||!this.isFiltered())return[];if(t[0]===-1)return e(a).removeClass("k-state-selected"),l=e.map(this._selectedDataItems.slice(0),function(e,t){return{dataItem:e,position:t}}),this._selectedIndexes=[],this._selectedDataItems=[],this._values=[],l;for(;d<t.length;d++){for(r=-1,i=t[d],n=this._valueGetter(this.dataItemByIndex(i)),o=0;o<s.length;o++)if(n==s[o]){r=o;break}r>-1&&(l.push(this.removeAt(r)),e(a[i]).removeClass("k-state-selected"))}return l},_getSkip:function(e,t){var n=e<t?1:Math.floor(e/t)+1;return(n-1)*t},_select:function(t){var n,i,o=this,a="multiple"!==this.options.selectable,s=this.dataSource,l=this.itemCount,d=this._valueGetter,c=[];return a&&(o._selectedIndexes=[],o._selectedDataItems=[],o._values=[]),i=s.skip(),e.each(t,function(e,t){var a=o._getSkip(t,l);o.mute(function(){s.range(a,l),n=o._findDataItem(s.view(),[t-a]),o._selectedIndexes.push(t),o._selectedDataItems.push(n),o._values.push(r(n)?n:d(n)),c.push({index:t,dataItem:n}),o._getElementByIndex(t).addClass(A),s.range(i,l)})}),c},_clickHandler:function(t){var n=e(t.currentTarget);!t.isDefaultPrevented()&&n.attr("data-uid")&&this.trigger(N,{item:n})},_buildValueGetter:function(){this._valueGetter=_.getter(this.options.dataValueField)},_calculateGroupPadding:function(e){var t=this.items().first(),n=this.header,i=0;n[0]&&"none"!==n[0].style.display&&("auto"!==e&&(i=_.support.scrollbar()),i+=parseFloat(t.css("border-right-width"),10)+parseFloat(t.children(".k-group").css("right"),10),n.css("padding-right",i))}});_.ui.VirtualList=W,_.ui.plugin(W)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.scheduler.view.min",["kendo.core.min"],e)}(function(){return kendo.ui.scheduler={},function(e){function t(e,t){function n(e,r){var o,a;if(r=r[t])for(o=i[e]=i[e]||[],a=0;a<r.length;a++)o.push(r[a]),n(e+1,r[a])}var i=[];return n(0,e),i}function n(){return x.support.cssBorderSpacing?"":'cellspacing="0"'}function i(t,i){return t.length?"<table "+n()+' class="'+e.trim("k-scheduler-table "+(i||""))+'"><tr>'+t.join("</tr><tr>")+"</tr></table>":""}function r(e,t){return e.length?"<div style='position:relative'>"+i(e,t)+"</div>":""}function o(t,n,r){var o,a=[];if(r>0)for(o=0;o<t;o++)a.push("<th>&nbsp;</th>");return n&&a.push('<th class="k-scheduler-times-all-day">'+n.text+"</th>"),r<1?e():e('<div class="k-scheduler-times">'+i(a)+"</div>")}function a(t,n,o){var a,s,l,d,c,u,h,f,p,m,g=[];for(s=0;s<t.length;s++){for(l=t[s],d=[],c=n/l.length,a=0;a<l.length;a++)u=l[a],d.push('<th colspan="'+(u.colspan||c)+'" class="'+(u.className||"")+'">'+u.text+"</th>");g.push(d.join(""))}if(h=[],o){for(f=t[t.length-1],p=[],m=o.cellContent,a=0;a<f.length;a++)p.push('<td class="'+(f[a].className||"")+'">'+(m?m(a):"&nbsp;")+"</td>");h.push(p.join(""))}return e('<div class="k-scheduler-header k-state-default"><div class="k-scheduler-header-wrap">'+i(g)+r(h,"k-scheduler-header-all-day")+"</div></div>")}function s(t,n){var r,o,a,s,l,d=Array(n).join().split(","),c=[];for(o=0;o<t.length;o++)for(a=t[o],s=n/a.length,r=0;r<a.length;r++)l=a[r].className||"",a[r].allDay&&(l="k-scheduler-times-all-day"),d[s*r]+='<th class="'+l+'" rowspan="'+s+'">'+a[r].text+"</th>";for(r=0;r<n;r++)c.push(d[r]);return n<1?e():e('<div class="k-scheduler-times">'+i(c)+"</div>")}function l(){return e('<div class="k-scheduler-content"><table '+n()+' class="k-scheduler-table"/></div>')}function d(){return k=k?k:x.support.scrollbar()}function c(e,t,n){var i,r,o,a,s;for(i=e.length-1;i>=0;i--)r=u(e[i]),o=r.start,s=r.end,a=o<=t&&s>=t,(a||o>=t&&s<=n||t<=o&&n>=o)&&(o<t&&(t=o),s>n&&(n=s));return h(e,t,n)}function u(e){return{start:e.start,end:e.end}}function h(e,t,n){var i,r,o=[];for(i=0;i<e.length;i++)r=u(e[i]),(r.start<t&&r.end>t||r.start>=t&&r.end<=n)&&o.push(e[i]);return o}function f(e){return m(e)}function p(e){return m(e)}function m(e){var t,n,i,r,o,a,s,l=[];for(t=0;t<e.length;t++){for(n=e[t],i=u(n),r=null,o=0,a=l.length;o<a;o++)if(s=i.start>l[o].end,i.start<l[o].start||s){r=l[o],r.end<i.end&&(r.end=i.end);break}r||(r={start:i.start,end:i.end,events:[]},l.push(r)),r.events.push(n)}return l}function g(t,n,i,r){var o=[];return e.each(n,function(e,n){var a=n.className?"k-slot-cell "+n.className:"k-slot-cell",s={text:n.text,className:a};s[t]=r&&!n.minorTicks?g(t,n.columns,i,r):i,o.push(s)}),o}function v(t,n,i,r,o,a){var s,l,d,c=n[0],u=[];if(c){if(o&&i)e.each(o,function(e,i){i[t]=a&&!i.minorTicks?v(t,n,i.columns,r,i.columns,a):v(t,n,null,r)}),u=o;else for(s=c.dataSource.view(),l=0;l<s.length;l++)d={text:r({text:x.htmlEncode(x.getter(c.dataTextField)(s[l])),color:x.getter(c.dataColorField)(s[l]),field:c.field,title:c.title,name:c.name,value:x.getter(c.dataValueField)(s[l])}),className:"k-slot-cell"},d[t]=v(t,n.slice(1),i,r),u.push(d);return u}return i}function _(t){return function(n){if(e.isArray(n)||n instanceof x.data.ObservableArray){for(var i=0;i<n.length;i++)if(n[i]==t)return!0;return!1}return n==t}}function b(e){e.className=e.className.replace(y,"")+" k-state-selected"}var k,w,y,x=window.kendo,C=x.ui,T=C.Widget,S=x._outerHeight,D=x.keys,E=".kendoSchedulerView",F=Math,R='<div class="k-marquee k-scheduler-marquee"><div class="k-marquee-color"></div><div class="k-marquee-text"><div class="k-label-top"></div><div class="k-label-bottom"></div></div></div>',I=x.Class.extend({init:function(e,t){this._index=e,this._timeSlotCollections=[],this._daySlotCollections=[],this._isRtl=t},addTimeSlotCollection:function(e,t){return this._addCollection(e,t,this._timeSlotCollections)},addDaySlotCollection:function(e,t){return this._addCollection(e,t,this._daySlotCollections)},_addCollection:function(e,t,n){var i=new H(e,t,this._index,n.length);return n.push(i),i},timeSlotCollectionCount:function(){return this._timeSlotCollections.length},daySlotCollectionCount:function(){return this._daySlotCollections.length},daySlotByPosition:function(e,t,n){return this._slotByPosition(e,t,this._daySlotCollections,n)},timeSlotByPosition:function(e,t,n){return this._slotByPosition(e,t,this._timeSlotCollections,n)},_slotByPosition:function(e,t,n,i){var r,o,a,s,l,d,c,u,h;for(r=0;r<n.length;r++)for(o=n[r],a=0;a<o.count();a++)if(s=o.at(a),l=s.offsetWidth,d=s.offsetHeight,u=s.offsetLeft+l,h=s.offsetTop+d,i||(c=o.at(a+1)),c&&(c.offsetLeft!=s.offsetLeft?u=this._isRtl?s.offsetLeft+(s.offsetLeft-c.offsetLeft):c.offsetLeft:h=c.offsetTop),e>=s.offsetLeft&&e<u&&t>=s.offsetTop&&t<h)return s},refresh:function(){var e;for(e=0;e<this._daySlotCollections.length;e++)this._daySlotCollections[e].refresh();for(e=0;e<this._timeSlotCollections.length;e++)this._timeSlotCollections[e].refresh()},timeSlotRanges:function(e,t){var n,i=this._timeSlotCollections,r=this._startSlot(e,i);return!r.inRange&&e>=r.slot.end&&(r=null),n=r,e<t&&(n=this._endSlot(t,i)),n&&!n.inRange&&t<=n.slot.start&&(n=null),null===r&&null===n?[]:(null===r&&(r={inRange:!0,slot:i[n.slot.collectionIndex].first()}),null===n&&(n={inRange:!0,slot:i[r.slot.collectionIndex].last()}),this._continuousRange(M,i,r,n))},daySlotRanges:function(e,t,n){var i,r=this._daySlotCollections,o=this._startSlot(e,r,n);if(!o.inRange&&e>=o.slot.end&&(o=null),i=o,e<t&&(i=this._endSlot(t,r,n)),i&&!i.inRange&&t<=i.slot.start&&(i=null),null===o&&null===i)return[];if(null===o)do e+=x.date.MS_PER_DAY,o=this._startSlot(e,r,n);while(!o.inRange&&e>=o.slot.end);if(null===i)do t-=x.date.MS_PER_DAY,i=this._endSlot(t,r,n);while(!i.inRange&&t<=i.slot.start);return this._continuousRange(z,r,o,i)},_continuousRange:function(e,t,n,i){var r,o,a,s,l,d,c=n.slot,u=i.slot,h=c.collectionIndex,f=u.collectionIndex,p=[];for(r=h;r<=f;r++)o=t[r],a=o.first(),s=o.last(),l=!1,d=!1,r==h&&(d=!n.inRange),r==f&&(l=!i.inRange),a.start<c.start&&(a=c),s.start>u.start&&(s=u),h<f&&(r==h?l=!0:r==f?d=!0:l=d=!0),p.push(new e({start:a,end:s,collection:o,head:l,tail:d}));return p},slotRanges:function(e,t){var n=e._startTime||x.date.toUtcTime(e.start),i=e._endTime||x.date.toUtcTime(e.end);return void 0===t&&(t=e.isMultiDay()),t?this.daySlotRanges(n,i,e.isAllDay):this.timeSlotRanges(n,i)},ranges:function(e,t,n,i){return"number"!=typeof e&&(e=x.date.toUtcTime(e)),"number"!=typeof t&&(t=x.date.toUtcTime(t)),n?this.daySlotRanges(e,t,i):this.timeSlotRanges(e,t)},_startCollection:function(e,t){var n,i;for(n=0;n<t.length;n++)if(i=t[n],i.startInRange(e))return i;return null},_endCollection:function(e,t,n){var i,r;for(i=0;i<t.length;i++)if(r=t[i],r.endInRange(e,n))return r;return null},_getCollections:function(e){return e?this._daySlotCollections:this._timeSlotCollections},continuousSlot:function(e,t){var n=t?-1:1,i=this._getCollections(e.isDaySlot),r=i[e.collectionIndex+n];return r?r[t?"last":"first"]():void 0},firstSlot:function(){var e=this._getCollections(this.daySlotCollectionCount());return e[0].first()},lastSlot:function(){var e=this._getCollections(this.daySlotCollectionCount());return e[e.length-1].last()},upSlot:function(e,t,n){var i=this,r=function(e,n,r){var o=0===r;if(!t&&!e&&o&&i.daySlotCollectionCount())return i._daySlotCollections[0].at(n)};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(e,-1,r,n)},downSlot:function(e,t,n){var i=this,r=function(e,n,r){if(!t&&e&&i.timeSlotCollectionCount())return i._timeSlotCollections[r].at(0)};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(e,1,r,n)},leftSlot:function(e,t){return this._horizontalSlot(e,-1,t)},rightSlot:function(e,t){return this._horizontalSlot(e,1,t)},_horizontalSlot:function(e,t,n){var i,r=e.index,o=e.isDaySlot,a=e.collectionIndex,s=this._getCollections(o);return o=!n&&o,o?r+=t:a+=t,i=s[a],i?i.at(r):void 0},_verticalSlot:function(e,t,n,i){var r,o=e.index,a=e.isDaySlot,s=e.collectionIndex,l=this._getCollections(a);return(e=n(a,s,o))?e:(a=!i&&a,a?s+=t:o+=t,r=l[s],r?r.at(o):void 0)},_collection:function(e,t){var n=t?this._daySlotCollections:this._timeSlotCollections;return n[e]},_startSlot:function(e,t,n){var i,r=this._startCollection(e,t),o=!0;return r||(r=t[0],o=!1),i=r.slotByStartDate(e,n),i||(i=r.first(),o=!1),{slot:i,inRange:o}},_endSlot:function(e,t,n){var i,r=this._endCollection(e,t,n),o=!0;return r||(r=t[t.length-1],o=!1),i=r.slotByEndDate(e,n),i||(i=r.last(),o=!1),{slot:i,inRange:o}},getSlotCollection:function(e,t){return this[t?"getDaySlotCollection":"getTimeSlotCollection"](e)},getTimeSlotCollection:function(e){return this._timeSlotCollections[e]},getDaySlotCollection:function(e){return this._daySlotCollections[e]}}),A=x.Class.extend({init:function(t){e.extend(this,t)},innerHeight:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0;for(e=n;e<=i;e++)r+=t.at(e).offsetHeight;return r},events:function(){return this.collection.events()},addEvent:function(e){this.events().push(e)},startSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.end:this.start},endSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.start:this.end}}),M=A.extend({innerHeight:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0;for(e=n;e<=i;e++)r+=t.at(e).offsetHeight;return r},outerRect:function(e,t,n){return this._rect("offset",e,t,n)},_rect:function(e,t,n,i){var r,o,a,s,l,d,c,u,h=this.start,f=this.end,p=x.support.isRtl(h.element);return"number"!=typeof t&&(t=x.date.toUtcTime(t)),"number"!=typeof n&&(n=x.date.toUtcTime(n)),i?(r=h.offsetTop,o=f.offsetTop+f[e+"Height"],p?(a=f.offsetLeft,s=h.offsetLeft+h[e+"Width"]):(a=h.offsetLeft,s=f.offsetLeft+f[e+"Width"])):(l=t-h.start,l<0&&(l=0),d=h.end-h.start,r=h.offsetTop+h[e+"Height"]*l/d,c=f.end-n,c<0&&(c=0),u=f.end-f.start,o=f.offsetTop+f[e+"Height"]-f[e+"Height"]*c/u,p?(a=Math.round(f.offsetLeft+f[e+"Width"]*c/u),s=Math.round(h.offsetLeft+h[e+"Width"]-h[e+"Width"]*l/d)):(a=Math.round(h.offsetLeft+h[e+"Width"]*l/d),s=Math.round(f.offsetLeft+f[e+"Width"]-f[e+"Width"]*c/u))),{top:r,bottom:o,left:0===a?a:a+1,right:s}},innerRect:function(e,t,n){return this._rect("client",e,t,n)}}),z=A.extend({innerWidth:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0,o=n!==i?"offsetWidth":"clientWidth";for(e=n;e<=i;e++)r+=t.at(e)[o];return r}}),H=x.Class.extend({init:function(e,t,n,i){this._slots=[],this._events=[],this._start=x.date.toUtcTime(e),this._end=x.date.toUtcTime(t),this._groupIndex=n,this._collectionIndex=i},refresh:function(){for(var e=0;e<this._slots.length;e++)this._slots[e].refresh()},startInRange:function(e){return this._start<=e&&e<this._end},endInRange:function(e,t){var n=t?e<this._end:e<=this._end;return this._start<=e&&n},slotByStartDate:function(e){var t,n,i=e;for("number"!=typeof i&&(i=x.date.toUtcTime(e)),t=0;t<this._slots.length;t++)if(n=this._slots[t],n.startInRange(i))return n;return null},slotByEndDate:function(e,t){var n,i,r=e;if("number"!=typeof r&&(r=x.date.toUtcTime(e)),t)return this.slotByStartDate(e,!1);for(n=0;n<this._slots.length;n++)if(i=this._slots[n],i.endInRange(r))return i;return null},count:function(){return this._slots.length},events:function(){return this._events},addTimeSlot:function(e,t,n,i){var r=new P(e,t,n,this._groupIndex,this._collectionIndex,this._slots.length,i);this._slots.push(r)},addDaySlot:function(e,t,n,i){var r=new L(e,t,n,this._groupIndex,this._collectionIndex,this._slots.length,i);this._slots.push(r)},first:function(){return this._slots[0]},last:function(){return this._slots[this._slots.length-1]},at:function(e){return this._slots[e]}}),N=x.Class.extend({init:function(e,t,n,i,r,o){this.element=e,this.clientWidth=e.clientWidth,this.clientHeight=e.clientHeight,this.offsetWidth=e.offsetWidth,this.offsetHeight=e.offsetHeight,this.offsetTop=e.offsetTop,this.offsetLeft=e.offsetLeft,this.start=t,this.end=n,this.element=e,this.groupIndex=i,this.collectionIndex=r,this.index=o,this.isDaySlot=!1},refresh:function(){var e=this.element;this.clientWidth=e.clientWidth,this.clientHeight=e.clientHeight,this.offsetWidth=e.offsetWidth,this.offsetHeight=e.offsetHeight,this.offsetTop=e.offsetTop,this.offsetLeft=e.offsetLeft},startDate:function(){return x.timezone.toLocalDate(this.start)},endDate:function(){return x.timezone.toLocalDate(this.end)},startInRange:function(e){return this.start<=e&&e<this.end},endInRange:function(e){return this.start<e&&e<=this.end},startOffset:function(){return this.start},endOffset:function(){return this.end}}),P=N.extend({init:function(e,t,n,i,r,o,a){N.fn.init.apply(this,arguments),this.isHorizontal=!!a},offsetX:function(e,t){return e?this.offsetLeft+t:this.offsetLeft+t},startInRange:function(e){return this.start<=e&&e<this.end},endInRange:function(e){return this.start<e&&e<=this.end},startOffset:function(t,n,i){var r,o,a,s,l;if(i)return this.start;if(r=e(this.element).offset(),o=this.end-this.start,this.isHorizontal){if(l=x.support.isRtl(this.element),a=t-r.left,s=Math.floor(o*(a/this.offsetWidth)),l)return this.start+o-s}else a=n-r.top,s=Math.floor(o*(a/this.offsetHeight));return this.start+s},endOffset:function(t,n,i){var r,o,a,s,l;if(i)return this.end;if(r=e(this.element).offset(),o=this.end-this.start,this.isHorizontal){if(l=x.support.isRtl(this.element),a=t-r.left,s=Math.floor(o*(a/this.offsetWidth)),l)return this.start+o-s}else a=n-r.top,s=Math.floor(o*(a/this.offsetHeight));return this.start+s}}),L=N.extend({init:function(e,t,n,i,r,o,a){N.fn.init.apply(this,arguments),this.eventCount=a,this.isDaySlot=!0,this.element.children.length?(this.firstChildHeight=this.element.children[0].offsetHeight+3,this.firstChildTop=this.element.children[0].offsetTop):(this.firstChildHeight=3,this.firstChildTop=0)},startDate:function(){var e=new Date(this.start);return x.timezone.apply(e,"Etc/UTC")},endDate:function(){var e=new Date(this.end);return x.timezone.apply(e,"Etc/UTC")},startInRange:function(e){return this.start<=e&&e<this.end},endInRange:function(e){return this.start<e&&e<=this.end}});x.ui.SchedulerView=T.extend({init:function(t,n){T.fn.init.call(this,t,n),this._normalizeOptions(),this._scrollbar=d(),this._isRtl=x.support.isRtl(t),this._resizeHint=e(),this._moveHint=e(),this._cellId=x.guid(),this._resourcesForGroups(),this._selectedSlots=[]},_normalizeOptions:function(){var e=this.options;e.startTime&&e.startTime.setMilliseconds(0),e.endTime&&e.endTime.setMilliseconds(0),e.workDayStart&&e.workDayStart.setMilliseconds(0),e.workDayEnd&&e.workDayEnd.setMilliseconds(0)},_isMobile:function(){var e=this.options;return e.mobile===!0&&x.support.mobileOS||"phone"===e.mobile||"tablet"===e.mobile},_isMobilePhoneView:function(){var e=this.options;return e.mobile===!0&&x.support.mobileOS&&!x.support.mobileOS.tablet||"phone"===e.mobile},_addResourceView:function(){var e=new I(this.groups.length,this._isRtl);return this.groups.push(e),e},dateForTitle:function(){return x.format(this.options.selectedDateFormat,this.startDate(),this.endDate())},shortDateForTitle:function(){return x.format(this.options.selectedShortDateFormat,this.startDate(),this.endDate())},_changeGroup:function(e,t){var n=t?"prevGroupSlot":"nextGroupSlot",i=this[n](e.start,e.groupIndex,e.isAllDay);return i&&(e.groupIndex+=t?-1:1),this._isGroupedByDate()&&!i&&(e.groupIndex=t?this.groups.length-1:0),i},_changeDate:function(e,t,n){var i,r,o,a=this.groups[e.groupIndex];if(n){if(i=a._getCollections(!1),r=a.daySlotCollectionCount()?t.index-1:t.collectionIndex-1,r>=0)return i[r]._slots[i[r]._slots.length-1]}else if(i=a._getCollections(a.daySlotCollectionCount()),r=a.daySlotCollectionCount()?0:t.collectionIndex+1,o=a.daySlotCollectionCount()?t.collectionIndex+1:0,i[r]&&i[r]._slots[o])return i[r]._slots[o]},_changeGroupContinuously:function(){return null},_changeViewPeriod:function(){return!1},_horizontalSlots:function(e,t,n,i){var r,o,a,s=i?"leftSlot":"rightSlot",l={startSlot:t[0].start,endSlot:t[t.length-1].end},d=this.groups[e.groupIndex],c=this._isVerticallyGrouped();return n||(r=this._normalizeHorizontalSelection(e,t,i),r&&(l.startSlot=l.endSlot=r)),this._isGroupedByDate()&&!n?(o=this._changeGroup(e,i),o?l.startSlot=l.endSlot=o:l=this._getNextHorizontalRange(d,s,l)):(l.startSlot=d[s](l.startSlot),l.endSlot=d[s](l.endSlot),n||c||l.startSlot&&l.endSlot||(l.startSlot=l.endSlot=this._changeGroup(e,i))),l.startSlot&&l.endSlot||this._isGroupedByDate()||(a=this._continuousSlot(e,t,i),a=this._changeGroupContinuously(e,a,n,i),a&&(l.startSlot=l.endSlot=a)),l},_getNextHorizontalRange:function(e,t,n){return this._isVerticallyGrouped()||(n.startSlot=e[t](n.startSlot),n.endSlot=e[t](n.endSlot)),n},_verticalSlots:function(e,t,n,i){var r,o,a=this.groups[e.groupIndex],s={startSlot:t[0].start,endSlot:t[t.length-1].end};return n||(r=this._normalizeVerticalSelection(e,t,i),r&&(s.startSlot=s.endSlot=r)),o=i?"upSlot":"downSlot",s=this._getNextVerticalRange(a,o,s,n),n||!this._isVerticallyGrouped()||s.startSlot&&s.endSlot||(s.startSlot=s.endSlot=this._isGroupedByDate()?this._changeDate(e,r,i):this._changeGroup(e,i)),s},_getNextVerticalRange:function(e,t,n,i){return n.startSlot=e[t](n.startSlot,i),n.endSlot=e[t](n.endSlot,i),n},_normalizeHorizontalSelection:function(){return null},_normalizeVerticalSelection:function(e,t,n){var i;return i=n?t[0].start:t[t.length-1].end},_continuousSlot:function(){return null},constrainSelection:function(e){var t,n=this.groups[0];this.inRange(e)?n.daySlotCollectionCount()?n.timeSlotCollectionCount()||(e.isAllDay=!0):e.isAllDay=!1:(t=n.firstSlot(),e.isAllDay=t.isDaySlot,e.start=t.startDate(),e.end=t.endDate()),this.groups[e.groupIndex]||(e.groupIndex=0)},move:function(e,t,n){var i,r,o,a,s,l,d=!1,c=this.groups[e.groupIndex],u=this._isGroupedByDate()&&this._isVerticallyGrouped();if(c.timeSlotCollectionCount()||(e.isAllDay=!0),i=c.ranges(e.start,e.end,e.isAllDay,!1),t===D.DOWN||t===D.UP){if(d=!0,a=t===D.UP,this._updateDirection(e,i,n,a,!0),s=this._verticalSlots(e,i,n,a),!s.startSlot&&!n&&this._changeViewPeriod(e,a,!u))return d}else if((t===D.LEFT||t===D.RIGHT)&&(d=!0,a=t===D.LEFT,this._updateDirection(e,i,n,a,!1),s=this._horizontalSlots(e,i,n,a),!s.startSlot&&!n&&this._changeViewPeriod(e,a,u)))return d;return d&&(r=s.startSlot,o=s.endSlot,n?(l=e.backward,l&&r?e.start=r.startDate():!l&&o&&(e.end=o.endDate())):r&&o&&(e.isAllDay=r.isDaySlot,e.start=r.startDate(),e.end=o.endDate()),e.events=[]),d},moveToEventInGroup:function(t,n,i,r){for(var o,a,s=t._continuousEvents||[],l=r?-1:1,d=s.length,c=r?d-1:0;c<d&&c>-1;){if(a=s[c],(!r&&a.start.startDate()>=n.startDate()||r&&a.start.startDate()<=n.startDate())&&(i.length&&(a=s[c+l]),a&&e.inArray(a.uid,i)===-1)){o=!!a;break}c+=l}return a},moveToEvent:function(e,t){var n,i,r,o,a,s,l=e.groupIndex,d=this.groups[l],c=d.ranges(e.start,e.end,e.isAllDay,!1)[0].start,u=this.groups.length,h=t?-1:1,f=e.events;if(this._isGroupedByDate())if(i=this._getAllEvents(),r=this._getUniqueEvents(i),o=this._getSortedEvents(r),0===f.length)a=this._getNextEventIndexBySlot(c,o,l),t&&a--,n=o[a];else for(s=this._getStartIdx(f,o);s<o.length&&s>-1&&(f.length>0&&(c=this._getSelectedSlot(c,o,n,s,h,t)),c);){if((!t&&o[s].start.startDate()>=c.startDate()||t&&o[s].start.startDate()<=c.startDate())&&f[0]!=o[s].uid){n=o[s];break}s+=h}else for(;l<u&&l>-1&&(n=this.moveToEventInGroup(d,c,f,t),l+=h,d=this.groups[l],d&&!n);)f=[],c=t?d.lastSlot():d.firstSlot(!0);return n&&(e.events=[n.uid],e.start=n.start.startDate(),e.end=n.end.endDate(),e.isAllDay=n.start.isDaySlot,e.groupIndex=n.start.groupIndex),!!n},current:function(e){return void 0===e?this._current:(this._current=e,void(this.content.has(e)&&this._scrollTo(e,this.content[0])))},select:function(e){this.clearSelection(),this._selectEvents(e)||this._selectSlots(e)},_getNextEventIndexBySlot:function(e,t,n){var i,r,o=0,a=x.date.getDate(e.startDate());for(i=0;i<t.length;i++)if(r=x.date.getDate(t[i].start.startDate()),a>r)o++;else if(a.getTime()===r.getTime()&&n>t[i].start.groupIndex)o++;else{if(!(a.getTime()===r.getTime()&&n>=t[i].start.groupIndex&&e.startDate()>t[i].start.startDate()))break;o++}return o},_getSelectedSlot:function(e,t,n,i,r,o){var a,s;return t[i+r]&&t[i].start.groupIndex!==t[i+r].start.groupIndex&&(a=t[i+r].start.groupIndex,s=this.groups[a],s&&!n||(e=null),e=o?s.lastSlot():s.firstSlot(!0)),e},_getStartIdx:function(t,n){var i=0;return e.each(n,function(){return this.uid!==t[0]&&void i++}),i},_getAllEvents:function(){var e,t=[],n=this.groups;for(e=0;e<n.length;e++)n[e]._continuousEvents&&(t=t.concat(n[e]._continuousEvents));return t},_getUniqueEvents:function(e){var t,n,i,r=[];for(t=0;t<e.length;t++){for(n=!1,i=0;i<r.length;i++)if(e[t].uid===r[i].uid){n=!0;break}n||r.push(e[t])}return r},_getSortedEvents:function(t){return t.sort(function(t,n){var i=t.start.startDate(),r=n.start.startDate(),o=x.date.getDate(i)-x.date.getDate(r);return 0===o&&(o=t.start.groupIndex-n.start.groupIndex),0===o&&(o=i.getTime()-r.getTime()),0===o&&(t.start.isDaySlot&&!n.start.isDaySlot&&(o=-1),!t.start.isDaySlot&&n.start.isDaySlot&&(o=1)),0===o&&(o=e(t.element).index()-e(n.element).index()),o})},_selectSlots:function(e){var t,n,i,r,o,a,s,l=e.isAllDay,d=this.groups[e.groupIndex];for(d.timeSlotCollectionCount()||(l=!0),this._selectedSlots=[],t=d.ranges(e.start,e.end,l,!1),r=0;r<t.length;r++)for(o=t[r],a=o.collection,s=o.start.index;s<=o.end.index;s++)i=a.at(s),n=i.element,n.setAttribute("aria-selected",!0),b(n),this._selectedSlots.push({start:i.startDate(),end:i.endDate(),element:n});e.backward&&(n=t[0].start.element),this.current(n)},_selectEvents:function(t){var n,i,r=!1,o=t.events,a=this.groups[t.groupIndex]._continuousEvents||[],s=a.length;if(!o[0]||!a[0])return r;for(i=e(),t.events=[],n=0;n<s;n++)e.inArray(a[n].uid,o)>-1&&(i=i.add(a[n].element),t.events.push(a[n].uid));return i[0]&&(i.addClass("k-state-selected").attr("aria-selected",!0),this.current(i.last()[0]),
this._selectedSlots=[],r=!0),r},inRange:function(e){var t=this.startDate(),n=x.date.addDays(this.endDate(),1),i=e.start,r=e.end;return t<=i&&i<n&&t<r&&r<=n},_resourceValue:function(e,t){return e.valuePrimitive&&(t=x.getter(e.dataValueField)(t)),t},_resourceBySlot:function(e){var t,n,i,r,o,a=this.groupedResources,s={};if(a.length)for(t=e.groupIndex,n=a.length-1;n>=0;n--)i=a[n],r=this._resourceValue(i,i.dataSource.view()[t%i.dataSource.total()]),i.multiple&&(r=[r]),o=x.setter(i.field),o(s,r),t=Math.floor(t/i.dataSource.total());return s},_createResizeHint:function(t,n,i,r){return e(R).css({left:t,top:n,width:i,height:r})},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=e()},_removeMoveHint:function(){this._moveHint.remove(),this._moveHint=e()},_scrollTo:function(e,t){var n=e.offsetTop,i=e.offsetHeight,r=t.scrollTop,o=t.clientHeight,a=n+i,s=0;s=r>n?n:a>r+o?i<=o?a-o:n:r,t.scrollTop=s},_shouldInverseResourceColor:function(e){var t=new w(e.color).isDark(),n=this.element.css("color"),i=new w(n).isDark();return t==i},_eventTmpl:function(t,n){var i,r=this.options,o=e.extend({},x.Template,r.templateSettings),a=o.paramName,s="",l=typeof t,d={storage:{},count:0};return"function"===l?(d.storage["tmpl"+d.count]=t,s+="#=this.tmpl"+d.count+"("+a+")#",d.count++):"string"===l&&(s+=t),i=x.template(x.format(n,s),o),d.count>0&&(i=e.proxy(i,d.storage)),i},eventResources:function(e){var t,n,i,r,o,a,s,l,d,c,u=[],h=this.options;if(!h.resources)return u;for(t=0;t<h.resources.length;t++)if(n=h.resources[t],i=n.field,r=x.getter(i)(e),null!=r)for(n.multiple||(r=[r]),o=n.dataSource.view(),a=0;a<r.length;a++){for(s=null,l=r[a],n.valuePrimitive||(l=x.getter(n.dataValueField)(l)),d=0;d<o.length;d++)if(o[d].get(n.dataValueField)==l){s=o[d];break}null!==s&&(c=x.getter(n.dataColorField)(s),u.push({field:n.field,title:n.title,name:n.name,text:x.getter(n.dataTextField)(s),value:l,color:c}))}return u},createLayout:function(i){var r,o,a,s,l,d=-1;for(i.rows||(i.rows=[]),r=0;r<i.rows.length;r++)if(i.rows[r].allDay){d=r;break}o=i.rows[d],d>=0&&i.rows.splice(d,1),a=this.columnLevels=t(i,"columns"),s=this.rowLevels=t(i,"rows"),this.table=e("<table "+n()+' class="k-scheduler-layout k-scheduler-'+this.name+'view"><tbody></tbody></table>'),l=s[s.length-1].length,this.table.find("tbody:first").append(this._topSection(a,o,l)),this.table.find("tbody:first").append(this._bottomSection(a,s,l)),this.element.append(this.table),this._scroller()},refreshLayout:function(){var t,n,i,r,o,a,s=this,l=s.element.find(">.k-scheduler-toolbar"),d=s.element.innerHeight(),c=this._scrollbar,u=0,h=this._isRtl?"left":"right";for(t=0;t<l.length;t++)d-=S(l.eq(t));s.datesHeader&&(u=S(s.datesHeader)),s.timesHeader&&S(s.timesHeader)>u&&(u=S(s.timesHeader)),s.datesHeader&&s.timesHeader&&(n=s.datesHeader.find("table:first tr"),s.timesHeader.find("tr").height(function(t){e(this).height(n.eq(t).height())})),u&&(d-=u),s.footer&&(d-=S(s.footer)),i=function(e){var t,n;return!!e[0].style.height||(t=e.height(),e.height("auto"),n=e.height(),t!=n?(e.height(""),!0):(e.height(""),!1))},r=s.content[0],o=x.support.kineticScrollNeeded?0:c,i(s.element)&&(s.content.height(d>2*c?d:2*c+1),s.times.height(r.clientHeight),a=s.times.find("table"),a.length&&a.height(s.content.find("table")[0].clientHeight)),r.offsetWidth-r.clientWidth>0?(s.table.addClass("k-scrollbar-v"),s.datesHeader.css("padding-"+h,o-parseInt(s.datesHeader.children().css("border-"+h+"-width"),10))):s.datesHeader.css("padding-"+h,""),r.offsetHeight-r.clientHeight>0||r.clientHeight>s.content.children(".k-scheduler-table").height()?s.table.addClass("k-scrollbar-h"):s.table.removeClass("k-scrollbar-h")},_topSection:function(t,n,i){this.timesHeader=o(t.length,n,i);var r=t[t.length-1].length;return this.datesHeader=a(t,r,n),e("<tr>").append(this.timesHeader.add(this.datesHeader).wrap("<td>").parent())},_bottomSection:function(t,n,i){return this.times=s(n,i),this.content=l(t[t.length-1],n[n.length-1]),e("<tr>").append(this.times.add(this.content).wrap("<td>").parent())},_scroller:function(){var t,n=this;this.content.bind("scroll"+E,function(){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(this.scrollLeft),n.times.scrollTop(this.scrollTop)}),t=x.touchScroller(this.content,{avoidScrolling:function(t){return e(t.event.target).closest(".k-event.k-event-active").length>0}}),t&&t.movable&&(this._touchScroller=t,this.content=t.scrollElement,t.movable.bind("change",function(e){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(-e.sender.x),n.times.scrollTop(-e.sender.y)}))},_resourcesForGroups:function(){var e,t,n,i,r=[],o=this.options.group,a=this.options.resources;if(o=o&&o.resources?o.resources:[],a&&o.length)for(e=0,t=a.length;e<t;e++)for(n=0,i=o.length;n<i;n++)a[e].name===o[n]&&r.push(a[e]);this.groupedResources=r},_createDateLayout:function(e,t,n){return g("rows",e,t,n)},_createColumnsLayout:function(e,t,n,i,r){return v("columns",e,t,n,i,r)},_groupOrientation:function(){var e=this.options.group;return e&&e.resources?e.orientation:"horizontal"},_isGroupedByDate:function(){return this.options.group&&this.options.group.date},_isVerticallyGrouped:function(){return this.groupedResources.length&&"vertical"===this._groupOrientation()},_createRowsLayout:function(e,t,n,i){return v("rows",e,t,n,i)},selectionByElement:function(){return null},clearSelection:function(){this.content.find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},destroy:function(){var e=this;T.fn.destroy.call(this),e.table&&(x.destroy(e.table),e.table.remove()),e.groups=null,e.table=null,e.content=null,e.times=null,e.datesHeader=null,e.timesHeader=null,e.footer=null,e._resizeHint=null,e._moveHint=null},calendarInfo:function(){return x.getCulture().calendars.standard},prevGroupSlot:function(e,t,n){var i,r=this.groups[t],o=r.ranges(e,e,n,!1)[0].start;if(!(t<=0))return this._isGroupedByDate()?o:this._isVerticallyGrouped()?r.timeSlotCollectionCount()?(i=r._collection(n?o.index:o.collectionIndex,!1),i.last()):(i=r._collection(r.daySlotCollectionCount()-1,!0),i.at(o.index)):r.timeSlotCollectionCount()?(i=r._collection(n?0:r.timeSlotCollectionCount()-1,n),n?i.last():i.at(o.index)):(i=r._collection(o.collectionIndex,!0),i.last())},nextGroupSlot:function(e,t,n){var i,r,o=this.groups[t],a=o.ranges(e,e,n,!1)[0].start;if(!(t>=this.groups.length-1))return this._isGroupedByDate()?a:this._isVerticallyGrouped()?o.timeSlotCollectionCount()?(r=o.daySlotCollectionCount(),i=o._collection(r?0:a.collectionIndex,r),n?i.first():i.at(a.collectionIndex)):(i=o._collection(0,!0),i.at(a.index)):o.timeSlotCollectionCount()?(i=o._collection(0,n),n?i.first():i.at(a.index)):(i=o._collection(a.collectionIndex,!0),i.first())},_eventOptionsForMove:function(){return{}},_updateEventForResize:function(){},_updateEventForSelection:function(e){return e}}),w=function(e){var t,n,i,r,o,a=this,s=w.formats;if(1===arguments.length)for(e=a.resolveColor(e),r=0;r<s.length;r++)t=s[r].re,n=s[r].process,i=t.exec(e),i&&(o=n(i),a.r=o[0],a.g=o[1],a.b=o[2]);else a.r=arguments[0],a.g=arguments[1],a.b=arguments[2];a.r=a.normalizeByte(a.r),a.g=a.normalizeByte(a.g),a.b=a.normalizeByte(a.b)},w.prototype={resolveColor:function(e){return e=e||"#000","#"==e.charAt(0)&&(e=e.substr(1,6)),e=e.replace(/ /g,""),e=e.toLowerCase(),e=w.namedColors[e]||e},normalizeByte:function(e){return e<0||isNaN(e)?0:e>255?255:e},percBrightness:function(){var e=this;return F.sqrt(.241*e.r*e.r+.691*e.g*e.g+.068*e.b*e.b)},isDark:function(){var e=this,t=e.percBrightness();return t<180}},w.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],w.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},y=/\s*k-state-selected/,e.extend(C.SchedulerView,{createColumns:f,createRows:p,rangeIndex:u,collidingEvents:c,groupEqFilter:_})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.scheduler.dayview.min",["kendo.scheduler.view.min"],e)}(function(){return function(e,t){function n(e){var t=new Date(1980,1,1,0,0,0);return d(t,w(e)),t}function i(e,t,n){return e>=t&&e<=n}function r(e,t,n,i){return i=i?e<=n:e<n,e>t&&i}function o(e,t,n,i){var r,o=e._continuousEvents,a=o[o.length-1],l=m(t.start.startDate()).getTime();if(i&&a&&m(a.start.startDate()).getTime()==l){for(r=o.length-1;r>-1&&!(o[r].isAllDay||m(o[r].start.startDate()).getTime()<l);r--);o.splice(r+1,0,{element:n,isAllDay:!0,uid:n.attr(s.attr("uid")),start:t.start,end:t.end})}else o.push({element:n,isAllDay:i,uid:n.attr(s.attr("uid")),start:t.start,end:t.end})}function a(e){var t=[],n=e.workWeekStart;for(t.push(n);e.workWeekEnd!=n;)n>6?n-=7:n++,t.push(n);return t}var s=window.kendo,l=s.ui,d=s.date.setTime,c=l.SchedulerView,u=s._outerWidth,h=s._outerHeight,f=e.extend,p=e.proxy,m=s.date.getDate,g=s.date.MS_PER_MINUTE,v=s.date.MS_PER_DAY,_="k-current-time",b="k-current-time-arrow",k=.8666,w=s.date.getMilliseconds,y=".kendoMultiDayView",x=s.template('<div title="(#=kendo.format("{0:t} - {1:t}", start, end)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#</div><div class="k-event-template">${title}</div></div>'),C=s.template('<div title="(#=kendo.format("{0:t}", start)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">${title}</div></div>'),T=s.template("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd M/dd')#</span>"),S='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"></span>#}#</span>#if(resizable && !singleDay && !data.tail && !data.middle){#<span class="k-resize-handle k-resize-w"></span>#}##if(resizable && !singleDay && !data.head && !data.middle){#<span class="k-resize-handle k-resize-e"></span>#}#</div>',D='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#" #if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}#</span><span class="k-event-top-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-n"></span># } #</span><span class="k-event-bottom-actions"># if(data.head || data.middle) {#<span class="k-icon k-i-arrow-s"></span># } #</span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-n"></span># } ## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-s"></span># } #</div>',E=c.extend({init:function(e,t){var n=this;c.fn.init.call(n,e,t),n.title=n.options.title||n.options.name,n._workDays=a(n.options),n._templates(),n._editable(),n.calculateDateRange(),n._groups(),n._currentTime(!0)},_currentTimeMarkerUpdater:function(){this._updateCurrentTimeMarker(new Date)},_updateCurrentTimeMarker:function(t){var n,i,r,o,a,l,d,c,f,p,m,g,v,w,y,x=this.options;for(x.currentTimeMarker.useLocalTimezone===!1&&(n=x.dataSource.options.schema.timezone,x.dataSource&&n&&(i=s.timezone.offset(t,n),t=s.timezone.convert(t,t.getTimezoneOffset(),i))),this.times.find("."+_).remove(),this.content.find("."+_).remove(),r=x.group&&"horizontal"!=x.group.orientation?this.groups.length:1,o=this.times.find("tr:first th:first"),a=this.times.find("tr:first th:last"),l=0;l<r;l++){if(d=this.groups[l],!d)return;if(c=s.date.toUtcTime(t),f=d.timeSlotRanges(c,c+1),0===f.length)return;p=f[0].collection,m=p.slotByStartDate(t),m&&(g="<div class='"+_+"'></div>",v=e(g).prependTo(this.times),w=Math.round(f[0].innerRect(t,new Date(t.getTime()+1),!1).top),y={},this._isRtl?(y.right=o.position().left+h(o)-h(a),v.addClass(b+"-left")):(y.left=a.position().left,v.addClass(b+"-right")),y.top=w-u(v)*k/2,v.css(y),e(g).prependTo(this.content).css({top:w,height:"1px",right:"1px",width:this.content[0].scrollWidth,left:0}))}},_currentTime:function(e){var n=this,i=n.options.currentTimeMarker;i!==!1&&i.updateInterval!==t&&(n._currentTimeMarkerUpdater(),e&&(n._currentTimeUpdateTimer=setInterval(p(this._currentTimeMarkerUpdater,n),i.updateInterval)))},_updateResizeHint:function(e,t,n,i){var r,o,a,l,d,u,h,f,p,m,g,v,_=e.isMultiDay(),b=this.groups[t],k=b.ranges(n,i,_,e.isAllDay);for(this._removeResizeHint(),d=0;d<k.length;d++)if(u=k[d],h=u.startSlot(),this._isGroupedByDate()&&_)for(f=h.index;f<=u.end.index;f++)p=u.collection._slots[f],r=p.offsetWidth,o=p.clientHeight,a=p.offsetTop,l=c.fn._createResizeHint.call(this,p.offsetLeft,a,r,o),this._resizeHint=this._resizeHint.add(l);else r=h.offsetWidth,o=h.clientHeight,a=h.offsetTop,_?r=u.innerWidth():(m=u.outerRect(n,i,this.options.snap),a=m.top,o=m.bottom-m.top),l=c.fn._createResizeHint.call(this,h.offsetLeft,a,r,o),this._resizeHint=this._resizeHint.add(l);g="t",v=this.content,_&&(g="M/dd",v=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),v.length||(v=this.content)),this._resizeHint.appendTo(v),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(s.toString(s.timezone.toLocalDate(n),g)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(s.toString(s.timezone.toLocalDate(i),g))},_updateMoveHint:function(e,t,n){var i,r,o,a,l,d,c,u,h,f=e.isMultiDay(),p=this.groups[t],m=s.date.toUtcTime(e.start)+n,g=m+e.duration(),v=p.ranges(m,g,f,e.isAllDay);for(m=s.timezone.toLocalDate(m),g=s.timezone.toLocalDate(g),this._removeMoveHint(),!f&&(0===w(g)||w(g)<w(this.startTime()))&&v.length>1&&v.pop(),i=0;i<v.length;i++)if(r=v[i],o=r.start,l={left:o.offsetLeft+2,top:o.offsetTop},this._isGroupedByDate()&&f)for(d=o.index;d<=r.end.index;d++)c=r.collection._slots[d],l.left=this._isRtl?.1*c.clientWidth+c.offsetLeft+2:c.offsetLeft+2,l.height=c.offsetHeight,l.width=.9*c.clientWidth-4,a=this._createEventElement(e.clone({start:m,end:g}),!f),this._appendMoveHint(a,l);else this._isRtl&&(l.left=.1*o.clientWidth+o.offsetLeft+2),f?l.width=r.innerWidth()-4:(u=r.outerRect(m,g,this.options.snap),l.top=u.top,l.height=u.bottom-u.top,l.width=.9*o.clientWidth-4),a=this._createEventElement(e.clone({start:m,end:g}),!f),this._appendMoveHint(a,l);h=this.content,f&&(h=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),h.length||(h=this.content)),this._moveHint.appendTo(h)},_appendMoveHint:function(e,t){e.addClass("k-event-drag-hint"),e.css(t),this._moveHint=this._moveHint.add(e)},_slotByPosition:function(e,t){var n,i,r,o;for(this._isVerticallyGrouped()?(i=this.content.offset(),t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft):i=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day)").find(">div").offset(),i&&(e-=i.left,t-=i.top),e=Math.ceil(e),t=Math.ceil(t),o=0;o<this.groups.length;o++)if(r=this.groups[o],n=r.daySlotByPosition(e,t,this._isGroupedByDate()))return n;for(i&&(e+=i.left,t+=i.top),i=this.content.offset(),e-=i.left,t-=i.top,this._isVerticallyGrouped()||(t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft),e=Math.ceil(e),t=Math.ceil(t),o=0;o<this.groups.length;o++)if(r=this.groups[o],n=r.timeSlotByPosition(e,t))return n;return null},_groupCount:function(){var e=this.groupedResources,t=this._isGroupedByDate();return e.length?"vertical"===this._groupOrientation()?t?this._columnCountForLevel(e.length-1):this._rowCountForLevel(e.length-1):t?this._columnCountForLevel(e.length)/this._columnCountForLevel(0):this._columnCountForLevel(e.length)/this._columnOffsetForResource(e.length):1},_columnCountInResourceView:function(){var e=this.groupedResources,t=this._isGroupedByDate();return!e.length||this._isVerticallyGrouped()?t?this._rowCountForLevel(0):this._columnCountForLevel(0):t?this._columnCountForLevel(0):this._columnOffsetForResource(e.length)},_timeSlotGroups:function(e,t){var n,i,r,o,a,s,l,d,c,u,h=this._timeSlotInterval(),f=e,p=this._isGroupedByDate(),m=this.content.find("tr:not(.k-scheduler-header-all-day)");for(m.attr("role","row"),a=m.length,this._isVerticallyGrouped()&&(p&&(f=t),a=Math.floor(a/f)),s=0;s<f;s++)for(l=0,d=0,this._isVerticallyGrouped()?l=s:d=s,r=l*a;r<(l+1)*a;){if(c=m[r].children,r%a===0&&(i=w(new Date((+this.startTime())))),u=0,p)if(this._isVerticallyGrouped())for(o=0;o<e;o++)n=this.groups[o],this._addTimeSlotGroup(n,c,o,i,h,s);else for(n=this.groups[s],o=d;o<e*t;o+=e)this._addTimeSlotGroup(n,c,o,i,h,u),u++;else for(n=this.groups[s],o=d*t;o<(d+1)*t;o++)this._addTimeSlotGroup(n,c,o,i,h,u),u++;i+=h,r++}},_addTimeSlotGroup:function(e,t,n,i,r,o){var a=t[n],s=e.getTimeSlotCollection(o),l=this._dates[o],d=Date.UTC(l.getFullYear(),l.getMonth(),l.getDate()),c=d+i,u=c+r;a.setAttribute("role","gridcell"),a.setAttribute("aria-selected",!1),s.addTimeSlot(a,c,u)},_addDaySlotGroup:function(e,t,n,i,r){var o=t[n],a=this._dates[r],l=Date.UTC(a.getFullYear(),a.getMonth(),a.getDate());o.setAttribute("role","gridcell"),o.setAttribute("aria-selected",!1),e.addDaySlot(o,l,l+s.date.MS_PER_DAY)},_daySlotGroups:function(e,t){var n,i,r,o,a,s,l,d,c,u=e,h=this._isGroupedByDate();for(this._isVerticallyGrouped()?(h&&(u=t),n=this.element.find(".k-scheduler-header-all-day")):n=this.element.find(".k-scheduler-header-all-day tr"),n.attr("role","row"),r=0;r<u;r++)if(o=0,this._isVerticallyGrouped()&&(o=r),l=n[o].children,d=0,this._isVerticallyGrouped()||(d=r),c=0,h)if(this._isVerticallyGrouped())for(i=0;i<e;i++)a=this.groups[i],s=a.getDaySlotCollection(0),this._addDaySlotGroup(s,l,i,t,r);else for(a=this.groups[r],s=a.getDaySlotCollection(0),i=d;i<e*t;i+=e)this._addDaySlotGroup(s,l,i,t,c),c++;else for(a=this.groups[r],s=a.getDaySlotCollection(0),i=d*t;i<(d+1)*t;i++)this._addDaySlotGroup(s,l,i,t,c),c++},_groups:function(){var e,t,n,i=this._groupCount(),r=this._columnCountInResourceView();for(this.groups=[],e=0;e<i;e++){for(t=this._addResourceView(e),n=0;n<r;n++)t.addTimeSlotCollection(this._dates[n],s.date.addDays(this._dates[n],1));this.options.allDaySlot&&t.addDaySlotCollection(this._dates[0],s.date.addDays(this._dates[this._dates.length-1],1))}this._timeSlotGroups(i,r),this.options.allDaySlot&&this._daySlotGroups(i,r)},options:{name:"MultiDayView",selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}",allDaySlot:!0,showWorkHours:!1,title:"",startTime:s.date.today(),endTime:s.date.today(),minorTickCount:2,majorTick:60,majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",minorTimeHeaderTemplate:"&nbsp;",groupHeaderTemplate:"#=text#",slotTemplate:"&nbsp;",allDaySlotTemplate:"&nbsp;",eventTemplate:x,allDayEventTemplate:C,dateHeaderTemplate:T,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,footer:{command:"workDay"},messages:{allDay:"all day",showFullDay:"Show full day",showWorkDay:"Show business hours"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0}},events:["remove","add","edit"],_templates:function(){var e=this.options,t=f({},s.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,D),this.allDayEventTemplate=this._eventTmpl(e.allDayEventTemplate,S),this.majorTimeHeaderTemplate=s.template(e.majorTimeHeaderTemplate,t),this.minorTimeHeaderTemplate=s.template(e.minorTimeHeaderTemplate,t),this.dateHeaderTemplate=s.template(e.dateHeaderTemplate,t),this.slotTemplate=s.template(e.slotTemplate,t),this.allDaySlotTemplate=s.template(e.allDaySlotTemplate,t),this.groupHeaderTemplate=s.template(e.groupHeaderTemplate,t)},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+y,".k-event a:has(.k-si-close)",function(n){t.trigger("remove",{uid:e(this).closest(".k-event").attr(s.attr("uid"))}),n.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+y,".k-scheduler-content td",function(n){var i,r;e(this).parent().hasClass("k-scheduler-header-all-day")||(i=t._slotByPosition(n.pageX,n.pageY),i&&(r=t._resourceBySlot(i),t.trigger("add",{eventInfo:f({start:i.startDate(),end:i.endDate()},r)})),n.preventDefault())}).on("dblclick"+y,".k-scheduler-header-all-day td",function(e){var n,i=t._slotByPosition(e.pageX,e.pageY);i&&(n=t._resourceBySlot(i),t.trigger("add",{eventInfo:f({},{isAllDay:!0,start:s.date.getDate(i.startDate()),end:s.date.getDate(i.startDate())},n)})),e.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+y,".k-event",function(n){t.trigger("edit",{uid:e(this).closest(".k-event").attr(s.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var n=this,i=0;s.support.mobileOS.android&&(i=5),n.options.editable.create!==!1&&(n._addUserEvents=new s.UserEvents(n.element,{threshold:i,filter:".k-scheduler-content td",tap:function(i){var r,o,a,s;e(i.target).parent().hasClass("k-scheduler-header-all-day")||(r=i.x.location!==t?i.x.location:i.x,o=i.y.location!==t?i.y.location:i.y,a=n._slotByPosition(r,o),a&&(s=n._resourceBySlot(a),n.trigger("add",{eventInfo:f({start:a.startDate(),end:a.endDate()},s)})),i.preventDefault())}}),n._allDayUserEvents=new s.UserEvents(n.element,{threshold:i,filter:".k-scheduler-header-all-day td",tap:function(e){var i,r=e.x.location!==t?e.x.location:e.x,o=e.y.location!==t?e.y.location:e.y,a=n._slotByPosition(r,o);a&&(i=n._resourceBySlot(a),n.trigger("add",{eventInfo:f({},{isAllDay:!0,start:s.date.getDate(a.startDate()),end:s.date.getDate(a.startDate())},i)})),e.preventDefault()}})),n.options.editable.update!==!1&&(n._editUserEvents=new s.UserEvents(n.element,{threshold:i,filter:".k-event",tap:function(t){var i=e(t.target).closest(".k-event");i.hasClass("k-event-active")||n.trigger("edit",{uid:i.attr(s.attr("uid"))}),t.preventDefault()}}))},_layout:function(e){var t,n,i,r=[],o=[],a=this.options,l=this,d=l._isGroupedByDate();for(t=0;t<e.length;t++)n={},n.text=l.dateHeaderTemplate({date:e[t]}),s.date.isToday(e[t])&&(n.className="k-today"),r.push(n);return i=this.groupedResources,a.allDaySlot&&o.push({text:a.messages.allDay,allDay:!0,cellContent:function(t){var n=t;return t=i.length&&"vertical"!==l._groupOrientation()?t%e.length:t,l.allDaySlotTemplate({date:e[t],resources:function(){return l._resourceBySlot({groupIndex:n})}})}}),this._forTimeRange(this.startTime(),this.endTime(),function(e,t,n,i){var r=t?l.majorTimeHeaderTemplate:l.minorTimeHeaderTemplate,a={text:r({date:e}),className:i?"k-slot-cell":""};o.push(a)}),i.length&&("vertical"===this._groupOrientation()?d?(o=this._createDateLayout(r,o),r=this._createColumnsLayout(i,null,this.groupHeaderTemplate)):o=this._createRowsLayout(i,o,this.groupHeaderTemplate):r=d?this._createColumnsLayout(i,r,this.groupHeaderTemplate,r):this._createColumnsLayout(i,r,this.groupHeaderTemplate)),{columns:r,rows:o}},_footer:function(){var t,n,i,r=this.options;r.footer!==!1&&(t='<div class="k-header k-scheduler-footer">',n=r.footer.command,n&&"workDay"===n?(t+='<ul class="k-reset k-header">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"></span>',t+=(r.showWorkHours?r.messages.showFullDay:r.messages.showWorkDay)+"</a></li>",t+="</ul>"):t+="&nbsp;",t+="</div>",this.footer=e(t).appendTo(this.element),i=this,this.footer.on("click"+y,".k-scheduler-fullday",function(e){e.preventDefault(),i.trigger("navigate",{view:i.name||r.name,date:i.startDate(),isWorkDay:!r.showWorkHours})}))},_forTimeRange:function(e,t,i,r){var o,a,s,l,c,u,h,f,p,m,_,b,k,y,x,C;for(e=n(e),t=n(t),o=this,a=w(e),s=w(t),l=o.options.minorTickCount,c=o.options.majorTick*g,u=c/l||1,h=new Date((+e)),f=h.getDate(),m=0,b="",_=v/u,a!=s&&(a>s&&(s+=v),_=(s-a)/u),_=Math.round(_);m<_;m++)k=m%(c/u),y=0===k,x=k<l-1,C=k===l-1,b+=i(h,y,x,C),d(h,u,!1);return s&&(p=w(h),f<h.getDate()&&(p+=v),p>s&&(h=new Date((+t)))),r&&(b+=r(h)),b},_content:function(e){var t,n,i,r=this,o=r.options,a=r.startTime(),s=this.endTime(),l=1,d=1,c=e.length,u="",h=this.groupedResources,f=this.allDaySlotTemplate,p=!1,m=r._isGroupedByDate(),g=0;for(h.length&&(p="vertical"===r._groupOrientation(),p?(d=this._rowCountForLevel(this.rowLevels.length-2),m&&(l=this._columnCountForLevel(this.columnLevels.length-1)),o.allDaySlot&&(t=function(t){var n,i='<tr class="k-scheduler-header-all-day">',o=m?0:t,a=function(){return r._resourceBySlot({groupIndex:o})};if(m)for(;o<l;o++)i+="<td>"+f({date:e[g],resources:a})+"</td>";else for(n=0;n<e.length;n++)i+="<td>"+f({date:e[n],resources:a})+"</td>";return i+"</tr>"})):l=m?this._columnCountForLevel(this.columnLevels.length-1)/this._columnCountForLevel(0):this._columnCountForLevel(this.columnLevels.length-2)),u+="<tbody>",n=function(t,n){var o,a,s,d="",u=0;if(d="<tr"+(n?' class="k-middle-row"':"")+">",m)for(o=0,a=c;o<a;o++){for(u=0;u<l;u++)s=o,p&&(s=g),d=r._addCellsToContent(d,e,t,s,u,i);if(p)break}else for(;u<l;u++)for(o=0,a=c;o<a;o++)d=r._addCellsToContent(d,e,t,o,u,i);return d+="</tr>"},i=0;i<d;i++)u+=t?t(i):"",u+=this._forTimeRange(a,s,n),p&&g++;u+="</tbody>",this.content.find("table").append(u)},_addCellsToContent:function(e,t,n,i,r,o){var a,l=this,d="",c=this.slotTemplate,u="vertical"===this._groupOrientation(),h=function(e){return function(){return l._resourceBySlot({groupIndex:e})}};return s.date.isToday(t[i])&&(d+="k-today"),(s.date.getMilliseconds(n)<s.date.getMilliseconds(this.options.workDayStart)||s.date.getMilliseconds(n)>=s.date.getMilliseconds(this.options.workDayEnd)||!this._isWorkDay(t[i]))&&(d+=" k-nonwork-hour"),e+="<td"+(""!==d?' class="'+d+'"':"")+">",a=s.date.getDate(t[i]),s.date.setTime(a,s.date.getMilliseconds(n)),e+=c({date:a,resources:h(u&&!l._isGroupedByDate()?o:r)}),e+="</td>"},_isWorkDay:function(e){var t,n=e.getDay(),i=this._workDays;for(t=0;t<i.length;t++)if(i[t]===n)return!0;return!1},_render:function(t){var n,i=this;t=t||[],this._dates=t,this._startDate=t[0],this._endDate=t[t.length-1||0],this.createLayout(this._layout(t)),this._content(t),this._footer(),this.refreshLayout(),n=this.element.find(".k-scheduler-header-all-day td"),n.length&&(this._allDayHeaderHeight=n.first()[0].clientHeight),i.element.on("click"+y,".k-nav-day",function(t){var n,r=e(t.currentTarget).closest("th"),o=r.offset(),a=0,s=h(r);i._isGroupedByDate()&&(i._isVerticallyGrouped()?(a=u(i.times),s=0):s=h(i.datesHeader)),n=i._slotByPosition(o.left+a,o.top+s),i.trigger("navigate",{view:"day",date:n.startDate()})})},startTime:function(){var e=this.options;return e.showWorkHours?e.workDayStart:e.startTime},endTime:function(){var e=this.options;return e.showWorkHours?e.workDayEnd:e.endTime},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_end:function(e){var t=w(this.endTime())||v;return e&&(t=0),new Date(this._endDate.getTime()+t)},nextDate:function(){return s.date.nextDay(this.endDate())},previousDate:function(){return s.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},destroy:function(){var e=this;e._currentTimeUpdateTimer&&clearInterval(e._currentTimeUpdateTimer),e.datesHeader&&e.datesHeader.off(y),e.element&&e.element.off(y),e.footer&&e.footer.remove(),c.fn.destroy.call(this),this._isMobile()&&e.options.editable&&(e.options.editable.create!==!1&&(e._addUserEvents.destroy(),e._allDayUserEvents.destroy()),e.options.editable.update!==!1&&e._editUserEvents.destroy())},inRange:function(e){var t,n,i,r,o=c.fn.inRange.call(this,e);return e.isAllDay?o:(t=w(this.startTime()),n=w(this.endTime())||s.date.MS_PER_DAY,i=w(e.start),r=w(e.end)||s.date.MS_PER_DAY,o&&t<=i&&r<=n)},selectionByElement:function(e){var t=e.offset();return this._slotByPosition(t.left,t.top)},_timeSlotInterval:function(){var e=this.options;return e.majorTick/e.minorTickCount*g},_timeSlotIndex:function(e){var t=this.options,n=w(e),i=w(this.startTime()),r=t.majorTick/t.minorTickCount*g;return(n-i)/r},_slotIndex:function(e,t){return t?this._dateSlotIndex(e):this._timeSlotIndex(e)},_dateSlotIndex:function(e,t){var n,r,o,a,l=this._dates||[],d=1;for(n=0,r=l.length;n<r;n++)if(o=s.date.getDate(l[n]),a=new Date(s.date.getDate(l[n]).getTime()+v-(t?0:1)),i(e,o,a))return n*d;return-1},_positionAllDayEvent:function(t,n){var i,r,o,a,s,l,d,u=n.innerWidth(),h=n.start.index,f=n.end.index,p=c.collidingEvents(n.events(),h,f),m=this._headerColumnCount||0,g=2,v=h!==f?5:4,_=this._allDayHeaderHeight,b=n.startSlot();for(t.css({left:b.offsetLeft+g,width:u-v}),n.addEvent({slotIndex:h,start:h,end:f,element:t}),p.push({slotIndex:h,start:h,end:f,element:t}),i=c.createRows(p),i.length&&i.length>m&&(this._headerColumnCount=i.length),r=n.start.offsetTop,o=0,a=i.length;o<a;o++)for(s=i[o].events,l=0,d=s.length;l<d;l++)e(s[l].element).css({top:r+o*_})},_arrangeColumns:function(e,t,n,i){var r,o,a,s,l,d,u,h,f,p,m,g=i.start;for(e={element:e,slotIndex:g.index,start:t,end:t+n},o=g.clientWidth,a=.1*o,l=i.events(),d=c.collidingEvents(l,e.start,e.end),i.addEvent(e),d.push(e),r=c.createColumns(d),u=(o-a)/r.length,h=0,f=r.length;h<f;h++)for(s=r[h].events,p=0,m=s.length;p<m;p++)s[p].element[0].style.width=u-4+"px",s[p].element[0].style.left=(this._isRtl?a:0)+g.offsetLeft+h*u+2+"px"},_positionEvent:function(e,t,n){var i=e._startTime||e.start,r=e._endTime||e.end,o=n.innerRect(i,r,!1),a=o.bottom-o.top-2;a<0&&(a=0),t.css({top:o.top,height:a}),this._arrangeColumns(t,o.top,t[0].clientHeight,n)},_createEventElement:function(t,n,r,o){var a,l,d,c,u,h,p=n?this.eventTemplate:this.allDayEventTemplate,g=this.options,_=g.editable,b=this._isMobile(),k=_&&_.destroy!==!1&&!b,y=_&&_.resize!==!1,x=m(this.startDate()),C=m(this.endDate()),T=w(this.startTime()),S=w(this.endTime()),D=t._time("start"),E=t._time("end");return T>=S&&(S=w(new Date(this.endTime().getTime()+v-1))),n||t.isAllDay||(C=new Date(C.getTime()+v)),l=t.start,d=t.end,t.isAllDay&&(d=m(t.end)),!i(m(l),x,C)&&!i(d,x,C)||n&&D<T&&E>S?a=!0:m(l)<x||n&&D<T?o=!0:(d>C&&!n||n&&E>S)&&(r=!0),c=this.eventResources(t),t._startTime&&D!==s.date.getMilliseconds(t.start)&&(l=new Date(D),
l=s.timezone.apply(l,"Etc/UTC")),t._endTime&&E!==s.date.getMilliseconds(t.end)&&(d=new Date(E),d=s.timezone.apply(d,"Etc/UTC")),u=f({},{ns:s.ns,resizable:y,showDelete:k,middle:a,head:r,tail:o,singleDay:1==this._dates.length,resources:c,inverseColor:!(!c||!c[0])&&this._shouldInverseResourceColor(c[0])},t,{start:l,end:d}),h=e(p(u)),this.angular("compile",function(){return{elements:h,data:[{dataItem:u}]}}),h},_isInTimeSlot:function(e){var t,n=this.startTime(),i=this.endTime(),o=e._startTime||e.start,a=e._endTime||e.end;return w(i)===w(s.date.getDate(i))&&(i=s.date.getDate(i),d(i,v-1)),e._date("end")>e._date("start")&&(a=+e._date("end")+(v-1)),a-=e._date("end"),o-=e._date("start"),i=w(i),n=w(n),n===o&&o===a||(t=o!==i,r(o,n,i,t)||r(a,n,i,t)||r(n,o,a)||r(i,o,a))},_isInDateSlot:function(e){var t=this.groups[0],n=t.firstSlot().start,r=t.lastSlot().end-1,o=s.date.toUtcTime(e.start),a=s.date.toUtcTime(e.end);return(i(o,n,r)||i(a,n,r)||i(n,o,a)||i(r,o,a))&&(!i(a,n,n)||i(a,o,o)||e.isAllDay)},_updateAllDayHeaderHeight:function(e){var t,n;if(this._height!==e&&(this._height=e,t=this.element.find(".k-scheduler-header-all-day td"),t.length))for(t.parent().add(this.element.find(".k-scheduler-times-all-day").parent()).height(e),n=0;n<this.groups.length;n++)this.groups[n].refresh()},_renderEvents:function(e,t){var n,i,r,a,s,l,d,c,u,h,f,p,m,g,_,b,k,w,y,x,C,T=this.datesHeader.find(".k-scheduler-header-wrap > div"),S=this._isGroupedByDate();for(i=0,r=e.length;i<r;i++)if(n=e[i],this._isInDateSlot(n))if(a=n.isAllDay||n.end.getTime()-n.start.getTime()>=v,s=a&&!this._isVerticallyGrouped()?T:this.content,a){if(this.options.allDaySlot&&(f=this.groups[t],f._continuousEvents||(f._continuousEvents=[]),d=f.slotRanges(n),d.length))if(c=d[0],b=c.start.index,k=c.end.index,S&&b!==k)for(u=c.start.start,h=c.end.end,w=new Date(u),y=new Date(u),x=c.start.index;x<=c.end.index;x++)l=this._createEventElement(n,!a,x!==k,x!==b),C=f.daySlotRanges(w,y,!0)[0],y.setDate(y.getDate()+1),w.setDate(w.getDate()+1),this._positionAllDayEvent(l,C),o(f,C,l,!0),l.appendTo(s);else l=this._createEventElement(n,!a),this._positionAllDayEvent(l,d[0]),o(f,d[0],l,!0),l.appendTo(s)}else if(this._isInTimeSlot(n))for(f=this.groups[t],f._continuousEvents||(f._continuousEvents=[]),d=f.slotRanges(n),p=d.length,m=0;m<p;m++)c=d[m],u=n.start,h=n.end,p>1&&(0===m?h=c.end.endDate():m==p-1?u=c.start.startDate():(u=c.start.startDate(),h=c.end.endDate())),g=n.clone({start:u,end:h,_startTime:n._startTime,_endTime:n.endTime}),this._isInTimeSlot(g)&&(_=c.head,l=this._createEventElement(n,!a,_,c.tail),l.appendTo(s),this._positionEvent(g,l,c),o(f,c,l,!1))},render:function(t){var n,r,o,a;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),t=new s.data.Query(t).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),n=[],this._eventsByResource(t,this.groupedResources,n),r=e.map(this._dates,function(t){return Math.max.apply(null,e.map(n,function(n){return e.grep(n,function(e){return e.isMultiDay()&&i(t,m(e.start),m(e.end))}).length}))}),o=Math.max.apply(null,r),this._updateAllDayHeaderHeight((o+1)*this._allDayHeaderHeight),a=0;a<n.length;a++)this._renderEvents(n[a],a);this.refreshLayout(),this._currentTime(!1),this.trigger("activate")},_eventsByResource:function(e,t,n){var i,r,o,a,l=t[0];if(l)for(i=l.dataSource.view(),r=0;r<i.length;r++)o=this._resourceValue(l,i[r]),a=new s.data.Query(e).filter({field:l.field,operator:c.groupEqFilter(o)}).toArray(),t.length>1?this._eventsByResource(a,t.slice(1),n):n.push(a);else n.push(e)},_columnOffsetForResource:function(e){return this._columnCountForLevel(e)/this._columnCountForLevel(e-1)},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},clearSelection:function(){this.content.add(this.datesHeader).find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},_updateDirection:function(e,t,n,i,r){var o=e.isAllDay,a=t[0].start,s=t[t.length-1].end;n&&(r?o||a.index!==s.index||a.collectionIndex!==s.collectionIndex||(e.backward=i):(o&&a.index===s.index||!o&&a.collectionIndex===s.collectionIndex)&&(e.backward=i))},_changeViewPeriod:function(e,t,n){var i,r,o,a,s,l,c,u,h,f,p;if(!n)return i=t?this.previousDate():this.nextDate(),r=e.start,o=e.end,a=this._isGroupedByDate()&&this._isVerticallyGrouped(),s=this.groups[e.groupIndex],l=t?s._timeSlotCollections:s._getCollections(s.daySlotCollectionCount()),c=l[l.length-1]._slots,u=t||s.daySlotCollectionCount()?c.length-1:0,e.start=new Date(i),e.end=new Date(i),a?(f=new Date(c[u].startDate()),p=new Date(c[u].endDate()),h=w(p)?w(p):v,d(e.start,w(f)),d(e.end,h),s.daySlotCollectionCount()&&(e.isAllDay=!e.isAllDay)):(h=e.isAllDay||!w(o)?v:w(o),d(e.start,w(r)),d(e.end,h)),this._isVerticallyGrouped()||(e.groupIndex=t?this.groups.length-1:0),e.events=[],!0}});f(!0,l,{MultiDayView:E,DayView:E.extend({options:{name:"DayView",title:"Day"},name:"day"}),WeekView:E.extend({options:{name:"WeekView",title:"Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"},name:"week",calculateDateRange:function(){var e,t,n=this.options.date,i=s.date.dayOfWeek(n,this.calendarInfo().firstDay,-1),r=[];for(e=0,t=7;e<t;e++)r.push(i),i=s.date.nextDay(i);this._render(r)}}),WorkWeekView:E.extend({options:{name:"WorkWeekView",title:"Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"},name:"workWeek",nextDate:function(){var e=s.date.dayOfWeek(s.date.nextDay(this.startDate()),this.calendarInfo().firstDay,1);return s.date.addDays(e,this._workDays[0])},previousDate:function(){var e=s.date.dayOfWeek(this.startDate(),this.calendarInfo().firstDay,-1),t=this._workDays;return s.date.addDays(e,t[t.length-1]-7)},calculateDateRange:function(){for(var e=this.options.date,t=s.date.dayOfWeek,n=t(e,this.calendarInfo().firstDay,-1),i=t(n,this.options.workWeekStart,1),r=t(i,this.options.workWeekEnd,1),o=[];i<=r;)o.push(i),i=s.date.nextDay(i);this._render(o)}})})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.scheduler.agendaview.min",["kendo.scheduler.view.min"],e)}(function(){return function(e){function t(e){var t,n,i=0;for(t=0,n=e.length;t<n;t++)i+=e[t].items.length;return i}function n(e,t){return e.valuePrimitive&&(t=o.getter(e.dataValueField)(t)),t}function i(e){for(var t,n=0,i=e.length,o=[];n<i;n++)t=e[n],t.groups?(t=r(t.groups),o=o.concat(t)):o=o.concat(r(t.items));return o}function r(e){for(var t=[].concat(e),n=t.shift(),i=[],r=[].push;n;)n.groups?r.apply(t,n.groups):n.items?r.apply(t,n.items):r.call(i,n),n=t.shift();return i}var o=window.kendo,a=o.ui,s=".kendoAgendaView",l='<div class="k-task" title="#:title.replace(/"/g,"\'")#" data-#=kendo.ns#uid="#=uid#"># if (resources[0]) {#<span class="k-scheduler-mark" style="background-color:#=resources[0].color#"></span># } ## if (data.isException()) { #<span class="k-icon k-i-exception"></span># } else if (data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #{0}#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}#</div>',d=o.Class.extend({init:function(e){this._view=e},_getColumns:function(e,t){return e.concat(t)},_getGroupsInDay:function(){return[]},_getSumOfItemsForDate:function(){return 0},_renderTaskGroupsCells:function(e,t,n,i){var r=this._view;0===n&&0===i&&t.length&&r._renderTaskGroupsCells(e,t)},_renderDateCell:function(e,t,n,i,r,a){var s=this._view;e.push(o.format('<td class="k-scheduler-datecolumn{3}{2}" rowspan="{0}">{1}</td>',n.length,s._dateTemplate({date:i}),r!=a.length-1||t.length?"":" k-last",t.length?"":" k-first"))},_renderDates:function(){},_getParents:function(e){return e.splice(0)},_getGroupsByDate:function(){},_renderTaskGroups:function(e,t,n){var i=this._view;e.append(i._renderTaskGroups(t,n))}}),c=o.Class.extend({init:function(e){this._view=e},_getColumns:function(e,t){var n,i,r=this._view;return r._isMobilePhoneView()?e.concat(t):(n=t.slice(0,1),i=t.slice(1),n.concat(e).concat(i))},_compareDateGroups:function(e,t,n){return e[n].text==t[n].text&&(0===n||this._compareDateGroups(e,t,n-1))},_getGroupsInDay:function(e,t){var n,i,r,o,a,s=[],l=null;for(n=0;n<e.length;n++)for(i=0;i<e[n].items.length;i++){if(r=0,0===s.length)for(r;r<t[n].length;r++)s.push([1]);else for(r;r<t[n].length;r++)if(this._compareDateGroups(t[n],l,r))s[r][s[r].length-1]++;else{for(o=s[r][s[r].length-1]-1,a=0;a<o;a++)s[r].push(0);s[r].push(1)}l=t[n]}return s},_getSumOfItemsForDate:function(e){var t,n=0;for(t=0;t<e.length;t++)n+=e[t].items.length;return n},_renderTaskGroupsCells:function(e,t,n,i,r,a,s,l){var d,c=this._view,u=c._isMobilePhoneView();if(u)0===n&&0===i&&t.length&&c._renderTaskGroupsCells(e,t);else for(0===n&&0===i&&e.push(o.format('<td class="k-scheduler-datecolumn k-first" rowspan="{0}">{1}</td>',a,c._dateTemplate({date:s}))),d=0;d<t[n].length;d++)r[d][l]&&e.push(o.format('<td class="k-scheduler-groupcolumn" rowspan="{0}">{1}</td>',r[d][l],c._groupTemplate({value:t[n][d].text}),t[n][d].className))},_renderDateCell:function(){},_renderDates:function(e){var t,n=this._view,i=n._groupsByDate.sort(function(e,t){return e.array[0].value.getTime()-t.array[0].value.getTime()});for(t=0;t<i.length;t++)e.append(n._renderTaskGroups(i[t].array,i[t].groups))},_getParents:function(e){return e.slice(0)},_getGroupsByDate:function(e,t,n){var i,r,o,a,s=this._view;if(e[t].items)for(i=0;i<e[t].items.length;i++){for(r=e[t].items[i].value,o=!1,a=0;a<s._groupsByDate.length;a++)s._groupsByDate[a].array[0].value.getTime()===r.getTime()&&(o=!0,s._groupsByDate[a].array.push(e[t].items[i]),s._groupsByDate[a].groups.push(n));o||s._groupsByDate.push({array:[e[t].items[i]],groups:[n]})}},_renderTaskGroups:function(){}});o.ui.scheduler.AgendaGroupedView=d,o.ui.scheduler.AgendaGroupedByDateView=c,a.AgendaView=a.SchedulerView.extend({init:function(t,n){a.SchedulerView.fn.init.call(this,t,n),this._groupedView=this._getGroupedView(),n=this.options,n.editable&&(n.editable=e.extend({"delete":!0},n.editable,{create:!1,update:!1})),this.title=n.title,this._eventTemplate=this._eventTmpl(n.eventTemplate,l),this._dateTemplate=o.template(n.eventDateTemplate),this._groupTemplate=o.template(n.eventGroupTemplate),this._timeTemplate=o.template(n.eventTimeTemplate),this.element.on("mouseenter"+s,".k-scheduler-agenda .k-scheduler-content tr","_mouseenter").on("mouseleave"+s,".k-scheduler-agenda .k-scheduler-content tr","_mouseleave").on("click"+s,".k-scheduler-agenda .k-scheduler-content .k-link:has(.k-si-close)","_remove"),this._renderLayout(n.date)},name:"agenda",_getGroupedView:function(){return this._isGroupedByDate()?new o.ui.scheduler.AgendaGroupedByDateView(this):new o.ui.scheduler.AgendaGroupedView(this)},_mouseenter:function(t){e(t.currentTarget).addClass("k-state-hover")},_mouseleave:function(t){e(t.currentTarget).removeClass("k-state-hover")},_remove:function(t){t.preventDefault(),this.trigger("remove",{uid:e(t.currentTarget).closest(".k-task").attr(o.attr("uid"))})},nextDate:function(){return o.date.nextDay(this.startDate())},startDate:function(){return this._startDate},endDate:function(){return this._endDate},previousDate:function(){return o.date.previousDay(this.startDate())},_renderLayout:function(e){this._startDate=e,this._endDate=o.date.addDays(e,7),this.createLayout(this._layout()),this.table.addClass("k-scheduler-agenda")},_layout:function(){var e,t,n,i=[{text:this.options.messages.time,className:"k-scheduler-timecolumn"},{text:this.options.messages.event}];if(this._isMobilePhoneView()||i.splice(0,0,{text:this.options.messages.date,className:"k-scheduler-datecolumn"}),e=this.groupedResources,e.length){for(t=[],n=0;n<e.length;n++)t.push({text:"",className:"k-scheduler-groupcolumn"});i=this._groupedView._getColumns(t,i)}return{columns:i}},_tasks:function(e){var t,n,i,r,a,s,l,d=[];for(t=0;t<e.length;t++)if(n=e[t],i=n.start,r=n.isAllDay?o.date.getDate(n.end):n.end,a=Math.ceil((r-o.date.getDate(i))/o.date.MS_PER_DAY),n.isAllDay&&(a+=1),s=n.clone(),s.startDate=o.date.getDate(i),s.startDate>=this.startDate()&&d.push(s),a>1)for(s.end=o.date.nextDay(i),s.head=!0,l=1;l<a;l++)i=s.end,s=n.clone(),s.start=i,s.startDate=o.date.getDate(i),s.end=o.date.nextDay(i),l==a-1?(s.end=new Date(s.start.getFullYear(),s.start.getMonth(),s.start.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),s.tail=!0):(s.isAllDay=!0,s.middle=!0),(o.date.getDate(s.end)<=this.endDate()&&s.start>=this.startDate()||o.date.getDate(s.start).getTime()==this.endDate().getTime())&&d.push(s);return new o.data.Query(d).sort([{field:"start",dir:"asc"},{field:"end",dir:"asc"}]).groupBy({field:"startDate"}).toArray()},_renderTaskGroups:function(e,t){var n,i,r,a,s,l,d,c,u=[],h=this.options.editable,f=h&&h.destroy!==!1&&!this._isMobile(),p=this._isMobilePhoneView(),m=this._groupedView._getSumOfItemsForDate(e),g=this._groupedView._getGroupsInDay(e,t),v=0;for(n=0;n<e.length;n++)for(i=e[n].value,r=e[n].items,a=o.date.isToday(i),s=0;s<r.length;s++)l=r[s],d=[],c=p?[]:d,this._groupedView._renderTaskGroupsCells(c,t,n,s,g,m,i,v),v++,0===s&&(p?(c.push(o.format('<td class="k-scheduler-datecolumn" colspan="2">{0}</td>',this._dateTemplate({date:i}))),u.push('<tr role="row" aria-selected="false"'+(a?' class="k-today">':">")+c.join("")+"</tr>")):this._groupedView._renderDateCell(d,t,r,i,n,e)),l.format=l.head?"{0:t}":l.tail?"{1:t}":"{0:t}-{1:t}",l.resources=this.eventResources(l),d.push(o.format('<td class="k-scheduler-timecolumn"><div>{0}{1}{2}</div></td><td>{3}</td>',l.tail||l.middle?'<span class="k-icon k-i-arrow-w"></span>':"",this._timeTemplate(l.clone({start:l._startTime||l.start,end:l.endTime||l.end})),l.head||l.middle?'<span class="k-icon k-i-arrow-e"></span>':"",this._eventTemplate(l.clone({showDelete:f})))),u.push('<tr role="row" aria-selected="false"'+(a?' class="k-today">':">")+d.join("")+"</tr>");return u.join("")},_renderTaskGroupsCells:function(e,t){for(var n=0;n<t.length;n++)e.push(o.format('<td class="k-scheduler-groupcolumn{2}" rowspan="{0}">{1}</td>',t[n].rowSpan,this._groupTemplate({value:t[n].text}),t[n].className))},render:function(e){var t,n,r=this.content.find("table").empty(),o=[];e.length>0&&(t=this.groupedResources,t.length?(o=this._createGroupConfiguration(e,t,null),this._groupsByDate=[],this._renderGroups(o,r,[]),this._groupedView._renderDates(r)):(o=this._tasks(e),r.append(this._renderTaskGroups(o,[])))),n=this._eventsList=i(o),this._angularItems(r,n),this.refreshLayout(),this.trigger("activate")},_angularItems:function(e,t){this.angular("compile",function(){var n=[],i=t.map(function(t){return n.push({dataItem:t}),e.find(".k-task["+o.attr("uid")+"="+t.uid+"]")});return{elements:i,data:n}})},_renderGroups:function(e,t,n){var i,r,o;for(i=0,r=e.length;i<r;i++)o=this._groupedView._getParents(n),o.push(e[i]),this._groupedView._getGroupsByDate(e,i,o),e[i].groups?this._renderGroups(e[i].groups,t,o):this._groupedView._renderTaskGroups(t,e[i].items,o)},_createGroupConfiguration:function(e,i,r){var s,l,d,c,u,h,f,p=i[0],m=[],g=p.dataSource.view(),v=this._isMobilePhoneView();for(s=0;s<g.length;s++)l=n(p,g[s]),d=new o.data.Query(e).filter({field:p.field,operator:a.SchedulerView.groupEqFilter(l)}).toArray(),d.length&&(c=this._tasks(d),u=r?"":" k-first",s===g.length-1&&(!r||r.className.indexOf("k-last")>-1)&&(u+=" k-last"),h={text:o.getter(p.dataTextField)(g[s]),value:l,rowSpan:0,className:u},i.length>1?(h.groups=this._createGroupConfiguration(d,i.slice(1),h),r&&(r.rowSpan+=h.rowSpan)):(h.items=c,f=t(h.items),v&&(f+=h.items.length),h.rowSpan=f,r&&(r.rowSpan+=f)),m.push(h));return m},selectionByElement:function(t){var n,i,r;if(t=e(t),!t.hasClass("k-scheduler-datecolumn")&&this._eventsList.length)return t.is(".k-task")&&(t=t.closest("td")),this._isMobile()?(r=t.parent(),n=r.parent().children().filter(function(){return e(this).children(":not(.k-scheduler-datecolumn)").length}).index(r)):n=t.parent().index(),i=this._eventsList[n],{index:n,start:i.start,end:i.end,isAllDay:i.isAllDay,uid:i.uid}},select:function(e){this.clearSelection();var t=this.table.find(".k-task").eq(e.index).closest("tr").addClass("k-state-selected").attr("aria-selected",!0)[0];this.current(t)},move:function(e,t){var n,i=!1,r=e.index;return t==o.keys.UP?(r--,i=!0):t==o.keys.DOWN&&(r++,i=!0),i&&(n=this._eventsList[r],n&&(e.start=n.start,e.end=n.end,e.isAllDay=n.isAllDay,e.events=[n.uid],e.index=r)),i},moveToEvent:function(){return!1},constrainSelection:function(e){var t=this._eventsList[0];t&&(e.start=t.start,e.end=t.end,e.isAllDay=t.isAllDay,e.events=[t.uid],e.index=0)},isInRange:function(){return!0},destroy:function(){this.element&&this.element.off(s),a.SchedulerView.fn.destroy.call(this)},options:{title:"Agenda",name:"agenda",editable:!0,selectedDateFormat:"{0:D}-{1:D}",selectedShortDateFormat:"{0:d} - {1:d}",eventTemplate:"#:title#",eventTimeTemplate:"#if(data.isAllDay) {##=this.options.messages.allDay##} else { ##=kendo.format(format, start, end)## } #",eventDateTemplate:'<strong class="k-scheduler-agendaday">#=kendo.toString(date, "dd")#</strong><em class="k-scheduler-agendaweek">#=kendo.toString(date,"dddd")#</em><span class="k-scheduler-agendadate">#=kendo.toString(date, "y")#</span>',eventGroupTemplate:'<strong class="k-scheduler-adgendagroup">#=value#</strong>',messages:{event:"Event",date:"Date",time:"Time",allDay:"all day"}}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.scheduler.monthview.min",["kendo.scheduler.view.min"],e)}(function(){return function(e){function t(e,t){return e.slice(t).concat(e.slice(0,t))}function n(e,t){for(var n=t.firstDay,i=new Date(e.getFullYear(),e.getMonth(),0,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());i.getDay()!=n;)r.date.setTime(i,-1*c);return i}function i(e,t,n){var i,r=t,o=n;return i=e,i>=r&&i<=o}var r=window.kendo,o=r.ui,a=o.SchedulerView,s=".kendoMonthView",l=e.extend,d=r.date.getDate,c=r.date.MS_PER_DAY,u=6,h=7,f=r.template('<span class="k-link k-nav-day">#:kendo.toString(date, "dd")#</span>'),p='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span>#}#</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"></span>#}#</span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-w"></span>#}## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-e"></span>#}#</div>',m=r.template('<div title="#=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">#:title#</div></div>'),g=r.template('<div style="width:#=width#px;left:#=left#px;top:#=top#px" class="k-more-events k-button"><span>...</span></div>'),v=r.Class.extend({init:function(e){this._view=e},_verticalRowCountForLevel:function(e){var t=this._view;return t._rowCountForLevel(e)},_horizontalGroupCountForLevel:function(e){var t=this._view;return t._columnCountForLevel(e)},_getCalendarRowsLength:function(e,t){return t/e},_createRows:function(e,t,n,i){var r,o=this._view,a=h,s=o._isVerticallyGrouped(),l="";for(r=0;r<n;r++)l+=o._createRow(e,t,a,s?i:r);return l},_adjustStartDate:function(e){return r.date.addDays(e,h)},_getContent:function(e,t,n){return e({date:t,resources:n})},_getTimeSlotByPosition:function(e,t,n){var i=this._view.groups[n];return i.daySlotByPosition(e,t)},_nextSlotStartDate:function(e){return r.date.nextDay(e)},_createRowsLayout:function(e,t,n){var i=this._view;return i._createRowsLayout(e,t,n)},_createVerticalColumnsLayout:function(e,t,n,i){return i},_createColumnsLayout:function(e,t,n){var i=this._view;return i._createColumnsLayout(e,t,n)},_verticalGroupCount:function(e){var t=this._view;return t._rowCountForLevel(e)},_horizontalGroupCount:function(e){var t=this._view;return t._columnCountForLevel(e)/t._columnOffsetForResource(e)},_positionEvent:function(e,t,n,i,r,o,a){var s,l=this._view,d=l._isMobilePhoneView();i>1&&(0===a?o=n.end.endDate():a==i-1?r=n.start.startDate():(r=n.start.startDate(),o=n.end.endDate())),s=e.clone({start:r,end:o,head:n.head,tail:n.tail}),d?l._positionMobileEvent(n,l._createEventElement(s),t):l._positionEvent(n,l._createEventElement(s),t)},_addDaySlotCollections:function(e,t,n){var i,o,a,s,l,d,c,f,p,m,g,v=this._view,_=h,b=u;for(i=0;i<e;i++)for(o=0,a=0,v._isVerticallyGrouped()&&(a=i),s=a*b;s<(a+1)*b;s++)for(l=v.groups[i],d=l.addDaySlotCollection(r.date.addDays(n,o),r.date.addDays(n,o+_)),c=t[s],f=c.children,p=0,c.setAttribute("role","row"),v._isVerticallyGrouped()||(p=i),m=p*_;m<(p+1)*_;m++)g=f[m],v.addDaySlot(d,g,n,o),o++},_changePeriodGroupIndex:function(e){var t=this._view;return e?t.groups.length-1:0},_createResizeHint:function(e){var t=this._view,n=e.startSlot().offsetLeft,i=e.start.offsetTop,r=e.innerWidth(),o=e.start.clientHeight-2,s=a.fn._createResizeHint.call(t,n,i,r,o);t._appendResizeHint(s)},_createMoveHint:function(e,t){var n=this._view,i=e.startSlot(),r=e.endSlot(),o=n._createEventElement(t.clone({head:e.head,tail:e.tail}));o.css({left:i.offsetLeft+2,top:i.offsetTop+i.firstChildHeight,height:n.options.eventHeight,width:e.innerWidth()-(i.index!==r.index?5:4)}),o.addClass("k-event-drag-hint"),n._appendMoveHint(o)}}),_=r.Class.extend({init:function(e){this._view=e},_verticalRowCountForLevel:function(){return 1},_horizontalGroupCountForLevel:function(e){var t=this._view;return t._columnCountForLevel(e+1)/h},_createRows:function(e,t,n){var i,o,a=this._view,s=h,l=a._isVerticallyGrouped(),d="",c=0;if(l){for(i=new Date(e),o=a._groupCount(),c;c<u;c++)d+=a._createRow(i,t,o,c),i=r.date.addDays(i,s);e=r.date.nextDay(e)}else{for(c;c<s;c++)d+=a._createRow(e,t,n,c),e=r.date.nextDay(e);e=r.date.addDays(e,s)}return d},_adjustStartDate:function(e,t){var n=this._view,i=n._isVerticallyGrouped();return i?t?r.date.addDays(e,h*(u-1)+1):r.date.nextDay(e):r.date.addDays(e,h)},_getContent:function(e,t,n,i){return 0===i?e({date:t,resources:n}):""},_getTimeSlotByPosition:function(e,t,n){var i=this._view.groups[n];return i.daySlotByPosition(e,t,!0)},_nextSlotStartDate:function(e){return e},_getCalendarRowsLength:function(){var e=this._view,t=e._isVerticallyGrouped();return t?h:u},_createRowsLayout:function(e,t,n,i){var r=this._view;return r._createDateLayout(i,null,!1)},_createVerticalColumnsLayout:function(e,t,n){var i,o,a=this._view,s=e[0],l=[],d=s.dataSource.view();for(i=0;i<d.length*u;i++)o={text:n({text:r.htmlEncode(r.getter(s.dataTextField)(d[i%d.length])),color:r.getter(s.dataColorField)(d[i%d.length]),field:s.field,title:s.title,name:s.name,value:r.getter(s.dataValueField)(d[i%d.length])}),className:"k-slot-cell"},o.columns=a._createColumnsLayout(e.slice(1),null,n),l.push(o);return l},_createColumnsLayout:function(e,t,n,i){var r=this._view;return r._createColumnsLayout(e,t,n,i,!0)},_verticalGroupCount:function(e){var t=this._view;return t._columnCountForLevel(e)/u},_horizontalGroupCount:function(e){var t=this._view;return t._columnCountForLevel(e)/h},_positionEvent:function(e,t,n,i,r,o){var a,s,l,d,c=this._view,u=n.start.index,h=n.end.index,f=c._isMobilePhoneView();for(a=n.start.index;a<=n.end.index;a++)s=n.collection._slots[a],l=t.daySlotRanges(s.start,s.start,!0)[0],d=e.clone({start:a===u?s.start:r,end:a===h?s.end:o,head:a!==h||n.head,tail:a!==u||n.tail}),f?c._positionMobileEvent(l,c._createEventElement(d),t):c._positionEvent(l,c._createEventElement(d),t)},_addDaySlotCollections:function(e,t,n){var i,o,a,s,l,d,c,f,p,m,g,v,_,b,k=this._view,w=h,y=u,x=k._isVerticallyGrouped();for(i=0;i<w;i++)for(o=0;o<y;o++)for(a=0,s=x?i:o,l=t[s],d=l.children,c=0,l.setAttribute("role","row"),k._isVerticallyGrouped()||(c=i),f=c*e;f<(c+1)*e;f++)p=o*w+i,m=x?f+o*e:f,g=d[m],v=x?f:a,_=k.groups[v],b=0===i?_.addDaySlotCollection(r.date.addDays(n,p),r.date.addDays(n,p+w)):_._daySlotCollections[o],k.addDaySlot(b,g,n,p),a++},_changePeriodGroupIndex:function(e,t,n){var i=this._view;return t&&i._isVerticallyGrouped()?e?i.groups.length-1:0:n},_createResizeHint:function(e){var t,n,i,r,o,s,l,d=this._view;if(d._isVerticallyGrouped())t=e.startSlot().offsetLeft,n=e.start.offsetTop,i=e.startSlot().offsetWidth,r=e.endSlot().offsetTop+e.startSlot().offsetHeight-e.startSlot().offsetTop-2,o=a.fn._createResizeHint.call(d,t,n,i,r),d._appendResizeHint(o);else for(s=e.startSlot().index;s<=e.endSlot().index;s++)l=e.collection._slots[s],t=l.offsetLeft,n=l.offsetTop,i=l.offsetWidth,r=l.offsetHeight-2,o=a.fn._createResizeHint.call(d,t,n,i,r),d._appendResizeHint(o)},_createMoveHint:function(e,t){var n,i,r,o=this._view,a=e.startSlot(),s=e.endSlot();for(n=a.index;n<=s.index;n++)i=e.collection._slots[n],r=o._createEventElement(t.clone({head:e.head,tail:e.tail})),r.css({left:i.offsetLeft,top:i.offsetTop+i.firstChildHeight,height:o.options.eventHeight,width:i.offsetWidth-2}),r.addClass("k-event-drag-hint"),o._appendMoveHint(r)}});r.ui.scheduler.MonthGroupedView=v,r.ui.scheduler.MonthGroupedByDateView=_,o.MonthView=a.extend({init:function(e,t){var n=this;a.fn.init.call(n,e,t),n._groupedView=n._getGroupedView(),n.title=n.options.title,n._templates(),n._editable(),n._renderLayout(n.options.date),n._groups()},name:"month",_getGroupedView:function(){return this._isGroupedByDate()?new r.ui.scheduler.MonthGroupedByDateView(this):new r.ui.scheduler.MonthGroupedView(this)},_updateDirection:function(e,t,n,i,r){var o,a,s,l,d;n&&(o=t[0].start,a=t[t.length-1].end,s=o.index===a.index,l=o.collectionIndex===a.collectionIndex,d=r?s&&l||l:s&&l,d&&(e.backward=i))},_changeDate:function(e,t,n){var i,r,o,a=this.groups[e.groupIndex];if(n){if(i=a._getCollections(a.daySlotCollectionCount()),r=t.collectionIndex-1,r>=0)return i[r]._slots[i[r]._slots.length-1]}else if(i=a._getCollections(a.daySlotCollectionCount()),r=t.collectionIndex+1,o=0,i[r]&&i[r]._slots[o])return i[r]._slots[o]},_getNextHorizontalRange:function(e,t,n){var i=this._isVerticallyGrouped();return n.startSlot=e[t](n.startSlot,i),n.endSlot=e[t](n.endSlot,i),n},_getNextVerticalRange:function(e,t,n,i){var r=this._isVerticallyGrouped()&&this._isGroupedByDate();return n.startSlot=e[t](n.startSlot,i,r),n.endSlot=e[t](n.endSlot,i,r),n},_changeViewPeriod:function(e,t,n){var i=n?7:1;return t&&(i*=-1),e.start=r.date.addDays(e.start,i),e.end=r.date.addDays(e.end,i),(!n||n&&this._isVerticallyGrouped())&&(e.groupIndex=this._groupedView._changePeriodGroupIndex(t,n,e.groupIndex)),e.events=[],!0},_continuousSlot:function(e,t,n){var i=e.backward?0:t.length-1,r=this.groups[e.groupIndex];return r.continuousSlot(t[i].start,n)},_changeGroupContinuously:function(e,t,n,i){var r,o,a,s;return n||(r=e.groupIndex,o=this.groups.length-1,a=this._isVerticallyGrouped(),s=this.groups[r],!t&&a?(t=s[i?"lastSlot":"firstSlot"](),r+=i?-1:1):t&&!a&&(r=i?o:0),(r<0||r>o)&&(r=i?o:0,t=null),e.groupIndex=r),t},_normalizeHorizontalSelection:function(e,t,n){var i;return i=n?t[0].start:t[t.length-1].end},_normalizeVerticalSelection:function(e,t){var n;return n=e.backward?t[0].start:t[t.length-1].end},_templates:function(){var e=this.options,t=l({},r.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,p),this.dayTemplate=r.template(e.dayTemplate,t),this.groupHeaderTemplate=r.template(e.groupHeaderTemplate,t)},dateForTitle:function(){return r.format(this.options.selectedDateFormat,this._firstDayOfMonth,this._lastDayOfMonth)},shortDateForTitle:function(){return r.format(this.options.selectedShortDateFormat,this._firstDayOfMonth,this._lastDayOfMonth)},nextDate:function(){return r.date.nextDay(this._lastDayOfMonth)},previousDate:function(){return r.date.previousDay(this._firstDayOfMonth)},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_renderLayout:function(t){var i=this;this._firstDayOfMonth=r.date.firstDayOfMonth(t),this._lastDayOfMonth=r.date.lastDayOfMonth(t),this._startDate=n(t,this.calendarInfo()),this.createLayout(this._layout()),this._content(),this.refreshLayout(),this.content.on("click"+s,".k-nav-day,.k-more-events",function(t){var n=e(t.currentTarget).offset(),r=i._slotByPosition(n.left,n.top);t.preventDefault(),i.trigger("navigate",{view:"day",date:r.startDate()})})},_editable:function(){this.options.editable&&!this._isMobilePhoneView()&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+s,".k-scheduler-monthview .k-event a:has(.k-si-close)",function(n){t.trigger("remove",{uid:e(this).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+s,".k-scheduler-monthview .k-scheduler-content td",function(n){var i,r=e(n.currentTarget).offset(),o=t._slotByPosition(r.left,r.top);o&&(i=t._resourceBySlot(o),t.trigger("add",{eventInfo:l({isAllDay:!0,start:o.startDate(),end:o.startDate()},i)})),n.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+s,".k-scheduler-monthview .k-event",function(n){t.trigger("edit",{uid:e(this).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var t=this,n=0;r.support.mobileOS.android&&(n=5),t.options.editable.create!==!1&&(t._addUserEvents=new r.UserEvents(t.element,{threshold:n,filter:".k-scheduler-monthview .k-scheduler-content td",tap:function(n){var i,r=e(n.target).offset(),o=t._slotByPosition(r.left,r.top);o&&(i=t._resourceBySlot(o),t.trigger("add",{eventInfo:l({isAllDay:!0,start:o.startDate(),end:o.startDate()},i)})),n.preventDefault()}})),t.options.editable.update!==!1&&(t._editUserEvents=new r.UserEvents(t.element,{threshold:n,filter:".k-scheduler-monthview .k-event",tap:function(n){0===e(n.event.target).closest("a:has(.k-si-close)").length&&(t.trigger("edit",{uid:e(n.target).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault())}}))},selectionByElement:function(t){var n=e(t).offset();return this._slotByPosition(n.left,n.top)},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},_content:function(){var e,t="<tbody>",n=1,i=this._groupedView,r=this.groupedResources;for(r.length&&this._isVerticallyGrouped()&&(n=i._verticalRowCountForLevel(r.length-1)),e=0;e<n;e++)t+=this._createCalendar(e);t+="</tbody>",this.content.find("table").html(t)},_createCalendar:function(e){var t,n,i,o=this.startDate(),a=h*u,s=h,l=[o],d="",c=1,f=this._isVerticallyGrouped(),p=this._groupedView,m=this.groupedResources;for(m.length&&(f||(c=p._horizontalGroupCountForLevel(m.length-1))),this._slotIndices={},t=p._getCalendarRowsLength(s,a),n=0;n<t;n++)d+="<tr>",l.push(o),i=n*s,d+=p._createRows(o,i,c,e),o=p._adjustStartDate(o,n===t-1),d+="</tr>";return this._weekStartDates=l,this._endDate=r.date.previousDay(o),d},_createRow:function(e,t,n,i){var o,a=this,s=a._firstDayOfMonth,l=a._lastDayOfMonth,c=a.dayTemplate,u="",h="",f=this._groupedView,p=function(){return a._resourceBySlot({groupIndex:i})};for(o=0;o<n;o++)u="",r.date.isToday(e)&&(u+="k-today"),r.date.isInDateRange(e,s,l)||(u+=" k-other-month"),h+="<td ",""!==u&&(h+='class="'+u+'"'),h+=">",h+=f._getContent(c,e,p,o),h+="</td>",a._slotIndices[d(e).getTime()]=t+o,e=f._nextSlotStartDate(e);return h},_layout:function(){var n,i,r,o=this.calendarInfo(),a=this._isMobile()?o.days.namesShort:o.days.names,s=t(a,o.firstDay),l=e.map(s,function(e){return{text:e}}),d=this.groupedResources,c=this._groupedView;if(d.length)if(this._isVerticallyGrouped()){for(i=[],
r=0;r<6;r++)i.push({text:"<div>&nbsp;</div>",className:"k-hidden k-slot-cell"});n=c._createRowsLayout(d,i,this.groupHeaderTemplate,l),l=c._createVerticalColumnsLayout(d,i,this.groupHeaderTemplate,l)}else l=c._createColumnsLayout(d,l,this.groupHeaderTemplate,l);return{columns:l,rows:n}},_createEventElement:function(t){var n,i=this.options,o=i.editable,a=this._isMobile();return t.showDelete=o&&o.destroy!==!1&&!a,t.resizable=o&&o.resize!==!1&&!a,t.ns=r.ns,t.resources=this.eventResources(t),t.inverseColor=!(!t.resources||!t.resources[0])&&this._shouldInverseResourceColor(t.resources[0]),n=e(this.eventTemplate(t)),this.angular("compile",function(){return{elements:n,data:[{dataItem:t}]}}),n},_isInDateSlot:function(e){var t=this.groups[0],n=t.firstSlot().start,o=t.lastSlot().end-1,a=r.date.toUtcTime(e.start),s=r.date.toUtcTime(e.end);return(i(a,n,o)||i(s,n,o)||i(n,a,s)||i(o,a,s))&&(!i(s,n,n)||i(s,a,a)||e.isAllDay)},_slotIndex:function(e){return this._slotIndices[d(e).getTime()]},_positionMobileEvent:function(t,n,i){var o,s,l,d,c,u,h,f=t.start;t.start.offsetLeft>t.end.offsetLeft&&(f=t.end),o=t.start.index,s=o,l=3,d=a.collidingEvents(t.events(),o,s),d.push({element:n,start:o,end:s}),c=a.createRows(d),u=t.collection.at(o),h=u.container,h||(h=e(r.format('<div class="k-events-container" style="top:{0};left:{1};width:{2}"/>',f.offsetTop+f.firstChildTop+f.firstChildHeight-3+"px",f.offsetLeft+"px",f.offsetWidth+"px")),u.container=h,this.content[0].appendChild(h[0])),c.length<=l&&(t.addEvent({element:n,start:o,end:s,groupIndex:f.groupIndex}),i._continuousEvents.push({element:n,uid:n.attr(r.attr("uid")),start:t.start,end:t.end}),h[0].appendChild(n[0]))},_positionEvent:function(t,n,i){var o,s,l,d,c,u,h,f,p,m,v,_,b,k,w,y=this.options.eventHeight,x=t.start;for(t.start.offsetLeft>t.end.offsetLeft&&(x=t.end),o=t.start.index,s=t.end.index,l=x.eventCount,d=a.collidingEvents(t.events(),o,s),c=o!==s?5:4,d.push({element:n,start:o,end:s}),u=a.createRows(d),h=0,f=Math.min(u.length,l);h<f;h++)for(p=u[h].events,m=x.offsetTop+x.firstChildHeight+h*y+3*h+"px",v=0,_=p.length;v<_;v++)p[v].element[0].style.top=m;if(u.length>l)for(b=o;b<=s;b++){if(k=t.collection,w=k.at(b),w.more)return;w.more=e(g({ns:r.ns,start:b,end:b,width:w.clientWidth-2,left:w.offsetLeft+2,top:w.offsetTop+w.firstChildHeight+l*y+3*l})),this.content[0].appendChild(w.more[0])}else t.addEvent({element:n,start:o,end:s,groupIndex:x.groupIndex}),n[0].style.width=t.innerWidth()-c+"px",n[0].style.left=x.offsetLeft+2+"px",n[0].style.height=y+"px",i._continuousEvents.push({element:n,uid:n.attr(r.attr("uid")),start:t.start,end:t.end}),n.appendTo(this.content)},_slotByPosition:function(e,t){var n,i,r=this.content.offset();for(e-=r.left,t-=r.top,t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft,e=Math.ceil(e),t=Math.ceil(t),n=0;n<this.groups.length;n++)if(i=this._groupedView._getTimeSlotByPosition(e,t,n))return i;return null},_appendResizeHint:function(e){e.appendTo(this.content),this._resizeHint=this._resizeHint.add(e)},_updateResizeHint:function(e,t,n,i){var o,a,s;for(this._removeResizeHint(),o=this.groups[t],a=o.ranges(n,i,!0,e.isAllDay),s=0;s<a.length;s++)this._groupedView._createResizeHint(a[s]);this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(r.toString(r.timezone.toLocalDate(n),"M/dd")),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(r.toString(r.timezone.toLocalDate(i),"M/dd"))},_updateMoveHint:function(e,t,n){var i,o=r.date.toUtcTime(e.start)+n,a=o+e.duration(),s=this.groups[t],l=s.ranges(o,a,!0,e.isAllDay);for(this._removeMoveHint(),i=0;i<l.length;i++)this._groupedView._createMoveHint(l[i],e)},_appendMoveHint:function(e){e.appendTo(this.content),this._moveHint=this._moveHint.add(e)},_groups:function(){var e,t=this._groupCount(),n=this.content[0].getElementsByTagName("tr"),i=this.startDate();for(this.groups=[],e=0;e<t;e++)this._addResourceView(e);this._groupedView._addDaySlotCollections(t,n,i)},addDaySlot:function(e,t,n,i){var o,a=t.clientHeight,s=t.children.length?t.children[0].offsetHeight+3:0,l=r.date.addDays(n,i),d=r.date.MS_PER_DAY;n.getHours()!==l.getHours()&&(d+=(n.getHours()-l.getHours())*r.date.MS_PER_HOUR),l=r.date.toUtcTime(l),d+=l,o=Math.floor((a-s-this.options.moreButtonHeight)/(this.options.eventHeight+3)),t.setAttribute("role","gridcell"),t.setAttribute("aria-selected",!1),e.addDaySlot(t,l,d,o)},render:function(e){this.content.children(".k-event,.k-more-events,.k-events-container").remove(),this._groups(),e=new r.data.Query(e).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray();var t=this.groupedResources;t.length?this._renderGroups(e,t,0,1):this._renderEvents(e,0),this.refreshLayout(),this.trigger("activate")},_renderEvents:function(e,t){var n,i,r,o,a,s,l,d,c,u;for(i=0,r=e.length;i<r;i++)if(n=e[i],this._isInDateSlot(n))for(o=this.groups[t],o._continuousEvents||(o._continuousEvents=[]),a=o.slotRanges(n,!0),s=a.length,l=0;l<s;l++)d=a[l],c=n.start,u=n.end,this._groupedView._positionEvent(n,o,d,s,c,u,l)},_renderGroups:function(e,t,n,i){var o,s,l,d,c=t[0];if(c)for(o=c.dataSource.view(),s=0;s<o.length;s++)l=this._resourceValue(c,o[s]),d=new r.data.Query(e).filter({field:c.field,operator:a.groupEqFilter(l)}).toArray(),t.length>1?n=this._renderGroups(d,t.slice(1),n++,i+1):this._renderEvents(d,n++);return n},_groupCount:function(){var e=this.groupedResources,t=this._groupedView;return e.length?this._isVerticallyGrouped()?t._verticalGroupCount(e.length-1):t._horizontalGroupCount(e.length):1},_columnOffsetForResource:function(e){return this._columnCountForLevel(e)/this._columnCountForLevel(e-1)},destroy:function(){this.table&&this.table.removeClass("k-scheduler-monthview"),this.content&&this.content.off(s),this.element&&this.element.off(s),a.fn.destroy.call(this),this._isMobile()&&!this._isMobilePhoneView()&&this.options.editable&&(this.options.editable.create!==!1&&this._addUserEvents.destroy(),this.options.editable.update!==!1&&this._editUserEvents.destroy())},events:["remove","add","edit","navigate"],options:{title:"Month",name:"month",eventHeight:25,moreButtonHeight:13,editable:!0,selectedDateFormat:"{0:y}",selectedShortDateFormat:"{0:y}",groupHeaderTemplate:"#=text#",dayTemplate:f,eventTemplate:m}})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.scheduler.recurrence.min",["kendo.dropdownlist.min","kendo.datepicker.min","kendo.numerictextbox.min"],e)}(function(){return function(e,t){function n(e,t){var n;return 0!==e&&e<t?n=t-e:(n=e%t,n&&(n=t-n)),n}function i(e){var t=e.getMonth(),n=g(e)?te[t]:ne[t];return n+e.getDate()}function r(e,n){var i,r;return e=new Date(e.getFullYear(),e.getMonth(),e.getDate()),J(e,0),i=e.getFullYear(),n!==t?(X(e,n,-1),e.setDate(e.getDate()+4)):e.setDate(e.getDate()+(4-(e.getDay()||7))),J(e,0),r=Math.floor((e.getTime()-new Date(i,0,1,(-6)))/864e5),1+Math.floor(r/7)}function o(e,t){var n=Z(e).getDay(),i=7-(n+7-(t||7))||7;return i<0&&(i+=7),Math.ceil((e.getDate()-i)/7)+1}function a(e,t){return e+(e<t?7:0)}function s(e,t,n){var i,r,s,l,d,c=t.offset;return c?(i=new Date(e.getFullYear(),e.getMonth()+1,0),r=o(i,n),s=a(t.day,n),l=s<a(new Date(e.getFullYear(),e.getMonth(),1).getDay(),n),d=s>a(i.getDay(),n),c<0?c=r+(c+1-(d?1:0)):l&&(c+=1),r-=d?1:0,c<(l?1:0)||c>r?null:c):o(e,n)}function l(e,t){return o(new Date(e.getFullYear(),e.getMonth()+1,0),t)}function d(e,t,n){return o(e,n)===s(e,t,n)}function c(e,t,n){for(var i,r,l,d,c=a(t.getDay(),n),u=e.length,h=[],f=0;f<u;f++)if(r=e[f],d=o(t,n),i=s(t,r,n),null!==i)if(d<i)h.push(r);else if(d===i)if(l=a(r.day,n),c<l)h.push(r);else if(c===l)return null;return h}function u(e,t,n){for(var i,r=0,o=e.length,a=[];r<o;r++){if(i=e[r],n&&(i=n(i)),t===i)return null;t<i&&a.push(i)}return a}function h(e,t){for(var n,i=0,r=e.length;i<r;i++){if(n=parseInt(e[i],10),isNaN(n)||n<t.start||n>t.end||0===n&&t.start<0)return null;e[i]=n}return e.sort(v)}function f(e){for(var n,i,r,o=0,a=e.length;o<a;o++){if(n=e[o],i=n.length,r=n.substring(i-2).toUpperCase(),r=oe[r],r===t)return null;e[o]={offset:parseInt(n.substring(0,i-2),10)||0,day:r}}return e}function p(e){for(var t,n,i=0,r=e.length,o=[];i<r;i++)t=e[i],"string"==typeof t?n=t:(n=""+re[t.day],t.offset&&(n=t.offset+n)),o.push(n);return""+o}function m(e){var t=e.getMonth();return 1===t?1===new Date(e.getFullYear(),1,29).getMonth()?29:28:ie[t]}function g(e){return e=e.getFullYear(),e%4===0&&e%100!==0||e%400===0}function v(e,t){return e-t}function _(e,t){var n,i,r=0,o=[];if(e)for(e=e.split(e.indexOf(";")!==-1?";":","),n=e.length;r<n;r++)i=S(e[r],t),i&&o.push(i);return o}function b(t,n,i){for(var r=e.isArray(t)?t:_(t,i),o=n.getTime()-n.getMilliseconds(),a=0,s=r.length;a<s;a++)if(r[a].getTime()===o)return!0;return!1}function k(e,t){var n,i,r=0,o=[].concat(e);for(n=o.length;r<n;r++)i=o[r],i=U.timezone.convert(i,t||i.getTimezoneOffset(),"Etc/UTC"),o[r]=U.toString(i,de);return o.join(",")}function w(e,t){var n=new Date(e);switch(t.freq){case"yearly":n.setFullYear(n.getFullYear(),0,1);break;case"monthly":n.setFullYear(n.getFullYear(),n.getMonth(),1);break;case"weekly":X(n,t.weekStart,-1)}return t.hours&&n.setHours(0),t.minutes&&n.setMinutes(0),t.seconds&&n.setSeconds(0),n}function y(e,t){var n=new Date(e);switch(t.freq){case"yearly":n.setFullYear(n.getFullYear(),11,31);break;case"monthly":n.setFullYear(n.getFullYear(),n.getMonth()+1,0);break;case"weekly":X(n,t.weekStart,-1),n.setDate(n.getDate()+6)}return t.hours&&n.setHours(23),t.minutes&&n.setMinutes(59),t.seconds&&n.setSeconds(59),n}function x(e,t,n){var i,r,o,a,s=e.length,l=[];for(o=0,a=n.length;o<a;o++)i=n[o],i<0?i=s+i:i-=1,r=e[i],r&&r.start>=t&&l.push(r);return l}function C(e,t,n){var i,r,o=[];for(r=0;r<e.length;r++)i=e[r],b(t,i.start,n)||o.push(i);return o}function T(e,n,i,r){var o,a,s,l,d,c,u,h,f,p,m,g,v,T,S,D,F,R,I,A,M,z,H,N=E(e.recurrenceRule,r),P=[];if(!N)return[e];for(A=N.positions,M=A?0:1,p=N.start,m=N.end,(p||m)&&(e=e.clone({start:p?new Date(p.value[0]):t,end:m?new Date(m.value[0]):t})),F=e.start,D=F.getTime(),S=ee(F),T=_(e.recurrenceException,r),!T[0]&&N.exdates&&(T=N.exdates.value,e.set("recurrenceException",k(T,r))),h=n=new Date(n),i=new Date(i),v=N.freq,I=ve[v],R=N.count,N.until&&N.until<i&&(i=new Date(N.until)),g="yearly"===v||"monthly"===v||"weekly"===v,n<D||R||N.interval>1||g?n=new Date(D):(l=n.getHours(),d=n.getMinutes(),c=n.getSeconds(),N.hours||(l=F.getHours()),N.minutes||(d=F.getMinutes()),N.seconds||(c=F.getSeconds()),n.setHours(l,d,c,F.getMilliseconds())),N._startPeriod=new Date(n),A&&(n=w(n,N),i=y(i,N),H=ee(i)-ee(n),H<0&&(l=n.getHours(),i.setHours(l,n.getMinutes(),n.getSeconds(),n.getMilliseconds()),K.adjustDST(i,l)),N._startPeriod=new Date(n),N._endPeriod=y(n,N)),u=e.duration(),N._startTime=o=K.toInvariantTime(n),I.setup&&I.setup(N,F,n),I.limit(n,i,N);n<=i;)if(s=new Date(n),Q(s,u),f=n>=h||s>h,(f&&!b(T,n,r)||A)&&(o=K.toUtcTime(K.getDate(n))+ee(N._startTime),a=o+u,D!==n.getTime()||S!==ee(N._startTime)?P.push(e.toOccurrence({start:new Date(n),end:s,_startTime:o,_endTime:a})):(e._startTime=o,e._endTime=a,P.push(e))),A){if(I.next(n,N),I.limit(n,i,N),n>N._endPeriod&&(z=x(P.slice(M),F,A),z=C(z,T,r),P=P.slice(0,M).concat(z),N._endPeriod=y(n,N),M=P.length),R&&R===M)break}else{if(R&&R===M)break;M+=1,I.next(n,N),I.limit(n,i,N)}return P}function S(e,t){return e=U.parseDate(e,ae),e&&t&&(e=q.convert(e,e.getTimezoneOffset(),t)),e}function D(e,t){var n,i,r,o,a,s,l,d,c=e.split(";");for(l=0,d=c.length;l<d;l++)if(n=c[l].split(":"),i=n[0],r=n[1],i.indexOf("TZID")!==-1&&(o=i.substring(i.indexOf("TZID")).split("=")[1]),r)for(r=r.split(","),a=0,s=r.length;a<s;a++)r[a]=S(r[a],o||t);if(r)return{value:r,tzid:o}}function E(n,i){var r,o,a,s,l,d,c,u,p,m={},g=0,v=!1,_=function(e,t){var n=e.day,i=t.day;return n<u&&(n+=7),i<u&&(i+=7),n-i};if(!n)return null;for(d=n.split("\n"),d[1]||n.indexOf("DTSTART")===-1&&n.indexOf("DTEND")===-1&&n.indexOf("EXDATE")===-1||(d=n.split(" ")),g=0,a=d.length;g<a;g++)l=e.trim(d[g]),l.indexOf("DTSTART")!==-1?m.start=D(l,i):l.indexOf("DTEND")!==-1?m.end=D(l,i):l.indexOf("EXDATE")!==-1?m.exdates=D(l,i):l.indexOf("RRULE")!==-1?s=l.substring(6):e.trim(l)&&(s=l);for(s=s.split(";"),g=0,a=s.length;g<a;g++)switch(c=s[g],r=c.split("="),o=e.trim(r[1]).split(","),e.trim(r[0]).toUpperCase()){case"FREQ":m.freq=o[0].toLowerCase();break;case"UNTIL":m.until=S(o[0],i);break;case"COUNT":m.count=parseInt(o[0],10);break;case"INTERVAL":m.interval=parseInt(o[0],10);break;case"BYSECOND":m.seconds=h(o,{start:0,end:60}),v=!0;break;case"BYMINUTE":m.minutes=h(o,{start:0,end:59}),v=!0;break;case"BYHOUR":m.hours=h(o,{start:0,end:23}),v=!0;break;case"BYMONTHDAY":m.monthDays=h(o,{start:-31,end:31}),v=!0;break;case"BYYEARDAY":m.yearDays=h(o,{start:-366,end:366}),v=!0;break;case"BYMONTH":m.months=h(o,{start:1,end:12}),v=!0;break;case"BYDAY":m.weekDays=p=f(o),v=!0;break;case"BYWEEKNO":m.weeks=h(o,{start:-53,end:53}),v=!0;break;case"BYSETPOS":m.positions=h(o,{start:-366,end:366});break;case"WKST":m.weekStart=u=oe[o[0]]}return m.freq===t||m.count!==t&&m.until?null:(m.interval||(m.interval=1),u===t&&(m.weekStart=u=U.culture().calendar.firstDay),p&&(m.weekDays=p.sort(_)),m.positions&&!v&&(m.positions=null),m._hasRuleValue=v,m)}function F(e,t){for(var n,i=e.value,r=e.tzid||"",o=i.length,a=0;a<o;a++)n=i[a],n=q.convert(n,r||t||n.getTimezoneOffset(),"Etc/UTC"),i[a]=U.toString(n,"yyyyMMddTHHmmssZ");return r&&(r=";TZID="+r),r+":"+i.join(",")+" "}function R(e,n){var i=e.weekStart,r="FREQ="+e.freq.toUpperCase(),o=e.exdates||"",a=e.start||"",s=e.end||"",l=e.until;return e.interval>1&&(r+=";INTERVAL="+e.interval),e.count&&(r+=";COUNT="+e.count),l&&(l=q.convert(l,n||l.getTimezoneOffset(),"Etc/UTC"),r+=";UNTIL="+U.toString(l,"yyyyMMddTHHmmssZ")),e.months&&(r+=";BYMONTH="+e.months),e.weeks&&(r+=";BYWEEKNO="+e.weeks),e.yearDays&&(r+=";BYYEARDAY="+e.yearDays),e.monthDays&&(r+=";BYMONTHDAY="+e.monthDays),e.weekDays&&(r+=";BYDAY="+p(e.weekDays)),e.hours&&(r+=";BYHOUR="+e.hours),e.minutes&&(r+=";BYMINUTE="+e.minutes),e.seconds&&(r+=";BYSECOND="+e.seconds),e.positions&&(r+=";BYSETPOS="+e.positions),i!==t&&(r+=";WKST="+re[i]),a&&(a="DTSTART"+F(a,n)),s&&(s="DTEND"+F(s,n)),o&&(o="EXDATE"+F(o,n)),(a||s||o)&&(r=a+s+o+"RRULE:"+r),r}var I,A,M,z,H,N,P,L,B,O,V,W,U=window.kendo,q=U.timezone,j=U.Class,$=U.ui,G=$.Widget,Y=$.DropDownList,K=U.date,Q=K.setTime,X=K.setDayOfWeek,J=K.adjustDST,Z=K.firstDayOfMonth,ee=K.getMilliseconds,te=[0,31,60,91,121,152,182,213,244,274,305,335,366],ne=[0,31,59,90,120,151,181,212,243,273,304,334,365],ie=[31,28,30,31,30,31,30,31,30,31,30,31],re={0:"SU",1:"MO",2:"TU",3:"WE",4:"TH",5:"FR",6:"SA"},oe={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},ae=["yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-ddTHH","yyyy-MM-dd","yyyyMMddTHHmmssfffzzz","yyyyMMddTHHmmsszzz","yyyyMMddTHHmmss","yyyyMMddTHHmm","yyyyMMddTHH","yyyyMMdd"],se=["months","weeks","yearDays","monthDays","weekDays","hours","minutes","seconds"],le=se.length,de="yyyyMMddTHHmmssZ",ce={months:function(e,t,n){var i=n.months,r=u(i,e.getMonth()+1),o=!1;return null!==r&&(r.length?e.setMonth(r[0]-1,1):e.setFullYear(e.getFullYear()+1,i[0]-1,1),o=!0),o},monthDays:function(e,t,n){for(var i,r,o,a=!1,s=e.getHours(),l=function(e){return e<0&&(e=i+e),e};e<=t;){if(r=e.getMonth(),i=m(e),o=u(n.monthDays,e.getDate(),l),null===o)return a;if(a=!0,o.length){if(e.setMonth(r,o.sort(v)[0]),J(e,s),r===e.getMonth())break}else e.setMonth(r+1,1)}return a},yearDays:function(e,t,n){for(var r,o,a=!1,s=e.getHours(),l=function(e){return e<0&&(e=r+e),e};e<t;){if(r=g(e)?366:365,o=u(n.yearDays,i(e),l),null===o)return a;if(a=!0,r=e.getFullYear(),o.length){e.setFullYear(r,0,o.sort(v)[0]),J(e,s);break}e.setFullYear(r+1,0,1)}return a},weeks:function(e,t,n){for(var i,o,a,s=n.weekStart,l=!1,d=e.getHours(),c=function(e){return e<0&&(e=53+e),e};e<t;){if(o=u(n.weeks,r(e,s),c),null===o)return l;if(l=!0,i=e.getFullYear(),o.length){a=7*o.sort(v)[0]-1,e.setFullYear(i,0,a),X(e,s,-1),J(e,d);break}e.setFullYear(i+1,0,1)}return l},weekDays:function(e,t,n){var i,r,a=n.weekDays,s=n.weekStart,u=c(a,e,s),h=e.getHours();if(null===u)return!1;if(i=u[0],i||(i=a[0],X(e,s)),r=i.day,i.offset)for(;e<=t&&!d(e,i,s);)o(e,s)===l(e,s)?(e.setMonth(e.getMonth()+1,1),J(e,h)):(e.setDate(e.getDate()+7),J(e,h),X(e,s,-1));return e.getDay()!==r&&X(e,r),!0},hours:function(e,t,n){var i=n.hours,r=n._startTime,o=r.getHours(),a=u(i,o),s=!1;return null!==a&&(s=!0,e.setHours(o),J(e,o),a.length?(a=a[0],e.setHours(a)):(a=e.getHours(),e.setDate(e.getDate()+1),J(e,a),a=i[0],e.setHours(a),J(e,a)),n.minutes&&e.setMinutes(0),r.setHours(a,e.getMinutes())),s},minutes:function(e,t,n){var i=n.minutes,r=e.getMinutes(),o=u(i,r),a=n._startTime.getHours(),s=!1;return null!==o&&(s=!0,o.length?o=o[0]:(a+=1,o=i[0]),n.seconds&&e.setSeconds(0),e.setHours(a,o),a%=24,J(e,a),n._startTime.setHours(a,o,e.getSeconds())),s},seconds:function(e,t,n){var i=n.seconds,r=n._startTime.getHours(),o=u(i,e.getSeconds()),a=e.getMinutes(),s=!1;return null!==o&&(s=!0,o.length?e.setSeconds(o[0]):(a+=1,e.setMinutes(a,i[0]),a>59&&(a%=60,r=(r+1)%24)),n._startTime.setHours(r,a,e.getSeconds())),s}},ue=j.extend({next:function(e,t){var n,i,r=t._startTime,o=r.getDate();if(t.seconds)i=e.getSeconds()+1,e.setSeconds(i),r.setSeconds(i),r.setDate(o);else{if(!t.minutes)return!1;n=e.getMinutes()+1,e.setMinutes(n),r.setMinutes(n),r.setDate(o)}return!0},normalize:function(e){var t=e.rule;4===e.idx&&t.hours&&(t._startTime.setHours(0),this._hour(e.date,t))},limit:function(e,n,i){for(var r,o,a,s,l,d=i.interval;e<=n;){for(a=o=t,l=e.getDate(),s=0;s<le;s++){if(r=se[s],i[r]){if(a=ce[r](e,n,i),o!==t&&a)break;o=a}a&&this.normalize({date:e,rule:i,day:l,idx:s})}if((1===d||!this.interval(i,e))&&s===le)break}},interval:function(e,t){var i,o,a=new Date(e._startPeriod),s=new Date(t),l=t.getHours(),d=e.weekStart,c=e.interval,u=e.freq,h=!1,f=0,p=0,m=1;return"hourly"===u?(i=s.getTimezoneOffset()-a.getTimezoneOffset(),o=e._startTime.getHours(),s=s.getTime(),l!==o&&(s+=(o-l)*K.MS_PER_HOUR),s-=a,i&&(s-=i*K.MS_PER_MINUTE),i=Math.floor(s/K.MS_PER_HOUR),f=n(i,c),0!==f&&(this._hour(t,e,f),h=!0)):"daily"===u?(K.setTime(s,-a,!0),i=Math.ceil(s/K.MS_PER_DAY),f=n(i,c),0!==f&&(this._date(t,e,f),h=!0)):"weekly"===u?(i=52*(t.getFullYear()-a.getFullYear()),f=r(t,d)-r(a,d)+i,f=n(f,c),0!==f&&(K.setDayOfWeek(t,e.weekStart,-1),t.setDate(t.getDate()+7*f),J(t,l),h=!0)):"monthly"===u?(i=t.getFullYear()-a.getFullYear(),i=t.getMonth()-a.getMonth()+12*i,f=n(i,c),0!==f&&(m=e._hasRuleValue?1:t.getDate(),t.setFullYear(t.getFullYear(),t.getMonth()+f,m),J(t,l),h=!0)):"yearly"===u&&(i=t.getFullYear()-a.getFullYear(),f=n(i,c),e.months||(p=t.getMonth()),e.yearDays||e.monthDays||e.weekDays||(m=t.getDate()),0!==f&&(t.setFullYear(t.getFullYear()+f,p,m),J(t,l),h=!0)),h},_hour:function(e,t,n){var i=t._startTime,r=i.getHours();n&&(r+=n),e.setHours(r),r%=24,i.setHours(r),J(e,r)},_date:function(e,t,n){var i=e.getHours();e.setDate(e.getDate()+n),J(e,i)||this._hour(e,t)}}),he=ue.extend({next:function(e,t){ue.fn.next(e,t)||this._hour(e,t,1)},normalize:function(e){var t=e.rule;4===e.idx&&(t._startTime.setHours(0),this._hour(e.date,t))}}),fe=ue.extend({next:function(e,t){ue.fn.next(e,t)||this[t.hours?"_hour":"_date"](e,t,1)}}),pe=fe.extend({setup:function(e,t){e.weekDays||(e.weekDays=[{day:t.getDay(),offset:0}])}}),me=ue.extend({next:function(e,t){var n,i;if(!ue.fn.next(e,t))if(t.hours)this._hour(e,t,1);else if(t.monthDays||t.weekDays||t.yearDays||t.weeks)this._date(e,t,1);else{for(n=e.getDate(),i=e.getHours(),e.setMonth(e.getMonth()+1),J(e,i);e.getDate()!==n;)e.setDate(n),J(e,i);this._hour(e,t)}},normalize:function(e){var t=e.rule,n=e.date,i=n.getHours();0!==e.idx||t.monthDays||t.weekDays?ue.fn.normalize(e):(n.setDate(e.day),J(n,i))},setup:function(e,t,n){e.monthDays||e.weekDays||n.setDate(t.getDate())}}),ge=me.extend({next:function(e,t){var n,i=e.getHours();if(!ue.fn.next(e,t))if(t.hours)this._hour(e,t,1);else if(t.monthDays||t.weekDays||t.yearDays||t.weeks)this._date(e,t,1);else if(t.months){for(n=e.getDate(),e.setMonth(e.getMonth()+1),J(e,i);e.getDate()!==n;)e.setDate(n),J(e,i);this._hour(e,t)}else e.setFullYear(e.getFullYear()+1),J(e,i),this._hour(e,t)},setup:function(){}}),ve={hourly:new he,daily:new fe,weekly:new pe,monthly:new me,yearly:new ge},_e="click";U.recurrence={rule:{parse:E,serialize:R},expand:T,dayInYear:i,weekInYear:r,weekInMonth:o,numberOfWeeks:l,isException:b,toExceptionString:k},I=function(e){for(var t=U.culture().calendar.days.namesShort,n=t.length,i="",r=0,o=[];r<n;r++)o.push(r);for(t=t.slice(e).concat(t.slice(0,e)),o=o.slice(e).concat(o.slice(0,e)),r=0;r<n;r++)i+='<label class="k-check"><input class="k-recur-weekday-checkbox" type="checkbox" value="'+o[r]+'" /> '+t[r]+"</label>";return i},A=U.template('# if (frequency !== "never") { #<div class="k-edit-label"><label>#:messages.repeatEvery#</label></div><div class="k-edit-field"><input class="k-recur-interval"/>#:messages.interval#</div># } ## if (frequency === "weekly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field">#=weekDayCheckBoxes(firstWeekDay)#</div># } else if (frequency === "monthly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field"><ul class="k-reset"><li><label><input class="k-recur-month-radio" type="radio" name="month" value="monthday" />#:messages.day#</label><input class="k-recur-monthday" /></li><li><input class="k-recur-month-radio" type="radio" name="month" value="weekday" /><input class="k-recur-weekday-offset" /><input class="k-recur-weekday" /></li></ul></div># } else if (frequency === "yearly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field"><ul class="k-reset"><li><input class="k-recur-year-radio" type="radio" name="year" value="monthday" /><input class="k-recur-month" /><input class="k-recur-monthday" /></li><li><input class="k-recur-year-radio" type="radio" name="year" value="weekday" /><input class="k-recur-weekday-offset" /><input class="k-recur-weekday" />#:messages.of#<input class="k-recur-month" /></li></ul></div># } ## if (frequency !== "never") { #<div class="k-edit-label"><label>#:end.label#</label></div><div class="k-edit-field"><ul class="k-reset"><li><label><input class="k-recur-end-never" type="radio" name="end" value="never" />#:end.never#</label></li><li><label><input class="k-recur-end-count" type="radio" name="end" value="count" />#:end.after#</label><input class="k-recur-count" />#:end.occurrence#</li><li><label><input class="k-recur-end-until" type="radio" name="end" value="until" />#:end.on#</label><input class="k-recur-until" /></li></ul></div># } #'),M=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],z=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],H=[{day:0,offset:0},{day:6,offset:0}],N=G.extend({init:function(e,t){var n,i=this,r=t&&t.frequencies;G.fn.init.call(i,e,t),i.wrapper=i.element,t=i.options,t.start=n=t.start||K.today(),r&&(t.frequencies=r),"string"==typeof n&&(t.start=U.parseDate(n,"yyyyMMddTHHmmss")),null===t.firstWeekDay&&(t.firstWeekDay=U.culture().calendar.firstDay),i._namespace="."+t.name},options:{value:"",start:"",timezone:"",spinners:!0,firstWeekDay:null,frequencies:["never","daily","weekly","monthly","yearly"],mobile:!1,messages:{frequencies:{never:"Never",hourly:"Hourly",daily:"Daily",weekly:"Weekly",monthly:"Monthly",yearly:"Yearly"},hourly:{repeatEvery:"Repeat every: ",interval:" hour(s)"},daily:{repeatEvery:"Repeat every: ",interval:" day(s)"},weekly:{interval:" week(s)",repeatEvery:"Repeat every: ",repeatOn:"Repeat on: "},monthly:{repeatEvery:"Repeat every: ",repeatOn:"Repeat on: ",interval:" month(s)",day:"Day "},yearly:{repeatEvery:"Repeat every: ",repeatOn:"Repeat on: ",interval:" year(s)",of:" of "},end:{label:"End:",mobileLabel:"Ends",never:"Never",after:"After ",occurrence:" occurrence(s)",on:"On "},offsetPositions:{first:"first",second:"second",third:"third",fourth:"fourth",last:"last"},weekdays:{day:"day",weekday:"weekday",weekend:"weekend day"}}},events:["change"],_initInterval:function(){var e=this,t=e._value;e._container.find(".k-recur-interval").kendoNumericTextBox({spinners:e.options.spinners,value:t.interval||1,decimals:0,format:"#",min:1,change:function(){t.interval=this.value(),e._trigger()}})},_weekDayRule:function(e){var t=this,n=(t._weekDay.element||t._weekDay).val(),i=+(t._weekDayOffset.element||t._weekDayOffset).val(),r=null,o=null;e||("day"===n?(r=M,o=i):"weekday"===n?(r=z,o=i):"weekend"===n?(r=H,o=i):r=[{offset:i,day:+n}]),t._value.weekDays=r,t._value.positions=o},_weekDayView:function(){var e,t,n,i,r=this,o=r._value.weekDays,a=r._value.positions,s=r._weekDayOffset;o&&(n=o.length,a&&(7===n?(t="day",e=a):5===n?(t="weekday",e=a):2===n&&(t="weekend",e=a)),t||(o=o[0],t=o.day,e=o.offset||""),i=s.value?"value":"val",s[i](e),r._weekDay[i](t))},_initWeekDay:function(){var t,n=this,i=n.options.messages.weekdays,r=n.options.messages.offsetPositions,o=n._container.find(".k-recur-weekday"),a=function(){n._weekDayRule(),n._trigger()};o[0]&&(n._weekDayOffset=new Y(n._container.find(".k-recur-weekday-offset"),{change:a,dataTextField:"text",dataValueField:"value",dataSource:[{text:r.first,value:"1"},{text:r.second,value:"2"},{text:r.third,value:"3"},{text:r.fourth,value:"4"},{text:r.last,value:"-1"}]}),t=[{text:i.day,value:"day"},{text:i.weekday,value:"weekday"},{text:i.weekend,value:"weekend"}],n._weekDay=new Y(o,{value:n.options.start.getDay(),change:a,dataTextField:"text",dataValueField:"value",dataSource:t.concat(e.map(U.culture().calendar.days.names,function(e,t){return{text:e,value:t}}))}),n._weekDayView())},_initWeekDays:function(){var t,n,i,r,o,a=this,s=a._value,l=a._container.find(".k-recur-weekday-checkbox");if(l[0]&&(l.on(_e+a._namespace,function(){s.weekDays=e.map(l.filter(":checked"),function(e){return{day:+e.value,offset:0}}),a.options.mobile||a._trigger()}),s.weekDays))for(i=0,r=l.length,o=s.weekDays.length;i<r;i++)for(n=l[i],t=0;t<o;t++)n.value==s.weekDays[t].day&&(n.checked=!0)},_initMonthDay:function(){var e=this,t=e._value,n=e._container.find(".k-recur-monthday");n[0]&&(e._monthDay=new U.ui.NumericTextBox(n,{spinners:e.options.spinners,min:1,max:31,decimals:0,format:"#",value:t.monthDays?t.monthDays[0]:e.options.start.getDate(),change:function(){var n=this.value();t.monthDays=n?[n]:n,e._trigger()}}))},_initCount:function(){var e=this,t=e._container.find(".k-recur-count"),n=e._value;e._count=t.kendoNumericTextBox({spinners:e.options.spinners,value:n.count||1,decimals:0,format:"#",min:1,change:function(){n.count=this.value(),e._trigger()}}).data("kendoNumericTextBox")},_initUntil:function(){var e=this,t=e._container.find(".k-recur-until"),n=e.options.start,i=e._value,r=i.until;e._until=t.kendoDatePicker({min:r&&r<n?r:n,value:r||new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59),change:function(){var t=this.value();i.until=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59),e._trigger()}}).data("kendoDatePicker")},_trigger:function(){this.options.mobile||this.trigger("change")}}),P=N.extend({init:function(e,t){var n=this;N.fn.init.call(n,e,t),n._initFrequency(),n._initContainer(),n.value(n.options.value)},options:{name:"RecurrenceEditor"},events:["change"],destroy:function(){var e=this;e._frequency.destroy(),e._container.find("input[type=radio],input[type=checkbox]").off(_e+e._namespace),U.destroy(e._container),N.fn.destroy.call(e)},value:function(e){var n,i=this,r=i.options.timezone;return e===t?i._value.freq?R(i._value,r):"":(i._value=E(e,r)||{},n=i._value.freq,n?i._frequency.value(n):i._frequency.select(0),i._initView(i._frequency.value()),t)},_initContainer:function(){var t=this.element,n=e('<div class="k-recur-view" />'),i=t.parent(".k-edit-field");i[0]?n.insertAfter(i):t.append(n),this._container=n},_initFrequency:function(){var t,n=this,i=n.options,r=i.frequencies,o=i.messages.frequencies,a=e("<input />");r=e.map(r,function(e){return{text:o[e],value:e}}),t=r[0],t&&"never"===t.value&&(t.value=""),n.element.append(a),n._frequency=new Y(a,{dataTextField:"text",dataValueField:"value",dataSource:r,change:function(){n._value={},n._initView(n._frequency.value()),n.trigger("change")}})},_initView:function(e){var n=this,i=n._value,r=n.options,o={frequency:e||"never",weekDayCheckBoxes:I,firstWeekDay:r.firstWeekDay,messages:r.messages[e],end:r.messages.end};return U.destroy(n._container),n._container.html(A(o)),e?(i.freq=e,"weekly"!==e||i.weekDays||(i.weekDays=[{day:r.start.getDay(),offset:0}]),n._initInterval(),n._initWeekDays(),n._initMonthDay(),n._initWeekDay(),n._initMonth(),n._initCount(),n._initUntil(),n._period(),n._end(),t):(n._value={},t)},_initMonth:function(){var t,n=this,i=n._value,r=i.months||[n.options.start.getMonth()+1],o=n._container.find(".k-recur-month");o[0]&&(t={change:function(){i.months=[+this.value()],n.trigger("change")},dataTextField:"text",dataValueField:"value",dataSource:e.map(U.culture().calendar.months.names,function(e,t){return{text:e,value:t+1}})},n._month1=new Y(o[0],t),n._month2=new Y(o[1],t),r&&(r=r[0],n._month1.value(r),n._month2.value(r)))},_end:function(){var e,t=this,n=t._value,i=t._container,r=t._namespace,o=function(e){t._toggleEnd(e.currentTarget.value),t.trigger("change")};t._buttonNever=i.find(".k-recur-end-never").on(_e+r,o),t._buttonCount=i.find(".k-recur-end-count").on(_e+r,o),t._buttonUntil=i.find(".k-recur-end-until").on(_e+r,o),n.count?e="count":n.until&&(e="until"),t._toggleEnd(e)},_period:function(){var e=this,t=e._value,n="monthly"===t.freq,i=n?e._toggleMonthDay:e._toggleYear,r=".k-recur-"+(n?"month":"year")+"-radio",o=e._container.find(r);(n||"yearly"===t.freq)&&(o.on(_e+e._namespace,function(t){i.call(e,t.currentTarget.value),e.trigger("change")}),e._buttonMonthDay=o.eq(0),e._buttonWeekDay=o.eq(1),i.call(e,t.weekDays?"weekday":"monthday"))},_toggleEnd:function(e){var t,n,i,r,o=this;"count"===e?(o._buttonCount.prop("checked",!0),i=!0,r=!1,t=o._count.value(),n=null):"until"===e?(o._buttonUntil.prop("checked",!0),i=!1,r=!0,t=null,n=o._until.value()):(o._buttonNever.prop("checked",!0),i=r=!1,t=n=null),o._count.enable(i),o._until.enable(r),o._value.count=t,o._value.until=n},_toggleMonthDay:function(e){var t,n=this,i=!1,r=!0,o=!1;"monthday"===e?(n._buttonMonthDay.prop("checked",!0),t=[n._monthDay.value()],i=!0,r=!1,o=!0):(n._buttonWeekDay.prop("checked",!0),t=null),n._weekDay.enable(r),n._weekDayOffset.enable(r),n._monthDay.enable(i),n._value.monthDays=t,n._weekDayRule(o)},_toggleYear:function(e){var t,n=this,i=!1,r=!0;"monthday"===e?(i=!0,r=!1,t=n._month1.value()):t=n._month2.value(),n._month1.enable(i),n._month2.enable(r),n._value.months=[t],n._toggleMonthDay(e)}}),$.plugin(P),L=U.template('<div class="k-edit-label"><label>#:headerTitle#</label></div><div class="k-edit-field k-recur-pattern k-scheduler-toolbar"></div><div class="k-recur-view"></div>'),B=U.template('# if (frequency !== "never") { #<div class="k-edit-label"><label>#:messages.repeatEvery#</label></div><div class="k-edit-field"><input class="k-recur-interval" pattern="\\\\d*"/>#:messages.interval#</div># } ## if (frequency === "weekly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field">#=weekDayCheckBoxes(firstWeekDay)#</div># } else if (frequency === "monthly") { #<div class="k-edit-label"><label>#:messages.repeatBy#</label></div><div class="k-edit-field k-scheduler-toolbar k-repeat-rule"></div><div class="k-monthday-view" style="display:none"><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><input class="k-recur-monthday" pattern="\\\\d*"/></div></div><div class="k-weekday-view" style="display:none"><div class="k-edit-label"><label>#:messages.every#</label></div><div class="k-edit-field"><select class="k-recur-weekday-offset"></select></div><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><select class="k-recur-weekday"></select></div></div># } else if (frequency === "yearly") { #<div class="k-edit-label"><label>#:messages.repeatBy#</label></div><div class="k-edit-field k-scheduler-toolbar k-repeat-rule"></div><div class="k-monthday-view" style="display:none"><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><input class="k-recur-monthday" pattern="\\\\d*"/></div></div><div class="k-weekday-view" style="display:none"><div class="k-edit-label"><label>#:messages.every#</label></div><div class="k-edit-field"><select class="k-recur-weekday-offset"></select></div><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><select class="k-recur-weekday"></select></div></div><div class="k-edit-label"><label>#:messages.month#</label></div><div class="k-edit-field"><select class="k-recur-month"></select></div># } #'),
O=U.template('# if (endPattern === "count") { #<div class="k-edit-label"><label>#:messages.after#</label></div><div class="k-edit-field"><input class="k-recur-count" pattern="\\\\d*" /></div># } else if (endPattern === "until") { #<div class="k-edit-label"><label>#:messages.on#</label></div><div class="k-edit-field"><input type="date" class="k-recur-until" /></div># } #'),V=U.template('<ul class="k-reset k-header k-scheduler-navigation">#for (var i = 0, length = dataSource.length; i < length; i++) {#<li class="k-state-default #= value === dataSource[i].value ? "k-state-selected" : "" #"><a role="button" href="\\#" class="k-link" data-#=ns#value="#=dataSource[i].value#">#:dataSource[i].text#</a></li>#}#</ul>'),W=N.extend({init:function(e,t){var n=this;N.fn.init.call(n,e,t),t=n.options,n._optionTemplate=U.template('<option value="#:value#">#:text#</option>'),n.value(t.value),n._pane=t.pane,n._initRepeatButton(),n._initRepeatEnd(),n._defaultValue=n._value},options:{name:"MobileRecurrenceEditor",animations:{left:"slide",right:"slide:right"},mobile:!0,messages:{cancel:"Cancel",update:"Save",endTitle:"Repeat ends",repeatTitle:"Repeat pattern",headerTitle:"Repeat event",end:{patterns:{never:"Never",after:"After...",on:"On..."},never:"Never",after:"End repeat after",on:"End repeat on"},daily:{interval:""},hourly:{interval:""},weekly:{interval:""},monthly:{interval:"",repeatBy:"Repeat by: ",dayOfMonth:"Day of the month",dayOfWeek:"Day of the week",repeatEvery:"Repeat every",every:"Every",day:"Day "},yearly:{interval:"",repeatBy:"Repeat by: ",dayOfMonth:"Day of the month",dayOfWeek:"Day of the week",repeatEvery:"Repeat every: ",every:"Every",month:"Month",day:"Day"}}},events:["change"],value:function(e){var n=this,i=n.options.timezone;return e===t?n._value.freq?R(n._value,i):"":(n._value=E(e,i)||{},t)},destroy:function(){this._destroyView(),U.destroy(this._endFields),this._repeatButton.off(_e+this._namespace),N.fn.destroy.call(this)},_initRepeatButton:function(){var t=this,n=t.options.messages.frequencies[this._value.freq||"never"];t._repeatButton=e('<a href="#" class="k-button k-scheduler-recur">'+n+"</a>").on(_e+t._namespace,function(e){e.preventDefault(),t._createView("repeat"),t._pane.navigate("recurrence",t.options.animations.left)}),t.element.append(t._repeatButton)},_initRepeatEnd:function(){var t=this,n=e('<div class="k-edit-label"><label>'+t.options.messages.end.mobileLabel+"</label></div>").insertAfter(t.element.parent(".k-edit-field")),i=e('<div class="k-edit-field"><a href="#" class="k-button k-scheduler-recur-end"></a></div>').on(_e+t._namespace,function(e){e.preventDefault(),t._value.freq&&(t._createView("end"),t._pane.navigate("recurrence",t.options.animations.left))}).insertAfter(n);t._endFields=n.add(i).toggleClass("k-state-disabled",!t._value.freq),t._endButton=i.find(".k-scheduler-recur-end").text(t._endText())},_endText:function(){var e=this._value,t=this.options.messages.end,n=t.never;return e.count?n=U.format("{0} {1}",t.after,e.count):e.until&&(n=U.format("{0} {1:d}",t.on,e.until)),n},_initFrequency:function(){var t=this,n=t.options.messages.frequencies,i=V({dataSource:e.map(this.options.frequencies,function(e){return{text:n[e],value:"never"!==e?e:""}}),value:t._value.freq||"",ns:U.ns});t._view.element.find(".k-recur-pattern").append(i).on(_e+t._namespace,".k-scheduler-navigation li",function(n){var i=e(this);n.preventDefault(),i.addClass("k-state-selected").siblings().removeClass("k-state-selected"),t._value={freq:i.children("a").attr(U.attr("value"))},t._initRepeatView()})},_initEndNavigation:function(){var t,n=this,i=n.options.messages.end.patterns,r=n._value,o="";r.count?o="count":r.until&&(o="until"),t=V({dataSource:[{text:i.never,value:""},{text:i.after,value:"count"},{text:i.on,value:"until"}],value:o,ns:U.ns}),n._view.element.find(".k-recur-pattern").append(t).on(_e+n._namespace,".k-scheduler-navigation li",function(t){var i=e(this),o=null,a=null;t.preventDefault(),i.addClass("k-state-selected").siblings().removeClass("k-state-selected"),n._initEndView(i.children("a").attr(U.attr("value"))),n._count?(o=n._count.value(),a=null):n._until&&(o=null,a=n._until.val?U.parseDate(n._until.val(),"yyyy-MM-dd"):n._until.value()),r.count=o,r.until=a})},_createView:function(t){var n=this,i=n.options,r=i.messages,o=r["repeat"===t?"repeatTitle":"endTitle"],a='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list" id="recurrence"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+r.cancel+"</a>"+r.headerTitle+'<a href="#" class="k-button k-scheduler-update">'+r.update+"</a></div>",s=n._pane.view().id;n._view=n._pane.append(a+L({headerTitle:o})),n._view.element.on(_e+n._namespace,"a.k-scheduler-cancel, a.k-scheduler-update",function(t){t.preventDefault(),t.stopPropagation(),e(this).hasClass("k-scheduler-update")?(n.trigger("change"),n._defaultValue=e.extend({},n._value)):n._value=n._defaultValue;var i=n._value.freq;n._endButton.text(n._endText()),n._endFields.toggleClass("k-state-disabled",!i),n._repeatButton.text(r.frequencies[i||"never"]),n._pane.one("viewShow",function(){n._destroyView()}),n._pane.navigate(s,n.options.animations.right)}),n._container=n._view.element.find(".k-recur-view"),"repeat"===t?(n._initFrequency(),n._initRepeatView()):(n._initEndNavigation(),n._initEndView())},_destroyView:function(){this._view&&(this._view.destroy(),this._view.element.remove()),this._view=null},_initRepeatView:function(){var e=this,n=e._value.freq||"never",i={frequency:n,weekDayCheckBoxes:I,firstWeekDay:e.options.firstWeekDay,messages:e.options.messages[n]},r=B(i),o=e._container,a=e._value;return U.destroy(o),o.html(r),r?("weekly"!==n||a.weekDays||(a.weekDays=[{day:e.options.start.getDay(),offset:0}]),e._initInterval(),e._initMonthDay(),e._initWeekDays(),e._initWeekDay(),e._initMonth(),e._period(),t):(e._value={},t)},_initEndView:function(e){var n,i=this,r=i._value;e===t&&(r.count?e="count":r.until&&(e="until")),n={endPattern:e,messages:i.options.messages.end},U.destroy(i._container),i._container.html(O(n)),i._initCount(),i._initUntil()},_initWeekDay:function(){var t,n=this,i=n.options.messages.weekdays,r=n.options.messages.offsetPositions,o=n._container.find(".k-recur-weekday"),a=function(){n._weekDayRule(),n.trigger("change")};o[0]&&(n._weekDayOffset=n._container.find(".k-recur-weekday-offset").html(n._options([{text:r.first,value:"1"},{text:r.second,value:"2"},{text:r.third,value:"3"},{text:r.fourth,value:"4"},{text:r.last,value:"-1"}])).change(a),t=[{text:i.day,value:"day"},{text:i.weekday,value:"weekday"},{text:i.weekend,value:"weekend"}],t=t.concat(e.map(U.culture().calendar.days.names,function(e,t){return{text:e,value:t}})),n._weekDay=o.html(n._options(t)).change(a).val(n.options.start.getDay()),n._weekDayView())},_initMonth:function(){var t,n=this,i=n._value,r=n.options.start,o=i.months||[r.getMonth()+1],a=n._container.find(".k-recur-month"),s=U.culture().calendar.months.names;a[0]&&(t=e.map(s,function(e,t){return{text:e,value:t+1}}),a.html(n._options(t)).change(function(){i.months=[+this.value]}),n._monthSelect=a,o&&a.val(o[0]))},_period:function(){var t,n,i,r=this,o=r._value,a=r._container,s=r.options.messages[o.freq],l=a.find(".k-repeat-rule"),d=a.find(".k-weekday-view"),c=a.find(".k-monthday-view");l[0]&&(t=o.weekDays?"weekday":"monthday",n=V({value:t,dataSource:[{text:s.dayOfMonth,value:"monthday"},{text:s.dayOfWeek,value:"weekday"}],ns:U.ns}),i=function(e){var t=r._weekDay.val(),n=r._weekDayOffset.val(),i=r._monthDay.value(),a=r._monthSelect?r._monthSelect.val():null;"monthday"===e?(o.weekDays=null,o.monthDays=i?[i]:i,o.months=a?[+a]:a,d.hide(),c.show()):(o.monthDays=null,o.months=a?[+a]:a,o.weekDays=[{offset:+n,day:+t}],d.show(),c.hide())},l.append(n).on(_e+r._namespace,".k-scheduler-navigation li",function(t){var n,r=e(this).addClass("k-state-selected");t.preventDefault(),r.siblings().removeClass("k-state-selected"),n=r.children("a").attr(U.attr("value")),i(n)}),i(t))},_initUntil:function(){var e=this,t=e._container.find(".k-recur-until"),n=e.options.start,i=e._value,r=i.until,o=r&&r<n?r:n;e._until=U.support.input.date?t.attr("min",U.toString(o,"yyyy-MM-dd")).val(U.toString(r||n,"yyyy-MM-dd")).on("change",function(){i.until=U.parseDate(this.value,"yyyy-MM-dd")}):t.kendoDatePicker({min:o,value:r||n,change:function(){i.until=this.value()}}).data("kendoDatePicker")},_options:function(e,t){var n=0,i="",r=e.length,o=this._optionTemplate;for(t&&(i+=o({value:"",text:t}));n<r;n++)i+=o(e[n]);return i}}),$.plugin(W)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.scheduler.timelineview.min",["kendo.scheduler.view.min"],e)}(function(){return function(e,t){function n(e){var t=new Date(1980,1,1,0,0,0);return c(t,v(e)),t}function i(e){var t=[],n=e.workWeekStart;for(t.push(n);e.workWeekEnd!=n;)n>6?n-=7:n++,t.push(n);return t}function r(e){var t,n=0;if(e.columns){for(t=0;t<e.columns.length;t++)n+=r(e.columns[t]);return e.colspan=n,n}return e.colspan=1,1}function o(e,t,n){var i,r,o,s;for(i=e.length-1;i>=0;i--)r=e[i].rectLeft,s=e[i].rectRight,o=r<=t&&s>=t,(o||r>=t&&s<=n||t<=r&&n>=r)&&(r<t&&(t=r),s>n&&(n=s));return a(e,t,n)}function a(e,t,n){var i,r,o=[];for(i=0;i<e.length;i++)r={rectLeft:e[i].rectLeft,rectRight:e[i].rectRight},(r.rectLeft<t&&r.rectRight>t||r.rectLeft>=t&&r.rectRight<=n)&&o.push(e[i]);return o}var s,l=window.kendo,d=l.ui,c=l.date.setTime,u=d.SchedulerView,h=l._outerWidth,f=l._outerHeight,p=e.extend,m=e.proxy,g=l.date.getDate,v=l.date.getMilliseconds,_=l.date.MS_PER_DAY,b=l.date.MS_PER_MINUTE,k="k-current-time",w="k-current-time-arrow",y="k-scheduler-header-wrap",x=.8666,C=".kendoTimelineView",T=l.template('<div><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#</div><div class="k-event-template">${title}</div></div>'),S=l.template("<span class='k-link k-nav-day'>#=kendo.format('{0:m}', date)#</span>"),D='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head) {#<span class="k-icon k-i-arrow-e"></span>#}#</span>#if(resizable && !data.tail){#<span class="k-resize-handle k-resize-w"></span>#}##if(resizable && !data.head){#<span class="k-resize-handle k-resize-e"></span>#}#</div>',E=l.Class.extend({init:function(e){this._view=e},_getTimeSlotByPosition:function(e,t,n){var i=this._view.groups[n];return i.timeSlotByPosition(e,t)},_hideHeaders:function(){var e=this._view;e.timesHeader.find("table tr:last").hide(),e.datesHeader.find("table tr:last").hide()},_setColspan:function(e){r(e)},_createRowsLayout:function(e,t,n){var i=this._view;return i._createRowsLayout(e,t,n)},_createVerticalColumnsLayout:function(e,t,n,i){return i},_createColumnsLayout:function(e,t,n){var i=this._view;return i._createColumnsLayout(e,t,n)},_getRowCount:function(){var e=this._view;return e._groupCount()},_getGroupsCount:function(){return 1},_addContent:function(e,t,n,i,r,o,a,s){var d,c,u,h,f=this._view,p="",m=f.options,g=function(t){var n,i="",r="",o=function(e){return function(){return f._resourceBySlot({groupIndex:e})}};return l.date.isToday(e[u])&&(r+="k-today"),(l.date.getMilliseconds(t)<l.date.getMilliseconds(m.workDayStart)||l.date.getMilliseconds(t)>=l.date.getMilliseconds(m.workDayEnd)||!f._isWorkDay(e[u]))&&(r+=" k-nonwork-hour"),i+="<td"+(""!==r?' class="'+r+'"':"")+">",n=l.date.getDate(e[u]),l.date.setTime(n,l.date.getMilliseconds(t)),i+=a({date:n,resources:o(s?d:c)}),i+="</td>"};for(d=0;d<i;d++){for(p+="<tr>",c=0;c<n;c++)for(u=0,h=t;u<h;u++)p+=f._forTimeRange(r,o,g);p+="</tr>"}return p},_addTimeSlotsCollections:function(e,t,n,i,r){var o,a,s,l,d,c,u,h,f,p,m,g,_=this._view,b=n.length;for(r&&(b=Math.floor(b/e)),o=0;o<e;o++)for(a=0,s=_.groups[o],r&&(a=o),d=a*b,c=0,r||(c=o),u=n[d].children,h=u.length/(r?1:e),f=h/t,p=0;p<t;p++)for(m=p*f+h*c,l=v(new Date((+_.startTime()))),g=0;g<f;g++)_._addTimeSlotToCollection(s,u,g,m,p,l,i),l+=i},_getVerticalGroupCount:function(e){return e},_getVerticalRowCount:function(e,t,n){var i=this._view;return i._isVerticallyGrouped()?e[t].maxRowCount:n},_renderEvent:function(e,t,n,i,r,o){var a,s=this._view,l=s._createEventElement(n.occurrence,t,r.head||n.head,r.tail||n.tail);l.appendTo(o).css({top:0,height:s.options.eventHeight}),a={start:n.occurrence._startTime||n.occurrence.start,end:n.occurrence._endTime||n.occurrence.end,element:l,uid:t.uid,slotRange:r,rowIndex:0,offsetTop:0},e.events[t.uid]=a,s.addContinuousEvent(i,r,l,t.isAllDay),s._arrangeRows(a,r,e)},_verticalCountForLevel:function(e){var t=this._view;return t._rowCountForLevel(e)},_horizontalCountForLevel:function(e){var t=this._view;return t._columnCountForLevel(e)},_updateCurrentVerticalTimeMarker:function(t,n){var i=this._view,r="<div class='"+k+"'></div>",o=i.datesHeader.find("."+y),a=Math.round(t[0].innerRect(n,new Date(n.getTime()+1),!1).left),s=e(r).prependTo(o).addClass(w+"-down");s.css({left:i._adjustLeftPosition(a-h(s)*x/2),top:o.find("tr:last").prev().position().top}),e(r).prependTo(i.content).css({left:i._adjustLeftPosition(a),width:"1px",height:i.content[0].scrollHeight-1,top:0})},_changeGroup:function(){return t},_prevGroupSlot:function(e,t,n){var i,r=this._view;return r._isVerticallyGrouped()?e:(i=t._collection(0,n),i.last())},_nextGroupSlot:function(e,t,n){var i,r=this._view;return r._isVerticallyGrouped()?e:(i=t._collection(0,n),i.first())},_verticalSlots:function(e,t){var n=this._view;return n._changeGroup(e,t)},_verticalMethod:function(e){return e?"leftSlot":"rightSlot"},_normalizeVerticalSelection:function(){return t},_horizontalSlots:function(e,t,n,i,r,o,a){var s=this._view,l={};return l.startSlot=t[n](i),l.endSlot=t[n](r),o||!s._isHorizontallyGrouped()||l.startSlot&&l.endSlot||(l.startSlot=l.endSlot=s._changeGroup(e,a)),l},_changeVerticalViewPeriod:function(){return!1},_changeHorizontalViewPeriod:function(e,t,n,i){var r=this._view;return!(e.startSlot&&e.endSlot||t||!r._changeViewPeriod(n,i,!1))},_updateDirection:function(e,t,n,i){var r=this._view;r._updateDirection(e,t,n,i,!0)},_createMoveHint:function(e,t){var n,i,r,o,a=this._view,s=e.start,l=a._createEventElement(t.occurrence,t.occurrence,!1,!1);l.addClass("k-event-drag-hint"),n=e.innerRect(t.occurrence.start,t.occurrence.end,a.options.snap),i=n.right-n.left-2,i<0&&(i=0),r=a._adjustLeftPosition(n.left),o={left:r,top:s.offsetTop,height:s.offsetHeight-2,width:i},l.css(o),a._moveHint=a._moveHint.add(l)},_adjustLeftPosition:function(e){var t=this._view;return t._isRtl&&(e-=t.content[0].scrollWidth-t.content[0].offsetWidth),e}}),F=l.Class.extend({init:function(e){this._view=e},_getTimeSlotByPosition:function(e,t,n){var i=this._view.groups[n];return i.timeSlotByPosition(e,t,!0)},_hideHeaders:function(){var e=this._view;e._isVerticallyGrouped()?e.times.find(".k-last").hide():(e.timesHeader.find("table tr").eq(2).hide(),e.datesHeader.find("table tr").eq(2).hide())},_setColspan:function(){},_createRowsLayout:function(e,t,n,i){var r=this._view;return r._createDateLayout(i,null,!0)},_createVerticalColumnsLayout:function(e,t,n){var i=this._view;return i._createColumnsLayout(e,null,n)},_createColumnsLayout:function(e,t,n,i){var r=this._view;return r._createColumnsLayout(e,t,n,i,!0)},_getRowCount:function(e){var t=this._view;return t._rowCountForLevel(e)},_getGroupsCount:function(){var e=this._view;return e._groupCount()},_addContent:function(e,t,n,i,r,o,a,s){var d,u,h,f,p=this._view,m="",g=p.options,v=function(t,n,i,r,o,s){var c,u="",f="",m=p._isVerticallyGrouped()?d:h,v=function(e){return function(){return p._resourceBySlot({groupIndex:e})}};return l.date.isToday(e[h])&&(f+="k-today"),(l.date.getMilliseconds(t)<l.date.getMilliseconds(g.workDayStart)||l.date.getMilliseconds(t)>=l.date.getMilliseconds(g.workDayEnd)||!p._isWorkDay(e[m]))&&(f+=" k-nonwork-hour"),u+="<td"+(""!==f?' class="'+f+'"':"")+">",c=l.date.getDate(e[h]),l.date.setTime(c,l.date.getMilliseconds(t)),u+=a({date:c,resources:v(s)}),u+="</td>"},_=new Date(r),k=p.options.minorTickCount,w=p.options.majorTick*b,y=w/k||1;for(u=0;u<i;u++){for(m+="<tr>",u%(i/p._dates.length)===0&&(d=u/(i/p._dates.length),_=new Date(p._dates[d]),l.date.setTime(_,l.date.getMilliseconds(r))),h=0,f=t;h<f;h++)if(m+=p._forTimeRange(_,o,v,s,n),s){c(_,y,!1);break}m+="</tr>"}return m},_addTimeSlotsCollections:function(e,t,n,i,r){var o,a,s,l,d,c,u,h,f,p,m,g,_=this._view,b=n.length;for(r&&(b/=t),o=0;o<t;o++)for(a=0,r&&(a=o),l=a*b,d=0,c=n[l].children,u=r?b:c.length/(t*e),h=c.length/t,s=v(new Date((+_.startTime()))),p=0;p<u;p++){for(r?(f=0,c=n[p+u*o].children):(f=o*h+e*p,d++),m=0;m<e;m++)g=_.groups[m],_._addTimeSlotToCollection(g,c,m,f,o,s,i);s+=i}},_getVerticalGroupCount:function(){var e=this._view;return e.content.find("tr").length},_getVerticalRowCount:function(e,t,n){return n},_renderEvent:function(e,t,n,i,r,o,a,s){var l,d,c,u,h,f=this._view,p=[];for(d=r.start.index;d<=r.end.index;d++)l=f._createEventElement(n.occurrence,t,d!==s,d!==a),l.appendTo(o).css({top:0,height:f.options.eventHeight}),c=i._timeSlotCollections[0]._slots[d],u=i.timeSlotRanges(c.start,c.end,!1)[0],h={start:d===a?n.occurrence._startTime||n.occurrence.start:c.start,end:d===s?n.occurrence._endTime||n.occurrence.end:c.end,element:l,uid:t.uid,slotRange:u,rowIndex:0,offsetTop:0},e.events[t.uid]=h,p.push(h),f.addContinuousEvent(i,u,l,t.isAllDay),f._arrangeRows(h,u,e);e.events[t.uid]=p},_verticalCountForLevel:function(e){var t=this._view;return t._columnCountForLevel(e)},_horizontalCountForLevel:function(e,t){var n=this._view;return n._columnCountForLevel(t)/n._columnCountForLevel(2)},_updateCurrentVerticalTimeMarker:function(t,n){var i=this._view,r=i.times.find("tr:first th:first"),o=i.times.find("tr:first th:last"),a="<div class='"+k+"'></div>",s=e(a).prependTo(i.times),l=Math.round(t[0].innerRect(n,new Date(n.getTime()+1),!1).top),d={};this._isRtl?(d.right=r.position().left+f(r)-f(o),s.addClass(w+"-left")):(d.left=o.position().left,s.addClass(w+"-right")),d.top=l-h(s)*x/2,s.css(d),e(a).prependTo(i.content).css({top:l,height:"1px",right:"1px",width:i.content[0].scrollWidth,left:0})},_changeGroup:function(e,t,n){var i=this._view;n||(e.groupIndex=t?i.groups.length-1:0)},_prevGroupSlot:function(e){return e},_nextGroupSlot:function(e){return e},_changeDate:function(e,t,n){var i,r,o=this._view,a=o.groups[e.groupIndex];if(t){if(i=a._getCollections(!1),r=n.index-1,r>=0)return i[0]._slots[r]}else if(i=a._getCollections(!1),r=n.index+1,i[0]&&i[0]._slots[r])return i[0]._slots[r]},_verticalSlots:function(e,t,n){return this._changeDate(e,t,n)},_verticalMethod:function(e,t){return t?e?"upSlot":"downSlot":e?"leftSlot":"rightSlot"},_normalizeVerticalSelection:function(e,n,i,r){var o=this._view;return r?t:o._normalizeVerticalSelection(e,n,i)},_horizontalSlots:function(e,t,n,i,r,o,a){var s=this._view,l=s._changeGroup(e,a),d={};return l?d.startSlot=d.endSlot=l:s._isVerticallyGrouped()||(d.startSlot=t[n](i),d.endSlot=t[n](r)),d},_changeVerticalViewPeriod:function(e,t,n,i){var r=this._view;return!(e.startSlot&&e.endSlot||t||!r._changeViewPeriod(n,i,r._isVerticallyGrouped()))},_changeHorizontalViewPeriod:function(e,t,n,i){var r=this._view;return!r._isVerticallyGrouped()&&!(e.startSlot&&e.endSlot||t||!r._changeViewPeriod(n,i,!1))},_updateDirection:function(e,t,n,i){var r=this._view;r._updateDirection(e,t,n,i,!r._isVerticallyGrouped())},_createMoveHint:function(e,t){var n,i,r,o,a=this._view,s=e.start,l=e.end;for(n=s.index;n<=l.index;n++)i=e.collection._slots[n],r=a._createEventElement(t.occurrence,t.occurrence,!1,!1),r.addClass("k-event-drag-hint"),o={left:i.offsetLeft+2,top:i.offsetTop,height:a.options.eventHeight,width:i.offsetWidth},r.css(o),a._moveHint=a._moveHint.add(r)},_adjustLeftPosition:function(e){var t=this._view;return t._isRtl&&!t._isVerticallyGrouped()&&(e-=t.content[0].scrollWidth-t.content[0].offsetWidth),e}});l.ui.scheduler.TimelineGroupedView=E,l.ui.scheduler.TimelineGroupedByDateView=F,s=u.extend({init:function(e,t){var n=this;u.fn.init.call(n,e,t),n._groupedView=n._getGroupedView(),n.title=n.options.title||n.options.name,n._workDays=i(n.options),n._templates(),n._editable(),n.calculateDateRange(),n._groups(),n._currentTime(!0)},name:"timeline",_getGroupedView:function(){return this._isGroupedByDate()?new l.ui.scheduler.TimelineGroupedByDateView(this):new l.ui.scheduler.TimelineGroupedView(this)},_getNextEventIndexBySlot:function(e,t,n){var i,r;if(this._isVerticallyGrouped())return l.ui.SchedulerView.fn._getNextEventIndexBySlot.call(this,e,t,n);for(i=0,r=0;r<t.length;r++)if(e.startDate()>t[r].start.startDate())i++;else{if(!(e.startDate().getTime()===t[r].start.startDate().getTime()&&n>t[r].start.groupIndex))break;i++}return i},_getSelectedSlot:function(e,t,n,i,r,o){return this._isVerticallyGrouped()?l.ui.SchedulerView.fn._getSelectedSlot.call(this,e,t,n,i,r,o):e},_getSortedEvents:function(t){return this._isVerticallyGrouped()?l.ui.SchedulerView.fn._getSortedEvents.call(this,t):t.sort(function(t,n){var i=t.start.startDate().getTime()-n.start.startDate().getTime();return 0===i&&(t.start.isDaySlot&&!n.start.isDaySlot&&(i=-1),!t.start.isDaySlot&&n.start.isDaySlot&&(i=1)),0===i&&(i=t.start.groupIndex-n.start.groupIndex),0===i&&(i=e(t.element).index()-e(n.element).index()),i})},_currentTimeMarkerUpdater:function(){this._updateCurrentTimeMarker(new Date)},_updateCurrentTimeMarker:function(t){var n,i,r,o,a,s,d,c,u,f,p,m,g,v=this.options;if(this.datesHeader.find("."+k).remove(),this.times.find("."+k).remove(),this.content.find("."+k).remove(),this._isInDateSlot({start:t,end:t}))for(v.currentTimeMarker.useLocalTimezone===!1&&(n=v.dataSource.options.schema.timezone,v.dataSource&&n&&(i=l.timezone.offset(t,n),t=l.timezone.convert(t,t.getTimezoneOffset(),i))),r=v.group&&"vertical"!=v.group.orientation?this.groups.length:1,o=0;o<r;o++){if(a=this.groups[o],!a)return;if(s=l.date.toUtcTime(t),d=a.timeSlotRanges(s,s+1),0===d.length)return;c=d[0].collection,u=c.slotByStartDate(t),u&&(this._isVerticallyGrouped()?this._groupedView._updateCurrentVerticalTimeMarker(d,t):(f="<div class='"+k+"'></div>",p=this.datesHeader.find("."+y),m=Math.round(d[0].innerRect(t,new Date(t.getTime()+1),!1).left),g=e(f).prependTo(p).addClass(w+"-down"),g.css({left:this._adjustLeftPosition(m-h(g)*x/2),top:p.find("tr:last").prev().position().top}),e(f).prependTo(this.content).css({left:this._adjustLeftPosition(m),width:"1px",height:this.content[0].scrollHeight-1,top:0})))}},_adjustLeftPosition:function(e){return this._groupedView._adjustLeftPosition(e)},_currentTime:function(e){var n=this,i=n.options.currentTimeMarker;i!==!1&&i.updateInterval!==t&&(n._currentTimeMarkerUpdater(),e&&(n._currentTimeUpdateTimer=setInterval(m(this._currentTimeMarkerUpdater,n),i.updateInterval)))},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+C,".k-event a:has(.k-si-close)",function(n){t.trigger("remove",{uid:e(this).closest(".k-event").attr(l.attr("uid"))}),n.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+C,".k-scheduler-content td",function(e){var n,i=t._slotByPosition(e.pageX,e.pageY);i&&(n=t._resourceBySlot(i),t.trigger("add",{eventInfo:p({start:i.startDate(),end:i.endDate()},n)})),e.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+C,".k-event",function(n){t.trigger("edit",{uid:e(this).closest(".k-event").attr(l.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var n=this,i=0;l.support.mobileOS.android&&(i=5),n.options.editable.create!==!1&&(n._addUserEvents=new l.UserEvents(n.element,{threshold:i,filter:".k-scheduler-content td",tap:function(e){var i,r=e.x.location!==t?e.x.location:e.x,o=e.y.location!==t?e.y.location:e.y,a=n._slotByPosition(r,o);a&&(i=n._resourceBySlot(a),n.trigger("add",{eventInfo:p({start:a.startDate(),end:a.endDate()},i)})),e.preventDefault()}})),n.options.editable.update!==!1&&(n._editUserEvents=new l.UserEvents(n.element,{threshold:i,filter:".k-event",tap:function(t){var i=e(t.target).closest(".k-event");i.hasClass("k-event-active")||n.trigger("edit",{uid:i.attr(l.attr("uid"))}),t.preventDefault()}}))},_slotByPosition:function(e,t){var n,i,r,o=this.content,a=o.offset();for(e-=a.left,t-=a.top,this._isRtl?(r=l.support.browser,r.mozilla?(e+=o[0].scrollWidth-o[0].offsetWidth,e+=o[0].scrollLeft):r.msie?(e-=o.scrollLeft(),e+=o[0].scrollWidth-o[0].offsetWidth):r.webkit&&(e+=o[0].scrollLeft)):e+=o[0].scrollLeft,t+=o[0].scrollTop,e=Math.ceil(e),t=Math.ceil(t),i=0;i<this.groups.length;i++)if(n=this._groupedView._getTimeSlotByPosition(e,t,i))return n;return null},options:{name:"TimelineView",title:"Timeline",selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}",date:l.date.today(),startTime:l.date.today(),endTime:l.date.today(),showWorkHours:!1,minorTickCount:2,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,majorTick:60,eventHeight:25,eventMinWidth:0,columnWidth:100,groupHeaderTemplate:"#=text#",majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",slotTemplate:"&nbsp;",eventTemplate:T,dateHeaderTemplate:S,footer:{command:"workDay"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0},messages:{defaultRowText:"All events",showFullDay:"Show full day",showWorkDay:"Show business hours"}},events:["remove","add","edit"],_templates:function(){var e=this.options,t=p({},l.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,D),this.majorTimeHeaderTemplate=l.template(e.majorTimeHeaderTemplate,t),this.dateHeaderTemplate=l.template(e.dateHeaderTemplate,t),this.slotTemplate=l.template(e.slotTemplate,t),this.groupHeaderTemplate=l.template(e.groupHeaderTemplate,t)},_render:function(t){var n=this;t=t||[],n._dates=t,n._startDate=t[0],n._endDate=t[t.length-1||0],n._calculateSlotRanges(),n.createLayout(n._layout(t)),n._content(t),n._footer(),n._setContentWidth(),n.refreshLayout(),n.datesHeader.on("click"+C,".k-nav-day",function(t){var i=e(t.currentTarget).closest("th"),r=n._slotByPosition(i.offset().left,n.content.offset().top);n.trigger("navigate",{view:"timeline",date:r.startDate()})}),n._groupedView._hideHeaders()},_setContentWidth:function(){var e=this.content,t=e.width(),n=this.content.find("table"),i=n.find("tr:first").children().length,r=100,o=i*this.options.columnWidth;t<o&&(r=Math.ceil(o/t*100)),n.add(this.datesHeader.find("table")).css("width",r+"%")},_calculateSlotRanges:function(){var e,t,n,i,r=this._dates,o=this.startTime(),a=this.endTime();for(v(a)===v(l.date.getDate(a))&&(a=l.date.getDate(a),c(a,_-1)),a=v(a),o=v(o),e=[],t=0;t<r.length;t++)n=g(r[t]),c(n,o),i=g(r[t]),c(i,a),e.push({start:l.date.toUtcTime(n),end:l.date.toUtcTime(i)});this._slotRanges=e},_forTimeRange:function(e,t,i,r,o){var a,s,l,d,u,h,f,p,m,g,k,w,y,x,C,T,S,D;for(e=n(e),t=n(t),a=this,s=v(e),l=v(t),d=a.options.minorTickCount,u=a.options.majorTick*b,h=u/d||1,f=new Date((+e)),p=f.getDate(),g=0,w="",k=_/h,s!=l&&(s>l&&(l+=_),k=(l-s)/h),k=r?1:Math.round(k),o&&(k*=o);g<k;g++)y=g%(u/h),x=0===y,C=y<d-1,T=y===d-1,S=d,k%d!==0&&(D=k-(g+1)<d,x&&D&&(S=k%d)),w+=i(f,x,C,T,S,g%o),r||(o?g%o===o-1&&c(f,h,!1):c(f,h,!1));return l&&(m=v(f),p<f.getDate()&&(m+=_),m>l&&(f=new Date((+t)))),w},_layout:function(e){var t,n,i,r=[],o=[],a=this,s=[{text:a.options.messages.defaultRowText}],l=a._groupedView,d=[];for(t=0;t<a.options.minorTickCount;t++)d.push({text:"",className:"k-last",minorTicks:!0});for(this._forTimeRange(a.startTime(),a.endTime(),function(e,t,n,i,o){var s,c=a.majorTimeHeaderTemplate;t&&(s={text:c({date:e}),className:i?"k-slot-cell":"",columns:d.slice(0,o)},l._setColspan(s),r.push(s))}),n=0;n<e.length;n++)o.push({text:a.dateHeaderTemplate({date:e[n]}),className:"k-slot-cell",columns:r.slice(0)});return i=this.groupedResources,i.length&&("vertical"===this._groupOrientation()?(s=l._createRowsLayout(i,null,this.groupHeaderTemplate,o),o=l._createVerticalColumnsLayout(i,null,this.groupHeaderTemplate,o)):o=l._createColumnsLayout(i,o,this.groupHeaderTemplate,o)),{columns:o,rows:s}},_footer:function(){var t,n,i,r=this.options;r.footer!==!1&&(t='<div class="k-header k-scheduler-footer">',n=r.footer.command,n&&"workDay"===n?(t+='<ul class="k-reset k-header">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"></span>',t+=(r.showWorkHours?r.messages.showFullDay:r.messages.showWorkDay)+"</a></li>",t+="</ul>"):t+="&nbsp;",t+="</div>",this.footer=e(t).appendTo(this.element),i=this,this.footer.on("click"+C,".k-scheduler-fullday",function(e){e.preventDefault(),i.trigger("navigate",{view:i.name||r.name,date:i.startDate(),isWorkDay:!r.showWorkHours})}))},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},_isWorkDay:function(e){var t,n=e.getDay(),i=this._workDays;for(t=0;t<i.length;t++)if(i[t]===n)return!0;return!1},_content:function(e){var t=this,n=t.startTime(),i=this.endTime(),r=1,o=1,a=e.length,s="",l=this.groupedResources,d=this.slotTemplate,c=!1;l.length&&(c="vertical"===t._groupOrientation(),c?(o=t._groupedView._getRowCount(this.rowLevels.length-1),r=t._groupedView._getGroupsCount()):r=t._groupCount()),s+="<tbody>",s+=t._groupedView._addContent(e,a,r,o,n,i,d,c),s+="</tbody>",this.content.find("table").append(s)},_groups:function(){var e,t,n,i,r=this._groupCount(),o=this._dates,a=o.length;for(this.groups=[],e=0;e<r;e++)t=this._addResourceView(e),n=o[0],i=o[o.length-1||0],t.addTimeSlotCollection(n,l.date.addDays(i,1));this._timeSlotGroups(r,a)},_isHorizontallyGrouped:function(){return this.groupedResources.length&&"horizontal"===this._groupOrientation()},_timeSlotGroups:function(e,t){var n=this._timeSlotInterval(),i=this._isVerticallyGrouped(),r=this.content.find("tr");r.attr("role","row"),this._groupedView._addTimeSlotsCollections(e,t,r,n,i)},_addTimeSlotToCollection:function(e,t,n,i,r,o,a){var s=t[n+i],l=e.getTimeSlotCollection(0),d=this._dates[r],c=Date.UTC(d.getFullYear(),d.getMonth(),d.getDate()),u=c+o,h=u+a;s.setAttribute("role","gridcell"),s.setAttribute("aria-selected",!1),l.addTimeSlot(s,u,h,!0)},startDate:function(){return this._startDate},endDate:function(){return this._endDate},startTime:function(){var e=this.options;return e.showWorkHours?e.workDayStart:e.startTime},endTime:function(){var e=this.options;return e.showWorkHours?e.workDayEnd:e.endTime},_timeSlotInterval:function(){var e=this.options;return e.majorTick/e.minorTickCount*b},nextDate:function(){return l.date.nextDay(this.endDate())},previousDate:function(){return l.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},render:function(e){var t,n,i,r,o;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),e=new l.data.Query(e).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),t=[],this._eventsByResource(e,this.groupedResources,t),n=[],i=0,r=0;r<t.length;r++)o={groupIndex:r,maxRowCount:0,events:{}},n.push(o),this._renderEvents(t[r],r,o),i<o.maxRowCount&&(i=o.maxRowCount);this._setRowsHeight(n,t.length,i),this._positionEvents(n,t.length),this._currentTime(!1),this.trigger("activate")},_positionEvents:function(t,n){var i,r,o,a,s;for(i=0;i<n;i++){r=t[i].events;for(o in r)if(a=r[o],e.isArray(a))for(s=0;s<a.length;s++)this._positionEvent(a[s]);else this._positionEvent(a)}},_setRowsHeight:function(t,n,i){
var r,o,a,s,l,d=this.options.eventHeight+2,c=this._getBottomRowOffset(),u=this._groupedView,h=u._getVerticalGroupCount(n);for(n=this._isVerticallyGrouped()?h:1,r=0;r<n;r++)o=u._getVerticalRowCount(t,r,i),o=o?o:1,a=(d+2)*o+c,s=e(this.times.find("tr")[r]),l=e(this.content.find("tr")[r]),s.height(a),l.height(a);this._setContentWidth(),this.refreshLayout(),this._refreshSlots()},_getBottomRowOffset:function(){var e,t,n=.5*this.options.eventHeight,i=this._isMobile();return i?(e=30,t=60):(e=15,t=30),n>t?n=t:n<e&&(n=e),n},_positionEvent:function(e){var t,n,i,r=this.options.eventHeight+2,o=e.slotRange.innerRect(e.start,e.end,!1),a=this._adjustLeftPosition(o.left),s=o.right-o.left-2;s<0&&(s=0),s<this.options.eventMinWidth&&(t=e.slotRange.collection,n=t._slots[t._slots.length-1],i=n.offsetLeft+n.offsetWidth,s=this.options.eventMinWidth,i<a+s&&(s=i-o.left-2)),e.element.css({top:e.slotRange.start.offsetTop+e.rowIndex*(r+2)+"px",left:a,width:s})},_refreshSlots:function(){for(var e=0;e<this.groups.length;e++)this.groups[e].refresh()},_eventsByResource:function(e,t,n){var i,r,o,a,s=t[0];if(s)for(i=s.dataSource.view(),r=0;r<i.length;r++)o=this._resourceValue(s,i[r]),a=new l.data.Query(e).filter({field:s.field,operator:u.groupEqFilter(o)}).toArray(),t.length>1?this._eventsByResource(a,t.slice(1),n):n.push(a);else n.push(e)},_isInDateSlot:function(e){var t=e.start,n=e.end,i=g(this._startDate),r=l.date.addDays(g(this._endDate),1);return t<r&&i<=n},_isInTimeSlot:function(e){var t,n=e._startTime||l.date.toUtcTime(e.start),i=e._endTime||l.date.toUtcTime(e.end),r=this._slotRanges;for(n===i&&(i+=1),t=0;t<r.length;t++)if(n<r[t].end&&r[t].start<i)return!0;return!1},_adjustEvent:function(e){var t,n=e.start,i=e.end,r=e._time("start"),o=e._time("end"),a=v(this.startTime()),s=v(this.endTime()),d=null,u=null,h=!1,f=!1;return e.isAllDay?(d=g(n),a>r&&(c(d,a),f=!0),u=g(i),s===v(g(this.endTime()))?u=l.date.addDays(u,1):(c(u,s),h=!0)):(s=0===s?_:s,a>r?(d=g(n),c(d,a),f=!0):s<r&&(d=g(n),d=l.date.addDays(d,1),c(d,a),f=!0),s<o?(u=g(i),c(u,s),h=!0):a>o&&(u=g(i),u=l.date.addDays(u,-1),c(u,s),h=!0)),t=e.clone({start:d?d:n,end:u?u:i,_startTime:d?l.date.toUtcTime(d):e._startTime,_endTime:u?l.date.toUtcTime(u):e._endTime,isAllDay:!1}),{occurrence:t,head:h,tail:f}},_renderEvents:function(e,t,n){var i,r,o,a,s,l,d,c,u,h,f;for(r=0,o=e.length;r<o;r++)i=e[r],this._isInDateSlot(i)&&(a=i.isAllDay||i.end.getTime()-i.start.getTime()>=_,s=this.content,(a||this._isInTimeSlot(i))&&(l=this._adjustEvent(i),d=this.groups[t],d._continuousEvents||(d._continuousEvents=[]),c=d.slotRanges(l.occurrence,!1),u=c[0],h=u.start.index,f=u.end.index,this._isInTimeSlot(l.occurrence)&&this._groupedView._renderEvent(n,i,l,d,u,s,h,f)))},addContinuousEvent:function(e,t,n,i){var r=e._continuousEvents;r.push({element:n,isAllDay:i,uid:n.attr(l.attr("uid")),start:t.start,end:t.end})},_createEventElement:function(t,n,i,r){var o,a,s=this.eventTemplate,d=this.options.editable,c=this._isMobile(),u=d&&d.destroy!==!1&&!c,h=d&&d.resize!==!1,f=n._time("start"),m=n._time("end"),g=n.start,v=n.end,_=this.eventResources(n);return n._startTime&&f!==l.date.getMilliseconds(n.start)&&(g=new Date(f),g=l.timezone.apply(g,"Etc/UTC")),n._endTime&&m!==l.date.getMilliseconds(n.end)&&(v=new Date(m),v=l.timezone.apply(v,"Etc/UTC")),o=p({},{ns:l.ns,resizable:h,showDelete:u,head:i,tail:r,singleDay:1==this._dates.length,resources:_,inverseColor:!(!_||!_[0])&&this._shouldInverseResourceColor(_[0])},n,{start:g,end:v}),a=e(s(o)),this.angular("compile",function(){return{elements:a,data:[{dataItem:o}]}}),a},_arrangeRows:function(e,t,n){var i,r,a,s,l,d,c=t.start.index,h=t.end.index,f=e.slotRange.innerRect(e.start,e.end,!1),p=f.right+this.options.eventMinWidth,m=o(t.events(),f.left,p);for(t.addEvent({slotIndex:c,start:c,end:h,rectLeft:f.left,rectRight:p,element:e.element,uid:e.uid}),m.push({start:c,end:h,uid:e.uid}),i=u.createRows(m),n.maxRowCount<i.length&&(n.maxRowCount=i.length),r=0,a=i.length;r<a;r++)for(s=i[r].events,l=0,d=s.length;l<d;l++)n.events[s[l].uid].rowIndex=r},_groupCount:function(){var e=this.groupedResources,t=this._groupedView;return e.length?"vertical"===this._groupOrientation()?t._verticalCountForLevel(e.length-1):t._horizontalCountForLevel(e.length-1,this.columnLevels.length-1):1},_updateEventForSelection:function(e){var t=this._adjustEvent(e.clone());return t.occurrence},_eventOptionsForMove:function(e){return e.isAllDay?{isAllDay:!1}:{}},_updateEventForResize:function(e){e.isAllDay&&e.set("isAllDay",!1)},_updateMoveHint:function(e,t,n){var i,r,o,a,s=this.groups[t],l=e.clone({start:e.start,end:e.end}),d=l.duration();for(l.start=new Date(l.start.getTime()+n),l.end=new Date(+l.start+d),i=this._adjustEvent(l),r=s.slotRanges(i.occurrence,!1),this._removeMoveHint(),o=0;o<r.length;o++)this._groupedView._createMoveHint(r[o],i);a=this.content,this._moveHint.appendTo(a)},_updateResizeHint:function(e,t,n,i){var r,o,a,s,d,c,h,f,p,m,g=this.groups[t],v=g.ranges(n,i,!1,!1);for(this._removeResizeHint(),r=0;r<v.length;r++)o=v[r],a=o.startSlot(),s=o.innerRect(n,i,!1),s.top=a.offsetTop,d=s.right-s.left,c=o.endSlot().offsetTop+a.offsetHeight-s.top,h=this._adjustLeftPosition(s.left),f=u.fn._createResizeHint.call(this,h,s.top,d,c),this._resizeHint=this._resizeHint.add(f);p="t",m=this.content,this._resizeHint.appendTo(m),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(l.toString(l.timezone.toLocalDate(n),p)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(l.toString(l.timezone.toLocalDate(i),p))},selectionByElement:function(e){var t=e.offset();return this._slotByPosition(t.left,t.top)},_updateDirection:function(e,t,n,i,r){var o=t[0].start,a=t[t.length-1].end;n&&!r&&o.index===a.index&&o.collectionIndex===a.collectionIndex&&(e.backward=i)},_changeGroup:function(e,t){var n=t?"prevGroupSlot":"nextGroupSlot",i=this[n](e.start,e.groupIndex,!1);return i&&(e.groupIndex+=t?-1:1),this._groupedView._changeGroup(e,t,i),i},prevGroupSlot:function(e,t,n){var i=this.groups[t],r=i.ranges(e,e,n,!1)[0].start;if(!(t<=0))return this._groupedView._prevGroupSlot(r,i,n)},nextGroupSlot:function(e,t,n){var i=this.groups[t],r=i.ranges(e,e,n,!1)[0].start;if(!(t>=this.groups.length-1))return this._groupedView._nextGroupSlot(r,i,n)},_verticalSlots:function(e,t,n,i){var r=this._groupedView,o=r._verticalMethod(i,n),a=t[0].start,s=t[t.length-1].end,l=this.groups[e.groupIndex],d=r._normalizeVerticalSelection(e,t,i,n);return d&&(a=s=d),a=l[o](a),s=l[o](s),n||!this._isVerticallyGrouped()||a&&s||(a=s=r._verticalSlots(e,i,d)),{startSlot:a,endSlot:s}},_horizontalSlots:function(e,t,n,i){var r=i?"upSlot":"downSlot",o=t[0].start,a=t[t.length-1].end,s=this.groups[e.groupIndex],l={};return n?(l.startSlot=s[r](o),l.endSlot=s[r](a),n||!this._isHorizontallyGrouped()||o&&a||(l.startSlot=l.endSlot=this._changeGroup(e,i))):l=this._groupedView._horizontalSlots(e,s,r,o,a,n,i),l},_changeViewPeriod:function(e,t){var n,i=t?this.previousDate():this.nextDate(),r=e.start,o=e.end;return e.start=new Date(i),e.end=new Date(i),this._isHorizontallyGrouped()&&(e.groupIndex=t?this.groups.length-1:0),n=o-r,t?(o=v(this.endTime()),o=0===o?_:o,c(e.start,o-n),c(e.end,o)):(r=v(this.startTime()),c(e.start,r),c(e.end,r+n)),e.events=[],!0},move:function(e,t,n){var i,r,o,a,s,d=!1,c=this.groups[e.groupIndex],u=l.keys,h=this._groupedView,f=c.ranges(e.start,e.end,!1,!1);if(t===u.DOWN||t===u.UP){if(d=!0,o=t===u.UP,h._updateDirection(e,f,n,o),a=this._verticalSlots(e,f,n,o),h._changeVerticalViewPeriod(a,n,e,o))return d}else if((t===u.LEFT||t===u.RIGHT)&&(d=!0,o=t===u.LEFT,this._updateDirection(e,f,n,o,!1),a=this._horizontalSlots(e,f,n,o),h._changeHorizontalViewPeriod(a,n,e,o)))return d;return d&&(i=a.startSlot,r=a.endSlot,n?(s=e.backward,s&&i?e.start=i.startDate():!s&&r&&(e.end=r.endDate())):i&&r&&(e.start=i.startDate(),e.end=r.endDate()),e.events=[]),d},destroy:function(){var e=this;e.element&&e.element.off(C),e.footer&&e.footer.remove(),e._currentTimeUpdateTimer&&clearInterval(e._currentTimeUpdateTimer),u.fn.destroy.call(this),this._isMobile()&&e.options.editable&&(e.options.editable.create!==!1&&e._addUserEvents.destroy(),e.options.editable.update!==!1&&e._editUserEvents.destroy())}}),p(!0,d,{TimelineView:s,TimelineWeekView:s.extend({options:{name:"TimelineWeekView",title:"Timeline Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",majorTick:120},name:"timelineWeek",calculateDateRange:function(){var e,t,n=this.options.date,i=l.date.dayOfWeek(n,this.calendarInfo().firstDay,-1),r=[];for(e=0,t=7;e<t;e++)r.push(i),i=l.date.nextDay(i);this._render(r)}}),TimelineWorkWeekView:s.extend({options:{name:"TimelineWorkWeekView",title:"Timeline Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",majorTick:120},name:"timelineWorkWeek",nextDate:function(){var e=l.date.dayOfWeek(l.date.nextDay(this.endDate()),this.calendarInfo().firstDay,1);return l.date.addDays(e,this._workDays[0])},previousDate:function(){var e=l.date.dayOfWeek(this.startDate(),this.calendarInfo().firstDay,-1),t=this._workDays;return l.date.addDays(e,t[t.length-1]-7)},calculateDateRange:function(){for(var e=this.options.date,t=l.date.dayOfWeek(e,this.options.workWeekStart,-1),n=l.date.dayOfWeek(t,this.options.workWeekEnd,1),i=[];t<=n;)i.push(t),t=l.date.nextDay(t);this._render(i)}}),TimelineMonthView:s.extend({options:{name:"TimelineMonthView",title:"Timeline Month",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",workDayStart:new Date(1980,1,1,0,0,0),workDayEnd:new Date(1980,1,1,23,59,59),footer:!1,majorTick:1440,minorTickCount:1},name:"timelineMonth",calculateDateRange:function(){var e,t,n=this.options.date,i=l.date.firstDayOfMonth(n),r=l.date.lastDayOfMonth(n),o=[];for(e=0,t=r.getDate();e<t;e++)o.push(i),i=l.date.nextDay(i);this._render(o)}})})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.scheduler.min",["kendo.dropdownlist.min","kendo.editable.min","kendo.multiselect.min","kendo.window.min","kendo.datetimepicker.min","kendo.scheduler.recurrence.min","kendo.scheduler.view.min","kendo.scheduler.dayview.min","kendo.scheduler.agendaview.min","kendo.scheduler.monthview.min","kendo.scheduler.timelineview.min","kendo.mobile.actionsheet.min","kendo.mobile.pane.min","kendo.pdf.min"],e)}(function(){return function(e,t){function n(e,t){return t=t||"",e.startTimezone&&(t=e.startTimezone,e.endTimezone&&(t+=" | "+e.endTimezone)),t}function i(e,t){var n=t.timezone;n&&(e[I.attr("timezone")]=n)}function r(e,t){var n,i=t.model.fields[t.field].validation;i&&(n=i.dateCompare,n&&$(n)&&n.message&&(e[I.attr("dateCompare-msg")]=n.message))}function o(e,t){return function(n){return n=e(n),s(n,"apply",t),n||[]}}function a(e,t){return function(n){return n&&("[object Array]"===K.call(n)||n instanceof I.data.ObservableArray||(n=[n])),s(n,"remove",t,!0),n=e(n),n||[]}}function s(e,t,n,i){var r,o,a;for(e=e||[],o=0,a=e.length;o<a;o++)r=e[o],i?r.startTimezone||r.endTimezone?n?(r.start=I.timezone.convert(r.start,r.startTimezone||r.endTimezone,n),r.end=I.timezone.convert(r.end,r.endTimezone||r.startTimezone,n),r.start=I.timezone[t](r.start,n),r.end=I.timezone[t](r.end,n)):(r.start=I.timezone[t](r.start,r.startTimezone||r.endTimezone),r.end=I.timezone[t](r.end,r.endTimezone||r.startTimezone)):n&&(r.start=I.timezone[t](r.start,n),r.end=I.timezone[t](r.end,n)):r.startTimezone||r.endTimezone?(r.start=I.timezone[t](r.start,r.startTimezone||r.endTimezone),r.end=I.timezone[t](r.end,r.endTimezone||r.startTimezone),n&&(r.start=I.timezone.convert(r.start,r.startTimezone||r.endTimezone,n),r.end=I.timezone.convert(r.end,r.endTimezone||r.startTimezone,n))):n&&(r.start=I.timezone[t](r.start,n),r.end=I.timezone[t](r.end,n)),i&&delete r.uid;return e}function l(e,t){for(var n,i=e.length,r=0;r<i;r++)if(n=e[r],n.uid===t)return n}function d(e,t,n){return e=n?I.timezone.convert(e,t,n):I.timezone.remove(e,t)}function c(e){var t,n,i,r,o,a,s,l,c,u,h,f;return!(e.filter("[name=end]").length&&(t=e.closest(".k-scheduler-edit-form"),n=t.find("[name=start]:visible"),i=t.find("[name=end]:visible"),i[0]&&n[0]&&(a=I.widgetInstance(n,I.ui),s=I.widgetInstance(i,I.ui),l=t.data("kendoEditable"),c=l?l.options.model:null,a&&s?(r=a.value(),o=s.value()):(r=I.parseDate(n.val()),o=I.parseDate(i.val())),r&&o)))||(c&&(u=n.attr(I.attr("timezone")),h=c.startTimezone,f=c.endTimezone,h=h||f,f=f||h,h&&(r=d(r,h,u),o=d(o,f,u))),r<=o)}function u(e,t,n,i){for(var r=e.length,o=[],a=0;a<r;a++)o=o.concat(e[a].expand(t,n,i));return o}function h(e){return delete e.name,delete e.prefix,delete e.remove,delete e.edit,delete e.add,delete e.navigate,e}function f(t,n){var i,r,o=(t.fields||t)[n],a=["url","email","number","date","boolean"],s=o?o.validation:{},l=I.attr("type"),d=e.inArray,c={};for(i in s)r=s[i],d(i,a)>=0?c[l]=i:I.isFunction(r)||(c[i]=$(r)?r.value||i:r),c[I.attr(i+"-msg")]=r.message;return c}function p(t,n){var i=f(n,t.field);return function(n){e(I.format('<select data-{0}bind="value:{1}">',I.ns,t.field)).appendTo(n).attr(i).kendoDropDownList({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource,valuePrimitive:t.valuePrimitive,optionLabel:"None",template:I.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField)})}}function m(t){var n=f(t.model,t.field);return function(t){e('<textarea name="description" class="k-textbox"/>').attr(n).appendTo(t)}}function g(t,n){var i=f(n,t.field);return function(n){e(I.format('<select data-{0}bind="value:{1}">',I.ns,t.field)).appendTo(n).attr(i).kendoMultiSelect({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource,valuePrimitive:t.valuePrimitive,itemTemplate:I.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField),tagTemplate:I.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField)})}}function v(t,n){var i=f(n,t.field);return function(n){var r,o,a="",s=t.dataSource.view();for(r=0,o=s.length;r<o;r++)a+=I.format('<option value="{0}">{1}</option>',I.getter(t.dataValueField)(s[r]),I.getter(t.dataTextField)(s[r]));e(I.format('<select data-{0}bind="value:{1}" multiple="multiple" data-{0}value-primitive="{3}">{2}</select>',I.ns,t.field,a,t.valuePrimitive)).appendTo(n).attr(i)}}function _(e,t){var n,i=e.end.getTime()-e.start.getTime(),r=new Date(e.start.getTime());return I.date.setTime(r,t),n=new Date(r.getTime()),I.date.setTime(n,i,!0),{start:r,end:n}}var b,k,w,y,x,C,T,S,D,E,F,R,I=window.kendo,A=I.date,M=I.support.input,z=A.MS_PER_DAY,H=A.getDate,N=I.date.getMilliseconds,P=I.recurrence,L=I.keys,B=I.ui,O=B.Widget,V=B.DataBoundWidget,W="string",U=B.Popup,q=B.Calendar,j=I.data.DataSource,$=e.isPlainObject,G=e.extend,Y=e.proxy,K=Object.prototype.toString,Q=e.isArray,X=".kendoScheduler",J="click",Z="change",ee="cancel",te="remove",ne="save",ie="add",re="edit",oe=/(?:value:start|value:end)(?:,|$)/,ae=H(new Date),se=",",le=/\;/g,de="recurrenceException",ce="Are you sure you want to delete this event?",ue="Do you want to delete only this event occurrence or the whole series?",he="Do you want to edit only this event occurrence or the whole series?",fe="Are you sure you want to delete this event occurrence?",pe="Are you sure you want to delete the whole series?",me='<a class="k-button #=className#" #=attr# href="\\#">#=text#</a>',ge=I.template('<li class="k-current-view" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}</a></li>'),ve=I.template('<div class="k-floatwrap k-header k-scheduler-toolbar"># if (pdf) { #<ul class="k-reset k-scheduler-tools"><li><a role="button" href="\\#" class="k-button k-pdf"><span class="k-icon k-i-pdf"></span>${messages.pdf}</a></li></ul># } #<ul class="k-reset k-scheduler-navigation"><li class="k-state-default k-header k-nav-today"><a role="button" href="\\#" class="k-link">${messages.today}</a></li><li class="k-state-default k-header k-nav-prev"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-w"></span></a></li><li class="k-state-default k-header k-nav-next"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-e"></span></a></li><li class="k-state-default k-nav-current"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-calendar"></span><span class="k-sm-date-format" data-#=ns#bind="text: formattedShortDate"></span><span class="k-lg-date-format" data-#=ns#bind="text: formattedDate"></span></a></li></ul>#if(viewsCount === 1){#<a role="button" data-#=ns#name="#=view#" href="\\#" class="k-link k-scheduler-refresh"><span class="k-icon k-i-refresh"></span></a>#}else{#<ul class="k-reset k-header k-scheduler-views">#for(var view in views){#<li class="k-state-default k-view-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}</a></li>#}#</ul>#}#</div>'),_e=I.template('<div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-scheduler-navigation"><li class="k-state-default k-nav-today"><a role="button" href="\\#" class="k-link">${messages.today}</a></li></ul>#if(viewsCount === 1){#<a role="button" data-#=ns#name="#=view#" href="\\#" class="k-link k-scheduler-refresh"><span class="k-icon k-i-refresh"></span></a>#}else{#<ul class="k-reset k-header k-scheduler-views">#for(var view in views){#<li class="k-state-default k-view-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}</a></li>#}#</ul>#}#</div><div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-scheduler-navigation"><li class="k-state-default k-nav-prev"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-w"></span></a></li><li class="k-state-default k-nav-current"><span class="k-sm-date-format" data-#=ns#bind="text: formattedShortDate"></span><span class="k-lg-date-format" data-#=ns#bind="text: formattedDate"></span></li><li class="k-state-default k-nav-next"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-e"></span></a></li></ul></div>'),be=function(t,n){var o={name:n.field},a=M.date?"":I.attr("role")+'="datepicker" ',s=I.attr("role")+'="datetimepicker" ',l=n.model.isAllDay,d=I.attr("validate")+"='"+!l+"'",c=I.attr("validate")+"='"+l+"'";i(o,n),r(o,n),e('<input type="datetime-local" required '+I.attr("type")+'="date" '+s+I.attr("bind")+'="value:'+n.field+',invisible:isAllDay" '+d+"/>").attr(o).appendTo(t),e('<input type="date" required '+I.attr("type")+'="date" '+a+I.attr("bind")+'="value:'+n.field+',visible:isAllDay" '+c+"/>").attr(o).appendTo(t),e("<span "+I.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},ke=function(t,n){var o={name:n.field},a=n.model.isAllDay,s=I.attr("validate")+"='"+!a+"' ",l=I.attr("validate")+"='"+a+"' ";i(o,n),r(o,n),e('<input type="text" required '+I.attr("type")+'="date" '+I.attr("role")+'="datetimepicker" '+I.attr("bind")+'="value:'+n.field+',invisible:isAllDay" '+s+"/>").attr(o).appendTo(t),e('<input type="text" required '+I.attr("type")+'="date" '+I.attr("role")+'="datepicker" '+I.attr("bind")+'="value:'+n.field+',visible:isAllDay" '+l+"/>").attr(o).appendTo(t),e("<span "+I.attr("bind")+'="text: '+n.field+'Timezone"></span>').appendTo(t),"end"===n.field&&e("<span "+I.attr("bind")+'="text: startTimezone, invisible: endTimezone"></span>').appendTo(t),e("<span "+I.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},we=function(t,n){e("<div "+I.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoRecurrenceEditor({start:n.model.start,timezone:n.timezone,messages:n.messages})},ye=function(t,n){e("<div "+I.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoMobileRecurrenceEditor({start:n.model.start,timezone:n.timezone,messages:n.messages,pane:n.pane,value:n.model[n.field]})},xe=function(t,i){var r=n(i.model,i.messages.noTimezone);e('<a href="#" class="k-button k-timezone-button" data-bind="invisible:isAllDay">'+r+"</a>").click(i.click).appendTo(t)},Ce=function(t,n){e('<a href="#" class="k-button" data-bind="invisible:isAllDay">'+n.messages.timezoneEditorButton+"</a>").click(n.click).appendTo(t)},Te=function(t,n){e("<div "+I.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).toggle(n.visible).appendTo(t).kendoMobileTimezoneEditor({optionLabel:n.noTimezone})},Se=function(n,i){var r=i.visible||i.visible===t;e("<div "+I.attr("bind")+'="value:'+i.field+'" />').attr({name:i.field}).toggle(r).appendTo(n).kendoTimezoneEditor({optionLabel:i.noTimezone})},De=I.Class.extend({init:function(t,n){var i=t.timezone;this.reader=n,n.model&&(this.model=n.model),this.timezone=i,this.data=o(e.proxy(this.data,this),i),this.serialize=a(e.proxy(this.serialize,this),i)},errors:function(e){return this.reader.errors(e)},parse:function(e){return this.reader.parse(e)},data:function(e){return this.reader.data(e)},total:function(e){return this.reader.total(e)},groups:function(e){return this.reader.groups(e)},aggregates:function(e){return this.reader.aggregates(e)},serialize:function(e){return this.reader.serialize(e)}}),Ee=I.data.Model.define({init:function(e){var t=this;I.data.Model.fn.init.call(t,e),t._defaultId=t.defaults[t.idField]},_time:function(e){var t=this[e],n="_"+e+"Time";return this[n]?this[n]-I.date.toUtcTime(I.date.getDate(t)):N(t)},_date:function(e){var t="_"+e+"Time";return this[t]?this[t]-this._time(e):I.date.getDate(this[e])},clone:function(t,n){var i=this.uid,r=new this.constructor(e.extend({},this.toJSON(),t));return n||(r.uid=i),r},duration:function(){var e=this.end,t=this.start,n=(e.getTimezoneOffset()-t.getTimezoneOffset())*I.date.MS_PER_MINUTE;return e-t-n},expand:function(e,t,n){return P?P.expand(this,e,t,n):[this]},update:function(e){for(var t in e)this.set(t,e[t]);this._startTime&&this.set("_startTime",I.date.toUtcTime(this.start)),this._endTime&&this.set("_endTime",I.date.toUtcTime(this.end))},isMultiDay:function(){return this.isAllDay||this.duration()>=I.date.MS_PER_DAY},isException:function(){return!this.isNew()&&this.recurrenceId},isOccurrence:function(){return this.isNew()&&this.recurrenceId},isRecurring:function(){return!(!this.recurrenceRule&&!this.recurrenceId)},isRecurrenceHead:function(){return!(!this.id||!this.recurrenceRule)},toOccurrence:function(t){return t=e.extend(t,{recurrenceException:null,recurrenceRule:null,recurrenceId:this.id||this.recurrenceId}),t[this.idField]=this.defaults[this.idField],this.clone(t,!0)},toJSON:function(){var e=I.data.Model.fn.toJSON.call(this);return e.uid=this.uid,delete e._startTime,delete e._endTime,e},shouldSerialize:function(e){return I.data.Model.fn.shouldSerialize.call(this,e)&&"_defaultId"!==e},set:function(e,t){var n,i,r,o=this.isAllDay||!1;I.data.Model.fn.set.call(this,e,t),"isAllDay"==e&&t!=o&&(n=I.date.getDate(this.start),i=new Date(this.end),r=I.date.getMilliseconds(i),0===r&&t&&(r=z),this.set("start",n),t===!0?(I.date.setTime(i,-r),i<n&&(i=n)):I.date.setTime(i,z-r),this.set("end",i))},id:"id",fields:{id:{type:"number"},title:{defaultValue:"",type:"string"},start:{type:"date",validation:{required:!0}},startTimezone:{type:"string"},end:{type:"date",validation:{required:!0,dateCompare:{value:c}}},endTimezone:{type:"string"},recurrenceRule:{defaultValue:"",type:"string"},recurrenceException:{defaultValue:"",type:"string"},isAllDay:{type:"boolean",defaultValue:!1},description:{type:"string"}}}),Fe=j.extend({init:function(e){j.fn.init.call(this,G(!0,{},{schema:{modelBase:Ee,model:Ee}},e)),this.reader=new De(this.options.schema,this.reader)},expand:function(e,t){var n=this.view(),i={};return e&&t&&(t=new Date(t.getTime()+z-1),i={logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:e},{field:"end",operator:"gte",value:e},{field:"start",operator:"lte",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:new Date(e.getTime()+z-1)},{field:"end",operator:"gte",value:e}]}]},n=new I.data.Query(u(n,e,t,this.reader.timezone)).filter(i).toArray()),n},cancelChanges:function(e){e&&e.isOccurrence()&&this._removeExceptionDate(e),j.fn.cancelChanges.call(this,e)},insert:function(e,t){if(t){if(!(t instanceof Ee)){var n=t;t=this._createNewModel(),t.accept(n)}return(!this._pushCreated&&t.isRecurrenceHead()||t.recurrenceId)&&(t=t.recurrenceId?t:t.toOccurrence(),this._addExceptionDate(t)),j.fn.insert.call(this,e,t)}},pushCreate:function(e){this._pushCreated=!0,j.fn.pushCreate.call(this,e),this._pushCreated=!1},remove:function(e){return e.isRecurrenceHead()?this._removeExceptions(e):e.isRecurring()&&this._addExceptionDate(e),j.fn.remove.call(this,e)},_removeExceptions:function(e){for(var t=this.data().slice(0),n=t.shift(),i=e.id;n;)n.recurrenceId===i&&j.fn.remove.call(this,n),n=t.shift();e.set(de,"")},_removeExceptionDate:function(e){var t,n,i,r;e.recurrenceId&&(t=this.get(e.recurrenceId),t&&(n=e.start,i=RegExp("(\\"+se+"?)"+P.toExceptionString(n,this.reader.timezone)),r=(t.recurrenceException||"").replace(le,se).replace(/\,$/,""),t.set(de,r.replace(i,""))))},_addExceptionDate:function(e){var t,n=e.start,i=this.reader.timezone,r=this.get(e.recurrenceId),o=(r.recurrenceException||"").replace(le,se).replace(/\,$/,"");P.isException(o,n,i)||(t=P.toExceptionString(n,i),r.set(de,o+(o&&t?se:"")+t))}});Fe.create=function(e){(Q(e)||e instanceof I.data.ObservableArray)&&(e={data:e});var t=e||{},n=t.data;if(t.data=n,!(t instanceof Fe)&&t instanceof I.data.DataSource)throw Error("Incorrect DataSource type. Only SchedulerDataSource instances are supported");return t instanceof Fe?t:new Fe(t)},G(!0,I.data,{SchedulerDataSource:Fe,SchedulerDataReader:De,SchedulerEvent:Ee}),b={update:{text:"Save",className:"k-primary k-scheduler-update"},canceledit:{text:"Cancel",className:"k-scheduler-cancel"},destroy:{text:"Delete",imageClass:"k-i-delete",className:"k-primary k-scheduler-delete",iconClass:"k-icon"}},k={mobile:{dateRange:be,timezonePopUp:xe,timezone:Te,recurrence:ye,description:m,multipleResources:v,resources:p},desktop:{dateRange:ke,timezonePopUp:Ce,timezone:Se,recurrence:we,description:m,multipleResources:g,resources:p}},w=I.Observable.extend({init:function(e,t){I.Observable.fn.init.call(this),this.element=e,this.options=G(!0,{},this.options,t),this.createButton=this.options.createButton,this.toggleDateValidationHandler=Y(this._toggleDateValidation,this)},_toggleDateValidation:function(t){if("isAllDay"==t.field){var n,i,r,o=this.container,a=this.editable.options.model.isAllDay,s=I.attr("bind");o.find("["+s+"*=end],["+s+"*=start]").each(function(){n=e(this),oe.test(n.attr(s))&&(i=n.is("["+I.attr("role")+"=datetimepicker],[type*=datetime]"),r=a!==i,n.attr(I.attr("validate"),r))})}},fields:function(e,t){var n,i,r=this,o=r.options.messages,a=r.options.timezone,s=function(e){e.preventDefault(),r._initTimezoneEditor(t,this)},l=[{field:"title",title:o.editor.title},{field:"start",title:o.editor.start,editor:e.dateRange,timezone:a},{field:"end",title:o.editor.end,editor:e.dateRange,timezone:a},{field:"isAllDay",title:o.editor.allDayEvent}];I.timezone.windows_zones&&(l.push({field:"timezone",title:o.editor.timezone,editor:e.timezonePopUp,click:s,messages:o.editor,model:t}),l.push({field:"startTimezone",title:o.editor.startTimezone,editor:e.timezone,noTimezone:o.editor.noTimezone}),l.push({field:"endTimezone",title:o.editor.endTimezone,editor:e.timezone,noTimezone:o.editor.noTimezone})),t.recurrenceId||l.push({field:"recurrenceRule",title:o.editor.repeat,editor:e.recurrence,timezone:a,messages:o.recurrenceEditor,pane:this.pane}),"description"in t&&l.push({field:"description",title:o.editor.description,editor:e.description({model:t,field:"description"})});for(n=0;n<this.options.resources.length;n++)i=this.options.resources[n],l.push({field:i.field,title:i.title,editor:i.multiple?e.multipleResources(i,t):e.resources(i,t)});return l},end:function(){return this.editable.end()},_buildEditTemplate:function(e,t,n){var i,r,o,a,s=this.options.messages,l=G({},I.Template,this.options.templateSettings),d=l.paramName,c=this.options.editable.template,u="";if(c)typeof c===W&&(c=window.unescape(c)),u+=I.template(c,l)(e);else for(i=0,r=t.length;i<r;i++)o=t[i],"startTimezone"===o.field&&(u+='<div class="k-popup-edit-form k-scheduler-edit-form k-scheduler-timezones" style="display:none">',u+='<div class="k-edit-form-container">',u+='<div class="k-edit-label"></div>',u+='<div class="k-edit-field"><label class="k-check"><input class="k-timezone-toggle" type="checkbox" />'+s.editor.separateTimezones+"</label></div>"),u+='<div class="k-edit-label"><label for="'+o.field+'">'+(o.title||o.field||"")+"</label></div>",!e.editable||e.editable(o.field)?(n.push(o),u+="<div "+I.attr("container-for")+'="'+o.field+'" class="k-edit-field"></div>'):(a="#:",o.field?(o=I.expr(o.field,d),a+=o+"==null?'':"+o):a+="''",a+="#",a=I.template(a,l),u+='<div class="k-edit-field">'+a(e)+"</div>"),"endTimezone"===o.field&&(u+=this._createEndTimezoneButton());return u},_createEndTimezoneButton:function(){return"</div></div>"},_revertTimezones:function(e){e.set("startTimezone",this._startTimezone),e.set("endTimezone",this._endTimezone),delete this._startTimezone,delete this._endTimezone}}),y=w.extend({init:function(){w.fn.init.apply(this,arguments),this.pane=I.mobile.ui.Pane.wrap(this.element),this.pane.element.parent().css("height",this.options.height),this.view=this.pane.view(),this._actionSheetButtonTemplate=I.template('<li><a #=attr# class="k-button #=className#" href="\\#">#:text#</a></li>'),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"}},options:{animations:{left:"slide",right:"slide:right"}},destroy:function(){this.close(),this.unbind(),this.pane.destroy()},_initTimezoneEditor:function(t){var i,r=this,o=r.pane,a=r.options.messages,s=r.timezoneView,l=r.container.find(".k-scheduler-timezones"),d=l.find(".k-timezone-toggle"),c=l.find(".k-edit-label:last").add(l.find(".k-edit-field:last")),u=function(e){if("startTimezone"===e.field){var n=t.startTimezone;d.prop("disabled",!n),n||(c.hide(),t.set("endTimezone",""),d.prop("checked",!1))}};r._startTimezone=t.startTimezone||"",r._endTimezone=t.endTimezone||"",s||(i='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+a.cancel+"</a>"+a.editor.timezoneTitle+'<a href="#" class="k-button k-scheduler-update">'+a.save+"</a></div></div>",this.timezoneView=s=o.append(i),s.contentElement().append(l.show()),s.element.on(J+X,".k-scheduler-cancel, .k-scheduler-update",function(i){var s,l;i.preventDefault(),i.stopPropagation(),e(this).hasClass("k-scheduler-cancel")&&r._revertTimezones(t),t.unbind("change",u),s=o.element.find("#edit").data("kendoMobileView"),l=n(t,a.editor.noTimezone),s.contentElement().find(".k-timezone-button").text(l),o.navigate(s,r.options.animations.right)}),d.click(function(){c.toggle(d.prop("checked")),t.set("endTimezone","")}),t.bind("change",u)),d.prop("checked",t.endTimezone).prop("disabled",!t.startTimezone),t.endTimezone?c.show():c.hide(),o.navigate(s,r.options.animations.left)},_createActionSheetButton:function(e){return e.template=this._actionSheetButtonTemplate,this.createButton(e)},showDialog:function(t){var n,i,r="",o='<ul><li class="km-actionsheet-title">'+t.title+"</li>",a=this.element.find(".k-event["+I.attr("uid")+"='"+t.model.uid+"']");for(this.container&&(a=this.container.find(".k-scheduler-delete"),a[0]&&(r="phone")),n=0;n<t.buttons.length;n++)o+=this._createActionSheetButton(t.buttons[n]);o+="</ul>",i=e(o).appendTo(this.pane.view().element).kendoMobileActionSheet({type:r,cancel:this.options.messages.cancel,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',
close:function(){this.destroy()},command:function(n){var r=i.element.find("li:not(.km-actionsheet-cancel) > .k-button").index(e(n.currentTarget));r>-1&&(i.close(),t.buttons[r].click())},popup:this._actionSheetPopupOptions}).data("kendoMobileActionSheet"),i.open(a)},editEvent:function(t){var n,i,r,o,a,s=this.pane,l="",d=this.options.messages,c=d.save,u=d.destroy,h=d.cancel,f=d.editor.editorTitle;return l+='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list" id="edit" '+I.attr("uid")+'="'+t.uid+'"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+h+"</a>"+f+'<a href="#" class="k-button k-scheduler-update">'+c+"</a></div>",n=this.fields(k.mobile,t),i=this,r=[],l+=this._buildEditTemplate(t,n,r),!t.isNew()&&this.options.editable&&this.options.editable.destroy!==!1&&(l+='<div class="k-edit-buttons"><a href="#" class="k-scheduler-delete k-button">'+u+"</a></div>"),l+="</div>",o=s.append(l),a=this.container=o.element,this.editable=a.kendoEditable({fields:r,model:t,clearContainer:!1,target:i.options.target,validateOnBlur:!0}).data("kendoEditable"),a.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),this.trigger("edit",{container:a,model:t})?this.trigger("cancel",{container:a,model:t}):(a.on(J+X,"a.k-scheduler-edit, a.k-scheduler-cancel, a.k-scheduler-update, a.k-scheduler-delete",function(n){var r,o;n.preventDefault(),n.stopPropagation(),r=e(this),r.hasClass("k-scheduler-edit")?s.navigate("#edit",i.options.animations.right):(o="cancel",r.hasClass("k-scheduler-update")?o="save":r.hasClass("k-scheduler-delete")&&(o="remove"),i.trigger(o,{container:a,model:t}))}),s.navigate(o,i.options.animations.left),t.bind("change",i.toggleDateValidationHandler)),this.editable},_views:function(){return this.pane.element.find(I.roleSelector("view")).not(this.view.element)},close:function(){var e,t,n,i;if(this.container){for(this.pane.navigate("",this.options.animations.right),e=this._views(),n=0,i=e.length;n<i;n++)t=e.eq(n).data("kendoMobileView"),t&&t.purge();e.remove(),this.container=null,this.editable&&(this.editable.options.model.unbind("change",this.toggleDateValidationHandler),this.editable.destroy(),this.editable=null),this.timezoneView=null}}}),x=w.extend({destroy:function(){this.close(),this.unbind()},editEvent:function(t){var n,i,r,o=this,a=o.options.editable,s="<div "+I.attr("uid")+'="'+t.uid+'" class="k-popup-edit-form k-scheduler-edit-form"><div class="k-edit-form-container">',l=o.options.messages,d=l.save,c=l.cancel,u=l.destroy,h=this.fields(k.desktop,t),f=[];return s+=this._buildEditTemplate(t,h,f),i=$(a)?a.window:{},s+='<div class="k-edit-buttons k-state-default">',s+=this.createButton({name:"update",text:d,attr:n})+this.createButton({name:"canceledit",text:c,attr:n}),t.isNew()||a.destroy===!1||(s+=this.createButton({name:"delete",text:u,attr:n})),s+="</div></div></div>",r=this.container=e(s).appendTo(o.element).eq(0).kendoWindow(G({modal:!0,resizable:!1,draggable:!0,title:l.editor.editorTitle,visible:!1,close:function(e){e.userTriggered&&o.trigger(ee,{container:r,model:t})&&e.preventDefault()}},i)),o.editable=r.kendoEditable({fields:f,model:t,clearContainer:!1,validateOnBlur:!0,target:o.options.target}).data("kendoEditable"),o.trigger(re,{container:r,model:t})?o.trigger(ee,{container:r,model:t}):(r.data("kendoWindow").center().open(),r.on(J+X,"a.k-scheduler-cancel",function(e){e.preventDefault(),e.stopPropagation(),o.trigger(ee,{container:r,model:t})}),r.on(J+X,"a.k-scheduler-update",function(e){e.preventDefault(),e.stopPropagation(),o.trigger("save",{container:r,model:t})}),r.on(J+X,"a.k-scheduler-delete",function(e){e.preventDefault(),e.stopPropagation(),o.trigger(te,{container:r,model:t})}),I.cycleForm(r),t.bind("change",o.toggleDateValidationHandler)),o.editable},close:function(){var e=this,t=function(){e.editable&&(e.editable.options.model.unbind("change",e.toggleDateValidationHandler),e.editable.destroy(),e.editable=null,e.container=null),e.popup&&(e.popup.destroy(),e.popup=null)};e.editable?(e._timezonePopup&&e._timezonePopup.data("kendoWindow")&&(e._timezonePopup.data("kendoWindow").destroy(),e._timezonePopup=null),e.container.is(":visible")?e.container.data("kendoWindow").bind("deactivate",t).close():t()):t()},_createEndTimezoneButton:function(){var e=this.options.messages,t="";return t+='<div class="k-edit-buttons k-state-default">',t+=this.createButton({name:"savetimezone",text:e.save})+this.createButton({name:"canceltimezone",text:e.cancel}),t+="</div></div></div>"},showDialog:function(t){var n,i,r,o=I.format("<div class='k-popup-edit-form'><div class='k-edit-form-container'><p class='k-popup-message'>{0}</p>",t.text);for(o+='<div class="k-edit-buttons k-state-default">',n=0;n<t.buttons.length;n++)o+=this.createButton(t.buttons[n]);o+="</div></div></div>",i=this.element,this.popup&&this.popup.destroy(),r=this.popup=e(o).appendTo(i).eq(0).on("click",".k-button",function(n){n.preventDefault(),r.close();var i=e(n.currentTarget).index();t.buttons[i].click()}).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,close:function(){this.destroy(),i.focus()}}).getKendoWindow(),r.center().open()},_initTimezoneEditor:function(e,t){var n,i=this,r=i.container.find(".k-scheduler-timezones"),o=r.find(".k-timezone-toggle"),a=r.find(".k-edit-label:last").add(r.find(".k-edit-field:last")),s=r.find(".k-scheduler-savetimezone"),l=r.find(".k-scheduler-canceltimezone"),d=i._timezonePopup,c=function(t){if("startTimezone"===t.field){var n=e.startTimezone;o.prop("disabled",!n),n||(a.hide(),e.set("endTimezone",""),o.prop("checked",!1))}};i._startTimezone=e.startTimezone,i._endTimezone=e.endTimezone,d||(i._timezonePopup=d=r.kendoWindow({modal:!0,resizable:!1,draggable:!0,title:i.options.messages.editor.timezoneEditorTitle,visible:!1,close:function(n){e.unbind("change",c),n.userTriggered&&i._revertTimezones(e),t&&t.focus()}}),o.click(function(){a.toggle(o.prop("checked")),e.set("endTimezone","")}),s.click(function(e){e.preventDefault(),n.close()}),l.click(function(t){t.preventDefault(),i._revertTimezones(e),n.close()}),e.bind("change",c)),o.prop("checked",e.endTimezone).prop("disabled",!e.startTimezone),e.endTimezone?a.show():a.hide(),n=d.data("kendoWindow"),n.center().open()}}),C=V.extend({init:function(t,n){var i=this;O.fn.init.call(i,t,n),i.options.views&&i.options.views.length||(i.options.views=["day","week"]),i.resources=[],i._initModel(),i._wrapper(),i._views(),i._toolbar(),i._dataSource(),i._resources(),i._resizeHandler=function(){i.resize()},i.wrapper.on("mousedown"+X+" selectstart"+X,function(t){e(t.target).is(":kendoFocusable")||t.preventDefault()}),i.options.editable&&i.options.editable.resize!==!1&&i._resizable(),i._movable(),i._bindResize(),i.options.messages&&i.options.messages.recurrence&&(P.options=i.options.messages.recurrence),i._selectable(),i._ariaId=I.guid(),i._createEditor()},_bindResize:function(){e(window).on("resize"+X,this._resizeHandler)},_unbindResize:function(){e(window).off("resize"+X,this._resizeHandler)},dataItems:function(){var n,i,r,o,a,s=this,l=s.items(),d=s._data,c=e.map(l,function(t){return e(t).attr("data-uid")}),u={},h=c.length;for(n=0;n<h;n++)u[c[n]]=null;for(r=d.length,n=0;n<r;n++)o=d[n],u[o.uid]!==t&&(u[o.uid]=o);a=[];for(i in u)a.push(u[i]);return a},_isMobile:function(){var e=this.options;return e.mobile===!0&&I.support.mobileOS||"phone"===e.mobile||"tablet"===e.mobile},_isMobilePhoneView:function(){var e=this.options;return e.mobile===!0&&I.support.mobileOS&&!I.support.mobileOS.tablet||"phone"===e.mobile},_groupsByResource:function(e,t,n,i,r){var o,a,s,l,d,c,u;if(n||(n=[]),o=e[0]){for(s=o.dataSource.view(),l=0,d=0;d<s.length;d++)c=I.getter(o.dataValueField)(s[d]),u=t+l+d,a=this._groupsByResource(e.slice(1),u,n,c,o.field),a[o.field]=c,l=a.groupIndex,r&&i&&(a[r]=i),1===e.length&&(a.groupIndex=t+d,n.push(a));return a}return{}},data:function(){return this._data},select:function(n){var i,r,o,a,s,l,d,c,u,h,f=this,p=f.view(),m=f._selection,g=p.groups;if(n===t)return o=p._selectedSlots,m?(m&&m.events&&(r=f._selectedEvents()),{start:m.start,end:m.end,events:r,slots:o,resources:p._resourceBySlot(m)}):[];if(!n)return f._selection=null,f._old=null,p.clearSelection(),t;if(e.isArray(n)&&(n={events:n.splice(0)}),n.resources){s=[],l=[],p.groupedResources&&f._groupsByResource(p.groupedResources,0,l);for(a in n.resources)s.push({field:a,operator:"eq",value:n.resources[a]});i=new I.data.Query(l).filter(s).toArray()}return n.events&&n.events.length?(f._selectEvents(n.events,i),f._select(),t):(g&&n.start&&n.end&&(d=H(p._startDate),c=I.date.addDays(H(p._endDate),1),n.start<c&&d<=n.end&&(u=i&&i.length?g[i[0].groupIndex]:g[0],h=u.ranges(n.start,n.end,n.isAllDay,!1),h.length&&(f._selection={start:I.timezone.toLocalDate(h[0].start.start),end:I.timezone.toLocalDate(h[h.length-1].end.end),groupIndex:h[0].start.groupIndex,index:h[0].start.index,isAllDay:h[0].start.isDaySlot,events:[]},f._select()))),t)},_selectEvents:function(e,t){var n,i,r,o,a,s,l,d,c=this,u=c.view(),h=u.groups,f=e.length,p=t&&t.length;for(n=0;n<f;n++)if(h&&p){for(i=h[t[0].groupIndex],r=[],o=i.timeSlotCollectionCount(),a=i.daySlotCollectionCount(),s=0;s<o;s++)r=r.concat(i.getTimeSlotCollection(s).events());for(l=0;l<a;l++)r=r.concat(i.getDaySlotCollection(l).events());r=new I.data.Query(r).filter({field:"element[0].getAttribute('data-uid')",operator:"eq",value:e[n]}).toArray(),r[0]&&c._createSelection(r[0].element)}else d=u.element.find(I.format(".k-event[data-uid={0}], .k-task[data-uid={0}]",e[n])),d.length&&c._createSelection(d[0])},_selectable:function(){var t,n=this,i=n.wrapper,r=I.support.mobileOS?"touchend":"mousedown";n.options.selectable&&(n._tabindex(),i.on(r+X,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",function(e){var t=e.which,r=e.button,o=I.support.browser,a=t&&3===t||r&&2==r;I.support.mobileOS&&e.isDefaultPrevented()||(a||n._createSelection(e.currentTarget),i.focus(),o.msie&&o.version<9&&setTimeout(function(){i.focus()}))}),t=e.proxy(n._mouseMove,n),i.on("mousedown"+X,".k-scheduler-header-all-day td, .k-scheduler-content td",function(e){var n=e.which,r=e.button,o=n&&3===n||r&&2==r;o||i.on("mousemove"+X,".k-scheduler-header-all-day td, .k-scheduler-content td",t)}),i.on("mouseup"+X+" mouseleave"+X,function(){i.off("mousemove"+X,".k-scheduler-header-all-day td, .k-scheduler-content td",t)}),i.on("focus"+X,function(){n._selection||n._selectFirstSlot(),n._select()}),i.on("focusout"+X,function(){n._ctrlKey=n._shiftKey=!1}),i.on("keydown"+X,Y(n._keydown,n)),i.on("keyup"+X,function(e){n._ctrlKey=e.ctrlKey,n._shiftKey=e.shiftKey}))},_selectFirstSlot:function(){this._createSelection(this.wrapper.find(".k-scheduler-content").find("td:first"))},_select:function(){var t,n,i,r,o,a=this,s=a.view(),l=a.wrapper,d=s.current(),c=a._selection;if(c&&(d&&(d.removeAttribute("id"),d.removeAttribute("aria-label"),l.removeAttr("aria-activedescendant")),s.select(c),d=s.current(),d&&a._old!==d)){if(t=e(d).data("uid"),a._old&&t&&t===e(a._old).data("uid"))return;i=c,r=a._selectedEvents(),o=s._selectedSlots,r[0]?(i=r[0]||c,n=I.format(a.options.messages.ariaEventLabel,i.title,i.start,i.start)):n=I.format(a.options.messages.ariaSlotLabel,i.start,i.end),d.setAttribute("id",a._ariaId),d.setAttribute("aria-label",n),l.attr("aria-activedescendant",a._ariaId),a._old=d,a.trigger("change",{start:c.start,end:c.end,events:r,slots:o,resources:s._resourceBySlot(c)})}},_selectedEvents:function(){for(var e,t=this._selection.events,n=t.length,i=0,r=[];i<n;i++)e=this.occurrenceByUid(t[i]),e&&r.push(e);return r},_mouseMove:function(t){var n=this;clearTimeout(n._moveTimer),n._moveTimer=setTimeout(function(){var i,r,o,a=n.view(),s=n._selection;s&&(i=a.selectionByElement(e(t.currentTarget)),i&&s.groupIndex===i.groupIndex&&(r=i.startDate(),o=i.endDate(),r>=s.end?s.backward=!1:o<=s.start&&(s.backward=!0),s.backward?s.start=r:s.end=o,n._select()))},5)},_viewByIndex:function(e){var t,n=this.views;for(t in n){if(!e)return t;e--}},_keydown:function(n){var i=this,r=n.keyCode,o=i.view(),a=o.options.editable,s=i._selection,l=n.shiftKey;return i._ctrlKey=n.ctrlKey,i._shiftKey=n.shiftKey,s?(r===L.TAB?o.moveToEvent(s,l)&&(i._select(),n.preventDefault()):a&&r===L.ENTER?s.events.length?a.update!==!1&&i.editEvent(s.events[0]):a.create!==!1&&(s.isAllDay&&(s=e.extend({},s,{end:I.date.addDays(s.end,-1)})),i.addEvent(G({},s,o._resourceBySlot(s)))):r===L.DELETE&&a!==!1&&a.destroy!==!1?i.removeEvent(s.events[0]):r>=49&&r<=57?i.view(i._viewByIndex(r-49)):o.move(s,r,l)&&(o.inRange(s)?i._select():i.date(s.start),n.preventDefault()),i._adjustSelectedDate(),t):(i._selectFirstSlot(),i._select(),t)},_createSelection:function(t){var n,i,r;this._selection&&(this._ctrlKey||this._shiftKey)||(this._selection={events:[],groupIndex:0}),t=e(t),r=this._selection,t.is(".k-event")&&(n=t.attr(I.attr("uid"))),i=this.view().selectionByElement(t),i&&(r.groupIndex=i.groupIndex||0),n&&(i=l(this._data,n)),i&&i.uid&&(n=[i.uid]),this._updateSelection(i,n),this._adjustSelectedDate()},_updateSelection:function(e,n,i){var r,o,a=this._selection;e&&a&&(r=this.view(),e.uid&&(e=r._updateEventForSelection(e)),this._shiftKey&&a.start&&a.end?(o=e.end<a.end,a.end=e.endDate?e.endDate():e.end,o&&r._timeSlotInterval&&I.date.setTime(a.end,-r._timeSlotInterval())):(a.start=e.startDate?e.startDate():e.start,a.end=e.endDate?e.endDate():e.end),a.isAllDay="isDaySlot"in e?e.isDaySlot:e.isAllDay,null!==i&&i!==t&&(a.groupIndex=i),a.index=e.index,a.events=this._ctrlKey?a.events.concat(n||[]):n||[])},options:{name:"Scheduler",date:ae,editable:!0,autoBind:!0,snap:!0,mobile:!1,timezone:"",allDaySlot:!0,min:new Date(1900,0,1),max:new Date(2099,11,31),toolbar:null,footer:{},messages:{today:"Today",pdf:"Export to PDF",save:"Save",cancel:"Cancel",destroy:"Delete",deleteWindowTitle:"Delete event",ariaSlotLabel:"Selected from {0:t} to {1:t}",ariaEventLabel:"{0} on {1:D} at {2:t}",views:{day:"Day",week:"Week",workWeek:"Work Week",agenda:"Agenda",month:"Month",timeline:"Timeline",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month"},recurrenceMessages:{deleteWindowTitle:"Delete Recurring Item",deleteWindowOccurrence:"Delete current occurrence",deleteWindowSeries:"Delete the series",editWindowTitle:"Edit Recurring Item",editWindowOccurrence:"Edit current occurrence",editWindowSeries:"Edit the series"},editable:{confirmation:ce},editor:{title:"Title",start:"Start",end:"End",allDayEvent:"All day event",description:"Description",repeat:"Repeat",timezone:" ",startTimezone:"Start timezone",endTimezone:"End timezone",separateTimezones:"Use separate start and end time zones",timezoneEditorTitle:"Timezones",timezoneEditorButton:"Time zone",timezoneTitle:"Time zones",noTimezone:"No timezone",editorTitle:"Event"}},height:null,width:null,resources:[],group:{resources:[],orientation:"horizontal"},views:[],selectable:!1},events:[te,re,ee,ne,"add","dataBinding","dataBound","moveStart","move","moveEnd","resizeStart","resize","resizeEnd","navigate","change"],destroy:function(){var t,n=this;O.fn.destroy.call(n),n.dataSource&&(n.dataSource.unbind(Z,n._refreshHandler),n.dataSource.unbind("progress",n._progressHandler),n.dataSource.unbind("error",n._errorHandler)),n.calendar&&(n.calendar.destroy(),n.popup.destroy()),n.view()&&n.view().destroy(),n._editor&&n._editor.destroy(),this._moveDraggable&&this._moveDraggable.destroy(),this._resizeDraggable&&this._resizeDraggable.destroy(),t=n.element.add(n.wrapper).add(n.toolbar).add(n.popup),t.off(X),clearTimeout(n._moveTimer),n._model=null,n.toolbar=null,n.element=null,e(window).off("resize"+X,n._resizeHandler),I.destroy(n.wrapper)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},items:function(){var e=this.wrapper.find(".k-scheduler-content"),t=this.view();return t&&"agenda"===t.options.name?e.find(".k-task"):e.find(".k-event").add(this.wrapper.find(".k-scheduler-header-wrap").find(".k-scheduler-header-all-day").siblings())},_movable:function(){var n,i,r,o,a,s,l,d=this,c=0,u=d._isMobile(),h=d.options.editable&&d.options.editable.move!==!1,f=d.options.editable&&d.options.editable.resize!==!1;(h||f&&u)&&(u&&I.support.mobileOS.android&&(c=5),d._moveDraggable=new I.ui.Draggable(d.element,{distance:c,filter:".k-event",ignore:".k-resize-handle",holdToDrag:u,autoScroll:!0}),h&&d._moveDraggable.bind("dragstart",function(e){var o=d.view(),c=e.currentTarget;return o.options.editable&&o.options.editable.move!==!1?u&&!c.hasClass("k-event-active")?(d.element.find(".k-event-active").removeClass("k-event-active"),e.preventDefault(),t):(a=d.occurrenceByUid(c.attr(I.attr("uid"))),s=a.clone(),s.update(o._eventOptionsForMove(s)),n=o._slotByPosition(e.x.startLocation,e.y.startLocation),r=n.startOffset(e.x.startLocation,e.y.startLocation,d.options.snap),i=n,l=n,n&&!d.trigger("moveStart",{event:a})||e.preventDefault(),t):(e.preventDefault(),t)}).bind("drag",function(e){var t,l,c=d.view(),u=c._slotByPosition(e.x.location,e.y.location);u&&(o=u.startOffset(e.x.location,e.y.location,d.options.snap),u.isDaySlot!==n.isDaySlot?(n=c._slotByPosition(e.x.location,e.y.location),r=n.startOffset(e.x.location,e.y.location,d.options.snap),t=o-r,s.isAllDay=u.isDaySlot,s.start=I.timezone.toLocalDate(r),s.end=I.timezone.toLocalDate(o),c._updateMoveHint(s,u.groupIndex,t),l={start:s.start,end:s.end}):(t=o-r,c._updateMoveHint(s,u.groupIndex,t),l=_(s,t)),d.trigger("move",{event:a,slot:{element:u.element,start:u.startDate(),end:u.endDate(),isDaySlot:u.isDaySlot},resources:c._resourceBySlot(u),start:l.start,end:l.end})?c._updateMoveHint(s,u.groupIndex,t):i=u)}).bind("dragend",function(t){var c,u,h,f,p,m,g,v,b;d.view()._removeMoveHint(),c=o-r,u=_(s,c),h=u.start,f=u.end,p=d.view()._resourceBySlot(i),m=d.view()._resourceBySlot(n),g=d.trigger("moveEnd",{event:a,slot:{element:i.element,start:i.startDate(),end:i.endDate()},start:h,end:f,resources:p}),g||a.start.getTime()===h.getTime()&&a.end.getTime()===f.getTime()&&l.isDaySlot===i.isDaySlot&&I.stringify(p)===I.stringify(m)||(v=d.view()._eventOptionsForMove(a),b=l.isDaySlot!==i.isDaySlot?i.isDaySlot?e.extend({start:i.startDate(),end:i.startDate(),isAllDay:i.isDaySlot},v,p):e.extend({isAllDay:i.isDaySlot,start:h,end:f},v,p):e.extend({isAllDay:a.isAllDay,start:h,end:f},v,p),d._updateEvent(null,a,b,i.groupIndex)),t.currentTarget.removeClass("k-event-active"),this.cancelHold()}).bind("dragcancel",function(){d.view()._removeMoveHint(),this.cancelHold()}),u&&(d._moveDraggable.bind("hold",function(e){d.element.find(".k-scheduler-monthview").length&&e.preventDefault(),d.element.find(".k-event-active").removeClass("k-event-active"),e.currentTarget.addClass("k-event-active")}),I.support.mobileOS.android||d._moveDraggable.userEvents.bind("press",function(e){e.preventDefault()})))},_resizable:function(){function t(e){var t,n={"k-resize-e":"east","k-resize-w":"west","k-resize-n":"north","k-resize-s":"south"};for(t in n)if(e.hasClass(t))return n[t]}var n,i,r,o,a,s=this,l=0;s._isMobile()&&I.support.mobileOS.android&&(l=5),s._resizeDraggable=new I.ui.Draggable(s.element,{distance:l,filter:".k-resize-handle",autoScroll:!0,dragstart:function(t){var l=e(t.currentTarget),d=l.closest(".k-event"),c=d.attr(I.attr("uid")),u=s.view();r=s.occurrenceByUid(c),o=r.clone(),u._updateEventForResize(o),a=u._slotByPosition(t.x.startLocation,t.y.startLocation),s.trigger("resizeStart",{event:r})&&t.preventDefault(),n=I.date.toUtcTime(o.start),i=I.date.toUtcTime(o.end)},drag:function(l){var d,c,u,h,f,p;a&&(d=e(l.currentTarget),c=t(d),u=s.view(),h=u._slotByPosition(l.x.location,l.y.location),h&&a.groupIndex==h.groupIndex&&(a=h,f=n,p=i,"south"==c?!a.isDaySlot&&a.end-I.date.toUtcTime(o.start)>=u._timeSlotInterval()&&(i=o.isAllDay?a.startOffset(l.x.location,l.y.location,s.options.snap):a.endOffset(l.x.location,l.y.location,s.options.snap)):"north"==c?!a.isDaySlot&&I.date.toUtcTime(o.end)-a.start>=u._timeSlotInterval()&&(n=a.startOffset(l.x.location,l.y.location,s.options.snap)):"east"==c?a.isDaySlot&&I.date.toUtcTime(I.date.getDate(a.endDate()))>=I.date.toUtcTime(I.date.getDate(o.start))?i=o.isAllDay?a.startOffset(l.x.location,l.y.location,s.options.snap):a.endOffset(l.x.location,l.y.location,s.options.snap):!a.isDaySlot&&a.end-I.date.toUtcTime(o.start)>=u._timeSlotInterval()&&(i=a.endOffset(l.x.location,l.y.location,s.options.snap)):"west"==c&&(a.isDaySlot&&I.date.toUtcTime(I.date.getDate(o.end))>=I.date.toUtcTime(I.date.getDate(a.startDate()))?n=a.startOffset(l.x.location,l.y.location,s.options.snap):!a.isDaySlot&&I.date.toUtcTime(o.end)-a.start>=u._timeSlotInterval()&&(n=a.startOffset(l.x.location,l.y.location,s.options.snap))),s.trigger("resize",{event:r,slot:{element:a.element,start:a.startDate(),end:a.endDate()},start:I.timezone.toLocalDate(n),end:I.timezone.toLocalDate(i),resources:u._resourceBySlot(a)})?(n=f,i=p):u._updateResizeHint(o,a.groupIndex,n,i)))},dragend:function(l){var d,c=e(l.currentTarget),u=new Date(o.start.getTime()),h=new Date(o.end.getTime()),f=t(c);s.view()._removeResizeHint(),"south"==f?h=I.timezone.toLocalDate(i):"north"==f?u=I.timezone.toLocalDate(n):"east"==f?h=a.isDaySlot?I.date.getDate(I.timezone.toLocalDate(i)):I.timezone.toLocalDate(i):"west"==f&&(a.isDaySlot?(u=new Date(I.timezone.toLocalDate(n)),u.setHours(0),u.setMinutes(0)):u=I.timezone.toLocalDate(n)),d=s.trigger("resizeEnd",{event:r,slot:{element:a.element,start:a.startDate(),end:a.endDate()},start:u,end:h,resources:s.view()._resourceBySlot(a)}),!d&&h.getTime()>=u.getTime()&&(o.start.getTime()==u.getTime()&&o.end.getTime()==h.getTime()||(s.view()._updateEventForResize(r),s._updateEvent(f,r,{start:u,end:h}))),a=null,r=null},dragcancel:function(){s.view()._removeResizeHint(),a=null,r=null}})},_updateEvent:function(e,t,n,i){var r,o=this,a=function(e,t){try{o._preventRefresh=!0,e.update(n),o._convertDates(e)}finally{o._preventRefresh=!1}o.trigger(ne,{event:e})||(t&&t(),o._updateSelection(e,[e.uid],i),o.dataSource.sync())},s=function(e){return e.recurrenceRule?o.dataSource.getByUid(e.uid):o.dataSource.get(e.recurrenceId)},l=function(){var i,r,l=s(t);"south"!=e&&"north"!=e||(n.start&&(i=I.date.getDate(l.start),I.date.setTime(i,N(n.start)),n.start=i),n.end&&(r=I.date.getDate(l.end),I.date.setTime(r,N(n.end)),n.end=r)),o.dataSource._removeExceptions(l),a(l)},d=function(){var e=s(t),n=function(){o._convertDates(e)},i=e.toOccurrence({start:t.start,end:t.end});a(o.dataSource.add(i),n)};t.recurrenceRule||t.isOccurrence()?(r=o.options.messages.recurrenceMessages,o._showRecurringDialog(t,d,l,{title:r.editWindowTitle,text:r.editRecurring?r.editRecurring:he,occurrenceText:r.editWindowOccurrence,seriesText:r.editWindowSeries})):a(o.dataSource.getByUid(t.uid))},_modelForContainer:function(t){return t=e(t).closest("["+I.attr("uid")+"]"),this.dataSource.getByUid(t.attr(I.attr("uid")))},showDialog:function(e){this._editor.showDialog(e)},focus:function(){this.wrapper.focus()},_confirmation:function(e,t){var n,i,r,o,a,s=this.options.editable;s===!0||s.confirmation!==!1?(n=this.options.messages,i=n.deleteWindowTitle,r=typeof s.confirmation===W?s.confirmation:n.editable.confirmation,this._isEditorOpened()&&t.isRecurring()&&(o=this.options.messages.recurrenceMessages,i=o.deleteWindowTitle,r=t.isException()?o.deleteRecurringConfirmation?o.deleteRecurringConfirmation:fe:o.deleteSeriesConfirmation?o.deleteSeriesConfirmation:pe),a=[{name:"destroy",text:n.destroy,click:function(){e()}}],this._isMobile()&&I.mobile.ui.Pane||a.push({name:"canceledit",text:n.cancel,click:function(){e(!0)}}),this._unbindResize(),this.showDialog({model:t,text:r,title:i,buttons:a}),this._bindResize()):e()},addEvent:function(e){var t,n,i=this._editor.editable,r=this.dataSource;e=e||{},n=this.trigger("add",{event:e}),!n&&(i&&i.end()||!i)&&(this.cancelEvent(),e&&e.toJSON&&(e=e.toJSON()),t=r.add(e),t&&(this.cancelEvent(),this._editEvent(t)))},saveEvent:function(){var e,t,n,i=this._editor;i&&(e=i.editable,t=i.container,n=this._modelForContainer(t),t&&e&&e.end()&&!this.trigger(ne,{container:t,event:n})&&(n.isRecurrenceHead()&&this.dataSource._removeExceptions(n),n.dirty||n.isOccurrence()||this._convertDates(n,"remove"),this.dataSource.sync()))},cancelEvent:function(){var e,t=this._editor,n=t.container;n&&(e=this._modelForContainer(n),e&&e.isOccurrence()&&(this._convertDates(e,"remove"),this._convertDates(this.dataSource.get(e.recurrenceId),"remove")),this.dataSource.cancelChanges(e),t.close())},editEvent:function(e){var t="string"==typeof e?this.occurrenceByUid(e):e;t&&(this.cancelEvent(),t.isRecurring()?this._editRecurringDialog(t):this._editEvent(t))},_editEvent:function(e){this._unbindResize(),this._createPopupEditor(e),this._bindResize()},_editRecurringDialog:function(e){var t=this,n=function(){e.isException()?t._editEvent(e):t.addEvent(e)},i=function(){e.recurrenceId&&(e=t.dataSource.get(e.recurrenceId)),t._editEvent(e)},r=t.options.messages.recurrenceMessages;t._showRecurringDialog(e,n,i,{title:r.editWindowTitle,text:r.editRecurring?r.editRecurring:he,occurrenceText:r.editWindowOccurrence,seriesText:r.editWindowSeries})},_showRecurringDialog:function(e,t,n,i){var r=this,o=r.options.editable,a=$(o)?o.editRecurringMode:"dialog";"series"===a?n():"occurrence"===a?t():(this._unbindResize(),r.showDialog({model:e,title:i.title,text:i.text,buttons:[{text:i.occurrenceText,click:t},{text:i.seriesText,click:n}]}),this._bindResize())},_createButton:function(e){var t=e.template||me,n=typeof e===W?e:e.name||e.text,i={className:"k-scheduler-"+(n||"").replace(/\s/g,""),text:n,attr:""};if(!(n||$(e)&&e.template))throw Error("Custom commands should have name specified");return $(e)?(e.className&&(e.className+=" "+i.className),"edit"===n&&$(e.text)&&(e=G(!0,{},e),e.text=e.text.edit),i=G(!0,i,b[n],e)):i=G(!0,i,b[n]),I.template(t)(i)},_convertDates:function(e,t){var n=this.dataSource.reader.timezone,i=e.startTimezone,r=e.endTimezone,o=e.start,a=e.start;t=t||"apply",i=i||r,r=r||i,i&&(n?"apply"===t?(o=I.timezone.convert(e.start,n,i),a=I.timezone.convert(e.end,n,r)):(o=I.timezone.convert(e.start,i,n),a=I.timezone.convert(e.end,r,n)):(o=I.timezone[t](e.start,i),a=I.timezone[t](e.end,r)),e._set("start",o),e._set("end",a))},_createEditor:function(){var e,n=this;e=n._editor=this._isMobile()&&I.mobile.ui.Pane?new y(this.wrapper,G({},this.options,{target:this,timezone:n.dataSource.reader.timezone,resources:n.resources,createButton:Y(this._createButton,this)})):new x(this.wrapper,G({},this.options,{target:this,createButton:Y(this._createButton,this),timezone:n.dataSource.reader.timezone,resources:n.resources})),e.bind("cancel",function(e){return n.trigger("cancel",{container:e.container,event:e.model})?(e.preventDefault(),t):(n.cancelEvent(),n.focus(),t)}),e.bind("edit",function(e){n.trigger(re,{container:e.container,event:e.model})&&e.preventDefault()}),e.bind("save",function(){n.saveEvent()}),e.bind("remove",function(e){n.removeEvent(e.model)})},_createPopupEditor:function(e){var t=this._editor;e.isNew()&&!e.isOccurrence()||(e.isOccurrence()&&this._convertDates(e.recurrenceId?this.dataSource.get(e.recurrenceId):e),this._convertDates(e)),this.editable=t.editEvent(e)},removeEvent:function(e){var t=this,n="string"==typeof e?t.occurrenceByUid(e):e;n&&(n.isRecurring()?t._deleteRecurringDialog(n):t._confirmation(function(e){e||t._removeEvent(n)},n))},occurrenceByUid:function(e){var t=this.dataSource.getByUid(e);return t||(t=l(this._data,e)),t},occurrencesInRange:function(e,t){return new I.data.Query(this._data).filter({logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:e},{field:"end",operator:"gte",value:e},{field:"start",operator:"lt",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:e},{field:"end",operator:"gt",value:e}]}]}).toArray()},_removeEvent:function(e){this.trigger(te,{event:e})||this.dataSource.remove(e)&&this.dataSource.sync()},_deleteRecurringDialog:function(e){var t,n,i,r,o,a=this,s=e,l=a.options.editable,d=$(l)?l.editRecurringMode:"dialog",c=function(){var e=s.recurrenceId?s:s.toOccurrence(),t=a.dataSource.get(e.recurrenceId);a._convertDates(t),a._removeEvent(e)},u=function(){s.recurrenceId&&(s=a.dataSource.get(s.recurrenceId)),a._removeEvent(s)};("dialog"!=d||a._isEditorOpened())&&(t=function(){a._confirmation(function(e){e||c()},s)},n=function(){a._confirmation(function(e){e||u()},s)}),i=n||u,r=t||c,a._isEditorOpened()?e.isException()?r():i():(o=a.options.messages.recurrenceMessages,a._showRecurringDialog(e,r,i,{title:o.deleteWindowTitle,text:o.deleteRecurring?o.deleteRecurring:ue,occurrenceText:o.deleteWindowOccurrence,seriesText:o.deleteWindowSeries}))},_isEditorOpened:function(){return!!this._editor.container},_unbindView:function(e){var t=this;t.angular("cleanup",function(){return{elements:t.items()}}),e.destroy()},_bindView:function(e){var t=this;t.options.editable&&(t._viewRemoveHandler&&e.unbind(te,t._viewRemoveHandler),t._viewRemoveHandler=function(e){t.removeEvent(e.uid)},e.bind(te,t._viewRemoveHandler),t._viewAddHandler&&e.unbind(ie,t._viewAddHandler),t._viewAddHandler=function(e){t.addEvent(e.eventInfo)},e.bind(ie,this._viewAddHandler),t._viewEditHandler&&e.unbind(re,t._viewEditHandler),t._viewEditHandler=function(e){t.editEvent(e.uid)},e.bind(re,this._viewEditHandler)),t._viewNavigateHandler&&e.unbind("navigate",t._viewNavigateHandler),t._viewNavigateHandler=function(e){var n,i;e.view&&(n="isWorkDay"in e,i=n?"changeWorkDay":"changeView",t.trigger("navigate",{view:e.view,isWorkDay:e.isWorkDay,action:i,date:e.date})||(n&&(t._workDayMode=e.isWorkDay),t._selectView(e.view),t.date(e.date)))},e.bind("navigate",t._viewNavigateHandler),t._viewActivateHandler&&e.unbind("activate",t._viewActivateHandler),t._viewActivateHandler=function(){var e=this;t._selection&&(e.constrainSelection(t._selection),t._select(),t._adjustSelectedDate())},e.bind("activate",t._viewActivateHandler)},_selectView:function(e){var t,n,i,r=this;e&&r.views[e]&&(r._selectedView&&r._unbindView(r._selectedView),r._selectedView=r._renderView(e),r._selectedViewName=e,r._viewsCount>1&&(t=ge({views:r.views,view:e,ns:I.ns}),n=r.toolbar.find(".k-scheduler-views li:first-child"),n.is(".k-current-view")?n.replaceWith(t):r.toolbar.find(".k-scheduler-views").prepend(t),i=r.toolbar.find(".k-scheduler-views li").removeClass("k-state-selected"),i.end().find(".k-view-"+e.replace(/\./g,"\\.").toLowerCase()).addClass("k-state-selected")))},view:function(e){var n=this;return e?(n._selectView(e),n.rebind(),t):n._selectedView},viewName:function(){return this.view().name},_renderView:function(e){var t=this._initializeView(e);return this._bindView(t),this._model.set("formattedDate",t.dateForTitle()),this._model.set("formattedShortDate",t.shortDateForTitle()),t},resize:function(e){var t=this.getSize(),n=this._size,i=this.view();i&&i.groups&&(!e&&n&&t.width===n.width&&t.height===n.height||(this.refresh({action:"resize"}),this._size=t))},_adjustSelectedDate:function(){var e=this._model.selectedDate,t=this._selection,n=t.start;n&&!I.date.isInDateRange(e,H(n),H(t.end))&&e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate())},_initializeView:function(e){var t,n,i=this.views[e];if(i){if(t=$(i),n=i.type,typeof n===W&&(n=I.getter(i.type)(window)),!n)throw Error("There is no such view");i=new n(this.wrapper,h(G(!0,{},this.options,t?i:{},{resources:this.resources,date:this.date(),showWorkHours:this._workDayMode})))}return i},_views:function(){var e,t,n,i,r,o,a,s,l,d=this.options.views;for(this.views={},this._viewsCount=0,a=0,s=d.length;a<s;a++)l=!1,e=d[a],i=$(e),i?(o=r=e.type?e.type:e,typeof o!==W&&(r=e.name||e.title,l=!0)):o=r=e,t=T[r],t&&!l&&(e.type=t.type,t.title=this.options.messages.views[r],"day"===t.type?t.messages={allDay:this.options.messages.allDay}:"agenda"===t.type&&(t.messages={event:this.options.messages.event,date:this.options.messages.date,time:this.options.messages.time})),e=G({title:r
},t,i?e:{}),r&&(this.views[r]=e,this._viewsCount++,n&&!e.selected||(n=r));n&&(this._selectedViewName=n)},rebind:function(){this.dataSource.fetch()},_dataSource:function(){var e=this,t=e.options,n=t.dataSource;n=Q(n)?{data:n}:n,!t.timezone||n instanceof Fe?n instanceof Fe&&(t.timezone=n.options.schema?n.options.schema.timezone:""):n=G(!0,n,{schema:{timezone:t.timezone}}),e.dataSource&&e._refreshHandler?e.dataSource.unbind(Z,e._refreshHandler).unbind("progress",e._progressHandler).unbind("error",e._errorHandler):(e._refreshHandler=Y(e.refresh,e),e._progressHandler=Y(e._requestStart,e),e._errorHandler=Y(e._error,e)),e.dataSource=I.data.SchedulerDataSource.create(n).bind(Z,e._refreshHandler).bind("progress",e._progressHandler).bind("error",e._errorHandler),e.options.dataSource=e.dataSource},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_progress:function(e){var t=this.element.find(".k-scheduler-content");I.ui.progress(t,e)},_resources:function(){var t,n,i,r,o,a=this,s=a.options.resources;for(t=0;t<s.length;t++){if(n=s[t],i=n.field,r=n.dataSource,!i||!r)throw Error('The "field" and "dataSource" options of the scheduler resource are mandatory.');a.resources.push({field:i,name:n.name||i,title:n.title||i,dataTextField:n.dataTextField||"text",dataValueField:n.dataValueField||"value",dataColorField:n.dataColorField||"color",valuePrimitive:null==n.valuePrimitive||n.valuePrimitive,multiple:n.multiple||!1,dataSource:I.data.DataSource.create(r)})}o=e.map(a.resources,function(e){return e.dataSource.fetch()}),e.when.apply(null,o).then(function(){a.options.autoBind?a.view(a._selectedViewName):a._selectView(a._selectedViewName)})},_initModel:function(){var e=this;e._model=I.observable({selectedDate:new Date(this.options.date),formattedDate:"",formattedShortDate:""}),e._model.bind("change",function(t){"selectedDate"===t.field&&e.view(e._selectedViewName)})},_wrapper:function(){var e=this,t=e.options,n=t.height,i=t.width;e.wrapper=e.element.addClass("k-widget k-scheduler k-floatwrap").attr("role","grid").attr("aria-multiselectable",!0),e._isMobile()&&e.wrapper.addClass("k-scheduler-mobile"),e._isMobilePhoneView()&&e.wrapper.addClass("k-scheduler-phone"),n&&e.wrapper.height(n),i&&e.wrapper.width(i)},date:function(e){return null!=e&&H(e)>=H(this.options.min)&&H(e)<=H(this.options.max)&&this._model.set("selectedDate",e),H(this._model.get("selectedDate"))},_toolbar:function(){var n,i,r=this,o=r.options,a=[];o.toolbar&&(a=e.isArray(o.toolbar)?o.toolbar:[o.toolbar]),n=this._isMobilePhoneView()?_e:ve,i=e(n({messages:o.messages,pdf:e.grep(a,function(e){return"pdf"==e||"pdf"==e.name}).length>0,ns:I.ns,views:r.views,viewsCount:r._viewsCount})),r.wrapper.append(i),r.toolbar=i,I.bind(r.toolbar,r._model),i.on(J+X,".k-pdf",function(e){e.preventDefault(),r.saveAsPDF()}),i.on(J+X,".k-scheduler-navigation li",function(n){var i=e(this),o=new Date(r.date()),a="";if(n.preventDefault(),i.hasClass("k-nav-today"))a="today",o=new Date;else if(i.hasClass("k-nav-next"))a="next",o=r.view().nextDate();else if(i.hasClass("k-nav-prev"))a="previous",o=r.view().previousDate();else if(i.hasClass("k-nav-current")&&!r._isMobilePhoneView())return r._showCalendar(),t;r.trigger("navigate",{view:r._selectedViewName,action:a,date:o})||r.date(o)}),i.on(J+X,".k-scheduler-views li, .k-scheduler-refresh",function(t){t.preventDefault();var n=e(this).attr(I.attr("name"));r.trigger("navigate",{view:n,action:"changeView",date:r.date()})||(r.view(n),r.element.find(".k-state-expanded").removeClass("k-state-expanded"))}),i.on(J+X,".k-scheduler-views li.k-current-view",function(){r.element.find(".k-scheduler-views").toggleClass("k-state-expanded")}),i.find("li").hover(function(){e(this).addClass("k-state-hover")},function(){e(this).removeClass("k-state-hover")})},_showCalendar:function(){var t=this,n=t.toolbar.find(".k-nav-current"),i=e('<div class="k-calendar-container"><div class="k-scheduler-calendar"/></div>');t.popup||(t.popup=new U(i,{anchor:n,open:function(){t.calendar||(t.calendar=new q(this.element.find(".k-scheduler-calendar"),{change:function(){var e=this.value();t.trigger("navigate",{view:t._selectedViewName,action:"changeDate",date:e})||(t.date(e),t.popup.close())},min:t.options.min,max:t.options.max})),t.calendar.value(t.date())},copyAnchorStyles:!1})),t.popup.open()},refresh:function(e){var t=this,n=this.view();this._progress(!1),this.angular("cleanup",function(){return{elements:t.items()}}),e=e||{},n&&(e&&"itemchange"===e.action&&(this._editor.editable||this._preventRefresh)||this.trigger("dataBinding",{action:e.action||"rebind",index:e.index,items:e.items})||(e&&"resize"===e.action||!this._editor||this._editor.close(),this._data=this.dataSource.expand(n.startDate(),n.endDate()),n.refreshLayout(),n.render(this._data),this.trigger("dataBound")))},slotByPosition:function(e,t){var n,i=this.view();return i._slotByPosition?(n=i._slotByPosition(e,t),n?{startDate:n.startDate(),endDate:n.endDate(),groupIndex:n.groupIndex,element:n.element,isDaySlot:n.isDaySlot}:null):null},slotByElement:function(t){var n=e(t).offset();return this.slotByPosition(n.left,n.top)},resourcesBySlot:function(e){return this.view()._resourceBySlot(e)}}),T={day:{type:"kendo.ui.DayView"},week:{type:"kendo.ui.WeekView"},workWeek:{type:"kendo.ui.WorkWeekView"},agenda:{type:"kendo.ui.AgendaView"},month:{type:"kendo.ui.MonthView"},timeline:{type:"kendo.ui.TimelineView"},timelineWeek:{type:"kendo.ui.TimelineWeekView"},timelineWorkWeek:{type:"kendo.ui.TimelineWorkWeekView"},timelineMonth:{type:"kendo.ui.TimelineMonthView"}},B.plugin(C),I.PDFMixin&&(I.PDFMixin.extend(C.prototype),S="k-scheduler-pdf-export",C.fn._drawPDF=function(t){var n,i,r,o=this.wrapper,a=o[0].style.cssText;return o.css({width:o.width(),height:o.height()}),o.addClass(S),n=this,i=new e.Deferred,r=o.find(".k-scheduler-content").find("table").css("table-layout","auto"),setTimeout(function(){r.css("table-layout","fixed"),n.resize(!0),n._drawPDFShadow({},{avoidLinks:n.options.pdf.avoidLinks}).done(function(e){var n={page:e,pageNumber:1,progress:1,totalPages:1};t.notify(n),i.resolve(n.page)}).fail(function(e){i.reject(e)}).always(function(){o[0].style.cssText=a,o.removeClass(S),n.resize(!0),n.resize(!0)})}),i}),D=O.extend({init:function(e,t){var n=this,i=I.timezone.windows_zones;if(!i||!I.timezone.zones_titles)throw Error("kendo.timezones.min.js is not included.");O.fn.init.call(n,e,t),n.wrapper=n.element,n._zonesQuery=new I.data.Query(i),n._zoneTitleId=I.guid(),n._zoneTitlePicker(),n._zonePicker(),n._zoneTitle.bind("cascade",function(){this.value()||n._zone.wrapper.hide()}),n._zone.bind("cascade",function(){n._value=this.value(),n.trigger("change")}),n.value(n.options.value)},options:{name:"TimezoneEditor",value:"",optionLabel:"No timezone"},events:["change"],_zoneTitlePicker:function(){var t=this,n=e('<input id="'+t._zoneTitleId+'"/>').appendTo(t.wrapper);t._zoneTitle=new I.ui.DropDownList(n,{dataSource:I.timezone.zones_titles,dataValueField:"other_zone",dataTextField:"name",optionLabel:t.options.optionLabel})},_zonePicker:function(){var t=this,n=e("<input />").appendTo(this.wrapper);t._zone=new I.ui.DropDownList(n,{dataValueField:"zone",dataTextField:"territory",dataSource:t._zonesQuery.data,cascadeFrom:t._zoneTitleId,dataBound:function(){t._value=this.value(),this.wrapper.toggle(this.dataSource.view().length>1)}}),t._zone.wrapper.hide()},destroy:function(){O.fn.destroy.call(this),I.destroy(this.wrapper)},value:function(e){var n,i=this;return e===t?i._value:(n=i._zonesQuery.filter({field:"zone",operator:"eq",value:e}).data[0],n?(i._zoneTitle.value(n.other_zone),i._zone.value(n.zone)):i._zoneTitle.select(0),t)}}),B.plugin(D),E=I.template('<option value="#=other_zone#">#=name#</option>'),F=I.template('<option value="#=zone#">#=territory#</option>'),R=O.extend({init:function(e,t){var n=this,i=I.timezone.windows_zones;if(!i||!I.timezone.zones_titles)throw Error("kendo.timezones.min.js is not included.");O.fn.init.call(n,e,t),n.wrapper=n.element,n._zonesQuery=new I.data.Query(i),n._zoneTitlePicker(),n._zonePicker(),n.value(n.options.value)},options:{name:"MobileTimezoneEditor",optionLabel:"No timezone",value:""},events:["change"],_bindZones:function(e){var t=e?this._filter(e):[];this._zone.html(this._options(t,F))},_filter:function(e){return this._zonesQuery.filter({field:"other_zone",operator:"eq",value:e}).data},_options:function(e,t,n){var i=0,r="",o=e.length;for(n&&(r+=t({other_zone:"",name:n}));i<o;i++)r+=t(e[i]);return r},_zoneTitlePicker:function(){var t=this,n=t._options(I.timezone.zones_titles,E,t.options.optionLabel);t._zoneTitle=e("<select>"+n+"</select>").appendTo(t.wrapper).change(function(){var e=this.value,n=t._zone;t._bindZones(e),e&&n[0].children.length>1?n.show():n.hide(),t._value=n[0].value,t.trigger("change")})},_zonePicker:function(){var t=this;t._zone=e('<select style="display:none"></select>').appendTo(this.wrapper).change(function(){t._value=this.value,t.trigger("change")}),t._bindZones(t._zoneTitle.val()),t._value=t._zone[0].value},destroy:function(){O.fn.destroy.call(this),I.destroy(this.wrapper)},value:function(e){var n,i=this,r=i._zone,o="",a="";return e===t?i._value:(n=i._zonesQuery.filter({field:"zone",operator:"eq",value:e}).data[0],n&&(a=n.zone,o=n.other_zone),i._zoneTitle.val(o),i._bindZones(o),r.val(a),a=r[0].value,a&&r[0].children.length>1?r.show():r.hide(),i._value=a,t)}}),B.plugin(R)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.touch.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=Math.abs,a=20,s=i.extend({init:function(e,t){function o(e){return function(t){s._triggerTouch(e,t)}}function a(e){return function(t){s.trigger(e,{touches:t.touches,distance:t.distance,center:t.center,event:t.event})}}var s=this;i.fn.init.call(s,e,t),t=s.options,e=s.element,s.wrapper=e,s.events=new n.UserEvents(e,{filter:t.filter,surface:t.surface,minHold:t.minHold,multiTouch:t.multiTouch,allowSelection:!0,fastTap:t.fastTap,press:o("touchstart"),hold:o("hold"),tap:r(s,"_tap"),gesturestart:a("gesturestart"),gesturechange:a("gesturechange"),gestureend:a("gestureend")}),t.enableSwipe?(s.events.bind("start",r(s,"_swipestart")),s.events.bind("move",r(s,"_swipemove"))):(s.events.bind("start",r(s,"_dragstart")),s.events.bind("move",o("drag")),s.events.bind("end",o("dragend"))),n.notify(s)},events:["touchstart","dragstart","drag","dragend","tap","doubletap","hold","swipe","gesturestart","gesturechange","gestureend"],options:{name:"Touch",surface:null,global:!1,fastTap:!1,filter:null,multiTouch:!1,enableSwipe:!1,minXDelta:30,maxYDelta:20,maxDuration:1e3,minHold:800,doubleTapTimeout:800},cancel:function(){this.events.cancel()},destroy:function(){this.events.destroy()},_triggerTouch:function(e,t){this.trigger(e,{touch:t.touch,event:t.event})&&t.preventDefault()},_tap:function(e){var t=this,i=t.lastTap,r=e.touch;i&&r.endTime-i.endTime<t.options.doubleTapTimeout&&n.touchDelta(r,i).distance<a?(t._triggerTouch("doubletap",e),t.lastTap=null):(t._triggerTouch("tap",e),t.lastTap=r)},_dragstart:function(e){this._triggerTouch("dragstart",e)},_swipestart:function(e){2*o(e.x.velocity)>=o(e.y.velocity)&&e.sender.capture()},_swipemove:function(e){var t=this,n=t.options,i=e.touch,r=e.event.timeStamp-i.startTime,a=i.x.initialDelta>0?"right":"left";o(i.x.initialDelta)>=n.minXDelta&&o(i.y.initialDelta)<n.maxYDelta&&r<n.maxDuration&&(t.trigger("swipe",{direction:a,touch:e.touch}),i.cancel())}});n.ui.plugin(s)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.gantt.list.min",["kendo.dom.min","kendo.touch.min","kendo.draganddrop.min","kendo.columnsorter.min","kendo.datetimepicker.min","kendo.editable.min"],e)}(function(){return function(e){function t(e){var t,n,i=[],r=e.className;for(t=0,n=e.level;t<n;t++)i.push(o("span",{className:r}));return i}function n(){var t=i._activeElement();t&&"body"!==t.nodeName.toLowerCase()&&e(t).blur()}var i=window.kendo,r=i.dom,o=r.element,a=r.text,s=i.support.browser,l=i.support.mobileOS,d=i.ui,c=d.Widget,u=e.extend,h=i._outerWidth,f=i._outerHeight,p=e.map,m=e.isFunction,g=s.msie&&s.version<9,v=i.keys,_={title:"Title",start:"Start Time",end:"End Time",percentComplete:"% Done",parentId:"Predecessor ID",id:"ID",orderId:"Order ID"},b="string",k=".kendoGanttList",w="click",y=".",x="<table style='visibility: hidden;'><tbody><tr style='height:{0}'><td>&nbsp;</td></tr></tbody></table>",C={wrapper:"k-treelist k-grid k-widget",header:"k-header",alt:"k-alt",rtl:"k-rtl",editCell:"k-edit-cell",group:"k-treelist-group",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",selected:"k-state-selected",icon:"k-icon",iconCollapse:"k-i-collapse",iconExpand:"k-i-expand",iconHidden:"k-i-none",iconPlaceHolder:"k-icon k-i-none",input:"k-input",link:"k-link",resizeHandle:"k-resize-handle",resizeHandleInner:"k-resize-handle-inner",dropPositions:"k-i-insert-top k-i-insert-bottom k-i-add k-i-insert-middle",dropTop:"k-i-insert-top",dropBottom:"k-i-insert-bottom",dropAdd:"k-i-add",dropMiddle:"k-i-insert-middle",dropDenied:"k-i-denied",dragStatus:"k-drag-status",dragClue:"k-drag-clue",dragClueText:"k-clue-text"},T=d.GanttList=c.extend({init:function(t,n){c.fn.init.call(this,t,n),0===this.options.columns.length&&this.options.columns.push("title"),this.dataSource=this.options.dataSource,this._columns(),this._layout(),this._domTrees(),this._header(),this._sortable(),this._editable(),this._selectable(),this._draggable(),this._resizable(),this._attachEvents(),this._adjustHeight(),this.bind("render",function(){var t,n;this.options.resizable&&(t=this.header.find("col"),n=this.content.find("col"),this.header.find("th").not(":last").each(function(i){var r=h(e(this));t.eq(i).width(r),n.eq(i).width(r)}),t.last().css("width","auto"),n.last().css("width","auto"))},!0)},_adjustHeight:function(){this.content.height(this.element.height()-f(this.header.parent()))},destroy:function(){c.fn.destroy.call(this),this._reorderDraggable&&this._reorderDraggable.destroy(),this._tableDropArea&&this._tableDropArea.destroy(),this._contentDropArea&&this._contentDropArea.destroy(),this._columnResizable&&this._columnResizable.destroy(),this.touch&&this.touch.destroy(),this.timer&&clearTimeout(this.timer),this.content.off(k),this.header.find("thead").off(k),this.header.find(y+T.link).off(k),this.header=null,this.content=null,this.levels=null,i.destroy(this.element)},options:{name:"GanttList",selectable:!0,editable:!0,resizable:!1},_attachEvents:function(){var t=this,n=T.styles;t.content.on(w+k,"td > span."+n.icon+":not(."+n.iconHidden+")",function(n){var i=e(this),r=t._modelFromElement(i);r.set("expanded",!r.get("expanded")),n.stopPropagation()})},_domTrees:function(){this.headerTree=new r.Tree(this.header[0]),this.contentTree=new r.Tree(this.content[0])},_columns:function(){var e=this.options.columns,t=function(){this.field="",this.title="",this.editable=!1,this.sortable=!1};this.columns=p(e,function(e){return e=typeof e===b?{field:e,title:_[e]}:e,u(new t,e)})},_layout:function(){var t=this,n=this.options,r=this.element,o=T.styles,a=function(){var r,o=typeof n.rowHeight===b?n.rowHeight:n.rowHeight+"px",a=e(i.format(x,o));return t.content.append(a),r=f(a.find("tr")),a.remove(),r};r.addClass(o.wrapper).append("<div class='"+o.gridHeader+"'><div class='"+o.gridHeaderWrap+"'></div></div>").append("<div class='"+o.gridContentWrap+"'></div>"),this.header=r.find(y+o.gridHeaderWrap),this.content=r.find(y+o.gridContent),n.rowHeight&&(this._rowHeight=a())},_header:function(){var e=this.headerTree,t=o("colgroup",null,this._cols()),n=o("thead",{role:"rowgroup"},[o("tr",{role:"row"},this._ths())]),i=o("table",{style:{minWidth:this.options.listWidth+"px"},role:"grid"},[t,n]);e.render([i])},_render:function(e){var t,n,i,r={style:{minWidth:this.options.listWidth+"px"},tabIndex:0,role:"treegrid"};this._rowHeight&&(r.style.height=e.length*this._rowHeight+"px"),this.levels=[{field:null,value:0}],t=o("colgroup",null,this._cols()),n=o("tbody",{role:"rowgroup"},this._trs(e)),i=o("table",r,[t,n]),this.contentTree.render([i]),this.trigger("render")},_ths:function(){var e,t,n,i,r=this.columns,s=[];for(n=0,i=r.length;n<i;n++)e=r[n],t={"data-field":e.field,"data-title":e.title,className:T.styles.header,role:"columnheader"},s.push(o("th",t,[a(e.title)]));return this.options.resizable&&s.push(o("th",{className:T.styles.header,role:"columnheader"})),s},_cols:function(){var e,t,n,i,r,a=this.columns,s=[];for(i=0,r=a.length;i<r;i++)e=a[i],n=e.width,t=n&&0!==parseInt(n,10)?{style:{width:typeof n===b?n:n+"px"}}:null,s.push(o("col",t,[]));return this.options.resizable&&s.push(o("col",{style:{width:"1px"}})),s},_trs:function(e){var t,n,i,r,o,a=[],s=[],l=T.styles;for(r=0,o=e.length;r<o;r++)t=e[r],i=this._levels({idx:t.parentId,id:t.id,summary:t.summary}),n={"data-uid":t.uid,"data-level":i,role:"row"},t.summary&&(n["aria-expanded"]=t.expanded),r%2!==0&&s.push(l.alt),t.summary&&s.push(l.group),s.length&&(n.className=s.join(" ")),a.push(this._tds({task:t,attr:n,level:i})),s=[];return a},_tds:function(e){var t,n,i,r=[],a=this.columns;for(n=0,i=a.length;n<i;n++)t=a[n],r.push(this._td({task:e.task,column:t,level:e.level}));return this.options.resizable&&r.push(o("td",{role:"gridcell"})),o("tr",e.attr,r)},_td:function(e){var n,r,s,l=[],d=this.options.resourcesField,c=T.styles,u=e.task,h=e.column,f=u.get(h.field);if(h.field==d){for(f=f||[],n=[],s=0;s<f.length;s++)n.push(i.format("{0} [{1}]",f[s].get("name"),f[s].get("formatedValue")));n=n.join(", ")}else n=h.format?i.format(h.format,f):f;return"title"===h.field&&(l=t({level:e.level,className:c.iconPlaceHolder}),l.push(o("span",{className:c.icon+" "+(u.summary?u.expanded?c.iconCollapse:c.iconExpand:c.iconHidden)})),r=i.format("{0}, {1:P0}",n,u.percentComplete)),l.push(o("span",{"aria-label":r},[a(n)])),o("td",{role:"gridcell"},l)},_levels:function(e){var t,n,i,r=this.levels,o=e.summary,a=e.idx,s=e.id;for(n=0,i=r.length;n<i;n++)if(t=r[n],t.field==a)return o&&r.push({field:s,value:t.value+1}),t.value},_sortable:function(){var e,t,n,r,o,a=this,s=this.options.resourcesField,l=this.columns,d=this.header.find("th["+i.attr("field")+"]"),c=function(e){(0===a.dataSource.total()||a.editable&&a.editable.trigger("validate"))&&e.preventDefault()};for(r=0,o=d.length;r<o;r++)e=l[r],e.sortable&&e.field!==s&&(n=d.eq(r),t=n.data("kendoColumnSorter"),t&&t.destroy(),n.attr("data-"+i.ns+"field",e.field).kendoColumnSorter({dataSource:this.dataSource,change:c}));d=null},_selectable:function(){var t=this,n=this.options.selectable;n&&this.content.on(w+k,"tr",function(n){var i=e(this);t.editable&&t.editable.trigger("validate"),n.ctrlKey?t.clearSelection():t.select(i)})},select:function(e){var t=this.content.find(e),n=T.styles.selected;return t.length?(t.siblings(y+n).removeClass(n).attr("aria-selected",!1).end().addClass(n).attr("aria-selected",!0),void this.trigger("change")):this.content.find(y+n)},clearSelection:function(){var e=this.select();e.length&&(e.removeClass(T.styles.selected),this.trigger("change"))},_setDataSource:function(e){this.dataSource=e,this._sortable()},_editable:function(){var t=this,i=this.options.editable,r=T.styles,o="span."+r.icon+":not("+r.iconHidden+")",a=function(){var e=t.editable;e&&(e.end()?t._closeCell():e.trigger("validate"))},s=function(t){var i=e(t.currentTarget);i.hasClass(r.editCell)||n()};i&&i.update!==!1&&(this._startEditHandler=function(n){var i=n.currentTarget?e(n.currentTarget):n,r=t._columnFromElement(i);t.editable||r&&r.editable&&t._editCell({cell:i,column:r})},t.content.on("focusin"+k,function(){clearTimeout(t.timer),t.timer=null}).on("focusout"+k,function(){t.timer=setTimeout(a,1)}).on("keydown"+k,function(e){e.keyCode===v.ENTER&&e.preventDefault()}).on("keyup"+k,function(e){var i,r,o=e.keyCode;switch(o){case v.ENTER:n(),a();break;case v.ESC:t.editable&&(i=t._editableContainer,r=t._modelFromElement(i),t.trigger("cancel",{model:r,cell:i})||t._closeCell(!0))}}),l?t.touch=t.content.kendoTouch({filter:"td",touchstart:function(e){s(e.touch)},doubletap:function(n){e(n.touch.initialTouch).is(o)||t._startEditHandler(n.touch)}}).data("kendoTouch"):t.content.on("mousedown"+k,"td",function(e){s(e)}).on("dblclick"+k,"td",function(n){e(n.target).is(o)||t._startEditHandler(n)}))},_editCell:function(t){var n,r=this.options.resourcesField,o=T.styles,a=t.cell,s=t.column,l=this._modelFromElement(a),d=this.dataSource._createNewModel(l.toJSON()),c=d.fields[s.field]||d[s.field],u=c.validation,h=i.attr("type"),f=i.attr("bind"),p=i.attr("format"),v={name:s.field,required:!!c.validation&&c.validation.required===!0};return s.field===r?void s.editor(a,d):(this._editableContent=a.children().detach(),this._editableContainer=a,a.data("modelCopy",d),"date"!==c.type&&"date"!==e.type(c)||s.format&&!/H|m|s|F|g|u/.test(s.format)||(v[f]="value:"+s.field,v[h]="date",s.format&&(v[p]=i._extractFormat(s.format)),n=function(t,n){e('<input type="text"/>').attr(v).appendTo(t).kendoDateTimePicker({format:n.format})}),this.editable=a.addClass(o.editCell).kendoEditable({fields:{field:s.field,format:s.format,editor:s.editor||n},model:d,clearContainer:!1}).data("kendoEditable"),u&&u.dateCompare&&m(u.dateCompare)&&u.message&&(e("<span "+i.attr("for")+'="'+s.field+'" class="k-invalid-msg"/>').hide().appendTo(a),a.find("[name="+s.field+"]").attr(i.attr("dateCompare-msg"),u.message)),this.editable.bind("validate",function(e){var t=this.element.find(":kendoFocusable:first").focus();g&&t.focus(),e.preventDefault()}),void(this.trigger("edit",{model:l,cell:a})&&this._closeCell(!0)))},_closeCell:function(e){var t=T.styles,n=this._editableContainer,i=this._modelFromElement(n),r=this._columnFromElement(n),o=r.field,a=n.data("modelCopy"),s={};s[o]=a.get(o),n.empty().removeData("modelCopy").removeClass(t.editCell).append(this._editableContent),this.editable.unbind(),this.editable.destroy(),this.editable=null,this._editableContainer=null,this._editableContent=null,e||("start"===o&&(s.end=new Date(s.start.getTime()+i.duration())),this.trigger("update",{task:i,updateInfo:s}))},_draggable:function(){var t,n=this,r=null,o=!0,a=T.styles,s=i.support.isRtl(this.element),d="tr["+i.attr("level")+" = 0]:last",c={},h=this.options.editable,f=function(){r=null,t=null,o=!0,c={}},p=function(e){for(var t=e;t;){if(r.get("id")===t.get("id")){o=!1;break}t=n.dataSource.taskParent(t)}},m=function(){var n=e(t).height(),r=i.getOffset(t).top;u(t,{beforeLimit:r+.25*n,afterLimit:r+.75*n})},g=function(e){var n,r,o,s,l;t&&(n=e.location,r=a.dropAdd,o="add",s=parseInt(t.attr(i.attr("level")),10),n<=t.beforeLimit?(l=t.prev(),r=a.dropTop,o="insert-before"):n>=t.afterLimit&&(l=t.next(),r=a.dropBottom,o="insert-after"),l&&parseInt(l.attr(i.attr("level")),10)===s&&(r=a.dropMiddle),c.className=r,c.command=o)},v=function(){return n._reorderDraggable.hint.children(y+a.dragStatus).removeClass(a.dropPositions)};h&&h.reorder!==!1&&h.update!==!1&&(this._reorderDraggable=this.content.kendoDraggable({distance:10,holdToDrag:l,group:"listGroup",filter:"tr[data-uid]",ignore:y+a.input,hint:function(t){return e('<div class="'+a.header+" "+a.dragClue+'"/>').css({width:300,paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).append('<span class="'+a.icon+" "+a.dragStatus+'" /><span class="'+a.dragClueText+'"/>')},cursorOffset:{top:-20,left:0},container:this.content,dragstart:function(e){var t=n.editable;return t&&t.reorder!==!1&&t.trigger("validate")?void e.preventDefault():(r=n._modelFromElement(e.currentTarget),this.hint.children(y+a.dragClueText).text(r.get("title")),void(s&&this.hint.addClass(a.rtl)))},drag:function(e){o&&(g(e.y),v().addClass(c.className))},dragend:function(){f()},dragcancel:function(){f()}}).data("kendoDraggable"),this._tableDropArea=this.content.kendoDropTargetArea({distance:0,group:"listGroup",filter:"tr[data-uid]",dragenter:function(e){t=e.dropTarget,p(n._modelFromElement(t)),m(),v().toggleClass(a.dropDenied,!o)},dragleave:function(){o=!0,v()},drop:function(){var e=n._modelFromElement(t),i=e.orderId,a={parentId:e.parentId};if(o){switch(c.command){case"add":a.parentId=e.id;break;case"insert-before":a.orderId=e.parentId===r.parentId&&e.orderId>r.orderId?i-1:i;break;case"insert-after":a.orderId=e.parentId===r.parentId&&e.orderId>r.orderId?i:i+1}n.trigger("update",{task:r,updateInfo:a})}}}).data("kendoDropTargetArea"),this._contentDropArea=this.element.kendoDropTargetArea({distance:0,group:"listGroup",filter:y+a.gridContent,drop:function(){var e=n._modelFromElement(n.content.find(d)),t=e.orderId,i={parentId:null,orderId:null!==r.parentId?t+1:t};n.trigger("update",{task:r,updateInfo:i})}}).data("kendoDropTargetArea"))},_resizable:function(){var t=this,n=T.styles,i=function(i){var r,o,a=e(i.currentTarget),s=t.resizeHandle,l=a.position(),d=l.left,c=h(a),u=a.closest("div"),p=i.clientX+e(window).scrollLeft(),m=t.options.columnResizeHandleWidth;return d+=u.scrollLeft(),s||(s=t.resizeHandle=e('<div class="'+n.resizeHandle+'"><div class="'+n.resizeHandleInner+'" /></div>')),r=a.offset().left+c,(o=p>r-m&&p<r+m)?(u.append(s),void s.show().css({top:l.top,left:d+c-m-1,height:f(a),width:3*m}).data("th",a)):void s.hide()};this.options.resizable&&(this._columnResizable&&this._columnResizable.destroy(),this.header.find("thead").on("mousemove"+k,"th",i),this._columnResizable=this.header.kendoResizable({handle:y+n.resizeHandle,start:function(n){var i=e(n.currentTarget).data("th"),r="col:eq("+i.index()+")",o=t.header.find("table"),a=t.content.find("table");t.element.addClass("k-grid-column-resizing"),this.col=a.children("colgroup").find(r).add(o.find(r)),this.th=i,this.startLocation=n.x.location,this.columnWidth=h(i),this.table=o.add(a),this.totalWidth=this.table.width()-h(o.find("th:last"))},resize:function(e){var t=11,n=e.x.location-this.startLocation;this.columnWidth+n<t&&(n=t-this.columnWidth),this.table.css({minWidth:this.totalWidth+n}),this.col.width(this.columnWidth+n)},resizeend:function(){var e,n,i;t.element.removeClass("k-grid-column-resizing"),e=Math.floor(this.columnWidth),n=Math.floor(h(this.th)),i=t.columns[this.th.index()],t.trigger("columnResize",{column:i,oldWidth:e,newWidth:n}),this.table=this.col=this.th=null}}).data("kendoResizable"))},_modelFromElement:function(e){var t=e.closest("tr"),n=this.dataSource.getByUid(t.attr(i.attr("uid")));return n},_columnFromElement:function(e){var t=e.closest("td"),n=t.parent(),i=n.children().index(t);return this.columns[i]}});u(!0,d.GanttList,{styles:C})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.gantt.timeline.min",["kendo.dom.min","kendo.touch.min","kendo.draganddrop.min"],e)}(function(){return function(e){function t(e){return delete e.name,delete e.prefix,delete e.views,e}function n(e){var t=[],n=e.workWeekStart;for(t.push(n);e.workWeekEnd!=n;)n>6?n-=7:n++,t.push(n);return t}function i(){var t=kendo._activeElement();t&&"body"!==t.nodeName.toLowerCase()&&e(t).blur()}var r,o,a=kendo.ui.Widget,s=kendo.dom.element,l=kendo.dom.text,d=kendo.dom.html,c=e.isPlainObject,u=kendo._outerWidth,h=kendo._outerHeight,f=e.extend,p=e.proxy,m=kendo.support.browser,g=!1,v=kendo.keys,_=kendo.data.Query,b="string",k=".kendoGanttTimeline",w="click",y="dblclick",x="mousemove",C="mouseenter",T="mouseleave",S="keydown",D=".",E=kendo.template("#=kendo.toString(start, 't')#"),F=kendo.template("#=kendo.toString(start, 'ddd M/dd')#"),R=kendo.template("#=kendo.toString(start, 'ddd M/dd')# - #=kendo.toString(kendo.date.addDays(end, -1), 'ddd M/dd')#"),I=kendo.template("#=kendo.toString(start, 'MMM')#"),A=kendo.template("#=kendo.toString(start, 'yyyy')#"),M=kendo.template('<div class="#=styles.marquee#"><div class="#=styles.marqueeColor#"></div></div>'),z=kendo.template('<div style="z-index: 100002;" class="#=styles.tooltipWrapper#"><div class="#=styles.tooltipContent#"><div>#=messages.start#: #=kendo.toString(start, format)#</div><div>#=messages.end#: #=kendo.toString(end, format)#</div></div></div>'),H=kendo.template('<div style="z-index: 100002;" class="#=styles.tooltipWrapper#" ><div class="#=styles.tooltipContent#">#=text#%</div><div class="#=styles.tooltipCallout#" style="left:13px;"></div></div>'),N=kendo.template('<div class="#=styles.taskDetails#"><strong>#=task.title#</strong><div class="#=styles.taskDetailsPercent#">#=kendo.toString(task.percentComplete, "p0")#</div><ul class="#=styles.reset#"><li>#=messages.start#: #=kendo.toString(task.start, "h:mm tt ddd, MMM d")#</li><li>#=messages.end#: #=kendo.toString(task.end, "h:mm tt ddd, MMM d")#</li></ul></div>'),P="<table style='visibility: hidden;'><tbody><tr style='height:{0}'><td>&nbsp;</td></tr></tbody></table>",L={day:{type:"kendo.ui.GanttDayView"},week:{type:"kendo.ui.GanttWeekView"},month:{type:"kendo.ui.GanttMonthView"},year:{type:"kendo.ui.GanttYearView"}},B={alt:"k-alt",reset:"k-reset",nonWorking:"k-nonwork-hour",header:"k-header",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",tasksWrapper:"k-gantt-tables",rowsTable:"k-gantt-rows",columnsTable:"k-gantt-columns",tasksTable:"k-gantt-tasks",dependenciesWrapper:"k-gantt-dependencies",resource:"k-resource",resourceAlt:"k-resource k-alt",task:"k-task",taskSingle:"k-task-single",taskMilestone:"k-task-milestone",taskSummary:"k-task-summary",taskWrap:"k-task-wrap",taskMilestoneWrap:"k-milestone-wrap",resourcesWrap:"k-resources-wrap",taskDot:"k-task-dot",taskDotStart:"k-task-start",taskDotEnd:"k-task-end",taskDragHandle:"k-task-draghandle",taskContent:"k-task-content",taskTemplate:"k-task-template",taskActions:"k-task-actions",taskDelete:"k-task-delete",taskComplete:"k-task-complete",taskDetails:"k-task-details",taskDetailsPercent:"k-task-pct",link:"k-link",icon:"k-icon",iconDelete:"k-si-close",taskResizeHandle:"k-resize-handle",taskResizeHandleWest:"k-resize-w",taskResizeHandleEast:"k-resize-e",taskSummaryProgress:"k-task-summary-progress",taskSummaryComplete:"k-task-summary-complete",line:"k-line",lineHorizontal:"k-line-h",lineVertical:"k-line-v",arrowWest:"k-arrow-w",arrowEast:"k-arrow-e",dragHint:"k-drag-hint",dependencyHint:"k-dependency-hint",tooltipWrapper:"k-widget k-tooltip k-popup k-group k-reset",tooltipContent:"k-tooltip-content",tooltipCallout:"k-callout k-callout-s",callout:"k-callout",marquee:"k-marquee k-gantt-marquee",marqueeColor:"k-marquee-color"},O=kendo.ui.GanttView=a.extend({init:function(e,t){a.fn.init.call(this,e,t),this.title=this.options.title||this.options.name,this.header=this.element.find(D+O.styles.gridHeader),this.content=this.element.find(D+O.styles.gridContent),this.contentWidth=this.content.width(),this._workDays=n(this.options),this._headerTree=t.headerTree,this._taskTree=t.taskTree,this._taskTemplate=t.taskTemplate?kendo.template(t.taskTemplate,f({},kendo.Template,t.templateSettings)):null,this._dependencyTree=t.dependencyTree,this._taskCoordinates={},this._currentTime()},destroy:function(){a.fn.destroy.call(this),clearTimeout(this._tooltipTimeout),this.headerRow=null,this.header=null,this.content=null,this._dragHint=null,this._resizeHint=null,this._resizeTooltip=null,this._taskTooltip=null,this._percentCompleteResizeTooltip=null,this._headerTree=null,this._taskTree=null,this._dependencyTree=null},options:{showWorkHours:!1,showWorkDays:!1,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,hourSpan:1,slotSize:100,currentTimeMarker:{updateInterval:1e4}},renderLayout:function(){this._slots=this._createSlots(),this._tableWidth=this._calculateTableWidth(),this.createLayout(this._layout()),this._slotDimensions(),this._adjustHeight(),this.content.find(D+O.styles.dependenciesWrapper).width(this._tableWidth)},_adjustHeight:function(){this.content.height(this.element.height()-h(this.header));
},createLayout:function(e){var t=this._headers(e),n=this._colgroup(),i=this._headerTree,r=s("thead",null,t),o=s("table",{style:{width:this._tableWidth+"px"}},[n,r]);i.render([o]),this.headerRow=this.header.find("table:first tr").last()},_slotDimensions:function(){var e,t,n,i,r=this.headerRow[0].children,o=this._timeSlots();for(n=0,i=r.length;n<i;n++)t=r[n],e=o[n],e.offsetLeft=t.offsetLeft,e.offsetWidth=t.offsetWidth},render:function(e){var t,n,i=e.length,r=O.styles,o=this._rowsTable(i),a=this._columnsTable(i),s=this._tasksTable(e),l=this.options.currentTimeMarker,d=this.options.calculatedSize;this._taskTree.render([o,a,s]),t=this.content.find(D+r.rowsTable),d&&(n=d.row*e.length,this.content.find(D+r.tasksTable).height(n),t.height(n)),this._contentHeight=t.height(),this._rowHeight=d?d.row:this._contentHeight/t.find("tr").length,this.content.find(D+r.columnsTable).height(this._contentHeight),l!==!1&&void 0!==l.updateInterval&&this._renderCurrentTime()},_rowsTable:function(e){var t,n,i=[],r=O.styles,o=[null,{className:r.alt}];for(n=0;n<e;n++)t=s("tr",o[n%2],[s("td",null,[l(" ")])]),i.push(t);return this._createTable(1,i,{className:r.rowsTable})},_columnsTable:function(){var e,t,n,i,r,o=[],a=O.styles,d=this._timeSlots(),c=d.length,u=0;for(r=0;r<c;r++)t=d[r],i={},n=t.span,u+=n,1!==n&&(i.colspan=n),t.isNonWorking&&(i.className=a.nonWorking),o.push(s("td",i,[l(" ")]));return e=s("tr",null,o),this._createTable(u,[e],{className:a.columnsTable})},_tasksTable:function(e){var t,n,i,r,o,a,l,d,c=[],u=O.styles,h=this._taskCoordinates={},f=this._calculateMilestoneWidth(),p=Math.round(f.width),m=this.options.resourcesField,v=[u.resource,u.resourceAlt],_=this.options.calculatedSize,b=this._calculateResourcesMargin(),k=this._calculateTaskBorderWidth(),w=function(e){var t=i.left,n=t+i.width;r.isMilestone()&&(t-=p/2,n=t+p),h[r.id]={start:t,end:n,rowIndex:e}};for(l=0,d=e.length;l<d;l++)r=e[l],i=this._taskPosition(r),i.borderWidth=k,t=s("tr",null),r.start<=this.end&&r.end>=this.start&&(n=s("td",null,[this._renderTask(e[l],i)]),r[m]&&r[m].length&&(o=g?this._tableWidth-i.left:Math.max(i.width||f.clientWidth,0)+i.left,a={width:this._tableWidth-(o+b)+"px"},a[g?"right":"left"]=o+"px",_&&(a.height=_.cell+"px"),n.children.push(s("div",{className:u.resourcesWrap,style:a},this._renderResources(r[m],v[l%2])))),t.children.push(n),w(l)),c.push(t);return this._createTable(1,c,{className:O.styles.tasksTable})},_createTable:function(e,t,n){var i,r,o,a=[];for(o=0;o<e;o++)a.push(s("col"));return i=s("colgroup",null,a),r=s("tbody",null,t),n.style||(n.style={}),n.style.width=this._tableWidth+"px",s("table",n,[i,r])},_calculateTableWidth:function(){var e,t,n,i,r=this._timeSlots(),o=0,a=0;for(n=0,i=r.length;n<i;n++)e=r[n].span,a+=e,e>o&&(o=e);return t=Math.round(a*this.options.slotSize/o)},_calculateMilestoneWidth:function(){var t,n,i=O.styles.task+" "+O.styles.taskMilestone,r=e("<div class='"+i+"' style='visibility: hidden; position: absolute'>");return this.content.append(r),n=r[0].getBoundingClientRect(),t={width:n.right-n.left,clientWidth:r[0].clientWidth},r.remove(),t},_calculateResourcesMargin:function(){var t,n=e("<div class='"+O.styles.resourcesWrap+"' style='visibility: hidden; position: absolute'>");return this.content.append(n),t=parseInt(n.css(g?"margin-right":"margin-left"),10),n.remove(),t},_calculateTaskBorderWidth:function(){var t,n,i=O.styles.task+" "+O.styles.taskSingle,r=e("<div class='"+i+"' style='visibility: hidden; position: absolute'>");return this.content.append(r),n=kendo.getComputedStyles(r[0],["border-left-width"]),t=parseFloat(n["border-left-width"],10),r.remove(),t},_renderTask:function(e,t){var n,i,r,o=this.options.editable,a=t.left,l=O.styles,d=l.taskWrap,c=this.options.calculatedSize,u={},h={className:d,style:{left:a+"px"}};return c&&(h.style.height=c.cell+"px"),e.summary?i=this._renderSummary(e,t):e.isMilestone()?(i=this._renderMilestone(e,t),h.className+=" "+l.taskMilestoneWrap):i=this._renderSingleTask(e,t),n=s("div",h,[i]),o&&o.dependencyCreate!==!1&&(n.children.push(s("div",{className:l.taskDot+" "+l.taskDotStart})),n.children.push(s("div",{className:l.taskDot+" "+l.taskDotEnd}))),e.summary||e.isMilestone()||!o||o.dragPercentComplete===!1||o.update===!1||null!==this._taskTemplate||(r=Math.round(t.width*e.percentComplete),u[g?"right":"left"]=r+"px",n.children.push(s("div",{className:l.taskDragHandle,style:u}))),n},_renderSingleTask:function(e,t){var n,i,r,o=O.styles,a=Math.round(t.width*e.percentComplete),c=[],u=this.options.editable;return null!==this._taskTemplate?n=d(this._taskTemplate(e)):(n=l(e.title),c.push(s("div",{className:o.taskComplete,style:{width:a+"px"}}))),i=s("div",{className:o.taskContent},[s("div",{className:o.taskTemplate},[n])]),c.push(i),u&&(u.destroy!==!1&&i.children.push(s("span",{className:o.taskActions},[s("a",{className:o.link+" "+o.taskDelete,href:"#"},[s("span",{className:o.icon+" "+o.iconDelete})])])),u.resize!==!1&&u.update!==!1&&(i.children.push(s("span",{className:o.taskResizeHandle+" "+o.taskResizeHandleWest})),i.children.push(s("span",{className:o.taskResizeHandle+" "+o.taskResizeHandleEast})))),r=s("div",{className:o.task+" "+o.taskSingle,"data-uid":e.uid,style:{width:Math.max(t.width-2*t.borderWidth,0)+"px"}},c)},_renderMilestone:function(e){var t=O.styles,n=s("div",{className:t.task+" "+t.taskMilestone,"data-uid":e.uid});return n},_renderSummary:function(e,t){var n=O.styles,i=Math.round(t.width*e.percentComplete),r=s("div",{className:n.task+" "+n.taskSummary,"data-uid":e.uid,style:{width:t.width+"px"}},[s("div",{className:n.taskSummaryProgress,style:{width:i+"px"}},[s("div",{className:n.taskSummaryComplete,style:{width:t.width+"px"}})])]);return r},_renderResources:function(e,t){var n,i,r,o=[];for(i=0,r=e.length;i<r;i++)n=e[i],o.push(s("span",{className:t,style:{color:n.get("color")}},[l(n.get("name"))]));return g&&o.reverse(),o},_taskPosition:function(e){var t=Math.round,n=t(this._offset(g?e.end:e.start)),i=t(this._offset(g?e.start:e.end));return{left:n,width:i-n}},_offset:function(e){var t,n,i,r,o=this._timeSlots(),a=0;return o.length?(r=this._slotIndex("start",e),t=o[r],t.end<e?a=t.offsetWidth:t.start<=e&&(n=e-t.start,i=t.end-t.start,a=n/i*t.offsetWidth),g&&(a=t.offsetWidth+1-a),t.offsetLeft+a):0},_slotIndex:function(e,t,n){var i,r=this._timeSlots(),o=0,a=r.length-1;n&&(r=[].slice.call(r).reverse());do i=Math.ceil((a+o)/2),r[i][e]<t?o=i:(i===a&&i--,a=i);while(o!==a);return n&&(o=r.length-1-o),o},_timeByPosition:function(t,n,i){var r,o,a,s=this._slotByPosition(t);return n?i?s.end:s.start:(r=t-e(D+O.styles.tasksTable).offset().left,o=s.end-s.start,a=r-s.offsetLeft,g&&(a=s.offsetWidth-a),new Date(s.start.getTime()+o*(a/s.offsetWidth)))},_slotByPosition:function(t){var n=t-e(D+O.styles.tasksTable).offset().left,i=this._slotIndex("offsetLeft",n,g);return this._timeSlots()[i]},_renderDependencies:function(e){var t,n,i=[],r=this._dependencyTree;for(t=0,n=e.length;t<n;t++)i.push.apply(i,this._renderDependency(e[t]));r.render(i)},_renderDependency:function(e){var t,n,i,r,o=this._taskCoordinates[e.predecessorId],a=this._taskCoordinates[e.successorId];if(!o||!a)return[];for(n="_render"+["FF","FS","SF","SS"][g?3-e.type:e.type],t=this[n](o,a),i=0,r=t.length;i<r;i++)t[i].attr["data-uid"]=e.uid;return t},_renderFF:function(e,t){var n=this._dependencyFF(e,t,!1);return n[n.length-1].children[0]=this._arrow(!0),n},_renderSS:function(e,t){var n=this._dependencyFF(t,e,!0);return n[0].children[0]=this._arrow(!1),n.reverse()},_renderFS:function(e,t){var n=this._dependencyFS(e,t,!1);return n[n.length-1].children[0]=this._arrow(!1),n},_renderSF:function(e,t){var n=this._dependencyFS(t,e,!0);return n[0].children[0]=this._arrow(!0),n.reverse()},_dependencyFF:function(e,t,n){var i,r=this,o=[],a=0,s=0,l=0,d=0,c=n?"start":"end",u=2,h=1,f=this._rowHeight,p=10,m=e.rowIndex*f+Math.floor(f/2)-1,g=t.rowIndex*f+Math.floor(f/2)-1,v=O.styles,_=function(){o.push(r._line(v.line+" "+v.lineHorizontal,{left:a+"px",top:s+"px",width:l+"px"}))},b=function(){o.push(r._line(v.line+" "+v.lineVertical,{left:a+"px",top:s+"px",height:d+"px"}))};return a=e[c],s=m,l=p,i=t[c]-e[c],i>0!==n&&(l=Math.abs(i)+p),n?(a-=l,l-=h,_()):(_(),a+=l-u),g<s?(d=s-g,d+=u,s=g,b()):(d=g-s,d+=u,b(),s+=d-u),l=Math.abs(a-t[c]),n||(l-=h,a-=l),_(),o},_dependencyFS:function(e,t,n){var i=this,r=[],o=0,a=0,s=0,l=0,d=this._rowHeight,c=Math.floor(d/2),u=10,h=2*u,f=t.start-e.end,p=2,m=1,g=e.rowIndex*d+Math.floor(d/2)-1,v=t.rowIndex*d+Math.floor(d/2)-1,_=O.styles,b=function(){r.push(i._line(_.line+" "+_.lineHorizontal,{left:o+"px",top:a+"px",width:s+"px"}))},k=function(){r.push(i._line(_.line+" "+_.lineVertical,{left:o+"px",top:a+"px",height:l+"px"}))};return o=e.end,a=g,s=u,n&&(o+=m,f>h&&(s=f-(u-p)),s-=m),b(),o+=s-p,f<=h&&(l=n?Math.abs(v-g)-c:c,v<g?(a-=l,l+=p,k()):(k(),a+=l),s=e.end-t.start+h,s<u&&(s=u),o-=s-p,b()),v<g?(l=a-v,a=v,l+=p,k()):(l=v-a,k(),a+=l),s=t.start-o,n||(s-=m),b(),r},_line:function(e,t){return s("div",{className:e,style:t})},_arrow:function(e){return s("span",{className:e?O.styles.arrowWest:O.styles.arrowEast})},_colgroup:function(){var e,t,n,i=this._timeSlots(),r=i.length,o=[];for(e=0;e<r;e++)for(t=0,n=i[e].span;t<n;t++)o.push(s("col"));return s("colgroup",null,o)},_createDragHint:function(e){this._dragHint=e.clone().addClass(O.styles.dragHint).css("cursor","move"),e.parent().append(this._dragHint)},_updateDragHint:function(e){var t=this._offset(e);this._dragHint.css({left:t})},_removeDragHint:function(){this._dragHint.remove(),this._dragHint=null},_createResizeHint:function(t){var n,i,r=O.styles,o=this._taskCoordinates[t.id].rowIndex*this._rowHeight,a=this.options,s=a.messages;this._resizeHint=e(M({styles:r})).css({top:0,height:this._contentHeight}),this.content.append(this._resizeHint),this._resizeTooltip=e(z({styles:r,start:t.start,end:t.end,messages:s.views,format:a.resizeTooltipFormat})).css({top:0,left:0}),this.content.append(this._resizeTooltip),this._resizeTooltipWidth=u(this._resizeTooltip),n=h(this._resizeTooltip),i=o-n,i<0&&(i=o+this._rowHeight),this._resizeTooltipTop=i},_updateResizeHint:function(t,n,i){var r=this._offset(g?n:t),o=this._offset(g?t:n),a=o-r,s=i!==g?r:o,l=this._tableWidth-kendo.support.scrollbar(),d=this._resizeTooltipWidth,c=this.options,u=c.messages,h=e(D+O.styles.tasksTable).offset().left-e(D+O.styles.tasksWrapper).offset().left;g&&(r+=h),this._resizeHint.css({left:r,width:a}),this._resizeTooltip&&this._resizeTooltip.remove(),s-=Math.round(d/2),s<0?s=0:s+d>l&&(s=l-d),g&&(s+=h),this._resizeTooltip=e(z({styles:O.styles,start:t,end:n,messages:u.views,format:c.resizeTooltipFormat})).css({top:this._resizeTooltipTop,left:s,"min-width":d}).appendTo(this.content)},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=null,this._resizeTooltip.remove(),this._resizeTooltip=null},_updatePercentCompleteTooltip:function(t,n,i){var r,o,a,s;this._removePercentCompleteTooltip(),r=this._percentCompleteResizeTooltip=e(H({styles:O.styles,text:i})).appendTo(this.element),o=Math.round(u(r)/2),a=r.find(D+O.styles.callout),s=Math.round(u(a)/2),r.css({top:t-(h(r)+s),left:n-o}),a.css("left",o-s)},_removePercentCompleteTooltip:function(){this._percentCompleteResizeTooltip&&this._percentCompleteResizeTooltip.remove(),this._percentCompleteResizeTooltip=null},_updateDependencyDragHint:function(e,t,n){this._removeDependencyDragHint(),n?this._creteVmlDependencyDragHint(e,t):this._creteDependencyDragHint(e,t)},_creteDependencyDragHint:function(t,n){var i=O.styles,r=n.x-t.x,o=n.y-t.y,a=Math.sqrt(r*r+o*o),s=Math.atan(o/r);r<0&&(s+=Math.PI),e("<div class='"+i.line+" "+i.lineHorizontal+" "+i.dependencyHint+"'></div>").css({top:t.y,left:t.x,width:a,"transform-origin":"0% 0","-ms-transform-origin":"0% 0","-webkit-transform-origin":"0% 0",transform:"rotate("+s+"rad)","-ms-transform":"rotate("+s+"rad)","-webkit-transform":"rotate("+s+"rad)"}).appendTo(this.content)},_creteVmlDependencyDragHint:function(t,n){var i=e("<kvml:line class='"+O.styles.dependencyHint+"' style='position:absolute; top: 0px; left: 0px;' strokecolor='black' strokeweight='2px' from='"+t.x+"px,"+t.y+"px' to='"+n.x+"px,"+n.y+"px'></kvml:line>").appendTo(this.content);i[0].outerHTML=i[0].outerHTML},_removeDependencyDragHint:function(){this.content.find(D+O.styles.dependencyHint).remove()},_createTaskTooltip:function(t,n,i){var r,o=O.styles,a=this.options,s=this.content,l=s.offset(),d=s.width(),c=kendo.scrollLeft(s),f=e(n).parents("tr").first(),p=f.offset(),m=a.tooltip&&a.tooltip.template?kendo.template(a.tooltip.template):N,v=g?i-(l.left+c+kendo.support.scrollbar()):i-(l.left-c),_=p.top+h(f)-l.top+s.scrollTop(),b=this._taskTooltip=e('<div style="z-index: 100002;" class="'+o.tooltipWrapper+'" ><div class="'+o.taskContent+'"></div></div>');b.css({left:v,top:_}).appendTo(s).find(D+o.taskContent).append(m({styles:o,task:t,messages:a.messages.views})),h(b)<p.top-l.top&&b.css("top",p.top-l.top-h(b)+s.scrollTop()),r=u(b),r+v-c>d&&(v-=r,v<c&&(v=c+d-(r+17)),b.css("left",v))},_removeTaskTooltip:function(){this._taskTooltip&&this._taskTooltip.remove(),this._taskTooltip=null},_scrollTo:function(e){var t=e.offset().left,n=e.width(),i=t+n,r=e.closest("tr"),o=r.offset().top,a=r.height(),s=o+a,l=this.content,d=l.offset(),c=d.top,u=l.height(),h=c+u,f=d.left,p=l.width(),m=f+p,g=kendo.support.scrollbar();o<c?l.scrollTop(l.scrollTop()+(o-c)):s>h&&l.scrollTop(l.scrollTop()+(s+g-h)),t<f&&n>p&&i<m||i>m&&n<p?l.scrollLeft(l.scrollLeft()+(i+g-m)):(i>m&&n>p&&t>f||t<f&&n<p)&&l.scrollLeft(l.scrollLeft()+(t-f))},_scrollToDate:function(e){var t,n=this.start,i=this.end;e>=n&&e<i&&(t=this._offset(e),kendo.support.isRtl(this.element)&&(t=this._tableWidth-t),kendo.scrollLeft(this.content,t))},_timeSlots:function(){return this._slots&&this._slots.length?this._slots[this._slots.length-1]:[]},_headers:function(e){var t,n,i,r,o,a,d,c,u=[],h=O.styles;for(o=0,a=e.length;o<a;o++){for(t=e[o],n=[],d=0,c=t.length;d<c;d++)i=t[d],r=l(i.text),n.push(s("th",{colspan:i.span,className:h.header+(i.isNonWorking?" "+h.nonWorking:"")},[r]));u.push(s("tr",null,n))}return u},_hours:function(e,t){var n,i,r,o=[],a=this.options,s=a.workDayStart.getHours(),l=a.workDayEnd.getHours(),d=a.hourSpan;for(e=new Date(e),t=new Date(t);e<t;)n=new Date(e),r=n.getHours(),i=r>=s&&r<l,n.setHours(n.getHours()+d),r==n.getHours()&&n.setHours(n.getHours()+2*d),a.showWorkHours&&!i||o.push({start:e,end:n,isNonWorking:!i,span:1}),e=n;return o},_days:function(e,t){var n,i,r=[];for(e=new Date(e),t=new Date(t);e<t;)n=t<kendo.date.nextDay(e)?t:kendo.date.nextDay(e),i=this._isWorkDay(e),this.options.showWorkDays&&!i||r.push({start:e,end:n,isNonWorking:!i,span:1}),e=n;return r},_weeks:function(e,t){var n,i,r,o=[],a=this.calendarInfo().firstDay;for(e=new Date(e),t=new Date(t);e<t;)n=kendo.date.dayOfWeek(kendo.date.addDays(e,1),a,1),n>t&&(n=t),i=this._days(e,n),r=i.length,r>0&&o.push({start:i[0].start,end:i[r-1].end,span:r}),e=n;return o},_months:function(e,t){var n,i,r,o,a=[];for(e=new Date(e),t=new Date(t);e<t;)n=new Date(e),i=kendo.date.firstDayOfMonth(new Date(n.setMonth(n.getMonth()+1))),n=t<i?t:i,r=this._days(e,n),o=r.length,o>0&&a.push({start:r[0].start,end:r[o-1].end,span:o}),e=n;return a},_years:function(e,t){var n,i,r,o=[];for(e=new Date(e),t=new Date(t);e<t;)n=new Date(e),n=kendo.date.firstDayOfMonth(new Date(n.setMonth(12))),n>=t&&(n=t),r=n.getMonth()||12,i=r-e.getMonth(),o.push({start:e,end:n,span:i}),e=n;return o},_slotHeaders:function(e,t){var n,i,r,o=[];for(i=0,r=e.length;i<r;i++)n=e[i],o.push({text:t(n),isNonWorking:!!n.isNonWorking,span:n.span});return o},_isWorkDay:function(e){var t,n,i=e.getDay(),r=this._workDays;for(t=0,n=r.length;t<n;t++)if(r[t]===i)return!0;return!1},calendarInfo:function(){return kendo.getCulture().calendars.standard},_renderCurrentTime:function(){var t,n=this._getCurrentTime(),i=this._offset(n),r=e("<div class='k-current-time'></div>"),o=O.styles,a=e(D+o.tasksWrapper),s=e(D+o.tasksTable);this.content&&this._timeSlots().length&&(this.content.find(".k-current-time").remove(),t=this._timeSlots()[this._slotIndex("start",n)],n<t.start||n>t.end||(a.length&&s.length&&(i+=s.offset().left-a.offset().left),r.css({left:i+"px",top:"0px",width:"1px",height:this._contentHeight+"px"}).appendTo(this.content)))},_getCurrentTime:function(){return new Date},_currentTime:function(){var e=this.options.currentTimeMarker;e!==!1&&void 0!==e.updateInterval&&(this._renderCurrentTime(),this._currentTimeUpdateTimer=setInterval(p(this._renderCurrentTime,this),e.updateInterval))}});f(!0,O,{styles:B}),kendo.ui.GanttDayView=O.extend({name:"day",options:{timeHeaderTemplate:E,dayHeaderTemplate:F,resizeTooltipFormat:"h:mm tt ddd, MMM d"},range:function(e){var t=this.options.range;this.start=kendo.date.getDate(e.start),this.end=kendo.date.getDate(e.end),(kendo.date.getMilliseconds(e.end)>0||this.end.getTime()===this.start.getTime())&&(this.end=kendo.date.addDays(this.end,1)),t&&t.start&&(this.start=kendo.date.getDate(t.start),this.start.setHours(t.start.getHours())),t&&t.end&&(this.end=kendo.date.getDate(t.end),this.end.setHours(t.end.getHours()))},_createSlots:function(){var e,t,n,i,r=[],o=this._days(this.start,this.end),a=[];for(n=0,i=o.length;n<i;n++)e=o[n],t=this._hours(e.start,e.end),e.span=t.length,a.push.apply(a,t);return r.push(o),r.push(a),r},_layout:function(){var e=[],t=this.options;return e.push(this._slotHeaders(this._slots[0],kendo.template(t.dayHeaderTemplate))),e.push(this._slotHeaders(this._slots[1],kendo.template(t.timeHeaderTemplate))),e}}),kendo.ui.GanttWeekView=O.extend({name:"week",options:{dayHeaderTemplate:F,weekHeaderTemplate:R,resizeTooltipFormat:"h:mm tt ddd, MMM d"},range:function(e){var t,n=this.options.range,i=this.calendarInfo(),r=i.firstDay,o=e.end;r===o.getDay()&&o.setDate(o.getDate()+7),this.start=kendo.date.getDate(kendo.date.dayOfWeek(e.start,r,-1)),this.end=kendo.date.getDate(kendo.date.dayOfWeek(o,r,1)),n&&n.start&&(this.start=kendo.date.getDate(n.start)),n&&n.end&&(t=new Date(n.end),this.end=kendo.date.getDate(t)<n.end?kendo.date.getDate(new Date(t.setDate(t.getDate()+1))):kendo.date.getDate(t))},_createSlots:function(){var e=[];return e.push(this._weeks(this.start,this.end)),e.push(this._days(this.start,this.end)),e},_layout:function(){var e=[],t=this.options;return e.push(this._slotHeaders(this._slots[0],kendo.template(t.weekHeaderTemplate))),e.push(this._slotHeaders(this._slots[1],kendo.template(t.dayHeaderTemplate))),e}}),kendo.ui.GanttMonthView=O.extend({name:"month",options:{weekHeaderTemplate:R,monthHeaderTemplate:I,resizeTooltipFormat:"dddd, MMM d, yyyy"},range:function(e){var t,n=this.options.range;this.start=kendo.date.firstDayOfMonth(e.start),this.end=kendo.date.addDays(kendo.date.getDate(kendo.date.lastDayOfMonth(e.end)),1),n&&n.start&&(this.start=kendo.date.getDate(n.start)),n&&n.end&&(t=new Date(n.end),this.end=kendo.date.getDate(t)<n.end?kendo.date.getDate(new Date(t.setDate(t.getDate()+1))):kendo.date.getDate(t))},_createSlots:function(){var e=[];return e.push(this._months(this.start,this.end)),e.push(this._weeks(this.start,this.end)),e},_layout:function(){var e=[],t=this.options;return e.push(this._slotHeaders(this._slots[0],kendo.template(t.monthHeaderTemplate))),e.push(this._slotHeaders(this._slots[1],kendo.template(t.weekHeaderTemplate))),e}}),kendo.ui.GanttYearView=O.extend({name:"year",options:{yearHeaderTemplate:A,monthHeaderTemplate:I,resizeTooltipFormat:"dddd, MMM d, yyyy"},range:function(e){var t,n=this.options.range;this.start=kendo.date.firstDayOfMonth(new Date(e.start.setMonth(0))),this.end=kendo.date.firstDayOfMonth(new Date(e.end.setMonth(12))),n&&n.start&&(this.start=kendo.date.firstDayOfMonth(n.start)),n&&n.end&&(t=kendo.date.firstDayOfMonth(n.end),this.end=kendo.date.getDate(new Date(t.setMonth(t.getMonth()+1))))},_createSlots:function(){var t=[],n=this._months(this.start,this.end);return e(n).each(function(e,t){t.span=1}),t.push(this._years(this.start,this.end)),t.push(n),t},_layout:function(){var e=[],t=this.options;return e.push(this._slotHeaders(this._slots[0],kendo.template(t.yearHeaderTemplate))),e.push(this._slotHeaders(this._slots[1],kendo.template(t.monthHeaderTemplate))),e}}),r={wrapper:"k-timeline k-grid k-widget",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",tasksWrapper:"k-gantt-tables",dependenciesWrapper:"k-gantt-dependencies",task:"k-task",line:"k-line",taskResizeHandle:"k-resize-handle",taskResizeHandleWest:"k-resize-w",taskDragHandle:"k-task-draghandle",taskComplete:"k-task-complete",taskDelete:"k-task-delete",taskWrapActive:"k-task-wrap-active",taskWrap:"k-task-wrap",taskDot:"k-task-dot",taskDotStart:"k-task-start",taskDotEnd:"k-task-end",hovered:"k-state-hover",selected:"k-state-selected",origin:"k-origin"},o=kendo.ui.GanttTimeline=a.extend({init:function(e,t){a.fn.init.call(this,e,t),this.options.views&&this.options.views.length||(this.options.views=["day","week","month"]),g=kendo.support.isRtl(e),this._wrapper(),this._domTrees(),this._views(),this._selectable(),this._draggable(),this._resizable(),this._percentResizeDraggable(),this._createDependencyDraggable(),this._attachEvents(),this._tooltip()},options:{name:"GanttTimeline",messages:{views:{day:"Day",week:"Week",month:"Month",year:"Year",start:"Start",end:"End"}},snap:!0,selectable:!0,editable:!0},destroy:function(){a.fn.destroy.call(this),clearTimeout(this._tooltipTimeout),this._currentTimeUpdateTimer&&clearInterval(this._currentTimeUpdateTimer),this._unbindView(this._selectedView),this._moveDraggable&&this._moveDraggable.destroy(),this._resizeDraggable&&this._resizeDraggable.destroy(),this._percentDraggable&&this._percentDraggable.destroy(),this._dependencyDraggable&&this._dependencyDraggable.destroy(),this.touch&&this.touch.destroy(),this._headerTree=null,this._taskTree=null,this._dependencyTree=null,this.wrapper.off(k),kendo.destroy(this.wrapper)},_wrapper:function(){var t=o.styles,n=this,i=this.options,r=function(){var r,o,a=typeof i.rowHeight===b?i.rowHeight:i.rowHeight+"px",s=e(kendo.format(P,a)),l=n.wrapper.find(D+t.tasksWrapper);return l.append(s),r=h(s.find("tr")),o=s.find("td").height(),s.remove(),{row:r,cell:o}};this.wrapper=this.element.addClass(t.wrapper).append("<div class='"+t.gridHeader+"'><div class='"+t.gridHeaderWrap+"'></div></div>").append("<div class='"+t.gridContentWrap+"'><div class='"+t.tasksWrapper+"'></div><div class='"+t.dependenciesWrapper+"'></div></div>"),i.rowHeight&&(this._calculatedSize=r())},_domTrees:function(){var e=o.styles,t=kendo.dom.Tree,n=this.wrapper;this._headerTree=new t(n.find(D+e.gridHeaderWrap)[0]),this._taskTree=new t(n.find(D+e.tasksWrapper)[0]),this._dependencyTree=new t(n.find(D+e.dependenciesWrapper)[0])},_views:function(){var e,t,n,i,r,o,a,s=this.options.views;for(this.views={},o=0,a=s.length;o<a;o++)e=s[o],t=c(e),t&&e.selectable===!1||(n=t?"string"!=typeof e.type?e.title:e.type:e,i=L[n],i&&(t&&(e.type=i.type),i.title=this.options.messages.views[n]),e=f({title:n},i,t?e:{}),n&&(this.views[n]=e,r&&!e.selected||(r=n)));r&&(this._selectedViewName=r)},view:function(e){return e&&(this._selectView(e),this.trigger("navigate",{view:e,action:"changeView"})),this._selectedView},_selectView:function(e){e&&this.views[e]&&(this._selectedView&&this._unbindView(this._selectedView),this._selectedView=this._initializeView(e),this._selectedViewName=e)},_viewByIndex:function(e){var t,n=this.views;for(t in n){if(!e)return t;e--}},_initializeView:function(e){var n,i,r,o=this.views[e];if(o){if(n=o.type,"string"==typeof n&&(n=kendo.getter(o.type)(window)),!n)throw Error("There is no such view");i={},f(i,this.options.range,o.range),r=o.date||this.options.date,o=new n(this.wrapper,t(f(!0,{headerTree:this._headerTree,taskTree:this._taskTree,dependencyTree:this._dependencyTree,calculatedSize:this._calculatedSize},o,this.options,{date:r,range:i})))}return o},_unbindView:function(e){e&&e.destroy()},_range:function(e){var t,n,i={field:"start",dir:"asc"},r={field:"end",dir:"desc"};return e&&e.length?(t=new _(e).sort(i).toArray()[0].start||new Date,n=new _(e).sort(r).toArray()[0].end||new Date,{start:new Date(t),end:new Date(n)}):{start:new Date,end:new Date}},_render:function(e){var t=this.view(),n=this._range(e),i=t.options.date;this._tasks=e,t.range(n),t.renderLayout(),t.render(e),i&&t._scrollToDate(i)},_renderDependencies:function(e){this.view()._renderDependencies(e)},_taskByUid:function(e){var t,n,i=this._tasks,r=i.length;for(n=0;n<r;n++)if(t=i[n],t.uid===e)return t},_draggable:function(){var e,t,n,r,a=this,s=this.options.snap,l=o.styles,d=this.options.editable,c=function(){a.view()._removeDragHint(),e&&e.css("opacity",1),e=null,t=null,a.dragInProgress=!1};d&&d.move!==!1&&d.update!==!1&&(this._moveDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:D+l.task,holdToDrag:kendo.support.mobileOS,ignore:D+l.taskResizeHandle}),this._moveDraggable.bind("dragstart",function(i){var o=a.view();return e=i.currentTarget.parent(),t=a._taskByUid(i.currentTarget.attr("data-uid")),a.trigger("moveStart",{task:t})?void i.preventDefault():(n=t.start,r=o._timeByPosition(i.x.location,s)-n,o._createDragHint(e),e.css("opacity",.5),clearTimeout(a._tooltipTimeout),void(a.dragInProgress=!0))}).bind("drag",kendo.throttle(function(e){var i,o,l;a.dragInProgress&&(i=a.view(),o=new Date(i._timeByPosition(e.x.location,s)-r),l=o,a.trigger("move",{task:t,start:o})||(n=o,g&&(l=new Date(n.getTime()+t.duration())),i._updateDragHint(l)))},15)).bind("dragend",function(){a.trigger("moveEnd",{task:t,start:n}),c()}).bind("dragcancel",function(){c()}).userEvents.bind("select",function(){i()}))},_resizable:function(){var e,t,n,r,a,s=this,l=this.options.snap,d=o.styles,c=this.options.editable,u=function(){s.view()._removeResizeHint(),e=null,t=null,s.dragInProgress=!1};c&&c.resize!==!1&&c.update!==!1&&(this._resizeDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:D+d.taskResizeHandle,holdToDrag:!1}),this._resizeDraggable.bind("dragstart",function(i){return a=i.currentTarget.hasClass(d.taskResizeHandleWest),g&&(a=!a),e=i.currentTarget.closest(D+d.task),t=s._taskByUid(e.attr("data-uid")),s.trigger("resizeStart",{task:t})?void i.preventDefault():(n=t.start,r=t.end,s.view()._createResizeHint(t),clearTimeout(s._tooltipTimeout),void(s.dragInProgress=!0))}).bind("drag",kendo.throttle(function(e){var i,o;s.dragInProgress&&(i=s.view(),o=i._timeByPosition(e.x.location,l,!a),a?n=o<r?o:r:r=o>n?o:n,s.trigger("resize",{task:t,start:n,end:r})||i._updateResizeHint(n,r,a))},15)).bind("dragend",function(){s.trigger("resizeEnd",{task:t,resizeStart:a,start:n,end:r}),u()}).bind("dragcancel",function(){u()}).userEvents.bind("select",function(){i()}))},_percentResizeDraggable:function(){var e,t,n,r,a,s,l,d,c,h,f=this,p=o.styles,m=this.options.editable,v=function(){f.view()._removePercentCompleteTooltip(),t=null,e=null,f.dragInProgress=!1},_=function(e){t.find(D+p.taskComplete).width(e).end().siblings(D+p.taskDragHandle).css(g?"right":"left",e)};m&&m.dragPercentComplete!==!1&&m.update!==!1&&(this._percentDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:D+p.taskDragHandle,holdToDrag:!1}),this._percentDraggable.bind("dragstart",function(i){return f.trigger("percentResizeStart")?void i.preventDefault():(t=i.currentTarget.siblings(D+p.task),e=f._taskByUid(t.attr("data-uid")),l=e.percentComplete,n=t.offset(),r=this.element.offset(),a=t.find(D+p.taskComplete).width(),s=u(t),clearTimeout(f._tooltipTimeout),void(f.dragInProgress=!0))}).bind("drag",kendo.throttle(function(e){if(f.dragInProgress){h=g?-e.x.initialDelta:e.x.initialDelta;var t=Math.max(0,Math.min(s,a+h));l=Math.round(t/s*100),_(t),d=n.top-r.top,c=n.left+t-r.left,g&&(c+=s-2*t),f.view()._updatePercentCompleteTooltip(d,c,l)}},15)).bind("dragend",function(){f.trigger("percentResizeEnd",{task:e,percentComplete:l/100}),v()}).bind("dragcancel",function(){_(a),v()}).userEvents.bind("select",function(){i()}))},_createDependencyDraggable:function(){var t,n,r,a=this,s=e(),l=e(),d=m.msie&&m.version<9,c=o.styles,f=this.options.editable,p=function(){t.css("display","").removeClass(c.hovered),t.parent().removeClass(c.origin),t=null,g(!1),l=e(),s=e(),a.view()._removeDependencyDragHint(),a.dragInProgress=!1},g=function(e){l.hasClass(c.origin)||(l.find(D+c.taskDot).css("display",e?"block":""),s.toggleClass(c.hovered,e))};f&&f.dependencyCreate!==!1&&(d&&document.namespaces&&document.namespaces.add("kvml","urn:schemas-microsoft-com:vml","#default#VML"),this._dependencyDraggable=new kendo.ui.Draggable(this.wrapper,{distance:0,filter:D+c.taskDot,holdToDrag:!1}),this._dependencyDraggable.bind("dragstart",function(e){var i,o;return a.trigger("dependencyDragStart")?void e.preventDefault():(t=e.currentTarget.css("display","block").addClass(c.hovered),t.parent().addClass(c.origin),i=t.offset(),o=a.wrapper.find(D+c.tasksWrapper).offset(),n=Math.round(i.left-o.left+h(t)/2),r=Math.round(i.top-o.top+u(t)/2),clearTimeout(a._tooltipTimeout),void(a.dragInProgress=!0))}).bind("drag",kendo.throttle(function(t){var i,o,u,h;a.dragInProgress&&(a.view()._removeDependencyDragHint(),i=e(kendo.elementUnderCursor(t)),o=a.wrapper.find(D+c.tasksWrapper).offset(),u=t.x.location-o.left,h=t.y.location-o.top,a.view()._updateDependencyDragHint({x:n,y:r},{x:u,y:h},d),g(!1),s=i.hasClass(c.taskDot)?i:e(),l=i.closest(D+c.taskWrap),g(!0))},15)).bind("dragend",function(){var e,n,i,r,o;s.length&&(e=t.hasClass(c.taskDotStart),n=s.hasClass(c.taskDotStart),i=e?n?3:2:n?1:0,r=a._taskByUid(t.siblings(D+c.task).attr("data-uid")),o=a._taskByUid(s.siblings(D+c.task).attr("data-uid")),r!==o&&a.trigger("dependencyDragEnd",{type:i,predecessor:r,successor:o})),p()}).bind("dragcancel",function(){p()}).userEvents.bind("select",function(){i()}))},_selectable:function(){var t=this,n=o.styles;this.options.selectable&&this.wrapper.on(w+k,D+n.task,function(n){n.stopPropagation(),n.ctrlKey?t.trigger("clear"):t.trigger("select",{uid:e(this).attr("data-uid")})}).on(w+k,D+n.taskWrap,function(t){t.stopPropagation(),e(this).css("z-index","0");var i=e(document.elementFromPoint(t.clientX,t.clientY));i.hasClass(n.line)&&i.click(),e(this).css("z-index","")}).on(w+k,D+n.tasksWrapper,function(){t.selectDependency().length>0?t.clearSelection():t.trigger("clear")}).on(w+k,D+n.line,function(e){e.stopPropagation(),t.selectDependency(this)})},select:function(e){var t=this.wrapper.find(e),n=o.styles;return t.length?(this.clearSelection(),t.addClass(n.selected),void(kendo.support.mobileOS&&t.parent().addClass(n.taskWrapActive))):this.wrapper.find(D+n.task+D+n.selected)},selectDependency:function(t){var n,i=this.wrapper.find(t),r=o.styles;return i.length?(this.clearSelection(),this.trigger("clear"),n=e(i).attr("data-uid"),void this.wrapper.find(D+r.line+"[data-uid='"+n+"']").addClass(r.selected)):this.wrapper.find(D+r.line+D+r.selected)},clearSelection:function(){var e=o.styles;this.wrapper.find(D+e.selected).removeClass(e.selected),kendo.support.mobileOS&&this.wrapper.find(D+e.taskWrapActive).removeClass(e.taskWrapActive)},_attachEvents:function(){var t=this,n=o.styles,i=this.options.editable;i&&(this._tabindex(),this.wrapper.on(w+k,D+n.taskDelete,function(i){t.trigger("removeTask",{uid:e(this).closest(D+n.task).attr("data-uid")}),i.stopPropagation(),i.preventDefault()}).on(S+k,function(e){var n,i=t.options.editable;e.keyCode===v.DELETE&&i&&i.dependencyDestroy!==!1&&(n=t.selectDependency(),n.length&&(t.trigger("removeDependency",{uid:n.attr("data-uid")}),t.clearSelection()))}),kendo.support.mobileOS?this.touch=this.wrapper.kendoTouch({filter:D+n.task,doubletap:function(n){t.options.editable.update!==!1&&t.trigger("editTask",{uid:e(n.touch.currentTarget).attr("data-uid")})}}).data("kendoTouch"):this.wrapper.on(y+k,D+n.task,function(n){t.options.editable.update!==!1&&(t.trigger("editTask",{uid:e(this).attr("data-uid")}),n.stopPropagation(),n.preventDefault())}))},_tooltip:function(){var t,n=this,i=this.options.tooltip,r=o.styles,a=function(e){t=e.clientX};i&&i.visible===!1||(kendo.support.mobileOS?(this.wrapper.on(w+k,D+r.taskDelete,function(e){
e.stopPropagation(),n.view()._removeTaskTooltip()}).on(T+k,D+r.task,function(t){var i=e(t.relatedTarget).parents(D+r.taskWrap,D+r.task);0===i.length&&n.view()._removeTaskTooltip()}),this.touch&&this.touch.bind("tap",function(t){var i=t.touch.target,r=n._taskByUid(e(i).attr("data-uid")),o=t.touch.x.client;n.view()._taskTooltip&&n.view()._removeTaskTooltip(),n.view()._createTaskTooltip(r,i,o)}).bind("doubletap",function(){n.view()._removeTaskTooltip()})):this.wrapper.on(C+k,D+r.task,function(){var i=this,r=n._taskByUid(e(this).attr("data-uid"));n.dragInProgress||(n._tooltipTimeout=setTimeout(function(){n.view()._createTaskTooltip(r,i,t)},800),e(this).on(x,a))}).on(T+k,D+r.task,function(){clearTimeout(n._tooltipTimeout),n.view()._removeTaskTooltip(),e(this).off(x,a)}))}}),f(!0,o,{styles:r})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.gantt.min",["kendo.data.min","kendo.popup.min","kendo.window.min","kendo.resizable.min","kendo.gantt.list.min","kendo.gantt.timeline.min","kendo.grid.min","kendo.pdf.min"],e)}(function(){return function(e,t){function n(e){return"["+m.attr("uid")+(e?"='"+e+"']":"]")}function i(e){return delete e.name,delete e.prefix,delete e.remove,delete e.edit,delete e.add,delete e.navigate,e}function r(e){var t,n,i,r,o,a;if(e.filter("[name=end], [name=start]").length){for(t=e.attr("name"),n=m.widgetInstance(e,m.ui),i={},r=e;r!==window&&!o;)r=r.parent(),o=r.data("kendoEditable");return!(a=o?o.options.model:null)||(i.start=a.start,i.end=a.end,i[t]=n?n.value():m.parseDate(e.value()),i.start<=i.end)}return!0}function o(t,n){var i=t.parents("["+m.attr("role")+'="gantt"]'),r=[],o=a(i);t.attr(L,0),n&&o.each(function(t,n){r[t]=e(n).scrollTop()});try{t[0].setActive()}catch(s){t[0].focus()}n&&o.each(function(t,n){e(n).scrollTop(r[t])})}function a(t){return e(t).parentsUntil("body").filter(function(e,t){var n=m.getComputedStyles(t,["overflow"]);return"visible"!=n.overflow}).add(window)}var s,l,d,c,u,h,f,p,m=window.kendo,g="matchMedia"in window,v=m.support.browser,_=m.support.mobileOS,b=m.Observable,k=m.ui.Widget,w=m.data.DataSource,y=m.data.ObservableObject,x=m.data.ObservableArray,C=m.data.Query,T=e.isArray,S=e.inArray,D=m.isFunction,E=e.proxy,F=e.extend,R=e.isPlainObject,I=e.map,A=m._outerWidth,M=m._outerHeight,z=m.keys,H=3,N=".kendoGantt",P="p0",L="tabIndex",B="click",O="width",V="string",W={down:{origin:"bottom left",position:"top left"},up:{origin:"top left",position:"bottom left"}},U="aria-activedescendant",q="gantt_active_cell",j="action-option-focused",$=".",G="Are you sure you want to delete this task?",Y="Are you sure you want to delete this dependency?",K=m.template('<button class="#=styles.buttonToggle#" type="button"><span class="#=styles.iconToggle#">&nbps;</span></button>'),Q='<button class="#=styles.button# #=className#" type="button" #if (action) {#data-action="#=action#"#}#><span class="#=iconClass#"></span><span>#=text#</span></button>',X='<a class="#=className#" #=attr# href="\\#">#=text#</a>',J=m.template('<li class="#=styles.currentView# #=styles.viewButtonDefault#"><a href="\\#" class="#=styles.link#">&nbps;</a></li>'),Z=m.template('<ul class="#=styles.viewsWrapper#">#for(var view in views){#<li class="#=styles.viewButtonDefault# #=styles.viewButton#-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a href="\\#" class="#=styles.link#">#=views[view].title#</a></li>#}#</ul>'),ee=m.template('<div class="#=styles.popupWrapper#"><ul class="#=styles.popupList#" role="listbox">#for(var i = 0, l = actions.length; i < l; i++){#<li class="#=styles.item#" data-action="#=actions[i].data#" role="option">#=actions[i].text#</span>#}#</ul></div>'),te=function(t,n){var i={name:n.field},r=n.model.fields[n.field].validation;r&&R(r)&&r.message&&(i[m.attr("dateCompare-msg")]=r.message),e('<input type="text" required '+m.attr("type")+'="date" '+m.attr("role")+'="datetimepicker" '+m.attr("bind")+'="value:'+n.field+'" '+m.attr("validate")+"='true' />").attr(i).appendTo(t),e("<span "+m.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},ne=function(t,n){e('<a href="#" class="'+n.styles.button+'">'+n.messages.assignButton+"</a>").click(n.click).appendTo(t)},ie={wrapper:"k-widget k-gantt",rowHeight:"k-gantt-rowheight",listWrapper:"k-gantt-layout k-gantt-treelist",list:"k-gantt-treelist",timelineWrapper:"k-gantt-layout k-gantt-timeline",timeline:"k-gantt-timeline",splitBarWrapper:"k-splitbar k-state-default k-splitbar-horizontal k-splitbar-draggable-horizontal k-gantt-layout",splitBar:"k-splitbar",splitBarHover:"k-splitbar-horizontal-hover",popupWrapper:"k-list-container",popupList:"k-list k-reset",resizeHandle:"k-resize-handle",icon:"k-icon",item:"k-item",line:"k-line",buttonDelete:"k-gantt-delete",buttonCancel:"k-gantt-cancel",buttonSave:"k-gantt-update",buttonToggle:"k-gantt-toggle",primary:"k-primary",hovered:"k-state-hover",selected:"k-state-selected",focused:"k-state-focused",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",popup:{form:"k-popup-edit-form",editForm:"k-gantt-edit-form",formContainer:"k-edit-form-container",resourcesFormContainer:"k-resources-form-container",message:"k-popup-message",buttonsContainer:"k-edit-buttons k-state-default",button:"k-button",editField:"k-edit-field",editLabel:"k-edit-label",resourcesField:"k-gantt-resources"},toolbar:{headerWrapper:"k-floatwrap k-header k-gantt-toolbar",footerWrapper:"k-floatwrap k-header k-gantt-toolbar",toolbar:"k-gantt-toolbar",expanded:"k-state-expanded",views:"k-gantt-views",viewsWrapper:"k-reset k-header k-gantt-views",actions:"k-gantt-actions",button:"k-button k-button-icontext",buttonToggle:"k-button k-button-icon k-gantt-toggle",iconPlus:"k-icon k-i-plus",iconPdf:"k-icon k-i-pdf",iconToggle:"k-icon k-i-gantt-toggle",viewButtonDefault:"k-state-default",viewButton:"k-view",currentView:"k-current-view",link:"k-link",pdfButton:"k-gantt-pdf",appendButton:"k-gantt-create"}},re=b.extend({init:function(e,t){b.fn.init.call(this),this.element=e,this.options=F(!0,{},this.options,t),this._popup()},options:{direction:"down",navigatable:!1},_current:function(e){var t=p.styles,n=this.list.find($+t.focused),i=n[e]();i.length&&(n.removeClass(t.focused).removeAttr("id"),i.addClass(t.focused).attr("id",j),this.list.find("ul").removeAttr(U).attr(U,j))},_popup:function(){var t=this,n=p.styles,i="li"+$+n.item,r=$+n.toolbar.appendButton,o=this.options.messages.actions,a=this.options.navigatable;this.list=e(ee({styles:n,actions:[{data:"add",text:o.addChild},{data:"insert-before",text:o.insertBefore},{data:"insert-after",text:o.insertAfter}]})),this.element.append(this.list),this.popup=new m.ui.Popup(this.list,F({anchor:this.element.find(r),open:function(){t._adjustListWidth()},animation:this.options.animation},W[this.options.direction])),this.element.on(B+N,r,function(i){var r=e(this),o=r.attr(m.attr("action"));i.preventDefault(),o?t.trigger("command",{type:o}):(t.popup.open(),a&&t.list.find("li:first").addClass(n.focused).attr("id",j).end().find("ul").attr({TABINDEX:0,"aria-activedescendant":j}).focus())}),this.list.find(i).hover(function(){e(this).addClass(n.hovered)},function(){e(this).removeClass(n.hovered)}).end().on(B+N,i,function(){t.trigger("command",{type:e(this).attr(m.attr("action"))}),t.popup.close()}),a&&(this.popup.bind("close",function(){t.list.find(i).removeClass(n.focused).end().find("ul").attr(L,0),t.element.parents("["+m.attr("role")+'="gantt"]').find($+n.gridContent+" > table:first").focus()}),this.list.find("ul").on("keydown"+N,function(e){var i=e.keyCode;switch(i){case z.UP:e.preventDefault(),t._current("prev");break;case z.DOWN:e.preventDefault(),t._current("next");break;case z.ENTER:t.list.find($+n.focused).click();break;case z.ESC:e.preventDefault(),t.popup.close()}}))},_adjustListWidth:function(){var e,t,n=this.list,i=p.styles,r=n[0].style.width,o=this.element.find($+i.toolbar.appendButton),a=A(n);!n.data(O)&&r||(e=window.getComputedStyle?window.getComputedStyle(o[0],null):0,t=e?parseFloat(e.width):A(o),e&&(v.mozilla||v.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),r="border-box"!==n.css("box-sizing")?t-(A(n)-n.width()):t,a>r&&(r=a),n.css({fontFamily:o.css("font-family"),width:r}).data(O,r))},destroy:function(){clearTimeout(this._focusTimeout),this.popup.destroy(),this.element.off(N),this.list.off(N),this.unbind()}}),oe=function(e,t){return function(n){var i,r;if(n=T(n)?{data:n}:n,i=n||{},r=i.data,i.data=r,!(i instanceof e)&&i instanceof w)throw Error("Incorrect DataSource type. Only "+t+" instances are supported");return i instanceof e?i:new e(i)}},ae=m.data.Model.define({id:"id",fields:{id:{type:"number"},predecessorId:{type:"number"},successorId:{type:"number"},type:{type:"number"}}}),se=w.extend({init:function(e){w.fn.init.call(this,F(!0,{},{schema:{modelBase:ae,model:ae}},e))},successors:function(e){return this._dependencies("predecessorId",e)},predecessors:function(e){return this._dependencies("successorId",e)},dependencies:function(e){var t=this.predecessors(e),n=this.successors(e);return t.push.apply(t,n),t},_dependencies:function(e,t){var n=this.view(),i={field:e,operator:"eq",value:t};return n=new C(n).filter(i).toArray()}});se.create=oe(se,"GanttDependencyDataSource"),l=m.data.Model.define({duration:function(){var e=this.end,t=this.start;return e-t},isMilestone:function(){return 0===this.duration()},_offset:function(e){var t,n,i=["start","end"];for(n=0;n<i.length;n++)t=new Date(this.get(i[n]).getTime()+e),this.set(i[n],t)},id:"id",fields:{id:{type:"number"},parentId:{type:"number",defaultValue:null,validation:{required:!0}},orderId:{type:"number",validation:{required:!0}},title:{type:"string",defaultValue:"New task"},start:{type:"date",validation:{required:!0}},end:{type:"date",validation:{required:!0,dateCompare:r,message:"End date should be after or equal to the start date"}},percentComplete:{type:"number",validation:{required:!0,min:0,max:1,step:.01}},summary:{type:"boolean"},expanded:{type:"boolean",defaultValue:!0}}}),d=w.extend({init:function(e){w.fn.init.call(this,F(!0,{},{schema:{modelBase:l,model:l}},e))},remove:function(e){var t=e.get("parentId"),n=this.taskAllChildren(e);return this._removeItems(n),e=w.fn.remove.call(this,e),this._childRemoved(t,e.get("orderId")),e},add:function(e){if(e)return e=this._toGanttTask(e),this.insert(this.taskSiblings(e).length,e)},insert:function(e,t){if(t)return t=this._toGanttTask(t),t.set("orderId",e),t=w.fn.insert.call(this,e,t),this._reorderSiblings(t,this.taskSiblings(t).length-1),this._resolveSummaryFields(this.taskParent(t)),t},taskChildren:function(e){var n,i=this.view(),r={field:"parentId",operator:"eq",value:null},o=this._sort&&this._sort.length?this._sort:{field:"orderId",dir:"asc"};if(e){if(n=e.get("id"),n===t||null===n||""===n)return[];r.value=n}return i=new C(i).filter(r).sort(o).toArray()},taskAllChildren:function(e){var t=[],n=this,i=function(e){var r=n.taskChildren(e);t.push.apply(t,r),I(r,i)};return e?i(e):t=this.view(),t},taskSiblings:function(e){if(!e)return null;var t=this.taskParent(e);return this.taskChildren(t)},taskParent:function(e){return e&&null!==e.get("parentId")?this.get(e.parentId):null},taskLevel:function(e){for(var t=0,n=this.taskParent(e);null!==n;)t+=1,n=this.taskParent(n);return t},taskTree:function(e){var t,n,i,r,o=[],a=this.taskChildren(e);for(n=0,i=a.length;n<i;n++)t=a[n],o.push(t),t.get("expanded")&&(r=this.taskTree(t),o.push.apply(o,r));return o},update:function(e,n){var i,r,o=this,a=function(e,t){var n,i,r=o.taskAllChildren(e);for(n=0,i=r.length;n<i;n++)r[n]._offset(t)},s=function(e){var t=e.field,n=e.sender;switch(t){case"start":o._resolveSummaryStart(o.taskParent(n)),a(n,n.get(t).getTime()-i.getTime());break;case"end":o._resolveSummaryEnd(o.taskParent(n));break;case"percentComplete":o._resolveSummaryPercentComplete(o.taskParent(n));break;case"orderId":o._reorderSiblings(n,i)}};n.parentId!==t&&(i=e.get("parentId"),i!==n.parentId&&(e.set("parentId",n.parentId),o._childRemoved(i,e.get("orderId")),e.set("orderId",o.taskSiblings(e).length-1),o._resolveSummaryFields(o.taskParent(e))),delete n.parentId),e.bind("change",s);for(r in n)i=e.get(r),e.set(r,n[r]);e.unbind("change",s)},_resolveSummaryFields:function(e){e&&(this._updateSummary(e),this.taskChildren(e).length&&(this._resolveSummaryStart(e),this._resolveSummaryEnd(e),this._resolveSummaryPercentComplete(e)))},_resolveSummaryStart:function(e){var t=this,n=function(e){var n,i,r,o=t.taskChildren(e),a=o[0].start.getTime();for(i=1,r=o.length;i<r;i++)n=o[i].start.getTime(),n<a&&(a=n);return new Date(a)};this._updateSummaryRecursive(e,"start",n)},_resolveSummaryEnd:function(e){var t=this,n=function(e){var n,i,r,o=t.taskChildren(e),a=o[0].end.getTime();for(i=1,r=o.length;i<r;i++)n=o[i].end.getTime(),n>a&&(a=n);return new Date(a)};this._updateSummaryRecursive(e,"end",n)},_resolveSummaryPercentComplete:function(e){var t=this,n=function(e){var n=t.taskChildren(e),i=new C(n).aggregate([{field:"percentComplete",aggregate:"average"}]);return i.percentComplete.average};this._updateSummaryRecursive(e,"percentComplete",n)},_updateSummaryRecursive:function(e,t,n){var i,r;e&&(i=n(e),e.set(t,i),r=this.taskParent(e),r&&this._updateSummaryRecursive(r,t,n))},_childRemoved:function(e,t){var n,i,r=null===e?null:this.get(e),o=this.taskChildren(r);for(n=t,i=o.length;n<i;n++)o[n].set("orderId",n);this._resolveSummaryFields(r)},_reorderSiblings:function(e,t){var n,i=e.get("orderId"),r=i>t,o=r?t:i,a=r?i:t,s=r?o:o+1,l=this.taskSiblings(e);for(a=Math.min(a,l.length-1),n=o;n<=a;n++)l[n]!==e&&(l[n].set("orderId",s),s+=1)},_updateSummary:function(e){if(null!==e){var t=this.taskChildren(e).length;e.set("summary",t>0)}},_toGanttTask:function(e){if(!(e instanceof l)){var t=e;e=this._createNewModel(),e.accept(t)}return e}}),d.create=oe(d,"GanttDataSource"),F(!0,m.data,{GanttDataSource:d,GanttTask:l,GanttDependencyDataSource:se,GanttDependency:ae}),c={desktop:{dateRange:te,resources:ne}},u=m.Observable.extend({init:function(e,t){m.Observable.fn.init.call(this),this.element=e,this.options=F(!0,{},this.options,t),this.createButton=this.options.createButton},fields:function(t,n){var i,r=this,o=this.options,a=o.messages.editor,s=o.resources,l=function(e){e.preventDefault(),s.editor(r.container.find($+p.styles.popup.resourcesField),n)};return o.editable.template?i=e.map(n.fields,function(e,t){return{field:t}}):(i=[{field:"title",title:a.title},{field:"start",title:a.start,editor:t.dateRange},{field:"end",title:a.end,editor:t.dateRange},{field:"percentComplete",title:a.percentComplete,format:P}],n.get(s.field)&&i.push({field:s.field,title:a.resources,messages:a,editor:t.resources,click:l,styles:p.styles.popup})),i},_buildEditTemplate:function(e,t,n){var i,r,o,a,s=this.options.resources,l=this.options.editable.template,d=F({},m.Template,this.options.templateSettings),c=d.paramName,u=p.styles.popup,h="";if(l)typeof l===V&&(l=window.unescape(l)),h+=m.template(l,d)(e);else for(i=0,r=t.length;i<r;i++)o=t[i],h+='<div class="'+u.editLabel+'"><label for="'+o.field+'">'+(o.title||o.field||"")+"</label></div>",o.field===s.field&&(h+='<div class="'+u.resourcesField+'" style="display:none"></div>'),!e.editable||e.editable(o.field)?(n.push(o),h+="<div "+m.attr("container-for")+'="'+o.field+'" class="'+u.editField+'"></div>'):(a="#:",o.field?(o=m.expr(o.field,c),a+=o+"==null?'':"+o):a+="''",a+="#",a=m.template(a,d),h+='<div class="'+u.editField+'">'+a(e)+"</div>");return h}}),h=u.extend({destroy:function(){this.close(),this.unbind()},editTask:function(e){this.editable=this._createPopupEditor(e)},close:function(){var e=this,t=function(){e.editable&&(e.editable.destroy(),e.editable=null,e.container=null),e.popup&&(e.popup.destroy(),e.popup=null)};this.editable&&this.container.is(":visible")?(e.trigger("close",{window:e.container}),this.container.data("kendoWindow").bind("deactivate",t).close()):t()},showDialog:function(t){var n,i,r,o,a=t.buttons,s=p.styles.popup,l=m.format('<div class="{0}"><div class="{1}"><p class="{2}">{3}</p><div class="{4}">',s.form,s.formContainer,s.message,t.text,s.buttonsContainer);for(n=0,i=a.length;n<i;n++)l+=this.createButton(a[n]);l+="</div></div></div>",r=this.element,this.popup&&this.popup.destroy(),o=this.popup=e(l).appendTo(r).eq(0).on("click",$+s.button,function(t){t.preventDefault(),o.close();var n=e(t.currentTarget).index();a[n].click()}).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,deactivate:function(){this.destroy(),r.focus()}}).getKendoWindow(),o.center().open()},_createPopupEditor:function(t){var n,i,r=this,o={},a=this.options.messages,s=p.styles,l=s.popup,d=m.format('<div {0}="{1}" class="{2} {3}"><div class="{4}">',m.attr("uid"),t.uid,l.form,l.editForm,l.formContainer),u=this.fields(c.desktop,t),h=[];return d+=this._buildEditTemplate(t,u,h),d+='<div class="'+l.buttonsContainer+'">',d+=this.createButton({name:"update",text:a.save,className:p.styles.primary}),d+=this.createButton({name:"cancel",text:a.cancel}),r.options.editable.destroy!==!1&&(d+=this.createButton({name:"delete",text:a.destroy})),d+="</div></div></div>",n=this.container=e(d).appendTo(this.element).eq(0).kendoWindow(F({modal:!0,resizable:!1,draggable:!0,title:a.editor.editorTitle,visible:!1,close:function(e){e.userTriggered&&r.trigger("cancel",{container:n,model:t})&&e.preventDefault()}},o)),i=n.kendoEditable({fields:h,model:t,clearContainer:!1,validateOnBlur:!0,target:r.options.target}).data("kendoEditable"),m.cycleForm(n),this.trigger("edit",{container:n,model:t})?r.trigger("cancel",{container:n,model:t}):(n.data("kendoWindow").center().open(),n.on(B+N,$+s.buttonCancel,function(e){e.preventDefault(),e.stopPropagation(),r.trigger("cancel",{container:n,model:t})}),n.on(B+N,$+s.buttonSave,function(e){var i,o,a,s,l;for(e.preventDefault(),e.stopPropagation(),i=r.fields(c.desktop,t),o={},s=0,l=i.length;s<l;s++)a=i[s].field,o[a]=t.get(a);r.trigger("save",{container:n,model:t,updateInfo:o})}),n.on(B+N,$+s.buttonDelete,function(e){e.preventDefault(),e.stopPropagation(),r.trigger("remove",{container:n,model:t})})),i}}),f=k.extend({init:function(e,t){k.fn.init.call(this,e,t),this.wrapper=this.element,this.model=this.options.model,this.resourcesField=this.options.resourcesField,this.createButton=this.options.createButton,this._initContainer(),this._attachHandlers()},events:["save"],open:function(){this.window.center().open()},close:function(){this.window.bind("deactivate",E(this.destroy,this)).close()},destroy:function(){this._dettachHandlers(),this.grid.destroy(),this.grid=null,this.window.destroy(),this.window=null,k.fn.destroy.call(this),m.destroy(this.wrapper),this.element=this.wrapper=null},_attachHandlers:function(){var t=p.styles,n=this.grid,i=this._cancelProxy=E(this._cancel,this);this.container.on(B+N,$+t.buttonCancel,this._cancelProxy),this._saveProxy=E(this._save,this),this.container.on(B+N,$+t.buttonSave,this._saveProxy),this.window.bind("close",function(e){e.userTriggered&&i(e)}),n.wrapper.on(B+N,"input[type='checkbox']",function(){var t=e(this),i=e(t).closest("tr"),r=n.dataSource.getByUid(i.attr(m.attr("uid"))),o=e(t).is(":checked")?1:"";r.set("value",o)})},_dettachHandlers:function(){this._cancelProxy=null,this._saveProxy=null,this.container.off(N),this.grid.wrapper.off()},_cancel:function(e){e.preventDefault(),this.close()},_save:function(e){e.preventDefault(),this._updateModel(),this.wrapper.is($+p.styles.popup.resourcesField)||this.trigger("save",{container:this.wrapper,model:this.model}),this.close()},_initContainer:function(){var t=this,n=p.styles.popup,i=m.format('<div class="{0} {1}"><div class="{2} {3}"/></div>"',n.form,n.editForm,n.formContainer,n.resourcesFormContainer);i=e(i),this.container=i.find($+n.resourcesFormContainer),this.window=i.kendoWindow({modal:!0,resizable:!1,draggable:!0,visible:!1,title:this.options.messages.resourcesEditorTitle,open:function(){t.grid.resize(!0)}}).data("kendoWindow"),this._resourceGrid(),this._createButtons()},_resourceGrid:function(){var t=this,n=this.options.messages,i=e('<div id="resources-grid"/>').appendTo(this.container);this.grid=new m.ui.Grid(i,{columns:[{field:"name",title:n.resourcesHeader,template:"<label><input type='checkbox' value='#=name#'# if (value > 0 && value !== null) {#checked='checked'# } #/>#=name#</labe>"},{field:"value",title:n.unitsHeader,template:function(e){var t=e.format,n=null!==e.value?e.value:"";return t?m.toString(n,t):n}}],height:280,sortable:!0,editable:!0,filterable:!0,dataSource:{data:t.options.data,schema:{model:{id:"id",fields:{id:{from:"id"},name:{from:"name",type:"string",editable:!1},value:{from:"value",type:"number",defaultValue:""},format:{from:"format",type:"string"}}}}},save:function(e){var t=!!e.values.value;e.container.parent().find("input[type='checkbox']").prop("checked",t)}})},_createButtons:function(){var e,t,n=this.options.buttons,i='<div class="'+p.styles.popup.buttonsContainer+'">';for(e=0,t=n.length;e<t;e++)i+=this.createButton(n[e]);i+="</div>",this.container.append(i)},_updateModel:function(){var e,t,n,i=[],r=this.grid.dataSource.data();for(t=0,n=r.length;t<n;t++)e=r[t].get("value"),null!==e&&e>0&&i.push(r[t]);this.model[this.resourcesField]=i}}),p=k.extend({init:function(e,t,n){T(t)&&(t={dataSource:t}),s={append:{text:"Add Task",action:"add",className:p.styles.toolbar.appendButton,iconClass:p.styles.toolbar.iconPlus},pdf:{text:"Export to PDF",className:p.styles.toolbar.pdfButton,iconClass:p.styles.toolbar.iconPdf}},k.fn.init.call(this,e,t),n&&(this._events=n),this._wrapper(),this._resources(),this.options.views&&this.options.views.length||(this.options.views=["day","week","month"]),this._timeline(),this._toolbar(),this._footer(),this._adjustDimensions(),this._preventRefresh=!0,this.view(this.timeline._selectedViewName),this._preventRefresh=!1,this._dataSource(),this._assignments(),this._dropDowns(),this._list(),this._dependencies(),this._resizable(),this._scrollable(),this._dataBind(),this._attachEvents(),this._createEditor(),m.notify(this)},events:["dataBinding","dataBound","add","edit","remove","cancel","save","change","navigate","moveStart","move","moveEnd","resizeStart","resize","resizeEnd","columnResize"],options:{name:"Gantt",autoBind:!0,navigatable:!1,selectable:!0,editable:!0,resizable:!1,columnResizeHandleWidth:H,columns:[],views:[],dataSource:{},dependencies:{},resources:{},assignments:{},taskTemplate:null,messages:{save:"Save",cancel:"Cancel",destroy:"Delete",deleteTaskConfirmation:G,deleteDependencyConfirmation:Y,deleteTaskWindowTitle:"Delete task",deleteDependencyWindowTitle:"Delete dependency",views:{day:"Day",week:"Week",month:"Month",year:"Year",start:"Start",end:"End"},actions:{append:"Add Task",addChild:"Add Child",insertBefore:"Add Above",insertAfter:"Add Below",pdf:"Export to PDF"},editor:{editorTitle:"Task",resourcesEditorTitle:"Resources",title:"Title",start:"Start",end:"End",percentComplete:"Complete",resources:"Resources",assignButton:"Assign",resourcesHeader:"Resources",unitsHeader:"Units"}},showWorkHours:!0,showWorkDays:!0,toolbar:null,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,hourSpan:1,snap:!0,height:600,listWidth:"30%",rowHeight:null},select:function(e){var n=this.list;return e?(n.select(e),t):n.select()},clearSelection:function(){this.list.clearSelection()},destroy:function(){k.fn.destroy.call(this),this.dataSource&&(this.dataSource.unbind("change",this._refreshHandler),this.dataSource.unbind("progress",this._progressHandler),this.dataSource.unbind("error",this._errorHandler)),this.dependencies&&(this.dependencies.unbind("change",this._dependencyRefreshHandler),this.dependencies.unbind("error",this._dependencyErrorHandler)),this.timeline&&(this.timeline.unbind(),this.timeline.destroy()),this.list&&(this.list.unbind(),this.list.destroy()),this.footerDropDown&&this.footerDropDown.destroy(),this.headerDropDown&&this.headerDropDown.destroy(),this._editor&&this._editor.destroy(),this._resizeDraggable&&this._resizeDraggable.destroy(),this.toolbar.off(N),g&&(this._mediaQuery.removeListener(this._mediaQueryHandler),this._mediaQuery=null),e(window).off("resize"+N,this._resizeHandler),e(this.wrapper).off(N),this.toolbar=null,this.footer=null},setOptions:function(t){var n,i=m.deepExtend({},this.options,t),r=this._events;t.views||(n=this.view().name,i.views=e.map(this.options.views,function(e){var t=R(e),i=t?"string"!=typeof e.type?e.title:e.type:e;return n===i?t?e.selected=!0:e={type:i,selected:!0}:t&&(e.selected=!1),e})),t.dataSource||(i.dataSource=this.dataSource),t.dependencies||(i.dependencies=this.dependencies),t.resources||(i.resources=this.resources),t.assignments||(i.assignments=this.assignments),this.destroy(),this.element.empty(),this.options=null,this.init(this.element,i,r),k.fn._setEvents.call(this,i)},_attachEvents:function(){this._resizeHandler=E(this.resize,this,!1),e(window).on("resize"+N,this._resizeHandler)},_wrapper:function(){var e=p.styles,t=[e.icon,e.resizeHandle].join(" "),n=this.options,i=n.height,r=n.width;this.wrapper=this.element.addClass(e.wrapper).append("<div class='"+e.listWrapper+"'><div></div></div>").append("<div class='"+e.splitBarWrapper+"'><div class='"+t+"'></div></div>").append("<div class='"+e.timelineWrapper+"'><div></div></div>"),this.wrapper.find($+e.list).width(n.listWidth),i&&this.wrapper.height(i),r&&this.wrapper.width(r),n.rowHeight&&this.wrapper.addClass(e.rowHeight)},_toolbar:function(){var t,n,i,r=this,o=p.styles,a=$+o.toolbar.views+" > li",s=$+o.toolbar.pdfButton,l=$+o.buttonToggle,d=$+o.gridContent,c=e($+o.list),u=e($+o.timeline),h=o.hovered,f=this.options.toolbar,v=e("<div class='"+o.toolbar.actions+"'>"),_=function(e){e.matches?c.css({display:"none","max-width":0}):(c.css({display:"inline-block",width:"30%","max-width":"none"}),u.css("display","inline-block"),r.refresh(),u.find(d).scrollTop(r.scrollTop)),r._resize()};D(f)||(f=typeof f===V?f:this._actions(f),f=E(m.template(f),this)),i=e(K({styles:o.toolbar})),n=e(Z({ns:m.ns,views:this.timeline.views,styles:o.toolbar})),v.append(f({})),t=e("<div class='"+o.toolbar.headerWrapper+"'>").append(i).append(n).append(v),n.find("li").length>1&&n.prepend(J({styles:o.toolbar})),this.wrapper.prepend(t),this.toolbar=t,g&&(this._mediaQueryHandler=E(_,this),this._mediaQuery=window.matchMedia("(max-width: 480px)"),this._mediaQuery.addListener(this._mediaQueryHandler)),t.on(B+N,a,function(t){var i,a,s;t.preventDefault(),i=r.list,a=e(this).attr(m.attr("name")),s=n.find($+o.toolbar.currentView),s.is(":visible")&&s.parent().toggleClass(o.toolbar.expanded),i.editable&&i.editable.trigger("validate")||r.trigger("navigate",{view:a})||r.view(a)}).on(B+N,s,function(e){e.preventDefault(),r.saveAsPDF()}).on(B+N,l,function(e){e.preventDefault(),c.is(":visible")?(c.css({display:"none",width:"0"}),u.css({display:"inline-block",width:"100%"}),r.refresh(),u.find(d).scrollTop(r.scrollTop)):(u.css({display:"none",width:0}),c.css({display:"inline-block",width:"100%","max-width":"none"}).find(d).scrollTop(r.scrollTop)),r._resize()}),this.wrapper.find($+o.toolbar.toolbar+" li").hover(function(){e(this).addClass(h)},function(){e(this).removeClass(h)})},_actions:function(){var e,t,n=this.options,i=n.editable,r=n.toolbar,o="";if(!T(r)){if(!i||i.create===!1)return o;r=["append"]}for(e=0,t=r.length;e<t;e++)o+=this._createButton(r[e]);return o},_footer:function(){var t,n,i,r,o,a=this.options.editable;a&&a.create!==!1&&(t=p.styles.toolbar,n=this.options.messages.actions,i=e(m.template(Q)(F(!0,{styles:t},s.append,{text:n.append}))),r=e("<div class='"+t.actions+"'>").append(i),o=e("<div class='"+t.footerWrapper+"'>").append(r),this.wrapper.append(o),this.footer=o)},_createButton:function(e){var t=e.template||Q,n=this.options.messages.actions,i=typeof e===V?e:e.name||e.text,r=s[i]?s[i].className:"k-gantt-"+(i||"").replace(/\s/g,""),o={iconClass:"",action:"",text:i,className:r,styles:p.styles.toolbar};if(!(i||R(e)&&e.template))throw Error("Custom commands should have name specified");return o=F(!0,o,s[i],{text:n[i]}),R(e)&&(e.className&&S(o.className,e.className.split(" "))<0&&(e.className+=" "+o.className),o=F(!0,o,e)),m.template(t)(o)},_adjustDimensions:function(){var e=this.element,t=p.styles,n=$+t.list,i=$+t.timeline,r=$+t.splitBar,o=M(this.toolbar),a=this.footer?M(this.footer):0,s=e.height(),l=e.width(),d=A(e.find(r)),c=A(e.find(n));e.children([n,i,r].join(",")).height(s-(o+a)).end().children(i).width(l-(d+c)),l<c+d&&e.find(n).width(l-d)},_scrollTo:function(e){var t,i,r=this.timeline.view(),o=this.list,a=m.attr("uid"),s="string"==typeof e?e:e.closest("tr"+n()).attr(a),l=function(){0!==i.length&&t()};r.content.is(":visible")?(i=r.content.find(n(s)),t=function(){r._scrollTo(i)}):(i=o.content.find(n(s)),t=function(){i.get(0).scrollIntoView()}),l()},_dropDowns:function(){var e=this,t=$+p.styles.toolbar.actions,n=this.options.messages.actions,i=this.timeline,r=this.options.editable,o=function(t){var n,r=t.type,o=e.dataSource,a=o._createNewModel(),s=e.dataItem(e.select()),l=o.taskParent(s),d=i.view()._timeSlots()[0],c="add"===r?s:l,u=e.list.editable;u&&u.trigger("validate")||(a.set("title","New task"),c?(a.set("parentId",c.get("id")),a.set("start",c.get("start")),a.set("end",c.get("end"))):(a.set("start",d.start),a.set("end",d.end)),"add"!==r&&(n=s.get("orderId"),n="insert-before"===r?n:n+1),e._createTask(a,n))};r&&r.create!==!1&&(this.footerDropDown=new re(this.footer.children(t).eq(0),{messages:{actions:n},direction:"up",animation:{open:{effects:"slideIn:up"}},navigatable:e.options.navigatable}),this.headerDropDown=new re(this.toolbar.children(t).eq(0),{messages:{actions:n},navigatable:e.options.navigatable}),this.footerDropDown.bind("command",o),this.headerDropDown.bind("command",o))},_list:function(){var e,t,n=this,i=n.options.navigatable,r=p.styles,a=this.wrapper.find($+r.list),s=a.find("> div"),l=this.wrapper.find($+r.toolbar.actions+" > button"),d={columns:this.options.columns||[],dataSource:this.dataSource,selectable:this.options.selectable,editable:this.options.editable,resizable:this.options.resizable,columnResizeHandleWidth:this.options.columnResizeHandleWidth,listWidth:A(a),resourcesField:this.resources.field,rowHeight:this.options.rowHeight},c=d.columns,u=function(){i&&(n._current(n._cachedCurrent),o(n.list.content.find("table"),!0)),delete n._cachedCurrent};for(t=0;t<c.length;t++)e=c[t],e.field===this.resources.field&&"function"!=typeof e.editor&&(e.editor=E(this._createResourceEditor,this));this.list=new m.ui.GanttList(s,d),this.list.bind("render",function(){n._navigatable()},!0).bind("edit",function(e){n._cachedCurrent=e.cell,n.trigger("edit",{task:e.model,container:e.cell})&&e.preventDefault()}).bind("cancel",function(e){n.trigger("cancel",{task:e.model,container:e.cell})&&e.preventDefault(),u()}).bind("update",function(e){n._updateTask(e.task,e.updateInfo),u()}).bind("change",function(){n.trigger("change");var e=n.list.select();e.length?(l.removeAttr("data-action","add"),n.timeline.select("[data-uid='"+e.attr("data-uid")+"']")):(l.attr("data-action","add"),n.timeline.clearSelection())}).bind("columnResize",function(e){n.trigger("columnResize",{column:e.column,oldWidth:e.oldWidth,newWidth:e.newWidth})})},_timeline:function(){var e=this,n=p.styles,r=i(F(!0,{resourcesField:this.resources.field},this.options)),o=this.wrapper.find($+n.timeline+" > div"),a=$+n.toolbar.currentView+" > "+$+n.toolbar.link;this.timeline=new m.ui.GanttTimeline(o,r),this.timeline.bind("navigate",function(t){var i=t.view.replace(/\./g,"\\.").toLowerCase(),r=e.toolbar.find($+n.toolbar.views+" > li").removeClass(n.selected).end().find($+n.toolbar.viewButton+"-"+i).addClass(n.selected).find($+n.toolbar.link).text();e.toolbar.find(a).text(r),e.refresh()}).bind("moveStart",function(n){var i=e.list.editable;return i&&i.trigger("validate")?(n.preventDefault(),t):(e.trigger("moveStart",{task:n.task})&&n.preventDefault(),t)}).bind("move",function(t){var n=t.task,i=t.start,r=new Date(i.getTime()+n.duration());
e.trigger("move",{task:n,start:i,end:r})&&t.preventDefault()}).bind("moveEnd",function(t){var n=t.task,i=t.start,r=new Date(i.getTime()+n.duration());e.trigger("moveEnd",{task:n,start:i,end:r})||e._updateTask(e.dataSource.getByUid(n.uid),{start:i,end:r})}).bind("resizeStart",function(n){var i=e.list.editable;return i&&i.trigger("validate")?(n.preventDefault(),t):(e.trigger("resizeStart",{task:n.task})&&n.preventDefault(),t)}).bind("resize",function(t){e.trigger("resize",{task:t.task,start:t.start,end:t.end})&&t.preventDefault()}).bind("resizeEnd",function(t){var n=t.task,i={};t.resizeStart?i.start=t.start:i.end=t.end,e.trigger("resizeEnd",{task:n,start:t.start,end:t.end})||e._updateTask(e.dataSource.getByUid(n.uid),i)}).bind("percentResizeStart",function(t){var n=e.list.editable;n&&n.trigger("validate")&&t.preventDefault()}).bind("percentResizeEnd",function(t){e._updateTask(e.dataSource.getByUid(t.task.uid),{percentComplete:t.percentComplete})}).bind("dependencyDragStart",function(t){var n=e.list.editable;n&&n.trigger("validate")&&t.preventDefault()}).bind("dependencyDragEnd",function(t){var n=e.dependencies._createNewModel({type:t.type,predecessorId:t.predecessor.id,successorId:t.successor.id});e._createDependency(n)}).bind("select",function(t){var n=e.list.editable;n&&n.trigger("validate"),e.select("[data-uid='"+t.uid+"']")}).bind("editTask",function(t){var n=e.list.editable;n&&n.trigger("validate")||e.editTask(t.uid)}).bind("clear",function(){e.clearSelection()}).bind("removeTask",function(t){var n=e.list.editable;n&&n.trigger("validate")||e.removeTask(e.dataSource.getByUid(t.uid))}).bind("removeDependency",function(t){var n=e.list.editable;n&&n.trigger("validate")||e.removeDependency(e.dependencies.getByUid(t.uid))})},_dataSource:function(){var e=this.options,t=e.dataSource;t=T(t)?{data:t}:t,this.dataSource&&this._refreshHandler?this.dataSource.unbind("change",this._refreshHandler).unbind("progress",this._progressHandler).unbind("error",this._errorHandler):(this._refreshHandler=E(this.refresh,this),this._progressHandler=E(this._requestStart,this),this._errorHandler=E(this._error,this)),this.dataSource=m.data.GanttDataSource.create(t).bind("change",this._refreshHandler).bind("progress",this._progressHandler).bind("error",this._errorHandler)},_dependencies:function(){var e=this.options.dependencies||{},t=T(e)?{data:e}:e;this.dependencies&&this._dependencyRefreshHandler?this.dependencies.unbind("change",this._dependencyRefreshHandler).unbind("error",this._dependencyErrorHandler):(this._dependencyRefreshHandler=E(this.refreshDependencies,this),this._dependencyErrorHandler=E(this._error,this)),this.dependencies=m.data.GanttDependencyDataSource.create(t).bind("change",this._dependencyRefreshHandler).bind("error",this._dependencyErrorHandler)},_resources:function(){var e=this.options.resources,t=e.dataSource||{};this.resources={field:"resources",dataTextField:"name",dataColorField:"color",dataFormatField:"format"},F(this.resources,e),this.resources.dataSource=m.data.DataSource.create(t)},_assignments:function(){var e=this.options.assignments,t=e.dataSource||{};this.assignments?this.assignments.dataSource.unbind("change",this._assignmentsRefreshHandler):this._assignmentsRefreshHandler=E(this.refresh,this),this.assignments={dataTaskIdField:"taskId",dataResourceIdField:"resourceId",dataValueField:"value"},F(this.assignments,e),this.assignments.dataSource=m.data.DataSource.create(t),this.assignments.dataSource.bind("change",this._assignmentsRefreshHandler)},_createEditor:function(){var e=this,n=this._editor=new h(this.wrapper,F({},this.options,{target:this,resources:{field:this.resources.field,editor:E(this._createResourceEditor,this)},createButton:E(this._createPopupButton,this)}));n.bind("cancel",function(n){var i=e.dataSource.getByUid(n.model.uid);return e.trigger("cancel",{container:n.container,task:i})?(n.preventDefault(),t):(e.cancelTask(),t)}).bind("edit",function(t){var n=e.dataSource.getByUid(t.model.uid);e.trigger("edit",{container:t.container,task:n})&&t.preventDefault()}).bind("save",function(t){var n=e.dataSource.getByUid(t.model.uid);e.saveTask(n,t.updateInfo)}).bind("remove",function(t){e.removeTask(t.model.uid)}).bind("close",e._onDialogClose)},_onDialogClose:function(){},_createResourceEditor:function(e,t){var n=this,i=t instanceof y?t:t.model,r=i.get("id"),o=this.options.messages,a=n.resources.field,s=this._resourceEditor=new f(e,{resourcesField:a,data:this._wrapResourceData(r),model:i,messages:F({},o.editor),buttons:[{name:"update",text:o.save,className:p.styles.primary},{name:"cancel",text:o.cancel}],createButton:E(this._createPopupButton,this),save:function(e){n._updateAssignments(e.model.get("id"),e.model.get(a))}});s.open()},_createPopupButton:function(e){var t=e.name||e.text,n={className:p.styles.popup.button+" k-gantt-"+(t||"").replace(/\s/g,""),text:t,attr:""};if(!(t||R(e)&&e.template))throw Error("Custom commands should have name specified");return R(e)&&(e.className&&(e.className+=" "+n.className),n=F(!0,n,e)),m.template(X)(n)},view:function(e){return this.timeline.view(e)},range:function(e){var t=this.dataSource,n=this.view(),i=this.timeline;return e&&(n.options.range={start:e.start,end:e.end},i._render(t.taskTree()),i._renderDependencies(this.dependencies.view())),{start:n.start,end:n.end}},date:function(e){var t=this.view();return e&&(t.options.date=e,t._scrollToDate(e)),t.options.date},dataItem:function(e){var t,n;return e?(t=this.list,n=t.content.find(e),t._modelFromElement(n)):null},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.list._setDataSource(this.dataSource),this.options.autoBind&&e.fetch()},setDependenciesDataSource:function(e){this.options.dependencies=e,this._dependencies(),this.options.autoBind&&e.fetch()},items:function(){return this.wrapper.children(".k-task")},_updateAssignments:function(e,t){for(var n,i,r,o,a,s,l,d=this.assignments.dataSource,c=this.assignments.dataTaskIdField,u=this.assignments.dataResourceIdField,h=!1,f=new C(d.view()).filter({field:c,operator:"eq",value:e}).toArray();f.length;){for(n=f[0],o=0,a=t.length;o<a;o++)if(i=t[o],n.get(u)===i.get("id")){r=t[o].get("value"),this._updateAssignment(n,r),t.splice(o,1),h=!0;break}h||this._removeAssignment(n),h=!1,f.shift()}for(s=0,l=t.length;s<l;s++)i=t[s],this._createAssignment(i,e);d.sync()},cancelTask:function(){var e=this._editor,t=e.container;t&&e.close()},editTask:function(e){var t,n="string"==typeof e?this.dataSource.getByUid(e):e;n&&(t=this.dataSource._createNewModel(n.toJSON()),t.uid=n.uid,this.cancelTask(),this._editTask(t))},_editTask:function(e){this._editor.editTask(e)},saveTask:function(e,t){var n=this._editor,i=n.container,r=n.editable;i&&r&&r.end()&&this._updateTask(e,t)},_updateTask:function(e,t){var n=this.resources.field;this.trigger("save",{task:e,values:t})||(this._preventRefresh=!0,this.dataSource.update(e,t),t[n]&&this._updateAssignments(e.get("id"),t[n]),this._syncDataSource())},_updateAssignment:function(e,t){var n=this.assignments.dataValueField;e.set(n,t)},removeTask:function(e){var t=this,n="string"==typeof e?this.dataSource.getByUid(e):e;n&&this._taskConfirm(function(e){e||t._removeTask(n)},n)},_createTask:function(e,n){if(!this.trigger("add",{task:e,dependency:null})){var i=this.dataSource;this._preventRefresh=!0,n===t?i.add(e):i.insert(n,e),this._scrollToUid=e.uid,this._syncDataSource()}},_createDependency:function(e){this.trigger("add",{task:null,dependency:e})||(this._preventDependencyRefresh=!0,this.dependencies.add(e),this._preventDependencyRefresh=!1,this.dependencies.sync())},_createAssignment:function(e,t){var n=this.assignments,i=n.dataSource,r=n.dataTaskIdField,o=n.dataResourceIdField,a=n.dataValueField,s=i._createNewModel();s[r]=t,s[o]=e.get("id"),s[a]=e.get("value"),i.add(s)},removeDependency:function(e){var t=this,n="string"==typeof e?this.dependencies.getByUid(e):e;n&&this._dependencyConfirm(function(e){e||t._removeDependency(n)},n)},_removeTaskDependencies:function(e,t){this._preventDependencyRefresh=!0;for(var n=0,i=t.length;n<i;n++)this.dependencies.remove(t[n]);this._preventDependencyRefresh=!1,this.dependencies.sync()},_removeTaskAssignments:function(e){var t,n,i=this.assignments.dataSource,r=i.view(),o={field:this.assignments.dataTaskIdField,operator:"eq",value:e.get("id")};for(r=new C(r).filter(o).toArray(),this._preventRefresh=!0,t=0,n=r.length;t<n;t++)i.remove(r[t]);this._preventRefresh=!1,i.sync()},_removeTask:function(e){var t=this.dependencies.dependencies(e.id);this.trigger("remove",{task:e,dependencies:t})||(this._removeTaskDependencies(e,t),this._removeTaskAssignments(e),this._preventRefresh=!0,this.dataSource.remove(e)&&this._syncDataSource(),this._preventRefresh=!1)},_removeDependency:function(e){this.trigger("remove",{task:null,dependencies:[e]})||this.dependencies.remove(e)&&this.dependencies.sync()},_removeAssignment:function(e){this.assignments.dataSource.remove(e)},_taskConfirm:function(e,t){var n=this.options.messages;this._confirm(e,{model:t,text:n.deleteTaskConfirmation,title:n.deleteTaskWindowTitle})},_dependencyConfirm:function(e,t){var n=this.options.messages;this._confirm(e,{model:t,text:n.deleteDependencyConfirmation,title:n.deleteDependencyWindowTitle})},_confirm:function(e,t){var n,i,r=this.options.editable;r===!0||r.confirmation!==!1?(n=this.options.messages,i=[{name:"delete",text:n.destroy,className:p.styles.primary,click:function(){e()}},{name:"cancel",text:n.cancel,click:function(){e(!0)}}],this.showDialog(F(!0,{},t,{buttons:i}))):e()},showDialog:function(e){this._editor.showDialog(e)},refresh:function(){var e,t,i,r,o,a;this._preventRefresh||this.list.editable||(this._progress(!1),e=this.dataSource,t=e.taskTree(),i=this._scrollToUid,a=-1,this.current&&(o=this.current.closest("tr").attr(m.attr("uid")),a=this.current.index()),this.trigger("dataBinding")||(0!==this.resources.dataSource.data().length&&this._assignResources(t),this._editor&&this._editor.close(),this.clearSelection(),this.list._render(t),this.timeline._render(t),this.timeline._renderDependencies(this.dependencies.view()),i&&(this._scrollTo(i),this.select(n(i))),(i||o)&&a>=0&&(r=this.list.content.find("tr"+n(i||o)+" > td:eq("+a+")"),this._current(r)),this._scrollToUid=null,this.trigger("dataBound")))},refreshDependencies:function(){this._preventDependencyRefresh||this.trigger("dataBinding")||(this.timeline._renderDependencies(this.dependencies.view()),this.trigger("dataBound"))},_assignResources:function(e){var t,n,i=this.resources,r=this.assignments,o=function(){var e=r.dataSource.view(),t={field:r.dataTaskIdField};return e=new C(e).group(t).toArray()},a=o(),s=function(e,t){var n,r,o=e.get("id");for(m.setter(i.field)(e,new x([])),n=0,r=a.length;n<r;n++)a[n].value===o&&t(e,a[n].items)},l=function(e,t){var n,o,a,s,l,d,c,u;for(n=0,o=t.length;n<o;n++)a=t[n],s=i.dataSource.get(a.get(r.dataResourceIdField)),l=a.get(r.dataValueField),d=a.get(r.dataResourceIdField),c=s.get(i.dataFormatField)||P,u=m.toString(l,c),e[i.field].push(new y({id:d,name:s.get(i.dataTextField),color:s.get(i.dataColorField),value:l,formatedValue:u}))};for(t=0,n=e.length;t<n;t++)s(e[t],l)},_wrapResourceData:function(e){var t,n,i,r=this,o=[],a=this.resources.dataSource.view(),s=this.assignments.dataSource.view(),l=new C(s).filter({field:r.assignments.dataTaskIdField,operator:"eq",value:e}).toArray(),d=function(e){var t=null;return new C(l).filter({field:r.assignments.dataResourceIdField,operator:"eq",value:e}).select(function(e){t+=e.get(r.assignments.dataValueField)}),t};for(n=0,i=a.length;n<i;n++)t=a[n],o.push({id:t.get("id"),name:t.get(r.resources.dataTextField),format:t.get(r.resources.dataFormatField)||P,value:d(t.id)});return o},_syncDataSource:function(){this._preventRefresh=!1,this._requestStart(),this.dataSource.sync()},_requestStart:function(){this._progress(!0)},_error:function(){this._progress(!1)},_progress:function(e){m.ui.progress(this.element,e)},_resizable:function(){var t,n,i,r=this,o=this.wrapper,a=p.styles,s=$+a.gridContent,l=o.find($+a.list),d=o.find($+a.timeline);this._resizeDraggable=o.find($+a.splitBar).height(l.height()).hover(function(){e(this).addClass(a.splitBarHover)},function(){e(this).removeClass(a.splitBarHover)}).end().kendoResizable({orientation:"horizontal",handle:$+a.splitBar,start:function(){t=l.width(),n=d.width(),i=d.find(s).scrollLeft()},resize:function(e){var a=e.x.initialDelta;m.support.isRtl(o)&&(a*=-1),t+a<0||n-a<0||(l.width(t+a),d.width(n-a),d.find(s).scrollLeft(i+a),r.timeline.view()._renderCurrentTime())}}).data("kendoResizable")},_scrollable:function(){var t=this,n=p.styles,i=$+n.gridContent,r=$+n.gridHeaderWrap,o=this.timeline.element.find(r),a=this.timeline.element.find(i),s=this.list.element.find(r),l=this.list.element.find(i);_&&l.css("overflow-y","auto"),a.on("scroll",function(){t.scrollTop=this.scrollTop,o.scrollLeft(this.scrollLeft),l.scrollTop(this.scrollTop)}),l.on("scroll",function(){s.scrollLeft(this.scrollLeft)}).on("DOMMouseScroll"+N+" mousewheel"+N,function(t){var n=a.scrollTop(),i=m.wheelDeltaY(t);i&&(t.preventDefault(),e(t.currentTarget).one("wheel"+N,!1),a.scrollTop(n+-i))})},_navigatable:function(){var i,r=this,a=this.options.navigatable,s=this.options.editable,l=this.list.header.find("table"),d=this.list.content.find("table"),c=p.styles,u=m.support.isRtl(this.wrapper),h=this.timeline.element.find($+c.gridContent),f=l.add(d),g=n(),v={collapse:!1,expand:!0},_=function(e){var t=r.timeline.view()._timeSlots()[0].offsetWidth;h.scrollLeft(h.scrollLeft()+(e?-t:t))},b=function(e){var t=r.current.parent("tr"+n()),i=r.current.index(),a=t[e]();0!==r.select().length&&r.clearSelection(),0!==a.length?(r._current(a.children("td:eq("+i+")")),r._scrollTo(r.current)):r.current.is("td")&&"prev"==e?o(l):r.current.is("th")&&"next"==e&&o(d)},k=function(e){var t=r.current[e]();0!==t.length&&(r._current(t),i=r.current.index())},w=function(e){var t=r.dataItem(r.current);t.summary&&t.expanded!==e&&t.set("expanded",e)},y=function(){var e,t,n=r.options.editable;n&&n.destroy!==!1&&!r.list.editable&&(e=r.select(),t=m.attr("uid"),e.length&&r.removeTask(e.attr(t)))};return e(this.wrapper).on("mousedown"+N,"tr"+g+", div"+g+":not("+$+c.line+")",function(t){var i,l=e(t.currentTarget),d=e(t.target).is(":button,a,:input,a>.k-icon,textarea,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap");t.ctrlKey||(a&&(i=l.is("tr")?e(t.target).closest("td"):r.list.content.find("tr"+n(l.attr(m.attr("uid")))+" > td:first"),r._current(i)),!a&&!s||d||(r._focusTimeout=setTimeout(function(){o(r.list.content.find("table"),!0)},2)))}),a!==!0?(d.on("keydown"+N,function(e){e.keyCode==z.DELETE&&y()}),t):(f.on("focus"+N,function(){var t=this===d.get(0)?"td":"th",n=r.select(),o=r.current||e(n.length?n:this).find(t+":eq("+(i||0)+")");r._current(o)}).on("blur"+N,function(){r._current(),this==l&&e(this).attr(L,-1)}).on("keydown"+N,function(t){var n,i=t.keyCode;if(r.current)switch(n=r.current.is("td"),i){case z.RIGHT:t.preventDefault(),t.altKey?_():t.ctrlKey?w(u?v.collapse:v.expand):k(u?"prev":"next");break;case z.LEFT:t.preventDefault(),t.altKey?_(!0):t.ctrlKey?w(u?v.expand:v.collapse):k(u?"next":"prev");break;case z.UP:t.preventDefault(),b("prev");break;case z.DOWN:t.preventDefault(),b("next");break;case z.SPACEBAR:t.preventDefault(),n&&r.select(r.current.closest("tr"));break;case z.ENTER:t.preventDefault(),n?r.options.editable&&r.options.editable.update!==!1&&(r._cachedCurrent=r.current,r.list._startEditHandler(r.current),e(this).one("keyup",function(e){e.stopPropagation()})):r.current.children("a.k-link").click();break;case z.ESC:t.stopPropagation();break;case z.DELETE:n&&y();break;default:i>=49&&i<=57&&r.view(r.timeline._viewByIndex(i-49))}}),t)},_current:function(t){var n,i=p.styles;this.current&&this.current.length&&this.current.removeClass(i.focused).removeAttr("id"),t&&t.length?(this.current=t.addClass(i.focused).attr("id",q),n=e(m._activeElement()),n.is("table")&&this.wrapper.find(n).length>0&&n.removeAttr(U).attr(U,q)):this.current=null},_dataBind:function(){var t,n=this;n.options.autoBind&&(this._preventRefresh=!0,this._preventDependencyRefresh=!0,t=e.map([this.dataSource,this.dependencies,this.resources.dataSource,this.assignments.dataSource],function(e){return e.fetch()}),e.when.apply(null,t).done(function(){n._preventRefresh=!1,n._preventDependencyRefresh=!1,n.refresh()}))},_resize:function(){this._adjustDimensions(),this.timeline.view()._adjustHeight(),this.timeline.view()._renderCurrentTime(),this.list._adjustHeight()}}),m.PDFMixin&&(m.PDFMixin.extend(p.fn),p.fn._drawPDF=function(){var e=p.styles,t="."+e.list,n=this.wrapper.find(t).width(),i=this.wrapper.clone();return i.find(t).css("width",n),this._drawPDFShadow({content:i},{avoidLinks:this.options.pdf.avoidLinks})}),m.ui.plugin(p),F(!0,p,{styles:ie})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.treelist.min",["kendo.dom.min","kendo.data.min","kendo.columnsorter.min","kendo.editable.min","kendo.window.min","kendo.filtermenu.min","kendo.selectable.min","kendo.resizable.min","kendo.treeview.draganddrop.min"],e)}(function(){return function(e,t){function n(e){return function(t){return t[e]}}function i(e){return function(t){return!e(t)}}function r(){return"none"!==this.style.display}function o(n){var i,r=n.find(">tr:not(.k-filter-row)"),o=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},a=e();return r.length>1&&(a=r.find("th").filter(o).filter(function(){return this.rowSpan>1})),a=a.add(r.last().find("th").filter(o)),i=kendo.attr("index"),a.sort(function(n,r){var o,a;return n=e(n),r=e(r),o=n.attr(i),a=r.attr(i),o===t&&(o=e(n).index()),a===t&&(a=e(r).index()),o=parseInt(o,10),a=parseInt(a,10),o>a?1:o<a?-1:0}),a}function a(e){var t,n,i=[],r=e.className;for(t=0,n=e.level;t<n;t++)i.push(g("span",{className:r}));return i}function s(e){var t,n,i,r=0;for(n=0,i=e.length;n<i;n++)t=e[n].style.width,t&&t.indexOf("%")==-1&&(r+=parseInt(t,10));return r}function l(e,t){var n,i,r,o;e=e[0],t=t[0],e.rows.length!==t.rows.length&&(n=e.offsetHeight,i=t.offsetHeight,n>i?(r=t.rows[t.rows.length-1],o=n-i):(r=e.rows[e.rows.length-1],o=i-n),r.style.height=r.offsetHeight+o+"px")}var d,c,u,h,f=kendo.data,p=e.extend,m=kendo.dom,g=m.element,v=m.text,_=m.html,b=kendo._outerWidth,k=kendo._outerHeight,w=kendo.ui,y=w.DataBoundWidget,x=f.DataSource,C=f.ObservableArray,T=f.Query,S=f.Model,D=e.proxy,E=e.map,F=e.grep,R=e.inArray,I=e.isPlainObject,A=Array.prototype.push,M="string",z="change",H="error",N="progress",P=".",L=".kendoTreeList",B="click",O="mousedown",V="edit",W="save",U="expand",q="collapse",j="remove",$="dataBinding",G="dataBound",Y="cancel",K="filterMenuInit",Q="columnHide",X="columnShow",J="th.k-header",Z="columnReorder",ee="columnResize",te="columnMenuInit",ne="columnLock",ie="columnUnlock",re="parentId",oe="dragstart",ae="drag",se="drop",le="dragend",de={wrapper:"k-treelist k-grid k-widget",header:"k-header",button:"k-button",alt:"k-alt",editCell:"k-edit-cell",group:"k-treelist-group",gridToolbar:"k-grid-toolbar",gridHeader:"k-grid-header",gridHeaderWrap:"k-grid-header-wrap",gridContent:"k-grid-content",gridContentWrap:"k-grid-content",gridFilter:"k-grid-filter",footerTemplate:"k-footer-template",loading:"k-i-loading",refresh:"k-i-refresh",retry:"k-request-retry",selected:"k-state-selected",status:"k-status",link:"k-link",withIcon:"k-with-icon",filterable:"k-filterable",icon:"k-icon",iconFilter:"k-i-filter",iconCollapse:"k-i-collapse",iconExpand:"k-i-expand",iconHidden:"k-i-none",iconPlaceHolder:"k-icon k-i-none",input:"k-input",dropPositions:"k-i-insert-top k-i-insert-bottom k-i-add k-i-insert-middle",dropTop:"k-i-insert-top",dropBottom:"k-i-insert-bottom",dropAdd:"k-i-add",dropMiddle:"k-i-insert-middle",dropDenied:"k-i-denied",dragStatus:"k-drag-status",dragClue:"k-drag-clue",dragClueText:"k-clue-text"},ce={create:{imageClass:"k-i-add",className:"k-grid-add",methodName:"addRow"},createchild:{imageClass:"k-i-add",className:"k-grid-add",methodName:"addRow"},destroy:{imageClass:"k-i-delete",className:"k-grid-delete",methodName:"removeRow"},edit:{imageClass:"k-i-edit",className:"k-grid-edit",methodName:"editRow"},update:{imageClass:"k-i-update",className:"k-primary k-grid-update",methodName:"saveRow"},canceledit:{imageClass:"k-i-cancel",className:"k-grid-cancel",methodName:"_cancelEdit"},excel:{imageClass:"k-i-excel",className:"k-grid-excel",methodName:"saveAsExcel"},pdf:{imageClass:"k-i-pdf",className:"k-grid-pdf",methodName:"saveAsPDF"}},ue=S.define({id:"id",parentId:re,fields:{id:{type:"number"},parentId:{type:"number",nullable:!0}},init:function(e){S.fn.init.call(this,e),this._loaded=!1,this.parentIdField||(this.parentIdField=re),this.parentId=this.get(this.parentIdField)},accept:function(e){S.fn.accept.call(this,e),this.parentId=this.get(this.parentIdField)},set:function(e,t,n){e==re&&this.parentIdField!=re&&(this[this.parentIdField]=t),S.fn.set.call(this,e,t,n),e==this.parentIdField&&(this.parentId=this.get(this.parentIdField))},loaded:function(e){return e===t?this._loaded:(this._loaded=e,t)},shouldSerialize:function(e){return S.fn.shouldSerialize.call(this,e)&&"_loaded"!==e&&"_error"!=e&&"_edit"!=e&&!("parentId"!==this.parentIdField&&"parentId"===e)}});ue.parentIdField=re,ue.define=function(e,n){var i,r;return n===t&&(n=e,e=ue),i=n.parentId||re,n.parentIdField=i,r=S.define(e,n),i&&(r.parentIdField=i),r},d=x.extend({init:function(e){x.fn.init.call(this,p(!0,{},{schema:{modelBase:ue,model:ue}},e))},_createNewModel:function(e){var t={},n=e instanceof S;return n&&(t=e),t=x.fn._createNewModel.call(this,t),n||(e.parentId&&(e[t.parentIdField]=e.parentId),t.accept(e)),t},_shouldWrap:function(){return!0},_push:function(e,t){var n=x.fn._readData.call(this,e);n||(n=e),this[t](n)},_readData:function(e){var t=this.data();return e=x.fn._readData.call(this,e),this._replaceData(t.toJSON().concat(e),t),e instanceof C?e:t},_replaceData:function(e,t){var n,i=e.length;for(n=0;n<i;n++)t[n]=e[n];t.length=i},_readAggregates:function(e){var t=p(this._aggregateResult,this.reader.aggregates(e));return""in t&&(t[this._defaultParentId()]=t[""],delete t[""]),t},remove:function(e){var t=this._subtree(this._childrenMap(this.data()),e.id);this._removeItems(t),x.fn.remove.call(this,e)},_filterCallback:function(e){var t,n,i={},r=[],o=e.toArray();for(t=0;t<o.length;t++)for(n=o[t];n&&(i[n.id]||(i[n.id]=!0,r.push(n)),!i[n.parentId]);)i[n.parentId]=!0,n=this.parentNode(n),n&&r.push(n);return new T(r)},_subtree:function(e,t){var n,i,r=e[t]||[],o=this._defaultParentId();for(n=0,i=r.length;n<i;n++)r[n].id!==o&&(r=r.concat(this._subtree(e,r[n].id)));return r},_childrenMap:function(e){var t,n,i,r,o={};for(e=this._observeView(e),t=0;t<e.length;t++)n=e[t],i=n.id,r=n.parentId,o[i]=o[i]||[],o[r]=o[r]||[],o[r].push(n);return o},_calculateAggregates:function(e,t){var n,i,r,o,a,s;for(t=t||{},n={},a=t.filter,a&&(e=T.process(e,{filter:a,filterCallback:D(this._filterCallback,this)}).data),s=this._childrenMap(e),n[this._defaultParentId()]=new T(this._subtree(s,this._defaultParentId())).aggregate(t.aggregate),o=0;o<e.length;o++)i=e[o],r=this._subtree(s,i.id),n[i.id]=new T(r).aggregate(t.aggregate);return n},_queryProcess:function(e,t){var n,i,r,o,a,s,l;for(t=t||{},t.filterCallback=D(this._filterCallback,this),n=this._defaultParentId(),i=T.process(e,t),r=this._childrenMap(i.data),e=r[n]||[],a=0;a<e.length;a++)s=e[a],s.id!==n&&(l=r[s.id],o=!(!l||!l.length),s.loaded()||s.loaded(o||!s.hasChildren),(s.loaded()||s.hasChildren!==!0)&&(s.hasChildren=o),o&&(e=e.slice(0,a+1).concat(l,e.slice(a+1))));return i.data=e,i},_queueRequest:function(e,t){t.call(this)},_modelLoaded:function(e){var t=this.get(e);t.loaded(!0),t.hasChildren=this.childNodes(t).length>0},_modelError:function(e,t){this.get(e)._error=t},success:function(e,n){return n&&t!==n.id||(this._data=this._observe([])),x.fn.success.call(this,e,n)},load:function(t){var n="_query",i=this.options.serverSorting||this.options.serverPaging||this.options.serverFiltering||this.options.serverGrouping||this.options.serverAggregates,r=e.Deferred().resolve().promise();if(t.loaded()){if(i)return r}else t.hasChildren&&(n="read");return this[n]({id:t.id}).done(D(this._modelLoaded,this,t.id)).fail(D(this._modelError,this,t.id))},contains:function(e,t){for(var n=e.id;t;){if(t.parentId===n)return!0;t=this.parentNode(t)}return!1},_byParentId:function(e,t){var n,i,r=[],o=this.view();if(e===t)return[];for(i=0;i<o.length;i++)n=o.at(i),n.parentId==e&&r.push(n);return r},_defaultParentId:function(){return this.reader.model.fn.defaults[this.reader.model.parentIdField]},childNodes:function(e){return this._byParentId(e.id,this._defaultParentId())},rootNodes:function(){return this._byParentId(this._defaultParentId())},parentNode:function(e){return this.get(e.parentId)},level:function(e){var t=-1;e instanceof ue||(e=this.get(e));do e=this.parentNode(e),t++;while(e);return t},filter:function(e){var n=x.fn.filter;return e===t?n.call(this,e):(n.call(this,e),t)}}),d.create=function(t){return e.isArray(t)?t={data:t}:t instanceof C&&(t={data:t.toJSON()}),t instanceof d?t:new d(t)},c=kendo.Observable.extend({init:function(e,t){kendo.Observable.fn.init.call(this),t=this.options=p(!0,{},this.options,t),this.element=e,this.bind(this.events,t),this.model=this.options.model,this.fields=this._fields(this.options.columns),this._initContainer(),this.createEditable()},events:[],_initContainer:function(){this.wrapper=this.element},createEditable:function(){var e=this.options;this.editable=new w.Editable(this.wrapper,{fields:this.fields,target:e.target,clearContainer:e.clearContainer,model:this.model})},_isEditable:function(e){return e.field&&this.model.editable(e.field)},_fields:function(e){var t,n,i,r=[];for(t=0,n=e.length;t<n;t++)i=e[t],this._isEditable(i)&&r.push({field:i.field,format:i.format,editor:i.editor});return r},end:function(){return this.editable.end()},close:function(){this.destroy()},destroy:function(){this.editable.destroy(),this.editable.element.find("["+kendo.attr("container-for")+"]").empty().end().removeAttr(kendo.attr("role")),this.model=this.wrapper=this.element=this.columns=this.editable=null}}),u=c.extend({init:function(e,t){c.fn.init.call(this,e,t),this._attachHandlers(),kendo.cycleForm(this.wrapper),this.open()},events:[Y,W],options:{window:{modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1}},_initContainer:function(){var t=this.options,n=[];this.wrapper=e('<div class="k-popup-edit-form"/>').attr(kendo.attr("uid"),this.model.uid).append('<div class="k-edit-form-container"/>'),t.template?(this._appendTemplate(n),this.fields=[]):this._appendFields(n),this._appendButtons(n),new m.Tree(this.wrapper.children()[0]).render(n),this.wrapper.appendTo(t.appendTo),this.window=new w.Window(this.wrapper,t.window)},_appendTemplate:function(e){var t=this.options.template;typeof t===M&&(t=window.unescape(t)),t=kendo.template(t)(this.model),e.push(_(t))},_appendFields:function(e){var t,n,i,r=this.options.columns;for(t=0,n=r.length;t<n;t++)i=r[t],i.command||(e.push(_('<div class="k-edit-label"><label for="'+i.field+'">'+(i.title||i.field||"")+"</label></div>")),e.push(this._isEditable(i)?_("<div "+kendo.attr("container-for")+'="'+i.field+'" class="k-edit-field"></div>'):g("div",{"class":"k-edit-field"},[this.options.fieldRenderer(i,this.model)])))},_appendButtons:function(e){e.push(g("div",{"class":"k-edit-buttons k-state-default"},this.options.commandRenderer()))},_attachHandlers:function(){var e=this._cancelProxy=D(this._cancel,this);this.wrapper.on(B+L,".k-grid-cancel",this._cancelProxy),this._saveProxy=D(this._save,this),this.wrapper.on(B+L,".k-grid-update",this._saveProxy),this.window.bind("close",function(t){t.userTriggered&&e(t)})},_dettachHandlers:function(){this._cancelProxy=null,this._saveProxy=null,this.wrapper.off(L)},_cancel:function(e){this.trigger(Y,e)},_save:function(){this.trigger(W)},open:function(){this.window.center().open()},close:function(){this.window.bind("deactivate",D(this.destroy,this)).close()},destroy:function(){this.window.destroy(),this.window=null,this._dettachHandlers(),c.fn.destroy.call(this)}}),h=y.extend({init:function(t,n){if(y.fn.init.call(this,t,n),this._dataSource(this.options.dataSource),this._columns(),this._layout(),this._selectable(),this._sortable(),this._resizable(),this._filterable(),this._attachEvents(),this._toolbar(),this._scrollable(),this._reorderable(),this._columnMenu(),this._minScreenSupport(),this._draggable(),this.options.autoBind&&this.dataSource.fetch(),this._hasLockedColumns){var i=this;this.wrapper.addClass("k-grid-lockedcolumns"),this._resizeHandler=function(){i.resize()},e(window).on("resize"+L,this._resizeHandler)}kendo.notify(this)},_draggable:function(){var t=this.options.editable;t&&t.move&&(this._dragging=new kendo.ui.HierarchicalDragAndDrop(this.wrapper,{$angular:this.$angular,autoScroll:!0,filter:"tbody>tr",itemSelector:"tr",allowedContainers:this.wrapper,hintText:function(t){var n=function(){return e(this).text()},i="<span class='k-header k-drag-separator' />";return t.children("td").map(n).toArray().join(i)},contains:D(function(e,t){var n=this.dataItem(t),i=this.dataItem(e);return i==n||this.dataSource.contains(i,n)},this),itemFromTarget:function(e){var t=e.closest("tr");return{item:t,content:t}},dragstart:D(function(e){this.wrapper.addClass("k-treelist-dragging");var t=this.dataItem(e);return this.trigger(oe,{source:t})},this),drag:D(function(e){e.source=this.dataItem(e.source),this.trigger(ae,e)},this),drop:D(function(e){return e.source=this.dataItem(e.source),e.destination=this.dataItem(e.destination),this.wrapper.removeClass("k-treelist-dragging"),this.trigger(se,e)},this),dragend:D(function(e){var t=this.dataItem(e.destination),n=this.dataItem(e.source);n.set("parentId",t?t.id:null),e.source=n,e.destination=t,this.trigger(le,e)},this),reorderable:!1,dropHintContainer:function(e){return e.children("td:eq(1)")},dropPositionFrom:function(e){return e.prevAll(".k-i-none").length>0?"after":"before"}}))},itemFor:function(e){return"number"==typeof e&&(e=this.dataSource.get(e)),this.tbody.find("["+kendo.attr("uid")+"="+e.uid+"]")},_scrollable:function(){var t,n,i;this.options.scrollable&&(t=this.thead.closest(".k-grid-header-wrap"),n=e(this.lockedContent).bind("DOMMouseScroll"+L+" mousewheel"+L,D(this._wheelScroll,this)),this.content.bind("scroll"+L,function(){t.scrollLeft(this.scrollLeft),n.scrollTop(this.scrollTop)}),i=kendo.touchScroller(this.content),i&&i.movable&&(this._touchScroller=i,i.movable.bind("change",function(e){t.scrollLeft(-e.sender.x),n&&n.scrollTop(-e.sender.y)})))},_wheelScroll:function(t){if(!t.ctrlKey){var n=kendo.wheelDeltaY(t);n&&(t.preventDefault(),e(t.currentTarget).one("wheel"+L,!1),this.content.scrollTop(this.content.scrollTop()+-n))}},_progress:function(){var e=this.options.messages;this.tbody.find("tr").length||this._showStatus(kendo.template("<span class='#= className #' /> #: messages.loading #")({className:de.icon+" "+de.loading,messages:e}))},_error:function(e){this.dataSource.rootNodes().length||this._render({error:e})},refresh:function(e){e=e||{},"itemchange"==e.action&&this.editor||this.trigger($)||(this._cancelEditor(),this._render(),this._adjustHeight(),this.trigger(G))},_angularFooters:function(e){var t,n,i,r=this.dataSource.aggregates(),o=this._footerItems();for(t=0;t<o.length;t++)n=o.eq(t),i=r[n.attr("data-parentId")],this._angularFooter(e,n.find("td").get(),i)},_angularFooter:function(e,t,n){var i=this.columns;this.angular(e,function(){return{elements:t,data:E(i,function(e){return{column:e,aggregate:n&&n[e.field]}})}})},items:function(){return this._hasLockedColumns?this._items(this.tbody).add(this._items(this.lockedTable)):this._items(this.tbody)},_items:function(t){return t.find("tr").filter(function(){return!e(this).hasClass(de.footerTemplate)})},_footerItems:function(){var t=this.tbody;return this._hasLockedColumns&&(t=t.add(this.lockedTable)),t.find("tr").filter(function(){return e(this).hasClass(de.footerTemplate)})},dataItems:function(){
var e,t,n,i=kendo.ui.DataBoundWidget.fn.dataItems.call(this);if(this._hasLockedColumns){for(e=i.length,t=Array(2*e),n=e;--n>=0;)t[n]=t[n+e]=i[n];i=t}return i},_showStatus:function(t){var n=this.element.find(".k-status"),i=e(this.content).add(this.lockedContent);n.length||(n=e("<div class='k-status' />").appendTo(this.element)),this._contentTree.render([]),this._hasLockedColumns&&this._lockedContentTree.render([]),i.hide(),n.html(t)},_hideStatus:function(){this.element.find(".k-status").remove(),e(this.content).add(this.lockedContent).show()},_adjustHeight:function(){var e,t,n=this.element,i=n.find(P+de.gridContentWrap),r=n.find(P+de.gridHeader),o=n.find(P+de.gridToolbar),a=kendo.support.scrollbar();n.height(this.options.height),t=function(e){var t,n;return!!e[0].style.height||(t=e.height(),e.height("auto"),n=e.height(),e.height(""),t!=n)},t(n)&&(e=n.height()-k(r)-k(o),i.height(e),this._hasLockedColumns&&(a=this.table[0].offsetWidth>this.table.parent()[0].clientWidth?a:0,this.lockedContent.height(e-a)))},_resize:function(){this._applyLockedContainersWidth(),this._adjustHeight()},_minScreenSupport:function(){var t=this.hideMinScreenCols();t&&(this.minScreenResizeHandler=D(this.hideMinScreenCols,this),e(window).on("resize",this.minScreenResizeHandler))},hideMinScreenCols:function(){var e,n,i,r=this.columns,o=!1,a=window.innerWidth>0?window.innerWidth:screen.width;for(e=0;e<r.length;e++)n=r[e],i=n.minScreenWidth,i!==t&&null!==i&&(o=!0,i>a?this.hideColumn(n):this.showColumn(n));return o},destroy:function(){y.fn.destroy.call(this);var t=this.dataSource;t.unbind(z,this._refreshHandler),t.unbind(H,this._errorHandler),t.unbind(N,this._progressHandler),this._resizeHandler&&e(window).off("resize"+L,this._resizeHandler),this._dragging&&(this._dragging.destroy(),this._dragging=null),this.resizable&&(this.resizable.destroy(),this.resizable=null),this.reorderable&&(this.reorderable.destroy(),this.reorderable=null),this._draggableInstance&&this._draggableInstance.element&&(this._draggableInstance.destroy(),this._draggableInstance=null),this.minScreenResizeHandler&&e(window).off("resize",this.minScreenResizeHandler),this._destroyEditor(),this.element.off(L),this._touchScroller&&this._touchScroller.destroy(),this._autoExpandable=null,this._refreshHandler=this._errorHandler=this._progressHandler=this._dataSourceFetchProxy=null,this.thead=this.content=this.tbody=this.table=this.element=this.lockedHeader=this.lockedContent=null,this._statusTree=this._headerTree=this._contentTree=this._lockedHeaderColsTree=this._lockedContentColsTree=this._lockedHeaderTree=this._lockedContentTree=null},options:{name:"TreeList",columns:[],autoBind:!0,scrollable:!0,selectable:!1,sortable:!1,toolbar:null,height:null,columnMenu:!1,messages:{noRows:"No records to display",loading:"Loading...",requestFailed:"Request failed.",retry:"Retry",commands:{edit:"Edit",update:"Update",canceledit:"Cancel",create:"Add new record",createchild:"Add child record",destroy:"Delete",excel:"Export to Excel",pdf:"Export to PDF"}},excel:{hierarchy:!0},resizable:!1,filterable:!1,editable:!1,reorderable:!1},events:[z,V,W,j,U,q,$,G,Y,oe,ae,se,le,K,Q,X,Z,ee,te,ne,ie],_toggle:function(n,i){var r=e.Deferred().resolve().promise(),o=n.loaded();return n._error&&(n.expanded=!1,n._error=t),!o&&n.expanded?r:(t===i&&(i=!n.expanded),n.expanded=i,o||(r=this.dataSource.load(n).always(D(function(){this._render(),this._syncLockedContentHeight()},this))),this._render(),this._syncLockedContentHeight(),r)},expand:function(e){return this._toggle(this.dataItem(e),!0)},collapse:function(e){return this._toggle(this.dataItem(e),!1)},_toggleChildren:function(t){var n=e(t.currentTarget),i=this.dataItem(n),r=i.expanded?q:U;this.trigger(r,{model:i})||this._toggle(i),t.preventDefault()},_attachEvents:function(){var e=P+de.iconCollapse+", ."+de.iconExpand+", ."+de.refresh,t=P+de.retry;this.element.on(O+L,e,D(this._toggleChildren,this)).on(B+L,t,this._dataSourceFetchProxy).on(B+L,".k-button[data-command]",D(this._commandClick,this))},_commandByName:function(t){var n,i,r,o,a=this.columns,s=e.isArray(this.options.toolbar)?this.options.toolbar:[];if(t=t.toLowerCase(),ce[t])return ce[t];for(n=0;n<a.length;n++)if(r=a[n].command)for(i=0;i<r.length;i++)if(o=r[i].name,o&&o.toLowerCase()==t)return r[i];for(n=0;n<s.length;n++)if(o=s[n].name,o&&o.toLowerCase()==t)return s[n]},_commandClick:function(n){var i=e(n.currentTarget),r=i.attr("data-command"),o=this._commandByName(r),a=i.parentsUntil(this.wrapper,"tr");a=a.length?a:t,o&&(o.methodName?this[o.methodName](a):o.click&&o.click.call(this,n),n.preventDefault())},_ensureExpandableColumn:function(){var e,t;this._autoExpandable&&delete this._autoExpandable.expandable,e=F(this.columns,i(n("hidden"))),t=F(e,n("expandable")),this.columns.length&&!t.length&&(this._autoExpandable=e[0],e[0].expandable=!0)},_columns:function(){var e,t=this.options.columns||[];this.columns=E(t,function(e){return e="string"==typeof e?{field:e}:e,p({encoded:!0},e)}),e=this._lockedColumns(),e.length>0&&(this._hasLockedColumns=!0,this.columns=e.concat(this._nonLockedColumns())),this._ensureExpandableColumn(),this._columnTemplates(),this._columnAttributes()},_columnTemplates:function(){var e,t,n,i=this.columns;for(e=0,t=i.length;e<t;e++)n=i[e],n.template&&(n.template=kendo.template(n.template)),n.headerTemplate&&(n.headerTemplate=kendo.template(n.headerTemplate)),n.footerTemplate&&(n.footerTemplate=kendo.template(n.footerTemplate))},_columnAttributes:function(){function t(t){var n,i,r,o;if(t&&t.style)for(n=t.style.split(";"),t.style={},i=0;i<n.length;i++)r=n[i].split(":"),o=e.trim(r[0]),o&&(t.style[e.camelCase(o)]=e.trim(r[1]))}var n,i,r=this.columns;for(n=0,i=r.length;n<i;n++)t(r[n].attributes),t(r[n].headerAttributes)},_layout:function(){var e,t,n,i=this.columns,r=this.element,o="";this.wrapper=r.addClass(de.wrapper),o="<div class='#= gridHeader #'>",this._hasLockedColumns&&(o+="<div class='k-grid-header-locked'><table role='grid'><colgroup></colgroup><thead role='rowgroup' /></table></div>"),o+="<div class='#= gridHeaderWrap #'><table role='grid'><colgroup></colgroup><thead role='rowgroup' /></table></div></div>",this._hasLockedColumns&&(o+="<div class='k-grid-content-locked'><table role='treegrid' tabindex='0'><colgroup></colgroup><tbody /></table></div>"),o+="<div class='#= gridContentWrap # k-auto-scrollable'><table role='treegrid' tabindex='0'><colgroup></colgroup><tbody /></table></div>",this.options.scrollable||(o="<table role='treegrid' tabindex='0'><colgroup></colgroup><thead class='#= gridHeader #' role='rowgroup' /><tbody /></table>"),this.options.toolbar&&(o="<div class='#= header # #= gridToolbar #' />"+o),r.append(kendo.template(o)(de)+"<div class='k-status' />"),this.toolbar=r.find(P+de.gridToolbar),e=r.find(P+de.gridHeader).find("thead").addBack().filter("thead"),this.thead=e.last(),this.options.scrollable&&(t=kendo.support.isRtl(r),r.find("div."+de.gridHeader).css(t?"padding-left":"padding-right",kendo.support.scrollbar())),n=r.find(P+de.gridContentWrap),n.length?this.content=n:n=r,this.table=n.find(">table"),this.tbody=this.table.find(">tbody"),this._hasLockedColumns&&(this.lockedHeader=e.first().closest(".k-grid-header-locked"),this.lockedContent=r.find(".k-grid-content-locked"),this.lockedTable=this.lockedContent.children()),this._initVirtualTrees(),this._renderCols(),this._renderHeader(),this.angular("compile",function(){return{elements:e.find("th.k-header").get(),data:E(i,function(e){return{column:e}})}})},_initVirtualTrees:function(){this._headerColsTree=new m.Tree(this.thead.prev()[0]),this._contentColsTree=new m.Tree(this.tbody.prev()[0]),this._headerTree=new m.Tree(this.thead[0]),this._contentTree=new m.Tree(this.tbody[0]),this._statusTree=new m.Tree(this.element.children(".k-status")[0]),this.lockedHeader&&(this._lockedHeaderColsTree=new m.Tree(this.lockedHeader.find("colgroup")[0]),this._lockedContentColsTree=new m.Tree(this.lockedTable.find(">colgroup")[0]),this._lockedHeaderTree=new m.Tree(this.lockedHeader.find("thead")[0]),this._lockedContentTree=new m.Tree(this.lockedTable.find(">tbody")[0]))},_toolbar:function(){var t,n=this.options.toolbar,i=this.toolbar;n&&(e.isArray(n)?(t=this._buildCommands(n),new m.Tree(i[0]).render(t)):i.append(kendo.template(n)({})),this.angular("compile",function(){return{elements:i.get()}}))},_lockedColumns:function(){return F(this.columns,n("locked"))},_nonLockedColumns:function(){return F(this.columns,i(n("locked")))},_templateColumns:function(){return F(this.columns,n("template"))},_flushCache:function(){this.options.$angular&&this._templateColumns().length&&(this._contentTree.render([]),this._hasLockedColumns&&this._lockedContentTree.render([]))},_render:function(t){var n,i,r,o;t=t||{},n=this.options.messages,i=this.dataSource.rootNodes(),r=kendo.attr("uid"),o=this.select().removeClass("k-state-selected").map(function(t,n){return e(n).attr(r)}),this._absoluteIndex=0,this._angularItems("cleanup"),this._angularFooters("cleanup"),this._flushCache(),t.error?this._showStatus(kendo.template("#: messages.requestFailed # <button class='#= buttonClass #'>#: messages.retry #</button>")({buttonClass:[de.button,de.retry].join(" "),messages:n})):i.length?(this._hideStatus(),this._contentTree.render(this._trs({columns:this._nonLockedColumns(),aggregates:t.aggregates,selected:o,data:i,visible:!0,level:0})),this._hasLockedColumns&&(this._absoluteIndex=0,this._lockedContentTree.render(this._trs({columns:this._lockedColumns(),aggregates:t.aggregates,selected:o,data:i,visible:!0,level:0})))):this._showStatus(kendo.htmlEncode(n.noRows)),this._touchScroller&&this._touchScroller.contentResized(),this._muteAngularRebind(function(){this._angularItems("compile"),this._angularFooters("compile")}),this.items().filter(function(){return e.inArray(e(this).attr(r),o)>=0}).addClass("k-state-selected"),this._adjustRowsHeight()},_adjustRowsHeight:function(){var e,t,n,i,r,o,a,s,l,d,c,u,h,f;if(this._hasLockedColumns){for(e=this.table,t=this.lockedTable,n=e[0].rows,i=n.length,o=t[0].rows,a=e.add(t),s=a.length,l=[],d=this.lockedHeader.find("tr"),c=this.thead.find("tr"),d.add(c).height("auto").height(Math.max(d.height(),c.height())),r=0;r<i&&o[r];r++)n[r].style.height&&(n[r].style.height=o[r].style.height="");for(r=0;r<i&&o[r];r++)u=n[r].offsetHeight,h=o[r].offsetHeight,f=0,u>h?f=u:u<h&&(f=h),l.push(f);for(r=0;r<s;r++)a[r].style.display="none";for(r=0;r<i;r++)l[r]&&(n[r].style.height=o[r].style.height=l[r]+1+"px");for(r=0;r<s;r++)a[r].style.display=""}},_ths:function(e){var t,n,i,r,o,a,s,l,d=[];for(s=0,l=e.length;s<l;s++)t=e[s],i=[],r=[de.header],n=t.headerTemplate?t.headerTemplate({}):t.title||t.field||"",a=t.headerTemplate?_(n):v(n),i.push(t.sortable?g("a",{href:"#",className:de.link},[a]):a),o={"data-field":t.field,"data-title":t.title,style:t.hidden===!0?{display:"none"}:{},className:r.join(" "),role:"columnheader"},o=p(!0,{},o,t.headerAttributes),d.push(g("th",o,i));return d},_cols:function(e){var t,n,i,r=[];for(i=0;i<e.length;i++)e[i].hidden!==!0&&(t=e[i].width,n={},t&&0!==parseInt(t,10)&&(n.style={width:"string"==typeof t?t:t+"px"}),r.push(g("col",n)));return r},_renderCols:function(){var e=this._nonLockedColumns();this._headerColsTree.render(this._cols(e)),this.options.scrollable&&this._contentColsTree.render(this._cols(e)),this._hasLockedColumns&&(e=this._lockedColumns(),this._lockedHeaderColsTree.render(this._cols(e)),this._lockedContentColsTree.render(this._cols(e)))},_renderHeader:function(){var e=this._nonLockedColumns();this._headerTree.render([g("tr",{role:"row"},this._ths(e))]),this._hasLockedColumns&&(e=this._lockedColumns(),this._lockedHeaderTree.render([g("tr",{role:"row"},this._ths(e))]),this._applyLockedContainersWidth())},_applyLockedContainersWidth:function(){var e,t,n,i,r,o;this._hasLockedColumns&&(e=s(this.lockedHeader.find(">table>colgroup>col")),t=this.thead.parent(),n=s(t.find(">colgroup>col")),i=this.wrapper[0].clientWidth,r=kendo.support.scrollbar(),e>=i&&(e=i-3*r),this.lockedHeader.add(this.lockedContent).width(e),t.add(this.table).width(n),o=i-e-2,this.content.width(o),t.parent().width(o-r))},_trs:function(t){var n,i,r,o,a,s,l,d=[],c=t.level,u=t.data,h=this.dataSource,f=h.aggregates()||{},p=t.columns;for(s=0,l=u.length;s<l;s++)r=[],n=u[s],a=n.loaded()&&h.childNodes(n),o=a&&a.length,i={role:"row"},i[kendo.attr("uid")]=n.uid,o&&(i["aria-expanded"]=!!n.expanded),t.visible?(this._absoluteIndex%2!==0&&r.push(de.alt),this._absoluteIndex++):i.style={display:"none"},e.inArray(n.uid,t.selected)>=0&&r.push(de.selected),o&&r.push(de.group),n._edit&&r.push("k-grid-edit-row"),i.className=r.join(" "),d.push(this._tds({model:n,attr:i,level:c},p,D(this._td,this))),o&&(d=d.concat(this._trs({columns:p,aggregates:f,selected:t.selected,visible:t.visible&&!!n.expanded,data:a,level:c+1})));return this._hasFooterTemplate()&&(i={className:de.footerTemplate,"data-parentId":n.parentId},t.visible||(i.style={display:"none"}),d.push(this._tds({model:f[n.parentId],attr:i,level:c},p,this._footerTd))),d},_footerTd:function(t){var n=[],i=t.column,r=t.column.footerTemplate||e.noop,o=t.model[i.field]||{},s={role:"gridcell",style:i.hidden===!0?{display:"none"}:{}};return i.expandable&&(n=n.concat(a({level:t.level+1,className:de.iconPlaceHolder}))),i.attributes&&p(s,i.attributes),n.push(_(r(o)||"")),g("td",s,n)},_hasFooterTemplate:function(){return!!F(this.columns,function(e){return e.footerTemplate}).length},_tds:function(e,t,n){var i,r,o,a=[];for(r=0,o=t.length;r<o;r++)i=t[r],a.push(n({model:e.model,column:i,level:e.level}));return g("tr",e.attr,a)},_td:function(e){var t,n=[],i=e.model,r=e.column,o={role:"gridcell",style:r.hidden===!0?{display:"none"}:{}};return i._edit&&r.field&&i.editable(r.field)?o[kendo.attr("container-for")]=r.field:(r.expandable&&(n=a({level:e.level,className:de.iconPlaceHolder}),t=[de.icon],t.push(i.hasChildren?i.expanded?de.iconCollapse:de.iconExpand:de.iconHidden),i._error?t.push(de.refresh):!i.loaded()&&i.expanded&&t.push(de.loading),n.push(g("span",{className:t.join(" ")})),o.style["white-space"]="nowrap"),r.attributes&&p(!0,o,r.attributes),r.command?n=this._buildCommands(i._edit?["update","canceledit"]:r.command):n.push(this._cellContent(r,i))),g("td",o,n)},_cellContent:function(e,n){var i;return e.template?i=e.template(n):e.field&&(i=n.get(e.field),null!==i&&e.format&&(i=kendo.format(e.format,i))),null!==i&&t!==i||(i=""),e.template||!e.encoded?_(i):v(i)},_buildCommands:function(e){var t,n=[];for(t=0;t<e.length;t++)n.push(this._button(e[t]));return n},_button:function(e){var t=(e.name||e).toLowerCase(),n=this.options.messages.commands[t],i=[];return e=p({},ce[t],{text:n},e),e.imageClass&&i.push(g("span",{className:["k-icon",e.imageClass].join(" ")})),g("button",{type:"button","data-command":t,className:["k-button k-button-icontext",e.className].join(" ")},i.concat([v(e.text||e.name)]))},_positionResizeHandle:function(n){var i,r,o,a=e(n.currentTarget),s=this.resizeHandle,l=a.position(),d=l.left,c=b(a),u=a.closest("div"),h=n.clientX+e(window).scrollLeft(),f=this.options.columnResizeHandleWidth||3;return d+=u.scrollLeft(),s||(s=this.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner" /></div>')),i=a.offset().left+c,(r=h>i-f&&h<i+f)?(u.append(s),s.show().css({top:l.top,left:d+c-f-1,height:k(a),width:3*f}).data("th",a),o=this,s.off("dblclick"+L).on("dblclick"+L,function(){var t=a.index();e.contains(o.thead[0],a[0])&&(t+=F(o.columns,function(e){return e.locked&&!e.hidden}).length),o.autoFitColumn(t)}),t):(s.hide(),t)},autoFitColumn:function(t){var n,i,a,s,l,d,c,u,h,f,p,m,g,v,_,k,w,y=this,x=y.options,C=y.columns,T=kendo.support.browser,S=y.lockedHeader?o(y.lockedHeader.find(">table>thead")).filter(r).length:0;if(t="number"==typeof t?C[t]:I(t)?F(C,function(e){return e===t})[0]:F(C,function(e){return e.field===t})[0],t&&!t.hidden){for(n=R(t,C),s=t.locked,a=s?y.lockedHeader.children("table"):y.thead.parent(),i=a.find("[data-index='"+n+"']"),d=s?y.lockedTable:y.table,c=y.footer||e(),y.footer&&y.lockedContent&&(c=y.footer.children(s?".k-grid-footer-locked":".k-grid-footer-wrap")),u=c.find("table").first(),y.lockedHeader&&S>=n&&!s&&(n-=S),h=0;h<C.length&&C[h]!==t;h++)C[h].hidden&&n--;if(l=x.scrollable?a.find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+n+")").add(d.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+n+")")).add(u.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+n+")")):d.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col):eq("+n+")"),f=a.add(d).add(u),p=b(i),l.width(""),f.css("table-layout","fixed"),l.width("auto"),f.addClass("k-autofitting"),f.css("table-layout",""),m=Math.ceil(Math.max(b(i),b(d.find("tr").eq(0).children("td:visible").eq(n)),b(u.find("tr").eq(0).children("td:visible").eq(n)))),l.width(m),t.width=m,x.scrollable){for(g=a.find("col"),_=0,k=0,w=g.length;k<w;k+=1){if(v=g[k].style.width,!v||v.indexOf("%")!=-1){_=0;break}_+=parseInt(v,10)}_&&f.each(function(){this.style.width=_+"px"})}T.msie&&8==T.version&&(f.css("display","inline-table"),setTimeout(function(){f.css("display","table")},1)),f.removeClass("k-autofitting"),y.trigger(ee,{column:t,oldWidth:p,newWidth:m}),y._applyLockedContainersWidth(),y._syncLockedContentHeight(),y._syncLockedHeaderHeight()}},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),n=e[0].offsetWidth>t[0].clientWidth?kendo.support.scrollbar():0;this.lockedContent.height(t.height()-n)},_syncLockedContentHeight:function(){this.lockedTable&&(this._touchScroller||this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){var e,t;this.lockedHeader&&(e=this.lockedHeader.children("table"),t=this.thead.parent(),this._adjustRowsHeight(e,t),l(e,t))},_resizable:function(){if(this.options.resizable){this.resizable&&this.resizable.destroy();var t=this;e(this.lockedHeader).find("thead").add(this.thead).on("mousemove"+L,"th",e.proxy(this._positionResizeHandle,this)),this.resizable=new kendo.ui.Resizable(this.wrapper,{handle:".k-resize-handle",start:function(n){var i,r,o=e(n.currentTarget).data("th"),a="col:eq("+e.inArray(o[0],o.parent().children().filter(":visible"))+")";t.wrapper.addClass("k-grid-column-resizing"),t.lockedHeader&&e.contains(t.lockedHeader[0],o[0])?(i=t.lockedHeader,r=t.lockedTable):(i=t.thead.parent(),r=t.table),this.col=r.children("colgroup").find(a).add(i.find(a)),this.th=o,this.startLocation=n.x.location,this.columnWidth=b(o),this.table=this.col.closest("table"),this.totalWidth=this.table.width()},resize:function(e){var t=11,n=e.x.location-this.startLocation;this.columnWidth+n<t&&(n=t-this.columnWidth),this.table.width(this.totalWidth+n),this.col.width(this.columnWidth+n)},resizeend:function(){var e,n,i;t.wrapper.removeClass("k-grid-column-resizing"),e=this.th.attr("data-field"),n=F(t.columns,function(t){return t.field==e}),i=Math.floor(b(this.th)),n[0].width=i,t._resize(),t._adjustRowsHeight(),t.trigger(ee,{column:n,oldWidth:this.columnWidth,newWidth:i}),this.table=this.col=this.th=null}})}},_sortable:function(){var t,n,i,r,o,a=this.columns,s=e(this.lockedHeader).add(this.thead).find("th"),l=kendo.attr("field"),d=this.options.sortable;if(d)for(r=0,o=s.length;r<o;r++)t=a[r],t.sortable!==!1&&!t.command&&t.field&&(i=s.eq(r),n=i.data("kendoColumnSorter"),n&&n.destroy(),i.attr(l,t.field).kendoColumnSorter(p({},d,t.sortable,{dataSource:this.dataSource})))},_filterable:function(){var t,n,i,r,o,a,s=e(this.lockedHeader).add(this.thead).find("th"),l=this.options.filterable;if(l&&!this.options.columnMenu)for(a=D(function(e){this.trigger(K,{field:e.field,container:e.container})},this),t=0,n=s.length;t<n;t++)i=this.columns[t],r=s.eq(t),o=r.data("kendoFilterMenu"),o&&o.destroy(),i.command||i.filterable===!1||r.kendoFilterMenu(p(!0,{},l,i.filterable,{dataSource:this.dataSource,init:a}))},_change:function(){this.trigger(z)},_selectable:function(){var e,n,i=this.options.selectable,r=this.table;i&&(i=kendo.ui.Selectable.parseOptions(i),this._hasLockedColumns&&(r=r.add(this.lockedTable),n=i.multiple&&i.cell),e=">tbody>tr:not(.k-footer-template)",i.cell&&(e+=">td"),this.selectable=new kendo.ui.Selectable(r,{filter:e,aria:!0,multiple:i.multiple,change:D(this._change,this),useAllItems:n,continuousItems:D(this._continuousItems,this,e,i.cell),relatedTarget:!i.cell&&this._hasLockedColumns?D(this._selectableTarget,this):t}))},_continuousItems:function(t,n){var i,r,o,a,s,l;if(this.lockedContent){for(i=e(t,this.lockedTable),r=e(t,this.table),o=n?this._lockedColumns().length:1,a=n?this.columns.length-o:1,s=[],l=0;l<i.length;l+=o)A.apply(s,i.slice(l,l+o)),A.apply(s,r.splice(0,a));return s}},_selectableTarget:function(t){var n,i,r,o=e();for(i=0,r=t.length;i<r;i++)n=this._relatedRow(t[i]),R(n[0],t)<0&&(o=o.add(n));return o},_relatedRow:function(t){var n,i,r=this.lockedTable;return t=e(t),r?(n=t.closest(this.table.add(this.lockedTable)),i=n.find(">tbody>tr").index(t),n=n[0]===this.table[0]?r:this.table,n.find(">tbody>tr").eq(i)):t},select:function(n){var i=this.selectable;return i?(t!==n&&(i.options.multiple||(i.clear(),n=n.first()),this._hasLockedColumns&&(n=n.add(e.map(n,D(this._relatedRow,this))))),i.value(n)):e()},clearSelection:function(){var e=this.select();e.length&&(this.selectable.clear(),this.trigger(z))},_dataSource:function(e){var t=this.dataSource;t&&(t.unbind(z,this._refreshHandler),t.unbind(H,this._errorHandler),t.unbind(N,this._progressHandler)),this._refreshHandler=D(this.refresh,this),this._errorHandler=D(this._error,this),this._progressHandler=D(this._progress,this),t=this.dataSource=d.create(e),t.bind(z,this._refreshHandler),t.bind(H,this._errorHandler),t.bind(N,this._progressHandler),this._dataSourceFetchProxy=D(function(){this.dataSource.fetch()},this)},setDataSource:function(e){this._dataSource(e),this._sortable(),this._filterable(),this._contentTree.render([]),this.options.autoBind&&this.dataSource.fetch()},dataItem:function(t){var n,i;return t instanceof ue?t:(n=e(t).closest("tr"),i=this.dataSource.getByUid(n.attr(kendo.attr("uid"))))},editRow:function(e){var t;typeof e===M&&(e=this.tbody.find(e)),t=this.dataItem(e),t&&("popup"!=this._editMode()&&(t._edit=!0),this._cancelEditor(),this._render(),this._createEditor(t),this.trigger(V,{container:this.editor.wrapper,model:t}))},_cancelEdit:function(e){e=p(e,{container:this.editor.wrapper,model:this.editor.model}),this.trigger(Y,e)||this.cancelRow()},cancelRow:function(){this._cancelEditor(),this._render()},saveRow:function(){var e,t=this.editor;t&&(e={model:t.model,container:t.wrapper},t.end()&&!this.trigger(W,e)&&this.dataSource.sync())},addRow:function(e){var n=this.editor,i=0,r={};if(!n||n.end())return e?(e instanceof ue||(e=this.dataItem(e)),r[e.parentIdField]=e.id,i=this.dataSource.indexOf(e)+1,this.expand(e).then(D(this._insertAt,this,r,i)),t):(this._insertAt(r,i),t)},_insertAt:function(e,t){e=this.dataSource.insert(t,e);var n=this.itemFor(e);this.editRow(n)},removeRow:function(e){var t=this.dataItem(e),n={model:t,row:e};t&&!this.trigger(j,n)&&(this.dataSource.remove(t),this.dataSource.sync())},_cancelEditor:function(){var e,t=this.editor;t&&(e=t.model,this._destroyEditor(),this.dataSource.cancelChanges(e),e._edit=!1)},_destroyEditor:function(){this.editor&&(this.editor.close(),this.editor=null)},_createEditor:function(e){var t,n,i=this.itemFor(e);i=i.add(this._relatedRow(i)),t=this._editMode(),n={columns:this.columns,model:e,target:this,clearContainer:!1,template:this.options.editable.template},"inline"==t?this.editor=new c(i,n):(p(n,{window:this.options.editable.window,commandRenderer:D(function(){return this._buildCommands(["update","canceledit"])},this),fieldRenderer:this._cellContent,save:D(this.saveRow,this),cancel:D(this._cancelEdit,this),appendTo:this.wrapper}),this.editor=new u(i,n))},_editMode:function(){var e="inline",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e.toLowerCase()},hideColumn:function(e){this._toggleColumnVisibility(e,!0)},showColumn:function(e){this._toggleColumnVisibility(e,!1)},_toggleColumnVisibility:function(e,t){e=this._findColumn(e),e&&e.hidden!==t&&(e.hidden=t,this._ensureExpandableColumn(),this._renderCols(),this._renderHeader(),this._render(),this._adjustTablesWidth(),this.trigger(t?Q:X,{column:e}),t||e.width||this.table.add(this.thead.closest("table")).width(""))},_findColumn:function(e){return e="number"==typeof e?this.columns[e]:I(e)?F(this.columns,function(t){return t===e})[0]:F(this.columns,function(t){return t.field===e})[0]},_adjustTablesWidth:function(){var e,t,n,i=this.thead.prev().children(),r=0;for(e=0,t=i.length;e<t;e++){if(n=i[e].style.width,!n||n.indexOf("%")!=-1){r=0;break}r+=parseInt(n,10)}r&&this.table.add(this.thead.closest("table")).width(r)},_reorderable:function(){var t,n,i;this.options.reorderable&&(t=this.options.scrollable===!0,n=(t?".k-grid-header:first ":"table:first>.k-grid-header ")+J,i=this,this._draggableInstance=new w.Draggable(this.wrapper,{group:kendo.guid(),filter:n,hint:function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(kendo.attr("title"))||t.attr(kendo.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-i-denied" />')}}),this.reorderable=new w.Reorderable(this.wrapper,{draggable:this._draggableInstance,dragOverContainers:D(this._allowDragOverContainers,this),inSameContainer:function(t){return e(t.source).parent()[0]===e(t.target).parent()[0]},change:function(e){var t=e.newIndex,n=e.oldIndex,r="before"===e.position,o=i.columns[n];i.trigger(Z,{newIndex:t,oldIndex:n,column:o}),i.reorderColumn(t,o,r)}}))},_allowDragOverContainers:function(e){return this.columns[e].lockable!==!1},reorderColumn:function(n,i,r){var o,a,s,l=this.columns,d=R(i,l),c=l[n],u=!!c.locked,h=this._nonLockedColumns().length;d!==n&&(u&&!i.locked&&1==h||!u&&i.locked&&l.length-h==1||(r===t&&(r=n<d),o=!!i.locked,o=o!=u,i.locked=u,l.splice(r?n:n+1,0,i),l.splice(d<n?d:d+1,1),this._renderCols(),a=e(this.lockedHeader).add(this.thead).find("th"),a.eq(d)[r?"insertBefore":"insertAfter"](a.eq(n)),s=this._headerTree.children[0].children,this._hasLockedColumns&&(s=this._lockedHeaderTree.children[0].children.concat(s)),s.splice(r?n:n+1,0,s[d]),s.splice(d<n?d:d+1,1),this._hasLockedColumns&&(this._lockedHeaderTree.children[0].children=s.splice(0,this._lockedColumns().length),this._headerTree.children[0].children=s),this._applyLockedContainersWidth(),this.refresh(),o&&(u?this.trigger(ne,{column:i}):this.trigger(ie,{column:i}))))},lockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:F(n,function(t){return t.field===e})[0],e&&!e.hidden&&(t=this._lockedColumns().length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:F(n,function(t){return t.field===e})[0],e&&!e.hidden&&(t=this._lockedColumns().length,this.reorderColumn(t,e,!0))},_columnMenu:function(){var t,n,i,r,o,a,s=e(this.lockedHeader).add(this.thead).find("th"),l=this.columns,d=this.options,c=d.columnMenu,u=D(this._columnMenuInit,this),h=this._lockedColumns().length;if(c)for("boolean"==typeof c&&(c={}),a=0;a<s.length;a++)t=l[a],t.field&&(n=s.eq(a).data("kendoColumnMenu"),n&&n.destroy(),r=!1,t.sortable!==!1&&c.sortable!==!1&&d.sortable!==!1&&(r=p({},d.sortable,{compare:(t.sortable||{}).compare})),o=!1,d.filterable&&t.filterable!==!1&&c.filterable!==!1&&(o=p({pane:this.pane},t.filterable,d.filterable)),i={dataSource:this.dataSource,values:t.values,columns:c.columns,sortable:r,filterable:o,messages:c.messages,owner:this,closeCallback:e.noop,init:u,pane:this.pane,lockedColumns:t.lockable!==!1&&h>0},d.$angular&&(i.$angular=d.$angular),s.eq(a).kendoColumnMenu(i))},_columnMenuInit:function(e){this.trigger(te,{field:e.field,container:e.container})}}),kendo.ExcelMixin&&kendo.ExcelMixin.extend(h.prototype),kendo.PDFMixin&&(kendo.PDFMixin.extend(h.prototype),h.fn._drawPDF=function(t){var n=new e.Deferred;return this._drawPDFShadow({width:this.wrapper.width()},{avoidLinks:this.options.pdf.avoidLinks}).done(function(e){var i={page:e,pageNumber:1,progress:1,totalPages:1};t.notify(i),n.resolve(i.page)}).fail(function(e){n.reject(e)}),n}),p(!0,kendo.data,{TreeListDataSource:d,TreeListModel:ue}),p(!0,kendo.ui,{TreeList:h}),w.plugin(h)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("util/parse-xml.min",["kendo.core.min","util/main.min"],e)}(function(){"use strict";function e(e){var t,n=[];for(t=0;t<e.length;++t)n.push(e.charCodeAt(t));return n}function t(e,t){t>65535?(t-=65536,e.push(t>>>10&1023|55296,56320|1023&t)):e.push(t)}function n(e,n){function C(n){var i=e[j++];240&i^240?224&i^224?192&i^192?n.push(i):t(n,(31&i)<<6|63&e[j++]):t(n,(15&i)<<12|(63&e[j++])<<6|63&e[j++]):t(n,(3&i)<<18|(63&e[j++])<<12|(63&e[j++])<<6|63&e[j++])}function T(e){throw Error(e+", at "+j)}function S(t){for(var n=[];j<e.length&&t(e[j]);)n.push(e[j++]);return n}function D(e){return i.apply(0,S(e))}function E(){S(I)}function F(t){var n,i=j;for(n=0;n<t.length;++n)if(e[j++]!=t[n])return j=i,!1;return t}function R(e){F(e)||T("Expecting "+e.join(", "))}function I(e){return 9==e||10==e||13==e||32==e}function A(e){return e>=48&&e<=57}function M(e){return e>=48&&e<=57||(e|=32)>=97&&e<=102}function z(e){return 58==e||95==e||(e|=32)>=97&&e<=122}function H(e){return 45==e||A(e)||z(e)}function N(){for(var t=[];j<e.length;){if(F(s))return q("comment",i.apply(0,t));C(t)}}function P(){var e,t;F(h)?W():F(l)?N():(e=B(),t=U(e),$.push(t),F(d)?q("enter",e,t,!0):(R(p),q("enter",e,t),L(e),e!=B()&&T("Bad closing tag"),q("leave",e,t),E(),R(p)),$.pop())}function L(t){for(var n=[];j<e.length;){if(F(c))return n.length&&q("text",i.apply(0,n));if(F(o))for(;j<e.length&&!F(a);)C(n);else F(f)?(n.length&&q("text",i.apply(0,n)),P(),n=[]):F(v)?V(n):C(n)}T("Unclosed tag "+t)}function B(){return z(e[j])||T("Expecting XML name"),D(H)}function O(){var t,n=F(_)||F(b);for(n||T("Expecting string"),t=[];j<e.length;){if(F(n))return i.apply(0,t);F(v)?V(t):C(t)}T("Unfinished string")}function V(e){var n,i;F(k)?(n=F(w)||F(y)?parseInt(D(M),16):parseInt(D(A),10),isNaN(n)&&T("Bad numeric entity")):(i=B(),n=r[i],void 0===n&&T("Unknown entity "+i)),t(e,n),R(m)}function W(){q("decl",B(),U()),R(u)}function U(t){for(var n,i={$tag:t};j<e.length&&(E(),n=e[j],63!=n&&62!=n&&47!=n);)i[B()]=(R(g),O());return i}function q(e,t,i,r){var o=n&&n[e];o&&o.call(G,t,i,r)}var j=0,$=[],G={is:function(e){for(var t=$.length,n=e.length;--t>=0&&--n>=0;)if($[t].$tag!=e[n]&&"*"!=e[n])return!1;return n<0?$[$.length-1]:null},exit:function(){throw x},stack:$},Y=[];for(C(Y),65279!=Y[0]&&(j=0);j<e.length;)E(),R(f),P(),E()}var i=String.fromCharCode,r={amp:38,lt:60,gt:62,quot:34,apos:39,nbsp:160},o=e("<![CDATA["),a=e("]]>"),s=e("-->"),l=e("!--"),d=e("/>"),c=e("</"),u=e("?>"),h=e("?"),f=e("<"),p=e(">"),m=e(";"),g=e("="),v=e("&"),_=e('"'),b=e("'"),k=e("#"),w=e("x"),y=e("X"),x={};kendo.util.parseXML=function(){try{return n.apply(this,arguments)}catch(e){if(e!==x)throw e}}},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/commands.min",["kendo.core.min","kendo.binder.min","kendo.window.min","kendo.list.min","kendo.tabstrip.min"],e)}(function(){!function(e){function t(e){var t=document.createElement("textarea");n(t).addClass("k-spreadsheet-clipboard").val(e).appendTo(document.body).focus().select(),document.execCommand("copy"),n(t).remove()}var n,i,r,o,a,s,l,d;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=e.spreadsheet.Command=e.Class.extend({init:function(e){this.options=e,this._workbook=e.workbook,this._property=e&&e.property,this._state={}},range:function(e){return void 0!==e&&this._setRange(e),this._range},_setRange:function(e){this._range=e},redo:function(){this.exec()},undo:function(){this.setState(this._state)},getState:function(){this._state=this.range().getState(this._property);
},setState:function(e){this.range().setState(e)},_forEachCell:function(e){var t=this.range(),n=t._ref;n.forEach(function(n){t.sheet().forEach(n.toRangeRef(),e.bind(this))}.bind(this))}}),r=i.extend({init:function(e){i.fn.init.call(this,e),this._target=e.target,this._value=e.value},exec:function(){this.getState(),this.setState(this._value)}}),e.spreadsheet.ColumnWidthCommand=r.extend({getState:function(){this._state=this.range().sheet().columnWidth(this._target)},setState:function(e){this.range().sheet().columnWidth(this._target,e)}}),e.spreadsheet.RowHeightCommand=r.extend({getState:function(){this._state=this.range().sheet().rowHeight(this._target)},setState:function(e){this.range().sheet().rowHeight(this._target,e)}}),e.spreadsheet.HyperlinkCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._link=e.link},exec:function(){var e=this.range();this._prevLink=e.link(),e.link(this._link),null==e.value()&&(this._hasSetValue=!0,e.value(this._link))},undo:function(){var e=this.range();e.link(this._prevLink),this._hasSetValue&&e.value(null)}}),e.spreadsheet.GridLinesChangeCommand=r.extend({getState:function(){this._state=this._range.sheet().showGridLines()},setState:function(e){this._range.sheet().showGridLines(e)}}),o=e.spreadsheet.PropertyChangeCommand=i.extend({_setRange:function(e){i.prototype._setRange.call(this,e.skipHiddenCells())},init:function(e){i.fn.init.call(this,e),this._value=e.value},exec:function(){var e=this.range();e.enable()&&(this.getState(),e[this._property](this._value))}}),e.spreadsheet.ClearContentCommand=i.extend({exec:function(){this.getState(),this.range().clearContent()}}),e.spreadsheet.EditCommand=o.extend({init:function(e){e.property=e.property||"input",o.fn.init.call(this,e)},rejectState:function(e){return this.undo(),{title:e.title,body:e.message,reason:"error",type:"validationError"}},getState:function(){this._state=this.range().getState()},exec:function(){var t,n,i=this.range();if(!i.enable())return{reason:"error",type:"rangeDisabled"};if(t=this._value,this.getState(),"value"==this._property)return void i.value(t);try{if(i.link(null),""===t?i.value(null):(i.input(t),/\n/.test(i.value())&&i.wrap(!0)),i._adjustRowHeight(),n=i._getValidationState())return this.rejectState(n)}catch(r){if(r instanceof e.spreadsheet.calc.ParseError)return{title:"Error in formula",body:r+"",reason:"error"};throw r}}}),e.spreadsheet.TextWrapCommand=o.extend({init:function(e){e.property="wrap",o.fn.init.call(this,e),this._value=e.value},getState:function(){var e={};this.range().forEachRow(function(t){var n=t.topLeft().row;e[n]=t.sheet().rowHeight(n)}),this._state=this.range().getState(this._property),this._rowHeight=e},undo:function(){var e,t=this.range().sheet(),n=this._rowHeight;this.range().setState(this._state);for(e in n)t.rowHeight(e,n[e])}}),e.spreadsheet.AdjustDecimalsCommand=i.extend({init:function(e){this._decimals=e.value,e.property="format",i.fn.init.call(this,e)},exec:function(){var t=this.range().sheet(),n=this._decimals,i=e.spreadsheet.formatting;this.getState(),t.batch(function(){this.range().forEachCell(function(e,r,o){var a=o.format;(a||n>0)&&(a=i.adjustDecimals(a||"#",n),t.range(e,r).format(a))})}.bind(this))}}),e.spreadsheet.BorderChangeCommand=i.extend({init:function(e){e.property="border",i.fn.init.call(this,e),this._type=e.border,this._style=e.style},exec:function(){this.getState(),this[this._type](this._style)},noBorders:function(){var e=this.range();e.sheet().batch(function(){e.borderLeft(null).borderTop(null).borderRight(null).borderBottom(null)}.bind(this),{})},allBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderLeft(e).borderTop(e).borderRight(e).borderBottom(e)}.bind(this),{})},leftBorder:function(e){this.range().leftColumn().borderLeft(e)},rightBorder:function(e){this.range().rightColumn().borderRight(e)},topBorder:function(e){this.range().topRow().borderTop(e)},bottomBorder:function(e){this.range().bottomRow().borderBottom(e)},outsideBorders:function(e){var t=this.range();t.sheet().batch(function(){t.leftColumn().borderLeft(e),t.topRow().borderTop(e),t.rightColumn().borderRight(e),t.bottomRow().borderBottom(e)}.bind(this),{})},insideBorders:function(e){this.range().sheet().batch(function(){this.allBorders(e),this.outsideBorders(null)}.bind(this),{})},insideHorizontalBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderBottom(e),t.bottomRow().borderBottom(null)}.bind(this),{})},insideVerticalBorders:function(e){var t=this.range();t.sheet().batch(function(){t.borderRight(e),t.rightColumn().borderRight(null)}.bind(this),{})}}),e.spreadsheet.MergeCellCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._type=e.value},exec:function(){this.getState(),this[this._type]()},activate:function(e){this.range().sheet().activeCell(e)},getState:function(){this._state=this.range().getState()},undo:function(){"unmerge"!==this._type&&(this.range().unmerge(),this.activate(this.range().topLeft())),this.range().setState(this._state)},cells:function(){var e=this.range(),t=e._ref;e.merge(),this.activate(t)},horizontally:function(){var e=this.range().topRow()._ref;this.range().forEachRow(function(e){e.merge()}),this.activate(e)},vertically:function(){var e=this.range().leftColumn()._ref;this.range().forEachColumn(function(e){e.merge()}),this.activate(e)},unmerge:function(){var e=this.range(),t=e._ref.topLeft;e.unmerge(),this.activate(t)}}),e.spreadsheet.FreezePanesCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._type=e.value},exec:function(){this.getState(),this._topLeft=this.range().topLeft(),this[this._type]()},getState:function(){this._state=this.range().sheet().getState()},undo:function(){this.range().sheet().setState(this._state)},panes:function(){var e=this._topLeft,t=this.range().sheet();t.frozenColumns(e.col).frozenRows(e.row)},rows:function(){var e=this._topLeft,t=this.range().sheet();t.frozenRows(e.row)},columns:function(){var e=this._topLeft,t=this.range().sheet();t.frozenColumns(e.col)},unfreeze:function(){var e=this.range().sheet();e.frozenRows(0).frozenColumns(0)}}),e.spreadsheet.PasteCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=this._workbook.clipboard()},getState:function(){this._range=this._workbook.activeSheet().range(this._clipboard.pasteRef()),this._state=this._range.getState()},exec:function(){var e,t=this._clipboard.canPaste();return this._clipboard.menuInvoked=!0,t.canPaste?(this.getState(),this._clipboard.paste(),e=this._workbook.activeSheet().range(this._clipboard.pasteRef()),void e._adjustRowHeight()):t.menuInvoked?{reason:"error",type:"useKeyboard"}:t.pasteOnMerged?{reason:"error",type:"modifyMerged"}:t.overflow?{reason:"error",type:"overflow"}:{reason:"error"}}}),e.spreadsheet.AdjustRowHeightCommand=i.extend({exec:function(){var e=this.options,t=this._workbook.activeSheet(),n=e.range||t.range(e.rowIndex);n._adjustRowHeight()}}),e.spreadsheet.ToolbarPasteCommand=i.extend({exec:function(){return e.support.clipboard.paste?(this._workbook._view.clipboard.focus().select(),void document.execCommand("paste")):{reason:"error",type:"useKeyboard"}}}),e.spreadsheet.CopyCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},undo:n.noop,exec:function(){var e=this._clipboard.canCopy();if(this._clipboard.menuInvoked=!0,e.canCopy)this._clipboard.copy();else{if(e.menuInvoked)return{reason:"error",type:"useKeyboard"};if(e.multiSelection)return{reason:"error",type:"unsupportedSelection"}}}}),e.spreadsheet.ToolbarCopyCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},undo:n.noop,exec:function(){if(!e.support.clipboard.copy)return{reason:"error",type:"useKeyboard"};var n=this._workbook._view.clipboard;t(n.html()),n.trigger("copy")}}),e.spreadsheet.CutCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},exec:function(){this.range().enable()&&this._clipboard.canCopy()&&(this.getState(),this._clipboard.cut())}}),e.spreadsheet.AutoFillCommand=i.extend({init:function(e){i.fn.init.call(this,e)},origin:function(e){this._origin=e},exec:function(){var t=this.range();if(!t.enable())return{reason:"error",type:"rangeDisabled"};this.getState();try{t.fillFrom(this._origin)}catch(n){if(n instanceof e.spreadsheet.Range.FillError)return{reason:"error",type:n.code};throw n}}}),e.spreadsheet.ToolbarCutCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._clipboard=e.workbook.clipboard()},exec:function(){if(!e.support.clipboard.copy)return{reason:"error",type:"useKeyboard"};var n=this._workbook._view.clipboard;t(n.html()),n.trigger("cut")}}),e.spreadsheet.FilterCommand=i.extend({undo:function(){this.range().filter(this._state)},exec:function(){var e=this.range();if(this._state=e.hasFilter(),e.hasFilter())e.filter(!1);else{if(e.intersectingMerged().length)return{reason:"error",type:"filterRangeContainingMerges"};e.filter(!0)}}}),e.spreadsheet.SortCommand=i.extend({undo:function(){var e=this.range().sheet();e.setState(this._state)},exec:function(){var e=this.range(),t=e.sheet(),n=t.activeCell(),i=this.options.sheet?n.topLeft.col:this.options.column||0,r="asc"===this.options.value;return this._state=t.getState(),this.options.sheet&&(e=this.expandRange()),e.intersectingMerged().length?{reason:"error",type:"sortRangeContainingMerges"}:void e.sort({column:i,ascending:r})},expandRange:function(){var t=this.range().sheet();return new e.spreadsheet.Range(t._sheetRef,t)}}),a=e.spreadsheet.ApplyFilterCommand=i.extend({column:function(){return this.options.column||0},undo:function(){var e=this.range().sheet();e.clearFilter(this.column()),this._state.length&&this.range().filter(this._state)},getState:function(){var e=this.range().sheet(),t=e.filter();t&&(this._state=t.columns.filter(function(e){return e.index==this.column()}.bind(this)))},exec:function(){var t,n,i=this.range(),r=this.column(),o=i.sheet().filter(),a=!1;this.options.valueFilter?n={column:r,filter:new e.spreadsheet.ValueFilter(this.options.valueFilter)}:this.options.customFilter&&(n={column:r,filter:new e.spreadsheet.CustomFilter(this.options.customFilter)}),this.getState(),o&&o.ref.eq(i._ref)&&o.columns.length?(o.columns.forEach(function(e){e.index===r&&(a=!0)}),t=o.columns.map(function(e){return e.index===r?n:{column:e.index,filter:e.filter}}),a||t.push(n)):t=n,i.filter(t)}}),e.spreadsheet.ClearFilterCommand=a.extend({exec:function(){var e=this.range(),t=this.column();this.getState(),e.clearFilter(t)}}),e.spreadsheet.HideLineCommand=i.extend({init:function(e){i.fn.init.call(this,e),this.axis=e.axis},undo:function(){var e=this.range().sheet();e.setAxisState(this._state)},exec:function(){var e=this.range().sheet();this._state=e.getAxisState(),"row"==this.axis?e.axisManager().hideSelectedRows():e.axisManager().hideSelectedColumns()}}),e.spreadsheet.UnHideLineCommand=e.spreadsheet.HideLineCommand.extend({exec:function(){var e=this.range().sheet();this._state=e.getAxisState(),"row"==this.axis?e.axisManager().unhideSelectedRows():e.axisManager().unhideSelectedColumns()}}),s=e.spreadsheet.DeleteCommand=i.extend({undo:function(){var e=this.range().sheet();e.setState(this._state)}}),e.spreadsheet.DeleteRowCommand=s.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),e.axisManager().deleteSelectedRows()}}),e.spreadsheet.DeleteColumnCommand=s.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),e.axisManager().deleteSelectedColumns()}}),l=i.extend({init:function(e){i.fn.init.call(this,e),this._value=e.value},undo:function(){var e=this.range().sheet();e.setState(this._state)}}),e.spreadsheet.AddColumnCommand=l.extend({exec:function(){var e=this.range().sheet();this._state=e.getState(),"left"===this._value?e.axisManager().addColumnLeft():e.axisManager().addColumnRight()}}),e.spreadsheet.AddRowCommand=l.extend({exec:function(){var e=this.range().sheet();return e.axisManager().canAddRow()?(this._state=e.getState(),void("above"===this._value?e.axisManager().addRowAbove():e.axisManager().addRowBelow())):{reason:"error",type:"shiftingNonblankCells"}}}),e.spreadsheet.EditValidationCommand=i.extend({init:function(e){i.fn.init.call(this,e),this._value=e.value},exec:function(){this.range().validation(this._value)}}),e.spreadsheet.OpenCommand=i.extend({cannotUndo:!0,exec:function(){var e=this.options.file;return null===e.name.match(/.xlsx$/i)?{reason:"error",type:"openUnsupported"}:void this.options.workbook.fromFile(this.options.file)}}),e.spreadsheet.SaveAsCommand=i.extend({exec:function(){var e=this.options.name+this.options.extension;".xlsx"===this.options.extension?this.options.workbook.saveAsExcel({fileName:e}):".pdf"===this.options.extension&&this.options.workbook.saveAsPDF(n.extend(this.options.pdf,{workbook:this.options.workbook,fileName:e}))}}),d=i.extend({init:function(e){i.fn.init.call(this,e),this._name=e.name,this._value=e.value},getState:function(){this._state=this._workbook.nameDefinition(this._name)},setState:function(){this._workbook.nameDefinition(this._name,this._state),this._workbook.trigger("change",{recalc:!0})}}),e.spreadsheet.DefineNameCommand=d.extend({exec:function(){this.getState();try{this._workbook.defineName(this._name,this._value),this._workbook.trigger("change",{recalc:!0})}catch(e){return{title:"Error",body:e+"",reason:"error"}}}}),e.spreadsheet.DeleteNameCommand=d.extend({exec:function(){this.getState(),this._workbook.undefineName(this._name),this._workbook.trigger("change",{recalc:!0})}}))}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulabar.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n={wrapper:"k-spreadsheet-formula-bar"},i=e.ui.Widget.extend({init:function(n,r){e.ui.Widget.call(this,n,r),n=this.element.addClass(i.classNames.wrapper),this.formulaInput=new e.spreadsheet.FormulaInput(t("<div/>").appendTo(n))},destroy:function(){this.formulaInput&&this.formulaInput.destroy(),this.formulaInput=null}}),e.spreadsheet.FormulaBar=i,t.extend(!0,i,{classNames:n}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulainput.min",["kendo.core.min"],e)}(function(){!function(e,t){function n(e){return"("==e||"["==e||"{"==e}function i(e){return")"==e||"]"==e||"}"==e}function r(e,t){return"("==t?")"==e:"["==t?"]"==e:"{"==t&&"}"==e}function o(e,t){return e.begin<=t.begin&&e.end>=t.end}function a(t){return e.spreadsheet.calc.runtime.FUNCS[t.toLowerCase()]}function s(e,t){return!(!e||!t)&&("ref"==e.type&&"ref"==t.type?e.ref.eq(t.ref):e.value===t.value)}var l,d,c,u,h,f,p,m,g;e.support.browser.msie&&e.support.browser.version<9||(l=e.jQuery,d=e.ui.Widget,c=".kendoFormulaInput",u=e.keys,h={wrapper:"k-spreadsheet-formula-input",listWrapper:"k-spreadsheet-formula-list"},f=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],p={27:"esc",37:"left",39:"right",35:"end",36:"home",32:"spacebar"},m=/(^_|[^a-z0-9]$)/i,g=d.extend({init:function(e,t){d.call(this,e,t),e=this.element,e.addClass(g.classNames.wrapper).attr("contenteditable",!0).attr("spellcheck",!1).css("white-space","pre"),this.options.autoScale&&e.on("input",this.scale.bind(this)),this._highlightedRefs=[],this._staticTokens=[],this._formulaSource(),this._formulaList(),this._popup(),this._tooltip(),e.on("keydown",this._keydown.bind(this)).on("keyup",this._keyup.bind(this)).on("blur",this._blur.bind(this)).on("input click",this._input.bind(this)).on("focus",this._focus.bind(this)).on("paste",this._paste.bind(this))},options:{name:"FormulaInput",autoScale:!1,filterOperator:"startswith",scalePadding:30,minLength:1},events:["keyup","focus"],enable:function(e){return void 0===e?"true"===this.element.attr("contenteditable"):(this.enableEditing(e),void this.element.toggleClass("k-state-disabled",!e))},enableEditing:function(e){e?this.element.attr("contenteditable",e):this.element.removeAttr("contenteditable")},getPos:function(){function e(e,t){try{!function r(n){if(n===e)throw t;if(1==n.nodeType)for(var i=n.firstChild;i;i=i.nextSibling)r(i);else 3==n.nodeType&&(t+=n.nodeValue.length)}(i)}catch(n){return n}}var n,i=this.element[0],r=t.getSelection(),o=e(r.focusNode,r.focusOffset),a=e(r.anchorNode,r.anchorOffset);if(null!=o&&null!=a)return o>a&&(n=o,o=a,a=n),{begin:o,end:a,collapsed:o==a}},setPos:function(e,n){function i(e,t){return e.startOffset!=t.startOffset||e.endOffset!=t.endOffset||e.startContainer!=t.endContainer||e.endContainer!=t.endContainer}function r(e,t){try{!function i(e){var n,r;if(3==e.nodeType){if(n=e.nodeValue.length,n>=t)throw e;t-=n}else if(1==e.nodeType)for(r=e.firstChild;r;r=r.nextSibling)i(r)}(e)}catch(n){return{node:n,pos:t}}}var o,a,s,l=this.element[0];e=r(l,e),n=null!=n?r(l,n):e,e&&n&&(o=document.createRange(),o.setStart(e.node,e.pos),o.setEnd(n.node,n.pos),a=t.getSelection(),s=a.getRangeAt(0),i(o,s)&&(a.removeAllRanges(),a.addRange(o)))},end:function(){this.setPos(this.length())},home:function(){this.setPos(0)},length:function(){return this.value().length},_formulaSource:function(){var t,n,i=[];for(n in e.spreadsheet.calc.runtime.FUNCS)m.test(n)||(t=n.toUpperCase(),i.push({value:t,text:t}));this.formulaSource=new e.data.DataSource({data:i})},_formulaList:function(){this.list=new e.ui.StaticList(l("<ul />").addClass(g.classNames.listWrapper).insertAfter(this.element),{autoBind:!1,selectable:!0,change:this._formulaListChange.bind(this),dataSource:this.formulaSource,dataValueField:"value",template:"#:data.value#"}),this.list.element.on("mousedown",function(e){e.preventDefault()})},_formulaListChange:function(){var e,t,n,i=this._tokenContext();i&&!this._mute&&(e=i.token,t=this.list.value()[0],n={replace:!0,token:e,end:e.end},i.nextToken&&"("==i.nextToken.value||(t+="("),this._replaceAt(n,t),this.popup.close())},_popup:function(){this.popup=new e.ui.Popup(this.list.element,{anchor:this.element})},_blur:function(){this.popup.close(),clearTimeout(this._focusId),this.trigger("blur")},_isFormula:function(){return/^=/.test(this.value())},_keydown:function(e){var t=e.keyCode;p[t]?(this.popup.close(),this._navigated=!0):this._move(t)&&(this._navigated=!0,e.preventDefault()),this._keyDownTimeout=setTimeout(this._syntaxHighlight.bind(this))},_keyup:function(){var e,t=this.popup;this._isFormula()&&!this._navigated&&(e=((this._tokenContext()||{}).token||{}).value,this.filter(e),e&&this.formulaSource.view().length?(t[t.visible()?"position":"open"](),this.list.focusFirst()):t.close()),this._navigated=!1,this._syntaxHighlight(),this.trigger("keyup")},_input:function(){this._syntaxHighlight()},_focus:function(){this._focusTimeout=setTimeout(this._syntaxHighlight.bind(this)),this.trigger("focus")},_paste:function(n){var i,r,o;n.preventDefault(),i=this.getPos(),r=e.support.browser.msie?t.clipboardData.getData("Text"):n.originalEvent.clipboardData.getData("text/plain"),o=this.value(),o=o.substr(0,i.begin)+r+o.substr(i.end),this.value(o),this.setPos(i.begin+r.length),this.scale()},_move:function(e){var t=this.list,n=this.popup;if(n.visible()){if(e===u.DOWN)return t.focusNext(),t.focus()||t.focusFirst(),!0;if(e===u.UP)return t.focusPrev(),t.focus()||t.focusLast(),!0;if(e===u.ENTER)return t.select(t.focus()),n.close(),!0;if(e===u.TAB)return t.select(t.focus()),n.close(),!0;if(e===u.PAGEUP)return t.focusFirst(),!0;if(e===u.PAGEDOWN)return t.focusLast(),!0}return e===u.ENTER},_tokenContext:function(){var t,n,i,r=this.getPos(),a=this.value();if(!a||!r||!r.collapsed)return null;for(t=e.spreadsheet.calc.tokenize(a,this.row(),this.col()),i=0;i<t.length;++i)if(n=t[i],o(n,r)&&/^(?:str|sym|func)$/.test(n.type))return{token:n,nextToken:t[i+1]};return null},_sync:function(){this._editorToSync&&this.isActive()&&this._editorToSync.value(this.value())},_textContainer:function(){var t=e.getComputedStyles(this.element[0],f);t.position="absolute",t.visibility="hidden",t.whiteSpace="pre",t.top=-3333,t.left=-3333,this._span=l("<span style='white-space: pre'/>").css(t).insertAfter(this.element)},_tooltip:function(){this._cellTooltip=l('<div class="k-widget k-tooltip" style="position:absolute; display:none">A1</div>').insertAfter(this.element)},tooltip:function(e){this._cellTooltip.text(e)},toggleTooltip:function(e){this._cellTooltip.toggle(e)},isActive:function(){return this.element[0]===e._activeElement()},filter:function(e){!e||e.length<this.options.minLength||(this._mute=!0,this.list.select(-1),this._mute=!1,this.formulaSource.filter({field:this.list.options.dataValueField,operator:this.options.filterOperator,value:e}))},hide:function(){this.enableEditing(!1),this.element.hide(),this._cellTooltip.hide()},show:function(){this.enableEditing(!0),this.element.show()},row:function(){if(this.activeCell)return this.activeCell.row},col:function(){if(this.activeCell)return this.activeCell.col},position:function(e){e&&(this.show(),this.element.css({top:e.top+1+"px",left:e.left+1+"px"}),this._cellTooltip.css({top:e.top-this._cellTooltip.height()-10+"px",left:e.left}))},resize:function(e){e&&this.element.css({width:e.width-1,height:e.height-1})},canInsertRef:function(e){var t,n=this._canInsertRef(e),i=n&&n.token;if(i)for(t=0;t<this._staticTokens.length;t++)if(s(i,this._staticTokens[t]))return null;return n},_canInsertRef:function(t){function i(e){return e.begin>l.begin}function r(e){if(e){if(/^(?:num|str|bool|sym|ref)$/.test(e.type))return{replace:!0,token:e,end:e.end};if(/^(?:op|punc|startexp)$/.test(e.type))return e.end==l.end?a(e,d[u+1]):a(d[u-1],e)}}function a(e,t){if(null==e)return null;if(null==t)return/^(?:op|startexp)$/.test(e.type)||n(e.value)?{token:e,end:l.end}:null;if(s){if("op"==e.type&&/^(?:punc|op)$/.test(t.type))return{token:e,end:l.end}}else{if("startexp"==e.type)return{token:e,end:l.end};if(/^(?:ref|op|punc)$/.test(e.type))return{token:e,end:l.end};if(/^(?:punc|op)$/.test(e.type))return/^[,;({]$/.test(e.value)?{token:e,end:l.end}:null}return!1}var s,l,d,c,u;if(this.popup.visible())return null;if(s=t,l=this.getPos(),l&&this._isFormula()){if(0===l.begin)return null;for(d=e.spreadsheet.calc.tokenize(this.value(),this.row(),this.col()),u=0;u<d.length;++u){if(c=d[u],o(c,l))return r(c);if(i(c))return a(d[u-1],c)}return a(c,null)}return null},refAtPoint:function(e){var t=this._canInsertRef();t&&this._replaceAt(t,""+e.simplify())},_replaceAt:function(e,t){var n,i=this.value(),r=e.token,o=i.substr(e.end);i=i.substr(0,e.replace?r.begin:e.end)+t,n=i.length,i+=o,this._value(i),this.setPos(n),this.scale(),this._syntaxHighlight(),this._sync()},syncWith:function(t){var n,i=this,r="input"+c,o=i._sync.bind(i);e.support.browser.msie&&(r="keydown"+c,n=function(){setTimeout(o)}),i._editorToSync=t,i.element.off(r).on(r,n||o)},scale:function(){var e,t,n=this.element;this._span||this._textContainer(),this._span.html(n.html()),e=this._span.width()+this.options.scalePadding,t=this._span.height(),e>n.width()&&n.width(e),t>n.height()&&n.height(t)},_value:function(e){this.element.text(e)},value:function(t){if(void 0===t){var n=this.element[0].innerText;return e.support.browser.mozilla&&(n=n.replace(/\n$/,"")),n}this._value(t),this._syntaxHighlight()},highlightedRefs:function(){return this._highlightedRefs.slice()},_syntaxHighlight:function(){var t,s=this.getPos(),l=this.value(),d=e.spreadsheet.Pane.classNames.series,c=[],u=0,h=[],f=[];if(!s||s.collapsed){if(!/^=/.test(l))return(this._staticTokens.length||this._highlightedRefs.length)&&(this._staticTokens=[],this._highlightedRefs=[],this.element.text(l)),void(this.popup&&this.popup.close());f=e.spreadsheet.calc.tokenize(l,this.row(),this.col()),f.forEach(function(e){if(e.active=!1,e.cls=["k-syntax-"+e.type],"ref"==e.type&&(e.colorClass=d[u++%d.length],e.cls.push(e.colorClass),c.push(e)),s&&"punc"==e.type)if(n(e.value))h.unshift(e);else if(i(e.value)){var l=h.shift();l?r(e.value,l.value)?(o(e,s)||o(l,s))&&(e.cls.push("k-syntax-paren-match"),l.cls.push("k-syntax-paren-match")):(e.cls.push("k-syntax-error"),l.cls.push("k-syntax-error")):e.cls.push("k-syntax-error")}s&&o(e,s)&&(e.cls.push("k-syntax-at-point"),e.active=!0,t=e),"func"!=e.type||a(e.value)||s&&o(e,s)||e.cls.push("k-syntax-error")}),f.reverse().forEach(function(t){var n=t.begin,i=t.end,r=e.htmlEncode(l.substring(n,i));l=l.substr(0,n)+"<span class='"+t.cls.join(" ")+"'>"+r+"</span>"+l.substr(i)}),this.element.html(l),s&&this.setPos(s.begin,s.end),t&&/^(?:startexp|op|punc)$/.test(t.type)&&this._setStaticTokens(f),this._highlightedRefs=c}},_setStaticTokens:function(e){var t,n;for(this._staticTokens=[],t=0;t<e.length;t++)n=e[t],/^(?:num|str|bool|sym|ref)$/.test(n.type)&&this._staticTokens.push(n)},destroy:function(){this._editorToSync=null,this.element.off(c),clearTimeout(this._focusTimeout),clearTimeout(this._keyDownTimeout),this._cellTooltip=null,this._span=null,this.popup.destroy(),this.popup=null,d.fn.destroy.call(this)},insertNewline:function(){var e=this.value(),t=this.getPos(),n=t.end==e.length;e=e.substr(0,t.begin)+(n?"\n\n":"\n"+e.substr(t.end)),this.value(e),this.setPos(t.begin+1)}}),e.spreadsheet.FormulaInput=g,l.extend(!0,g,{classNames:h}))}(kendo,window)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/eventlistener.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i,r,o,a;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n={8:"backspace",9:"tab",13:"enter",27:"esc",37:"left",38:"up",39:"right",40:"down",35:"end",36:"home",32:"spacebar",33:"pageup",34:"pagedown",46:"delete",113:":edit"},i=navigator.platform.toUpperCase().indexOf("MAC")>=0,r=function(e){return e>47&&e<58||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223},o=function(e){var t=e.keyCode,i=n[t];return!i&&r(t)&&(i=":alphanum"),!i&&e.key&&1==e.key.length&&(i=":alphanum"),i},a=e.Class.extend({init:function(e,n,i){if(this._handlers={},this.target=e,this._observer=n||window,this.keyDownProxy=this.keyDown.bind(this),this.mouseProxy=this.mouse.bind(this),this.threshold=5,this._pressLocation=null,e.on("keydown",this.keyDownProxy),e.on("contextmenu mousedown cut copy paste scroll wheel click dblclick focus",this.mouseProxy),t(document.documentElement).on("mousemove mouseup",this.mouseProxy),i)for(var r in i)this.on(r,i[r])},keyDown:function(e){this.handleEvent(e,o(e.originalEvent))},mouse:function(e){var t,n,i,r,o;e.which?t=3==e.which:e.button&&(t=2==e.button),n=e.type,"mousedown"===n&&(t?n="rightmousedown":this._pressLocation={x:e.pageX,y:e.pageY}),"mouseup"===n&&(t||(this._pressLocation=null)),"mousemove"===n&&this._pressLocation&&(i=this._pressLocation.x-e.pageX,r=this._pressLocation.y-e.pageY,o=Math.sqrt(i*i+r*r),o>this.threshold&&(n="mousedrag")),this.handleEvent(e,n)},handleEvent:function(e,t){var n,r,o="";e.mod=i?e.metaKey:e.ctrlKey&&!e.altKey,e.altKey&&(o+="alt+"),e.shiftKey&&(o+="shift+"),e.ctrlKey&&(o+="ctrl+"),o+=t,n=this._handlers["*+"+t],n&&n.call(this._observer,e,o),r=this._handlers[o],r&&r.call(this._observer,e,o)},on:function(e,t){var n=this._handlers;"string"==typeof t&&(t=this._observer[t]),"string"==typeof e&&(e=e.split(",")),e.forEach(function(e){n[e]=t})},destroy:function(){this.target.off("keydown",this.keyDownProxy),this.target.off("keydown",this.mouseProxy),t(document.documentElement).off("mousemove mouseup",this.mouseProxy)}}),e.spreadsheet.EventListener=a)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/rangelist.min",["kendo.core.min"],e)}(function(){!function(e){function t(e){return e}function n(e){if(e.left.level===e.level){var t=e;e=e.left,t.left=e.right,e.right=t}return e}function i(e){if(e.right.right.level===e.level){var t=e;e=e.right,t.right=e.left,e.left=t,e.level+=1}return e}function r(e,t){return e===c?new d(1,t,c,c):(e.value.start-t.start>0?e.left=r(e.left,t):e.right=r(e.right,t),i(n(e)))}function o(e,t){var r,a;if(e===c)return e;if(r=e.value.start-t.start,0===r)if(e.left!==c&&e.right!==c){for(a=e.left;a.right!==c;)a=a.right;e.value=a.value,e.left=o(e.left,e.value)}else e=e.left===c?e.right:e.left;else r>0?e.left=o(e.left,t):e.right=o(e.right,t);return(e.left.level<e.level-1||e.right.level<e.level-1)&&(e.level-=1,e.right.level>e.level&&(e.right.level=e.level),e=n(e),e.right=n(e.right),e.right.right=n(e.right.right),e=i(e),e.right=i(e.right)),e}function a(e,t){e!==c&&(a(e.left,t),t.push(e.value),a(e.right,t))}function s(e,t,n){if(e!==c){var i=e.value;t.start<i.start&&s(e.left,t,n),i.intersects(t)&&n.push(i),t.end>i.end&&s(e.right,t,n)}}function l(e,t,n){t!==c&&(l(e,t.left,n),e.insert(n(t.value)),l(e,t.right,n))}var d,c,u,h,f,p,m;e.support.browser.msie&&e.support.browser.version<9||(d=e.Class.extend({init:function(e,t,n,i){this.level=e,this.value=t,this.left=n,this.right=i}}),c=new function(){this.left=this,this.right=this,this.level=0},u=e.Class.extend({init:function(e,t,n){this.start=e,this.end=t,this.value=n},intersects:function(e){return e.start<=this.end&&e.end>=this.start}}),h=e.Class.extend({init:function(){this.root=c},insert:function(e){this.root=r(this.root,e)},remove:function(e){this.root=o(this.root,e)},findrange:function(e){for(var t=this.root;t!=c;)if(e<t.value.start)t=t.left;else{if(!(e>t.value.end))return t.value;t=t.right}return null},values:function(){var e=[];return a(this.root,e),e},intersecting:function(e,t){var n=[];return s(this.root,new u(e,t),n),n},map:function(e){var t=new h;return l(t,this.root,e),t},clone:function(){return this.map(t)},first:function(){for(var e=this.root;e.left!=c;)e=e.left;return e},last:function(){for(var e=this.root;e.right!=c;)e=e.right;return e}}),f=e.Class.extend({init:function(e,t,n){void 0===t?this.tree=e:(this.tree=new h,this.tree.insert(new u(e,t,n)))},values:function(){return this.tree.values()},map:function(e){return new f(this.tree.map(e))},intersecting:function(e,t){return this.tree.intersecting(e,t)},first:function(){return this.tree.first().value},last:function(){return this.tree.last().value},insert:function(e,t,n){return this.tree.insert(new u(e,t,n))},value:function(e,t,n){var i,r,o,a,s,l,d,c,u;if(void 0===n)return void 0===t&&(t=e),this.intersecting(e,t)[0].value;if(i=this.tree.intersecting(e-1,t+1),i.length)for(r=i[0],o=i[i.length-1],r.end<e&&(r.value===n?e=r.start:i.shift()),o.start>t&&(o.value===n?t=o.end:i.pop()),a=0,s=i.length;a<s;a++)l=i[a],d=l.value,c=l.start,u=l.end,this.tree.remove(l),c<e&&(d!==n?this.insert(c,e-1,d):e=c),u>t&&(d!==n?this.insert(t+1,u,d):t=u);this.insert(e,t,n)},expandedValues:function(e,t){var n,i=this.intersecting(e,t),r=[],o=0;for(n=e;n<=t;n++)i[o].end<n&&o++,r.push({index:n-e,value:i[o].value});return r},sortedIndices:function(e,t,n,i){var r=this.expandedValues(e,t),o=function(e,t){return e.value===t.value?e.index-t.index:n(e.value,t.value)};return i&&(o=function(e,t){var r=i[e.index],o=i[t.index];return r.value===o.value?n(e.value,t.value):e.index-t.index}),r.sort(o),r},sort:function(e,t,n){var i,r,o;if(1!==this.intersecting(e,t).length)for(i=this.expandedValues(e,t),r=0,o=n.length;r<o;r++)this.value(r+e,r+e,i[n[r].index].value)},copy:function(e,t,n){var i,r,o,a,s,l=this.intersecting(e,t),d=n;for(r=0,o=l.length;r<o;r++)a=l[r].start,a<e&&(a=e),s=l[r].end,s>t&&(s=t),i=d+(s-a),this.value(d,i,l[r].value),d=++i},iterator:function(e,t){return new p(e,t,this.intersecting(e,t))},getState:function(){return this.tree.clone()},setState:function(e){this.tree=e}}),p=e.Class.extend({init:function(e,t,n){this.start=e,this.end=t,this.index=0,this.ranges=n},unique:function(){return this.ranges.map(function(e){return e.value})},at:function(e){for(;this.ranges[this.index].end<e;)this.index++;return this.ranges[this.index].value},forEach:function(e){for(var t=this.start;t<=this.end;t++)e(this.at(t),t);this.index=0}}),m=f.extend({init:function(e,t,n){this.tree=new h,this.range=new u(e,t,n)},intersecting:function(e,t){var n,i,r,o=this.tree.intersecting(e,t),a=[];if(!o.length)return[this.range];for(i=0,r=o.length;i<r;i++)n=o[i],
n.start>e&&a.push(new u(e,n.start-1,this.range.value)),a.push(n),e=n.end+1;return n.end<t&&a.push(new u(n.end+1,t,this.range.value)),a},insert:function(e,t,n){n!==this.range.value&&this.tree.insert(new u(e,t,n))},lastRangeStart:function(){var e=this.tree.root;if(e===c)return this.range.start;for(;e.right!==c;)e=e.right;return e.value.end+1}}),e.spreadsheet.RangeTree=h,e.spreadsheet.RangeList=f,e.spreadsheet.SparseRangeList=m,e.spreadsheet.ValueRange=u)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/propertybag.min",["kendo.core.min"],e)}(function(){!function(e){function t(e){return e.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}var n,i,r,o;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=e.Class.extend({init:function(e){this.list=e},get:function(e){return this.parse(this.list.value(e,e))},set:function(e,t,n){void 0===n&&(n=t,t=e),this.list.value(e,t,n)},parse:function(e){return e},copy:function(e,t,n){this.list.copy(e,t,n)},iterator:function(e,t){return this.list.iterator(e,t)}}),r=i.extend({set:function(e,t,n){this.list.value(e,t,JSON.stringify(n))},parse:function(e){return JSON.parse(e)}}),o=i.extend({init:function(e,t,n){i.prototype.init.call(this,e),this.validations=n,this.formats=t},set:function(n,i,r){r instanceof Date&&(r=e.spreadsheet.dateToNumber(r),this.formats.value(n,i,t(e.culture().calendar.patterns.d))),this.list.value(n,i,r)}}),e.spreadsheet.PropertyBag=e.Class.extend({specs:[{property:o,name:"value",value:null,sortable:!0,serializable:!0,depends:"format"},{property:i,name:"format",value:null,sortable:!0,serializable:!0},{property:i,name:"formula",value:null,sortable:!0,serializable:!0},{property:i,name:"background",value:null,sortable:!0,serializable:!0},{property:r,name:"borderBottom",value:null,sortable:!1,serializable:!0},{property:r,name:"borderRight",value:null,sortable:!1,serializable:!0},{property:r,name:"borderLeft",value:null,sortable:!1,serializable:!0},{property:r,name:"borderTop",value:null,sortable:!1,serializable:!0},{property:i,name:"color",value:null,sortable:!0,serializable:!0},{property:i,name:"fontFamily",value:null,sortable:!0,serializable:!0},{property:i,name:"underline",value:null,sortable:!0,serializable:!0},{property:i,name:"fontSize",value:null,sortable:!0,serializable:!0},{property:i,name:"italic",value:null,sortable:!0,serializable:!0},{property:i,name:"bold",value:null,sortable:!0,serializable:!0},{property:i,name:"textAlign",value:null,sortable:!0,serializable:!0},{property:i,name:"verticalAlign",value:null,sortable:!0,serializable:!0},{property:i,name:"wrap",value:null,sortable:!0,serializable:!0},{property:i,name:"validation",value:null,sortable:!1,serializable:!0},{property:i,name:"enable",value:null,sortable:!1,serializable:!0},{property:i,name:"link",value:null,sortable:!1,serializable:!0},{property:i,name:"editor",value:null,sortable:!1,serializable:!0}],init:function(t){this.properties={},this.lists={},this.specs.forEach(function(n){this.lists[n.name]=new e.spreadsheet.SparseRangeList(0,t,n.value)},this),this.specs.forEach(function(e){this.properties[e.name]=new e.property(this.lists[e.name],this.lists[e.depends])},this)},getState:function(){var e={};return this.specs.forEach(function(t){e[t.name]=this.lists[t.name].getState()},this),e},setState:function(e){this.specs.forEach(function(t){this.lists[t.name].setState(e[t.name])},this)},get:function(e,t){return void 0===t?this.lists[e]:this.properties[e].get(t)},set:function(e,t,n,i){this.properties[e].set(t,n,i)},fromJSON:function(e,t){var n,i;for(n=0;n<this.specs.length;n++)i=this.specs[n],i.serializable&&void 0!==t[i.name]&&this.set(i.name,e,e,t[i.name],!1)},copy:function(e,t,n){this.specs.forEach(function(i){this.properties[i.name].copy(e,t,n)},this)},iterator:function(e,t,n){return this.properties[e].iterator(t,n)},sortable:function(){return this.specs.filter(function(e){return e.sortable}).map(function(e){return this.lists[e.name]},this)},iterators:function(e,t){var n=this.specs.filter(function(e){return e.serializable});return n.map(function(n){var i=this.iterator(n.name,e,t);return{name:n.name,value:n.value,at:function(e){return n.property.fn.parse(i.at(e))}}},this)},forEach:function(e,t,n){var i,r,o,a,s,l=this.iterators(e,t);for(i=e;i<=t;i++){for(r={},o=0;o<l.length;o++)a=l[o],s=a.at(i),s!==a.value&&(r[a.name]=s);n(r)}},forEachProperty:function(e){for(var t in this.properties)e(this.properties[t])}}),e.spreadsheet.ALL_PROPERTIES=n.map(e.spreadsheet.PropertyBag.prototype.specs,function(e){return e.name}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/references.min",["kendo.core.min"],e)}(function(){"use strict";function e(t){var n=Math.floor(t/26)-1;return(n>=0?e(n):"")+String.fromCharCode(65+t%26)}function t(e){return/^[a-z0-9_]*$/i.test(e)?e:"'"+e.replace(/\x27/g,"\\'")+"'"}function n(n,i,r,o){var a="";return++i,isFinite(i)?null==o||2&o||(i="$"+i):i="",isFinite(r)?(a=e(r),null==o||1&o||(a="$"+a)):r="",n?t(n)+"!"+a+i:a+i}var i,r,o,a,s,l,d,c;kendo.support.browser.msie&&kendo.support.browser.version<9||(i=kendo.spreadsheet,r=kendo.Class,o=r.extend({type:"ref",sheet:"",clone:function(){return this},hasSheet:function(){return this._hasSheet},simplify:function(){return this},setSheet:function(e,t){return this.sheet=e,null!=t&&(this._hasSheet=t),this},absolute:function(){return this},relative:function(){return this},adjust:function(){return this},toString:function(){return this.relative(0,0,3,3).print(0,0)},forEach:function(e,t){e.call(t,this)},map:function(e,t){return e.call(t,this)},intersects:function(e){return this.intersect(e)!==a},isCell:function(){return!1},toRow:function(){return this},toColumn:function(){return this},first:function(){return this},lastRange:function(){return this},size:function(){return 1},rangeAt:function(){return this},nextRangeIndex:function(){return 0},previousRangeIndex:function(){return 0},eq:function(e){var t,n,i,r,o=this,s=e;if(o===a||s===a)return o===s;if((s instanceof l||s instanceof d&&!(o instanceof l))&&(o=e,s=this),o instanceof l)return s=s.simplify(),s instanceof l&&o.row==s.row&&o.col==s.col&&o.sheet==s.sheet;if(o instanceof d){if(s instanceof d)return s.topLeft.eq(o.topLeft)&&s.bottomRight.eq(o.bottomRight);if(s instanceof c)return s.single()&&o.eq(s.refs[0])}else if(o instanceof c&&s instanceof c){if(t=o.refs,n=s.refs,t.length!=n.length)return!1;for(i=0,r=t.length;i<r;i++)if(!t[i].eq(n[i]))return!1;return!0}return o===s},concat:function(e){return new c([this,e])},replaceAt:function(e,t){return t},forEachColumnIndex:function(e){this.forEachAxisIndex("col",e)},forEachRowIndex:function(e){this.forEachAxisIndex("row",e)},forEachAxisIndex:function(e,t){var n=[],i="row"===e?"forEachRow":"forEachColumn";this[i](function(t){var i=t.first()[e];n.indexOf(i)===-1&&n.push(i)}),n.sort(function(e,t){return e>t?1:e<t?-1:0}).forEach(t)},valid:function(){return!1},renameSheet:function(e,t){if(this.sheet&&this.sheet.toLowerCase()==e.toLowerCase())return this.sheet=t,!0}}),o.display=n,a=new(o.extend({init:function(){},print:function(){return"#NULL!"},eq:function(e){return e===this},forEach:function(){}})),s=o.extend({ref:"name",init:function(e){this.name=e},clone:function(){return new s(this.name).setSheet(this.sheet,this.hasSheet())},print:function(){var e=t(this.name);return this.hasSheet()&&(e=t(this.sheet)+"!"+e),e}}),l=o.extend({ref:"cell",init:function(e,t,n){this.row=e,this.col=t,this.rel=n||0},clone:function(){return new l(this.row,this.col,this.rel).setSheet(this.sheet,this.hasSheet())},intersect:function(e){return e instanceof l?this.eq(e)?this:a:e.intersect(this)},print:function(e,i,r){var o,a,s=this.col,l=this.row,d=this.rel;return null==e&&d?(a=this.hasSheet()?t(this.sheet)+"!":"",s=isFinite(s)?1&d?"C["+s+"]":"C"+(s+1):"",l=isFinite(l)?2&d?"R["+l+"]":"R"+(l+1):"",a+l+s):(o=this.absolute(e,i),r?(l=o.row%1048576,s=o.col%16384,l<0&&(l+=1048576),s<0&&(s+=16384),n(this._hasSheet&&this.sheet,l,s,d)):o.valid()?n(this._hasSheet&&this.sheet,o.row,o.col,d):"#REF!")},absolute:function(e,t){var n=this.clone();return n.rel&!1?n:(1&n.rel&&(n.col=(n.col+t)%16384),2&n.rel&&(n.row=(n.row+e)%1048576),n.rel=0,n)},toRangeRef:function(){return new d(this,this)},relative:function(e,t,n){var i,r;return null==n&&(n=this.rel),i=2&n?this.row-e:this.row,r=1&n?this.col-t:this.col,new l(i,r,n).setSheet(this.sheet,this.hasSheet())},height:function(){return 1},width:function(){return 1},toString:function(){return n(null,this.row,this.col,3)},isCell:function(){return!0},leftColumn:function(){return this},rightColumn:function(){return this},topRow:function(){return this},bottomRow:function(){return this},forEachRow:function(e){e(this.toRangeRef())},forEachColumn:function(e){e(this.toRangeRef())},adjust:function(e,t,n,i,r,o,s){var l=this.absolute(e,t);if(r){if(l.row>=o){if(s<0&&l.row<o-s)return a;l.row+=s}}else if(l.col>=o){if(s<0&&l.col<o-s)return a;l.col+=s}return null!=n&&null!=i&&(l=l.relative(n,i,this.rel)),l},valid:function(){if(this.rel)throw Error("valid() called on relative reference");var e=this.col,t=this.row;return!(isFinite(e)&&e<0||isFinite(t)&&t<0)}}),d=o.extend({ref:"range",init:function(e,t){e._hasSheet&&t._hasSheet&&e.sheet.toLowerCase()!=t.sheet.toLowerCase()&&(this.endSheet=t.sheet),this.topLeft=new l(e.row,e.col,e.rel),this.bottomRight=new l(t.row,t.col,t.rel),this.normalize()},clone:function(){return new d(this.topLeft.clone(),this.bottomRight.clone()).setSheet(this.sheet,this.hasSheet())},_containsRange:function(e){return this._containsCell(e.topLeft)&&this._containsCell(e.bottomRight)},_containsCell:function(e){return e.sheet==this.sheet&&e.row>=this.topLeft.row&&e.col>=this.topLeft.col&&e.row<=this.bottomRight.row&&e.col<=this.bottomRight.col},contains:function(e){if(e instanceof Array){var t=this;return e.some(function(e){return t.contains(e)})}return e instanceof l?this._containsCell(e):e instanceof d&&this._containsRange(e)},_intersectRange:function(e){var t,n,i,r,o,s,c,u;return this.sheet!=e.sheet?a:(t=this.topLeft.col,n=this.topLeft.row,i=this.bottomRight.col,r=this.bottomRight.row,o=e.topLeft.col,s=e.topLeft.row,c=e.bottomRight.col,u=e.bottomRight.row,t<=c&&o<=i&&n<=u&&s<=r?new d(new l(Math.max(n,s),Math.max(t,o)),new l(Math.min(r,u),Math.min(i,c))).setSheet(this.sheet,this.hasSheet()):a)},intersect:function(e){return e instanceof l?this._containsCell(e)?e:a:e instanceof d?this._intersectRange(e).simplify():e instanceof c?e.intersect(this):a},simplify:function(){return this.isCell()?new l(this.topLeft.row,this.topLeft.col,this.topLeft.rel).setSheet(this.sheet,this.hasSheet()):this},normalize:function(){var e,t=this.topLeft,n=this.bottomRight,i=t.row,r=t.col,o=n.row,a=n.col,s=2&t.rel,d=1&t.rel,c=2&n.rel,u=1&n.rel,h=!1;return i>o&&(h=!0,e=i,i=o,o=e,e=s,s=c,c=e),r>a&&(h=!0,e=r,r=a,a=e,e=d,d=u,u=e),h&&(this.topLeft=new l(i,r,d|s),this.bottomRight=new l(o,a,u|c)),this},print:function(e,n,i){if(i||this.absolute(e,n).valid()){var r=this.topLeft.print(e,n,i)+":"+this.bottomRight.print(e,n,i);return this.hasSheet()&&(r=t(this.sheet)+(this.endSheet?":"+t(this.endSheet):"")+"!"+r),r}return"#REF!"},absolute:function(e,t){return new d(this.topLeft.absolute(e,t),this.bottomRight.absolute(e,t)).setSheet(this.sheet,this.hasSheet())},relative:function(e,t,n,i){return null==i&&(i=n),new d(this.topLeft.relative(e,t,n),this.bottomRight.relative(e,t,i)).setSheet(this.sheet,this.hasSheet())},height:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error("Mixed relative/absolute references");return this.bottomRight.row-this.topLeft.row+1},width:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error("Mixed relative/absolute references");return this.bottomRight.col-this.topLeft.col+1},collapse:function(){return this.topLeft.toRangeRef()},leftColumn:function(){return new d(this.topLeft,new l(this.bottomRight.row,this.topLeft.col))},rightColumn:function(){return new d(new l(this.topLeft.row,this.bottomRight.col),this.bottomRight)},topRow:function(){return new d(this.topLeft,new l(this.topLeft.row,this.bottomRight.col))},bottomRow:function(){return new d(new l(this.bottomRight.row,this.topLeft.col),this.bottomRight)},toRangeRef:function(){return this},toRow:function(e){return e+=Math.max(0,this.topLeft.row),new d(new l(e,this.topLeft.col),new l(e,this.bottomRight.col)).setSheet(this.sheet,this.hasSheet())},toColumn:function(e){return e+=Math.max(0,this.topLeft.col),new d(new l(this.topLeft.row,e),new l(this.bottomRight.row,e)).setSheet(this.sheet,this.hasSheet())},toCell:function(e,t){return e+=Math.max(0,this.topLeft.row),t+=Math.max(0,this.topLeft.col),new l(e,t,0).setSheet(this.sheet,this.hasSheet())},forEachRow:function(e){var t,n=this.topLeft.row,i=this.bottomRight.row,r=this.topLeft.col,o=this.bottomRight.col;for(t=n;t<=i;t++)e(new d(new l(t,r),new l(t,o)))},forEachColumn:function(e){var t,n=this.topLeft.row,i=this.bottomRight.row,r=this.topLeft.col,o=this.bottomRight.col;for(t=r;t<=o;t++)e(new d(new l(n,t),new l(i,t)))},intersecting:function(e){return e.filter(function(e){return e.toRangeRef().intersects(this)},this)},union:function(e,t){var n,i=this.intersecting(e),r=this.topLeft.row,o=this.topLeft.col,a=this.bottomRight.row,s=this.bottomRight.col,c=!1;return i.forEach(function(e){e=e.toRangeRef(),e.topLeft.row<r&&(c=!0,r=e.topLeft.row),e.topLeft.col<o&&(c=!0,o=e.topLeft.col),e.bottomRight.row>a&&(c=!0,a=e.bottomRight.row),e.bottomRight.col>s&&(c=!0,s=e.bottomRight.col),t&&t(e)}),n=new d(new l(r,o),new l(a,s)),c?n.union(e,t):n},resize:function(e){function t(e){return e||0}var n=Math.max.bind(Math,0),i=this.topLeft.row+t(e.top),r=this.topLeft.col+t(e.left),o=this.bottomRight.row+t(e.bottom),s=this.bottomRight.col+t(e.right);return r<0&&s<0||i<0&&o<0?a:i<=o&&r<=s?new d(new l(n(i),n(r)),new l(n(o),n(s))):a},move:function(e,t){return new d(new l(this.topLeft.row+e,this.topLeft.col+t),new l(this.bottomRight.row+e,this.bottomRight.col+t))},first:function(){return this.topLeft},isCell:function(){return!this.endSheet&&this.topLeft.eq(this.bottomRight)},toString:function(){return this.topLeft+":"+this.bottomRight},adjust:function(e,t,n,i,r,o,s){var l=this.topLeft.adjust(e,t,n,i,r,o,s),c=this.bottomRight.adjust(e,t,n,i,r,o,s);return l===a&&c===a?a:(l===a?(l=this.topLeft.absolute(e,t),r?l.row=o:l.col=o,null!=n&&null!=i&&(l=l.relative(n,i,this.topLeft.rel))):c===a&&(c=this.bottomRight.absolute(e,t),r?c.row=o-1:c.col=o-1,null!=n&&null!=i&&(c=c.relative(n,i,this.bottomRight.rel))),new d(l,c).setSheet(this.sheet,this.hasSheet()).simplify())},valid:function(){return this.topLeft.valid()&&this.bottomRight.valid()}}),c=o.extend({init:function(e){this.refs=e,this.length=e.length},clone:function(){return new c(this.refs.slice())},intersect:function(e){var t,n,i=[];for(t=0;t<this.length;++t)n=e.intersect(this.refs[t]),n!==a&&i.push(n);return i.length>0?new c(i).simplify():a},simplify:function(){var e=new c(this.refs.reduce(function(e,t){return t=t.simplify(),t!==a&&e.push(t),e},[]));return e.empty()?a:e.single()?e.refs[0]:e},absolute:function(e,t){return new c(this.refs.map(function(n){return n.absolute(e,t)}))},forEach:function(e,t){this.refs.forEach(e,t)},toRangeRef:function(){return this.refs[0].toRangeRef()},contains:function(e){return this.refs.some(function(t){return t.contains(e)})},map:function(e,t){return new c(this.refs.map(e,t))},first:function(){return this.refs[0].first()},lastRange:function(){return this.refs[this.length-1]},size:function(){return this.length},single:function(){return 1==this.length},empty:function(){return 0===this.length},isCell:function(){return this.single()&&this.refs[0].isCell()},rangeAt:function(e){return this.refs[e]},nextRangeIndex:function(e){return e===this.length-1?0:e+1},previousRangeIndex:function(e){return 0===e?this.length-1:e-1},concat:function(e){return new c(this.refs.concat([e]))},print:function(e,t,n){return this.refs.map(function(i){return i.print(e,t,n)}).join(",")},replaceAt:function(e,t){var n=this.refs.slice();return n.splice(e,1,t),new c(n)},leftColumn:function(){return this.map(function(e){return e.leftColumn()})},rightColumn:function(){return this.map(function(e){return e.rightColumn()})},topRow:function(){return this.map(function(e){return e.topRow()})},bottomRow:function(){return this.map(function(e){return e.bottomRow()})},forEachRow:function(e){this.forEach(function(t){t.forEachRow(e)})},forEachColumn:function(e){this.forEach(function(t){t.forEachColumn(e)})},adjust:function(e,t,n,i,r,o,a){return this.map(function(s){return s.adjust(e,t,n,i,r,o,a)}).simplify()},toString:function(){return this.refs.map(function(e){return""+e}).join(", ")},valid:function(){for(var e=this.refs.length;--e>=0;)if(this.refs[e].valid())return!1;return!0},renameSheet:function(e,t){this.refs.forEach(function(n){n.renameSheet(e,t)})}}),i.NULLREF=a,i.SHEETREF=new d(new l(0,0),new l(1/0,1/0)),i.FIRSTREF=new l(0,0),i.Ref=o,i.NameRef=s,i.CellRef=l,i.RangeRef=d,i.UnionRef=c,i.SHEETREF.print=function(){return"#SHEET"})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/autofillcalculator.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i;e.support.browser.msie&&e.support.browser.version<9||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.Class.extend({init:function(e){this._grid=e},rectIsVertical:function(e,t,n,i){var r=this._grid.rectangle(e.toRangeRef()),o=this._grid.rectangle(t.toRangeRef());return Math.abs(o[i]-r[i])>Math.abs(r[n]-o[n])},autoFillDest:function(e,i){var r,o,a,s,l,d,c,u=e.topLeft,h=e.bottomRight,f=i.row>=u.row,p=i.col>=u.col;return r=f?p?4:3:p?2:1,4===r?(o=u,a=h,l=i.row>a.row||i.col>a.col,l&&(i=new n(Math.max(i.row,a.row),Math.max(i.col,a.col))),s=this.rectIsVertical(a,i,"right","bottom")?new n(i.row,a.col):new n(a.row,i.col)):3===r?(d=new n(u.col,h.row),i.row>h.row&&this.rectIsVertical(d,i,"left","bottom")?(o=u,s=new n(i.row,h.col)):(o=h,s=new n(u.row,i.col))):2===r?(c=new n(u.row,h.col),i.col>h.col&&!this.rectIsVertical(c,i,"right","top")?(o=u,s=new n(h.row,i.col)):(o=h,s=new n(i.row,u.col))):(o=h,s=this.rectIsVertical(u,i,"left","top")?new n(i.row,u.col):new n(u.row,i.col)),this._grid.normalize(new t(o,s))}}),e.spreadsheet.AutoFillCalculator=i)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/navigator.min",["kendo.core.min","spreadsheet/autofillcalculator.min"],e)}(function(){!function(e){var t,n,i,r;e.support.browser.msie&&e.support.browser.version<9||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.Class.extend({init:function(e,t,n,i){this.rangeGetter=n,this.prevLeft=function(n){var r=i(this.range(n)),o=this.range(t.prevVisible(r.topLeft[e]));return i(o).topLeft[e]},this.nextRight=function(n){var r=i(this.range(n)),o=this.range(t.nextVisible(r.bottomRight[e]));return i(o).bottomRight[e]},this.nextLeft=function(n){var r=i(this.range(n));return t.nextVisible(r.bottomRight[e])},this.prevRight=function(n){var r=i(this.range(n));return t.prevVisible(r.topLeft[e])}},boundary:function(e,t){this.top=e,this.bottom=t},range:function(e){return this.rangeGetter(e,this.top,this.bottom)}}),r=e.Class.extend({init:function(t){this._sheet=t,this.columns=this._sheet._grid._columns,this.autoFillCalculator=new e.spreadsheet.AutoFillCalculator(t._grid),this.colEdge=new i("col",this._sheet._grid._columns,this.columnRange.bind(this),this.union.bind(this)),this.rowEdge=new i("row",this._sheet._grid._rows,this.rowRange.bind(this),this.union.bind(this))},height:function(e){this._viewPortHeight=e},union:function(e){return this._sheet.unionWithMerged(e)},columnRange:function(e,t,n){return this._sheet._ref(t,e,n-t,1)},rowRange:function(e,t,n){return this._sheet._ref(e,t,1,n-t)},selectionIncludesMergedCells:function(){return this._sheet.select().contains(this._sheet._mergedCells)},setSelectionValue:function(e){var t=this._sheet.selection();setTimeout(function(){t.value(e())})},selectAll:function(){this._sheet.select(this._sheet._sheetRef)},select:function(e,t,n){e=this.refForMode(e,t),n&&(e=this._sheet.select().concat(e)),this._sheet.select(e)},refForMode:function(e,t){var n=this._sheet._grid;switch(t){case"range":e=n.normalize(e);break;case"row":e=n.rowRef(e.row);break;case"column":e=n.colRef(e.col);break;case"sheet":e=this._sheet._sheetRef}return e},startSelection:function(e,n,i,r){if("autofill"==n)this._sheet.startAutoFill();else if(r&&"range"==n){var o=new t(this._sheet.activeCell().first(),e);this._sheet.select(o,!1,!1),this._sheet.startSelection()}else this._sheet.startSelection(),this.select(e,n,i)},completeSelection:function(){this._sheet.completeSelection()},selectForContextMenu:function(e,t){var n=this._sheet;n.select().contains(this.refForMode(e,t))||this.select(e,t)},modifySelection:function(e){var n,i,r=this.determineDirection(e),o=this._sheet,a=this._viewPortHeight,s=o._grid._rows,l=o._grid._columns,d=o.currentOriginalSelectionRange(),c=o.select().toRangeRef(),u=o.activeCell(),h=d.topLeft.clone(),f=d.bottomRight.clone();switch(this.colEdge.boundary(c.topLeft.row,c.bottomRight.row),this.rowEdge.boundary(c.topLeft.col,c.bottomRight.col),r){case"expand-left":h.col=this.colEdge.prevLeft(h.col),n=h;break;case"shrink-right":h.col=this.colEdge.nextLeft(h.col),n=h;break;case"expand-right":f.col=this.colEdge.nextRight(f.col),n=f;break;case"shrink-left":f.col=this.colEdge.prevRight(f.col),n=f;break;case"expand-up":h.row=this.rowEdge.prevLeft(h.row),n=h;break;case"shrink-down":h.row=this.rowEdge.nextLeft(h.row),n=h;break;case"expand-down":f.row=this.rowEdge.nextRight(f.row),n=f;break;case"shrink-up":f.row=this.rowEdge.prevRight(f.row),n=f;break;case"expand-page-up":h.row=s.prevPage(h.row,a);break;case"shrink-page-up":f.row=s.prevPage(f.row,a);break;case"expand-page-down":f.row=s.nextPage(f.row,a);break;case"shrink-page-down":h.row=s.nextPage(h.row,a);break;case"first-col":h.col=l.firstVisible(),f.col=u.bottomRight.col,n=h;break;case"last-col":f.col=l.lastVisible(),h.col=u.topLeft.col,n=f;break;case"first-row":h.row=s.firstVisible(),f.row=u.bottomRight.row,n=h;break;case"last-row":f.row=s.lastVisible(),h.row=u.topLeft.row,n=f;break;case"last":f.row=s.lastVisible(),f.col=l.lastVisible(),h=u.topLeft,n=f;break;case"first":h.row=s.firstVisible(),h.col=l.firstVisible(),f=u.bottomRight,n=h}return i=new t(h,f),this.union(i).intersects(u)?(n&&o.focus(n),void this.updateCurrentSelectionRange(i)):void this.modifySelection(r.replace("shrink","expand"))},moveActiveCell:function(e){var t=this._sheet,i=t.activeCell(),r=i.topLeft,o=i.bottomRight,a=t.originalActiveCell(),s=t._grid._rows,l=t._grid._columns,d=a.row,c=a.col;switch(e){case"left":c=l.prevVisible(r.col);break;case"up":d=s.prevVisible(r.row);break;case"right":c=l.nextVisible(o.col);break;case"down":d=s.nextVisible(o.row);break;case"first-col":c=l.firstVisible();break;case"last-col":c=l.lastVisible();break;case"first-row":d=s.firstVisible();break;case"last-row":d=s.lastVisible();break;case"last":d=s.lastVisible(),c=l.lastVisible();break;case"first":d=s.firstVisible(),c=l.firstVisible();break;case"next-page":d=s.nextPage(o.row,this._viewPortHeight);break;case"prev-page":d=s.prevPage(o.row,this._viewPortHeight)}t.select(new n(d,c))},navigateInSelection:function(e){for(var t,i=this._sheet,r=i.activeCell(),o=r.topLeft,a=i.originalActiveCell(),s=i._grid._rows,l=i._grid._columns,d=a.row,c=a.col,u=i.currentNavigationRange(),h=u.topLeft,f=u.bottomRight,p=!1,m=o.col,g=o.row;!p;){switch(t=new n(d,c),e){case"next":f.eq(t)?(u=i.nextNavigationRange(),d=u.topLeft.row,c=u.topLeft.col):(c=l.nextVisible(m,!0),c>f.col&&(c=h.col,d=s.nextVisible(d,!0)));break;case"previous":h.eq(t)?(u=i.previousNavigationRange(),d=u.bottomRight.row,c=u.bottomRight.col):(c=l.prevVisible(m,!0),c<h.col&&(c=f.col,d=s.prevVisible(d,!0)));break;case"lower":f.eq(t)?(u=i.nextNavigationRange(),d=u.topLeft.row,c=u.topLeft.col):(d=s.nextVisible(g,!0),d>f.row&&(d=h.row,c=l.nextVisible(c,!0)));break;case"upper":h.eq(t)?(u=i.previousNavigationRange(),d=u.bottomRight.row,c=u.bottomRight.col):(d=s.prevVisible(g,!0),d<h.row&&(d=f.row,c=l.prevVisible(c,!0)));break;default:throw Error("Unknown entry navigation: "+e)}p=!this.shouldSkip(d,c),m=c,g=d}i.singleCellSelection()?i.select(new n(d,c)):i.activeCell(new n(d,c))},extendSelection:function(e,n){var i,r=this._sheet,o=r._grid;return"autofill"===n?void this.resizeAutoFill(e):("range"===n?e=o.normalize(e):"row"===n?e=o.rowRef(e.row).bottomRight:"column"===n&&(e=o.colRef(e.col).bottomRight),i=r.originalActiveCell().toRangeRef(),void this.updateCurrentSelectionRange(new t(i.topLeft,e)))},shouldSkip:function(e,t){var i=new n(e,t),r=!1;return this._sheet.forEachMergedCell(function(e){e.intersects(i)&&!e.collapse().eq(i)&&(r=!0)}),r},resizeAutoFill:function(e){var t,n,i,r,o,a=this._sheet,s=a.select(),l=a._autoFillOrigin,d=this.autoFillCalculator.autoFillDest(s,e),c=this.punch(s,d);c||(r=a.range(d)._previewFillFrom(a.range(l)),r&&(n=r.direction,o=r.props,0===n||1==n?(i=o[o.length-1],t=i[i.length-1].value):2===n?(i=o[0],t=i[i.length-1].value):3===n&&(i=o[o.length-1],t=i[0].value))),a.updateAutoFill(d,c,t,n)},determineDirection:function(e){var t=this._sheet.currentSelectionRange(),n=this._sheet.activeCell(),i=n.topLeft.col==t.topLeft.col,r=n.bottomRight.col==t.bottomRight.col,o=n.topLeft.row==t.topLeft.row,a=n.bottomRight.row==t.bottomRight.row;switch(e){case"left":e=r?"expand-left":"shrink-left";break;case"right":e=i?"expand-right":"shrink-right";break;case"up":e=a?"expand-up":"shrink-up";break;case"down":e=o?"expand-down":"shrink-down";break;case"prev-page":e=a?"expand-page-up":"shrink-page-up";break;case"next-page":e=o?"expand-page-down":"shrink-page-down"}return e},updateCurrentSelectionRange:function(e){var t=this._sheet;t.select(t.originalSelect().replaceAt(t.selectionRangeIndex(),e),!1)},punch:function(e,i){var r,o,a;return i.topLeft.eq(e.topLeft)&&(i.bottomRight.row<e.bottomRight.row?(o=this.rowEdge.nextRight(i.bottomRight.row),r=new t(new n(o,e.topLeft.col),e.bottomRight)):i.bottomRight.col<e.bottomRight.col&&(a=this.colEdge.nextRight(i.bottomRight.col),r=new t(new n(e.topLeft.row,a),e.bottomRight))),r}}),e.spreadsheet.SheetNavigator=r)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/axismanager.min",["kendo.core.min"],e)}(function(){!function(e){if(!(e.support.browser.msie&&e.support.browser.version<9)){var t=e.Class.extend({init:function(e){this._sheet=e},forEachSelectedColumn:function(e){var t=this._sheet;t.batch(function(){t.select().forEachColumnIndex(function(n,i){e(t,n,i)})},{layout:!0,recalc:!0})},forEachSelectedRow:function(e){var t=this._sheet;t.batch(function(){t.select().forEachRowIndex(function(n,i){e(t,n,i)})},{layout:!0,recalc:!0})},includesHiddenColumns:function(e){return this._sheet._grid._columns.includesHidden(e.topLeft.col,e.bottomRight.col)},includesHiddenRows:function(e){return this._sheet._grid._rows.includesHidden(e.topLeft.row,e.bottomRight.row)},selectionIncludesHiddenColumns:function(){return this.includesHiddenColumns(this._sheet.select())},selectionIncludesHiddenRows:function(){return this.includesHiddenRows(this._sheet.select())},deleteSelectedColumns:function(){this.forEachSelectedColumn(function(e,t,n){e.deleteColumn(t-n)})},deleteSelectedRows:function(){this.forEachSelectedRow(function(e,t,n){e.deleteRow(t-n)})},hideSelectedColumns:function(){var t,n,i,r,o,a,s;for(this.forEachSelectedColumn(function(e,t){e.hideColumn(t)}),t=this._sheet,n=t.select().toRangeRef(),i=n.topLeft.col,r=n.bottomRight.col,o=null;;){if(a=r<t._columns._count,s=i>=0,!s&&!a)break;if(a&&!t.isHiddenColumn(r)){o=r;break}if(s&&!t.isHiddenColumn(i)){o=i;break}i--,r++}null!==o&&(n=new e.spreadsheet.RangeRef(new e.spreadsheet.CellRef(0,o),new e.spreadsheet.CellRef(t._rows._count-1,o)),t.range(n).select())},hideSelectedRows:function(){var t,n,i,r,o,a,s;for(this.forEachSelectedRow(function(e,t){e.hideRow(t)}),t=this._sheet,n=t.select().toRangeRef(),i=n.topLeft.row,r=n.bottomRight.row,o=null;;){if(a=r<t._rows._count,s=i>=0,!s&&!a)break;if(a&&!t.isHiddenRow(r)){o=r;break}if(s&&!t.isHiddenRow(i)){o=i;break}i--,r++}null!==o&&(n=new e.spreadsheet.RangeRef(new e.spreadsheet.CellRef(o,0),new e.spreadsheet.CellRef(o,t._columns._count-1)),t.range(n).select())},unhideSelectedColumns:function(){this.forEachSelectedColumn(function(e,t){e.unhideColumn(t)})},unhideSelectedRows:function(){this.forEachSelectedRow(function(e,t){e.unhideRow(t)})},addColumnLeft:function(){this.forEachSelectedColumn(function(e,t,n){e.insertColumn(t-n)})},addColumnRight:function(){this.forEachSelectedColumn(function(e,t,n){e.insertColumn(t+(n+1))})},canAddRow:function(){var e=this._sheet.select().toRangeRef(),t=e.height();return this._sheet.canInsertRow(0,t)},addRowAbove:function(){this.forEachSelectedRow(function(e,t,n){e.insertRow(t-n)})},addRowBelow:function(){this.forEachSelectedRow(function(e,t,n){e.insertRow(t+(n+1))})}});e.spreadsheet.AxisManager=t}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/clipboard.min",["kendo.core.min"],e)}(function(){!function(e){function t(){var e=new c(0,0,0);return{ref:e,mergedCells:[],data:[],foreign:!0,origRef:e.toRangeRef()}}function n(e,t,n,i){var r,o=e.data||(e.data=[]);o[t]||(o[t]=[]),o[t][n]=i,r=e.origRef.bottomRight,r.row=Math.max(r.row,t),r.col=Math.max(r.col,n)}function i(e){return e.origRef}function r(e){return e.replace(/^-(?:ms|moz|webkit)-/,"")}function o(e){var t={};return["borderBottom","borderRight","borderLeft","borderTop"].forEach(function(n){t[n]="none"==e[n+"Style"]?null:{size:1,color:e[n+"Color"]}}),t}function a(e){var t=window.getComputedStyle(e[0]),n=e[0].innerText,i=o(t),a={value:""===n?null:n,borderBottom:i.borderBottom,borderRight:i.borderRight,borderLeft:i.borderLeft,borderTop:i.borderTop,fontSize:parseInt(t["font-size"],10)};return"rgb(0, 0, 0)"!==t["background-color"]&&"rgba(0, 0, 0, 0)"!==t["background-color"]&&(a.background=t["background-color"]),"rgb(0, 0, 0)"!==t.color&&"rgba(0, 0, 0, 0)"!==t.color&&(a.color=t.color),"underline"==t["text-decoration"]&&(a.underline=!0),"italic"==t["font-style"]&&(a.italic=!0),"bold"==t["font-weight"]&&(a.bold=!0),"right"!==r(t["text-align"])&&(a.textAlign=r(t["text-align"])),"middle"!==t["vertical-align"]&&(a.verticalAlign=t["vertical-align"]),"normal"!==t["word-wrap"]&&(a.wrap=!0),a}function s(e){var i=t();return e.find(">tr, >tbody>tr").each(function(t,n){d(n).find(">td, >th").each(function(i,r){var o,a,s,l,c,u=parseInt(d(r).attr("rowspan"),10)-1||0,h=parseInt(d(r).attr("colspan"),10)-1||0,f="<td/>";if(u){for(a=t+u,s=t;s<=a;s++)if(l=e.find("tr").eq(s),s>t&&(f="<td class='rowspan'></td>",0===i?l.find("td").eq(i).after(f):(c=Math.min(l.find("td").length,i),l.find("td").eq(c-1).after(f))),h)for(o=i;o<h+i;o++)f="<td class='rowspan colspan'></td>",l.find("td").eq(o).after(f)}else if(h)for(o=i;o<h+i;o++)f="<td class='colspan'></td>",d(n).find("td").eq(o).after(f)})}),e.find(">tr, >tbody>tr").each(function(e,t){d(t).find(">td, >th").each(function(t,r){var o,s,l,c=parseInt(d(r).attr("rowspan"),10)-1||0,u=parseInt(d(r).attr("colspan"),10)-1||0;n(i,e,t,a(d(r))),(c||u)&&(o=String.fromCharCode(65+t),s=String.fromCharCode(65+t+u),l=o+(e+1)+":"+s+(e+1+c),i.mergedCells.push(l))})}),i}function l(e){var i,r,o,a,s=t();if(e.indexOf("\t")===-1&&e.indexOf("\n")==-1)n(s,0,0,{value:e});else for(i=e.split("\n"),r=0;r<i.length;r++)for(o=i[r].split("\t"),a=0;a<o.length;a++)n(s,r,a,{value:o[a]});return s}var d,c,u;e.support.browser.msie&&e.support.browser.version<9||(d=e.jQuery,c=e.spreadsheet.CellRef,u=e.Class.extend({init:function(t){this.workbook=t,this.origin=e.spreadsheet.NULLREF,this.iframe=document.createElement("iframe"),this.iframe.className="k-spreadsheet-clipboard-paste",this.menuInvoked=!0,this._external={},this._uid=e.guid(),document.body.appendChild(this.iframe)},canCopy:function(){var t={canCopy:!0},n=this.workbook.activeSheet().select();
return n===e.spreadsheet.NULLREF&&(t.canCopy=!1),n instanceof e.spreadsheet.UnionRef&&(t.canCopy=!1,t.multiSelection=!0),this.menuInvoked&&(t.canCopy=!1,t.menuInvoked=!0),t},canPaste:function(){var t,n=this.workbook.activeSheet(),i=this.pasteRef(),r={canPaste:!0};return i===e.spreadsheet.NULLREF?(t=this.isExternal(),r.pasteOnMerged=this.intersectsMerged(),r.canPaste=!r.pasteOnMerged&&t,r):(i.eq(n.unionWithMerged(i))||(r.canPaste=!1,r.pasteOnMerged=!0),this.menuInvoked&&(r.canPaste=!1,r.menuInvoked=!0),(i.bottomRight.row>=n._rows._count||i.bottomRight.col>=n._columns._count)&&(r.canPaste=!1,r.overflow=!0),r)},intersectsMerged:function(){var e,t=this.workbook.activeSheet(),n=this.parse(this._external);return this.origin=i(n),e=this.pasteRef(),!e.eq(t.unionWithMerged(e))},copy:function(){var e=this.workbook.activeSheet();this.origin=e.select(),this.contents=e.selection().getState(),delete this._external.html,delete this._external.plain},cut:function(){var e=this.workbook.activeSheet();this.copy(),e.range(e.select()).clear()},pasteRef:function(){var e=this.workbook.activeSheet(),t=e.activeCell().first(),n=this.origin.first(),i=n.row-t.row,r=n.col-t.col;return this.origin.relative(i,r,3)},destroy:function(){document.body.removeChild(this.iframe)},paste:function(){var e,t={},n=this.workbook.activeSheet();this._isInternal()?t=this.contents:(t=this.parse(this._external),this.origin=i(t)),e=this.pasteRef(),n.range(e).setState(t,this),n.triggerChange({recalc:!0,ref:e})},external:function(e){return e&&(e.html||e.plain)?void(this._external=e):this._external},isExternal:function(){return!this._isInternal()},parse:function(e){var i,r,o,c=t();return e.html?(i=this.iframe.contentWindow.document,i.open(),i.write(e.html),i.close(),r=d(i).find("table:first"),r.length?c=s(r):e.plain?c=l(e.plain):(o=d(i.body).find(":not(style)"),n(c,0,0,a(o.text())))):c=l(e.plain),c},_isInternal:function(){var e,t;return void 0===this._external.html||(e=!!d("<div/>").html(this._external.html).find("table.kendo-clipboard-"+this._uid).length,t=!!d("<div/>").html(this._external.plain).find("table.kendo-clipboard-"+this._uid).length,!(!e&&!t))}}),e.spreadsheet.Clipboard=u)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/range.min",["kendo.core.min","util/text-metrics.min"],e)}(function(){!function(e){function t(e,n,i){for(;e<=n&&i(e);)e++;if(e>n)return[];for(var r=e+1;r<=n;++r)if(i(r))return[{begin:e,end:r-1}].concat(t(r+1,n,i));return[{begin:e,end:n}]}function n(e){return e.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}function i(t){return!/^=/.test(t)&&/number|percent/.test(e.spreadsheet.calc.parse(null,0,0,t).type)}function r(t,n,i,r){var o={baselineMarkerSize:0,width:n+"px","font-size":(i||12)+"px","word-break":r===!0?"break-all":"normal","white-space":r===!0?"pre-wrap":"pre"};return e.util.measureText(t,o,h).height}var o,a,s,l,d,c,u,h;e.support.browser.msie&&e.support.browser.version<9||(o=e.jQuery,a=e.spreadsheet.UnionRef,s=e.spreadsheet.CellRef,l=e.spreadsheet.RangeRef,d=["color","fontFamily","underline","italic","bold","textAlign","verticalAlign","background","format","link","editor"],c={borderTop:{complement:"borderBottom",direction:{top:-1,bottom:-1}},borderLeft:{complement:"borderRight",direction:{left:-1,right:-1}},borderRight:{complement:"borderLeft",direction:{left:1,right:1}},borderBottom:{complement:"borderTop",direction:{top:1,bottom:1}}},u=e.Class.extend({init:function(e,t){this._sheet=t,this._ref=e},clone:function(){return new u(this._ref.clone(),this._sheet)},skipHiddenCells:function(){var e=[],n=this,i=n._sheet,r=i.isHiddenRow.bind(i),o=i.isHiddenColumn.bind(i);return n._ref.forEach(function d(i){var c,u,h,f,p,m;if(i instanceof a)i.forEach(d);else for(i=n._normalize(i.toRangeRef()),c=i.topLeft,u=i.bottomRight,h=t(c.row,u.row,r),f=t(c.col,u.col,o),p=0;p<h.length;++p)for(m=0;m<f.length;++m)e.push(new l(new s(h[p].begin,f[m].begin),new s(h[p].end,f[m].end)))}),i.range(e.length>1?new a(e):e[0])},_normalize:function(e){return this._sheet._grid.normalize(e)},_set:function(e,t,n){var i=this,r=i._sheet;return i._ref.forEach(function(n){r._set(n.toRangeRef(),e,t)}),n||r.triggerChange({recalc:"formula"==e||"value"==e||"validation"==e,value:t,ref:i._ref}),i},_get:function(e){return this._sheet._get(this._ref.toRangeRef(),e)},_property:function(e,t){return void 0===t?this._get(e):this._set(e,t)},value:function(e){return void 0!==e&&this._set("formula",null,!0),this._property("value",e)},resize:function(e){var t=this._resizedRef(e);return new u(t,this._sheet)},_resizedRef:function(e){return this._ref.map(function(t){return t.toRangeRef().resize(e)})},_border:function(t,n){var i,r=c[t].complement,o=c[t].direction,a=this._sheet;return a.batch(function(){i=this._property(t,n),void 0!==n&&this._resizedRef(o).forEach(function(t){t!==e.spreadsheet.NULLREF&&new u(t,a)._property(r,null)})}.bind(this),{}),i},_collapsedBorder:function(t){var n=this._property(t),i=c[t].complement,r=c[t].direction;return this._resizedRef(r).forEach(function(t){if(!n&&t!==e.spreadsheet.NULLREF){var r=new u(t,this._sheet);n=r._property(i)}}.bind(this)),n},borderTop:function(e){return this._border("borderTop",e)},borderRight:function(e){return this._border("borderRight",e)},borderBottom:function(e){return this._border("borderBottom",e)},borderLeft:function(e){return this._border("borderLeft",e)},collapsedBorderTop:function(){return this._collapsedBorder("borderTop")},collapsedBorderRight:function(){return this._collapsedBorder("borderRight")},collapsedBorderBottom:function(){return this._collapsedBorder("borderBottom")},collapsedBorderLeft:function(){return this._collapsedBorder("borderLeft")},input:function(t){var r,o,a,s,l,d,c=this._get("format");return void 0!==t?(o=this._ref.toRangeRef().topLeft,r=e.spreadsheet.calc.parse(this._sheet.name(),o.row,o.col,t),this._sheet.batch(function(){var i=null;"exp"==r.type?i=e.spreadsheet.calc.compile(r):"@"!=c?"date"==r.type?this.format(r.format||n(e.culture().calendar.patterns.d)):"percent"==r.type?this.format(100*r.value==(100*r.value|0)?"0%":"0.00%"):r.format&&!c&&this.format(r.format):"string"!=r.type&&(r.value=t),this.formula(i),i||this.value(r.value)}.bind(this),{recalc:!0,value:t,ref:this._ref,editorChange:this._sheet.isInEditMode()}),this):(t=this._get("value"),a=this._get("formula"),s=c&&!a&&e.spreadsheet.formatting.type(t,c),a?t="="+a:c&&"date"==s&&(l=e.spreadsheet.formatting.text(t,c),r=e.spreadsheet.calc.parse(null,null,null,l),"number"==typeof r.value&&(d=e.spreadsheet.formatting.text(r.value,c),l==d))?t=l:"date"===s?t=e.toString(e.spreadsheet.numberToDate(t),e.culture().calendar.patterns.d):"percent"===s?t=100*t+"%":"string"==typeof t&&(/^[=']/.test(t)||/^(?:true|false)$/i.test(t)||i(t))&&(t="'"+t),t)},enable:function(e){return void 0===e?(e=!0,this._sheet.forEach(this._ref.toRangeRef(),function(t,n,i){i.enable===!1&&(e=!1)}),e):this._property("enable",e)},formula:function(e){if(void 0===e){var t=this._get("formula");return t?""+t:null}return this._property("formula",e)},validation:function(e){if(void 0===e){var t=this._get("validation");return t?t.toJSON():null}return this._property("validation",e)},_getValidationState:function(){var e,t,n,i=this._ref.toRangeRef(),r=i.topLeft.row,o=i.topLeft.col,a=i.bottomRight.row,s=i.bottomRight.col;for(e=o;e<=s;e++)for(t=r;t<=a;t++)if(n=this._sheet._validation(t,e),n&&"reject"===n.type&&n.value===!1)return n;return!1},merge:function(){return this._ref=this._sheet._merge(this._ref),this},unmerge:function(){var e=this._sheet._mergedCells;return this._ref.forEach(function(t){t.toRangeRef().intersecting(e).forEach(function(t){e.splice(e.indexOf(t),1)})}),this._sheet.triggerChange({}),this},select:function(){return this._sheet.select(this._ref),this},values:function(t){var n,i,r,o,s,l,d,c,u,h;if(this._ref instanceof a)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF){if(void 0!==t)throw Error("Unsupported for NULLREF.");return[]}if(n=this._ref.toRangeRef(),i=n.topLeft.row,r=n.topLeft.col,o=n.bottomRight.row,s=n.bottomRight.col,void 0===t){for(t=Array(n.height()),c=0;c<t.length;c++)t[c]=Array(n.width());for(l=r;l<=s;l++)for(d=i;d<=o;d++)t[d-i][l-r]=this._sheet._value(d,l);return t}for(this._sheet._set(n,"formula",null),l=r;l<=s;l++)for(d=i;d<=o;d++)u=t[d-i],u&&(h=u[l-r],void 0!==h&&this._sheet._value(d,l,h));return this._sheet.triggerChange({recalc:!0,ref:n}),this},_properties:function(t){var n,i,r,o,s,l,d,c,u,h,f;if(this._ref instanceof a)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF){if(void 0!==t)throw Error("Unsupported for NULLREF.");return[]}if(n=this._ref.toRangeRef(),i=n.topLeft.row,r=n.topLeft.col,o=n.bottomRight.row,s=n.bottomRight.col,c=this._sheet,void 0===t)return t=Array(n.height()),c.forEach(n,function(e,n,o){e-=i,n-=r;var a=t[e]||(t[e]=[]);a[n]=o}),t;for(n=n.clone(),h=function(e){var t=u[e];n.topLeft.row=n.bottomRight.row=d,n.topLeft.col=n.bottomRight.col=l,"value"==e&&c._set(n,"formula",null),c._set(n,e,t)},l=r;l<=s;l++)for(d=i;d<=o;d++)f=t[d-i],f&&(u=f[l-r],u&&Object.keys(u).forEach(h));return c.triggerChange({recalc:!0,ref:this._ref}),this},clear:function(e){var t=!e||!Object.keys(e).length,n=this._sheet,i={recalc:t||e&&e.contentsOnly===!0,ref:this._ref};return n.batch(function(){i.recalc&&this.formula(null),t&&this.validation(null),(t||e&&e.formatOnly===!0)&&(d.forEach(function(e){this[e](null)}.bind(this)),this.unmerge())}.bind(this),i),this},clearContent:function(){return this.clear({contentsOnly:!0})},clearFormat:function(){return this.clear({formatOnly:!0})},isSortable:function(){return!(this._ref instanceof a||this._ref===e.spreadsheet.NULLREF)},sort:function(t){if(this._ref instanceof a)throw Error("Unsupported for multiple ranges.");if(this._ref===e.spreadsheet.NULLREF)throw Error("Unsupported for NULLREF.");return void 0===t&&(t={column:0}),t=t instanceof Array?t:[t],this._sheet._sortBy(this._ref.toRangeRef(),t.map(function(e,t){return"number"==typeof e&&(e={column:e}),{index:void 0===e.column?t:e.column,ascending:void 0===e.ascending||e.ascending}})),this},isFilterable:function(){return!(this._ref instanceof a)},filter:function(e){if(this._ref instanceof a)throw Error("Unsupported for multiple ranges.");return e===!1?this.clearFilters():(e=e===!0?[]:e instanceof Array?e:[e],this._sheet._filterBy(this._ref.toRangeRef(),e.map(function(e,t){return{index:void 0===e.column?t:e.column,filter:e.filter}}))),this},clearFilter:function(e){this._sheet.clearFilter(e)},clearFilters:function(){var e,t=this._sheet.filter(),n=[];if(t){for(e=0;e<t.columns.length;e++)n.push(e);this._sheet.batch(function(){this.clearFilter(n),this._filter=null},{layout:!0,filter:!0})}},hasFilter:function(){var e=this._sheet.filter();return!!e},leftColumn:function(){return new u(this._ref.leftColumn(),this._sheet)},rightColumn:function(){return new u(this._ref.rightColumn(),this._sheet)},topRow:function(){return new u(this._ref.topRow(),this._sheet)},bottomRow:function(){return new u(this._ref.bottomRow(),this._sheet)},column:function(e){return new u(this._ref.toColumn(e),this._sheet)},row:function(e){return new u(this._ref.toRow(e),this._sheet)},forEachRow:function(e){this._ref.forEachRow(function(t){e(new u(t,this._sheet))}.bind(this))},forEachColumn:function(e){this._ref.forEachColumn(function(t){e(new u(t,this._sheet))}.bind(this))},sheet:function(){return this._sheet},topLeft:function(){return this._ref.toRangeRef().topLeft},intersectingMerged:function(){var e=this._sheet,t=[];return e._mergedCells.forEach(function(e){e.intersects(this._ref)&&t.push(""+e)}.bind(this)),t},getState:function(t){var n,i,r=this._ref.first(),o={ref:r,data:[],origRef:this._ref};return t?n="input"===t?["value","formula"]:"border"===t?["borderLeft","borderTop","borderRight","borderBottom"]:[t]:(n=e.spreadsheet.ALL_PROPERTIES,o.mergedCells=this.intersectingMerged()),i=o.data,this.forEachCell(function(e,t,o){var a={},s=e-r.row,l=t-r.col;i[s]||(i[s]=[]),i[s][l]=a,n.forEach(function(e){a[e]=void 0===o[e]?null:o[e]})}),o},setState:function(e,t){var n=this._sheet,i=this._ref.first(),r=e.ref.row-i.row,o=e.ref.col-i.col;n.batch(function(){e.mergedCells&&this.unmerge();var a=i.row;e.data.forEach(function(r,o){if(!t||t.isExternal()||!n.isHiddenRow(e.ref.row+o)){var s=i.col;r.forEach(function(r,l){var d,c;if(!t||t.isExternal()||!n.isHiddenColumn(e.ref.col+l)){if(d=t?n.range(a,s):n.range(i.row+o,i.col+l),d.enable()){for(c in r)"value"!=c&&(t&&"enable"==c||d._set(c,r[c]));if(!r.formula)if(t&&t.isExternal())try{null==r.value?d._set("value",null):d.input(r.value)}catch(u){d._set("value",r.value)}else d._set("value",r.value)}s++}}),a++}}),e.mergedCells&&e.mergedCells.forEach(function(e){e=n._ref(e).relative(r,o,3),n.range(e).merge()},this)}.bind(this),{recalc:!0})},_adjustRowHeight:function(){var t,n=this._sheet,i=this.getState(),r=[];for(t=0;t<i.mergedCells.length;t++)r.push(n.range(i.mergedCells[t]));this.forEachRow(function(t){if(!(t.topLeft().row>=t.sheet()._rows._count)){var i=t.sheet().rowHeight(t.topLeft().row);t.forEachCell(function(t,o,a){var s,l,d=n.range(t,o),c=0;for(s=0;s<r.length;s++)if(d._ref.intersects(r[s]._ref)){c+=a.width;break}l=Math.max(n.columnWidth(o),c),i=Math.max(i,e.spreadsheet.util.getTextHeight(a.value,l,a.fontSize,a.wrap))}),n.rowHeight(t.topLeft().row,Math.max(n.rowHeight(t.topLeft().row),i))}})},forEachCell:function(e){this._ref.forEach(function(t){this._sheet.forEach(t.toRangeRef(),e.bind(this))}.bind(this))},hasValue:function(){var e=!1;return this.forEachCell(function(t,n,i){0!==Object.keys(i).length&&(e=!0)}),e},wrap:function(t){return void 0===t?!!this._property("wrap"):(this.forEachRow(function(t){var n=t.sheet().rowHeight(t.topLeft().row);t.forEachCell(function(t,i,r){var o=this._sheet.columnWidth(i);null!==r.value&&void 0!==r.value&&(n=Math.max(n,e.spreadsheet.util.getTextHeight(r.value,o,r.fontSize,!0)))}),t.sheet().rowHeight(t.topLeft().row,n)}.bind(this)),this._property("wrap",t),this)},fontSize:function(t){return void 0===t?this._property("fontSize"):(this.forEachRow(function(n){var i=n.sheet().rowHeight(n.topLeft().row);n.forEachCell(function(n,r,o){var a=this._sheet.columnWidth(r);null!==o.value&&void 0!==o.value&&(i=Math.max(i,e.spreadsheet.util.getTextHeight(o.value,a,t,o.wrap)))}),n.sheet().rowHeight(n.topLeft().row,i)}.bind(this)),this._property("fontSize",t),this)},draw:function(e,t){this._sheet.draw(this,e,t)}}),o.each(d,function(e,t){u.prototype[t]=function(e){return this._property(t,e)}}),h=o('<div style="position: absolute !important; top: -4000px !important; height: auto !important;padding: 1px !important; margin: 0 !important; border: 1px solid black !important;line-height: normal !important; visibility: hidden !important;white-space: pre-wrap !important; word-break: break-all !important;" />')[0],e.spreadsheet.util={getTextHeight:r},e.spreadsheet.Range=u)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.min",["spreadsheet/references.min"],e)}(function(){"use strict";function e(t){return t instanceof e?t:void(this.code=t)}function t(e,t,n){for(var i,r=n(e),o=e;++e<t;)i=n(e),i>r&&(r=i,o=e);return o}function n(t,n){function r(e){var t,n,i,a;return d=e[0],t="{ ",Array.isArray(d)?(h+="while (i < args.length) { ",f+="while (i < args.length) { ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="while (i < args.length) { ",t+=e.map(r).join(""),t+="} ",t+="xargs = stack.pop(); ",f+="} ",h+="} "):"+"==d?(h+="while (i < args.length) { ",f+="while (i < args.length) { ",t+="if (i >= args.length) return new CalcError('N/A'); ",t+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",t+="do { ",t+=e.slice(1).map(r).join(""),t+="} while (i < args.length); ",t+="xargs = stack.pop(); ",f+="} ",h+="} "):"?"==d?t+="if (!("+l(e[1])+")) return new CalcError(err); ":(n=e[1],Array.isArray(n)&&/^#?collect/.test(n[0])?(i=n[2],o(),t+="try {var $"+d+" = this.cellValues(args.slice(i",i&&(t+=", i + "+i),t+=")).filter(function($"+d+"){ ","collect"==n[0]&&(t+="if ($"+d+" instanceof CalcError) throw $"+d+"; "),t+="return "+l(n[1])+"; }, this); ",t+=i?"i += "+i+"; ":"i = args.length; ",t+="xargs.push($"+d+")} catch(ex) { if (ex instanceof CalcError) return ex; throw ex; } ",f+="toResolve.push(args.slice(i)); "):"rest"==n?t+="xargs.push(args.slice(i)); i = args.length; ":((g=/^\*/.test(d))&&(v=!0,d=d.substr(1)),t+="var $"+d+" = args[i++]; ",a=!1,/!$/.test(n)?(n=n.substr(0,n.length-1),a=!0):t+="if ($"+d+" instanceof CalcError) return $"+d+"; ",t+=s(n,a)+"xargs.push($"+d+"); ")),t+="} "}function o(){return c?"$"+d:(m=!0,c=!0,f+="toResolve.push(args[i++]); ","($"+d+" = this.force($"+d+"))")}function a(e){return"("+(e?"(typeof "+o()+" == 'number' ? ($"+d+" = round($"+d+"), true) : false) || ":"(typeof "+o()+" == 'number') || ")+"(typeof $"+d+" == 'boolean') || (typeof $"+d+" == 'string' && !/^(?:=|true|false)/i.test($"+d+") ? (tmp = kendo.spreadsheet.calc.parse(0, 0, 0, $"+d+"), /^date|number|percent$/.test(tmp.type) ? ($"+d+" = +tmp.value, true) : false) : false))"}function s(e,t){c=!1;var n="if (!("+l(e)+")) { ";return c&&!t&&(n+=" if ($"+d+" instanceof CalcError) return $"+d+"; "),n+="return new CalcError(err); } ",c||(f+="i++; "),h+=g?"var $"+d+" = this.asMatrix(args[i]); if ($"+d+") { xargs.push($"+d+"); width = Math.max(width, $"+d+".width); height = Math.max(height, $"+d+".height); arrays.push(true) } else { xargs.push(args[i]); arrays.push(false); } i++; ":"xargs.push(args[i++]); arrays.push(false); ",n}function l(e){if(Array.isArray(e)){if("or"==e[0])return"("+e.slice(1).map(l).join(") || (")+")";if("and"==e[0])return"("+e.slice(1).map(l).join(") && (")+")";if("values"==e[0])return"("+e.slice(1).map(function(e){return o()+" === "+e}).join(") || (")+")";if("null"==e[0])return"("+l("null")+" ? (($"+d+" = "+e[1]+"), true) : false)";if("between"==e[0]||"[between]"==e[0])return"("+o()+" >= "+e[1]+" && $"+d+" <= "+e[2]+" ? true : ((err = 'NUM'), false))";if("(between)"==e[0])return"("+o()+" > "+e[1]+" && $"+d+" < "+e[2]+" ? true : ((err = 'NUM'), false))";if("(between]"==e[0])return"("+o()+" > "+e[1]+" && $"+d+" <= "+e[2]+" ? true : ((err = 'NUM'), false))";if("[between)"==e[0])return"("+o()+" >= "+e[1]+" && $"+d+" < "+e[2]+" ? true : ((err = 'NUM'), false))";if("assert"==e[0]){var t=e[2]||"N/A";return"(("+e[1]+") ? true : (err = "+JSON.stringify(t)+", false))"}if("not"==e[0])return"!("+l(e[1])+")";throw Error("Unknown array type condition: "+e[0])}if("number"==e||"datetime"==e)return a(!0);if("integer"==e||"date"==e)return"("+a()+" && (($"+d+" |= 0), true))";if("divisor"==e)return"("+a(!0)+" && ($"+d+" == 0 ? ((err = 'DIV/0'), false) : true))";if("number+"==e)return"("+a(!0)+" && ($"+d+" >= 0 ? true : ((err = 'NUM'), false)))";if("integer+"==e)return"("+a()+" && (($"+d+" |= 0) >= 0 ? true : ((err = 'NUM'), false)))";if("number++"==e)return"("+a(!0)+" && ($"+d+" > 0 ? true : ((err = 'NUM'), false)))";if("integer++"==e)return"("+a()+" && (($"+d+" |= 0) > 0 ? true : ((err = 'NUM'), false)))";if("string"==e)return"((typeof "+o()+" == 'string' || typeof $"+d+" == 'boolean' || typeof $"+d+" == 'number') ? ($"+d+" += '', true) : ($"+d+" === undefined ? (($"+d+" = ''), true) : false))";if("boolean"==e)return"(typeof "+o()+" == 'boolean')";if("logical"==e)return"(typeof "+o()+" == 'boolean' || (typeof $"+d+" == 'number' ? ($"+d+" = !!$"+d+", true) : false))";if("matrix"==e)return o(),"((m = this.asMatrix($"+d+")) ? ($"+d+" = m) : false)";if("#matrix"==e)return"((m = this.asMatrix($"+d+")) ? ($"+d+" = m) : false)";if("ref"==e)return"($"+d+" instanceof kendo.spreadsheet.Ref)";if("area"==e)return"($"+d+" instanceof kendo.spreadsheet.CellRef || $"+d+" instanceof kendo.spreadsheet.RangeRef)";if("cell"==e)return"($"+d+" instanceof kendo.spreadsheet.CellRef)";if("null"==e)return"("+o()+" == null)";if("anyvalue"==e)return"("+o()+" != null && i <= args.length)";if("forced"==e)return"("+o()+", i <= args.length)";if("anything"==e)return"(i <= args.length)";if("blank"==e)return"("+o()+" == null || $"+d+" === '')";throw Error("Can't check for type: "+e)}var d,c,u,h="function arrayArgs(args) { var xargs = [], width = 0, height = 0, arrays = [], i = 0; ",f="function resolve(args, callback) { var toResolve = [], i = 0; ",p="'use strict'; function check(args) { var stack = [], tmp, xargs = [], i = 0, m, err = 'VALUE'; ",m=!1,g=!1,v=!1;return p+=n.map(r).join(""),p+="if (i < args.length) return new CalcError('N/A'); ",p+="return xargs; } ",h+="return { args: xargs, width: width, height: height, arrays: arrays }; } ",m?(f+="this.resolveCells(toResolve, callback); } ",u=Function("CalcError","round",p+f+h+" return { resolve: resolve, check: check, arrayArgs: arrayArgs };")):u=Function("CalcError","round",p+" return { check: check };"),u=u(e,i),v||delete u.arrayArgs,u}function i(e){return Math.round(1e15*e)/1e15}function r(e){return"number"==typeof e?i(e):e}function o(t,n,i){if(i instanceof e)return i;try{return n.apply(t,i)}catch(r){if(r instanceof e)return r;throw r}}function a(e,t,n,i){return function(r,a){function s(){var t,s,l,d,c,u,h;if(i&&(t=i.call(this,a),a=t.args,t.width>0&&t.height>0)){for(s=new A(this),l=0;l<t.height;++l)for(d=0;d<t.width;++d){for(c=[],u=0;u<a.length;++u)t.arrays[u]?(h=a[u],c[u]=h.get(l%h.height,d%h.width)):c[u]=a[u];c=n.call(this,c),s.set(l,d,o(this,e,c))}return r(s)}c=n.call(this,a),r(o(this,e,c))}t?t.call(this,a,s):s.call(this)}}function s(t,n,i,r){return function(o,a){function s(){var n,s,l,d,c,u,h,f,p;if(r&&(n=r.call(this,a),a=n.args,n.width>0&&n.height>0))for(s=new A(this),l=n.width*n.height,d=function(e,t){return function(n){if(s.set(e,t,n),--l,0===l)return o(s)}},c=0;c<n.height&&l>0;++c)for(u=0;u<n.width&&l>0;++u){for(h=[],f=0;f<a.length;++f)n.arrays[f]?(p=a[f],h[f]=p.get(c%p.height,u%p.width)):h[f]=a[f];if(h=i.call(this,h),h instanceof e){if(s.set(c,u,h),--l,0===l)return o(s)}else h.unshift(d(c,u)),t.apply(this,h)}else n=i.call(this,a),n instanceof e?o(n):(n.unshift(o),t.apply(this,n))}n?n.call(this,a,s):s.call(this)}}function l(e,t){return e=e.toLowerCase(),z[e]=t,{args:function(i,r){var o,s=n(e,i);return r&&(s.arrayArgs&&console.log(""+s.arrayArgs),s.resolve&&console.log(""+s.resolve),s.check&&console.log(""+s.check)),o=z[e]=a(t,s.resolve,s.check,s.arrayArgs),o.kendoSpreadsheetArgs=i,this},argsAsync:function(i,r){var o,a=n(e,i);return r&&(a.arrayArgs&&console.log(""+a.arrayArgs),a.resolve&&console.log(""+a.resolve),a.check&&console.log(""+a.check)),o=z[e]=s(t,a.resolve,a.check,a.arrayArgs),o.kendoSpreadsheetArgs=i,this}}}function d(e,t,n){return t++,(1461*(e+4800+((t-14)/12|0))/4|0)+(367*(t-2-12*((t-14)/12|0))/12|0)-(3*((e+4900+((t-14)/12|0))/100|0)/4|0)+n-32075}function c(e){var t,n,i,r,o,a,s;return t=e+68569,n=4*t/146097|0,t-=(146097*n+3)/4|0,r=4e3*(t+1)/1461001|0,t=t-(1461*r/4|0)+31,i=80*t/2447|0,a=t-(2447*i/80|0),t=i/11|0,o=i+2-12*t,s=100*(n-49)+r+t,o--,{year:s,month:o,date:a,day:(e+1)%7,ord:P[u(s)][o]+a}}function u(e){return e%4?0:e%100?1:e%400?0:1}function h(e){return u(e)?366:365}function f(e,t){return u(e)&&1==t?29:N[t]}function p(e){return c((0|e)+H)}function m(e,t,n){return d(e,t,n)-H}function g(e){var t,n,i,r,o=e-(0|e);return o<0&&o++,t=Math.round(O*o),n=Math.floor(t/B),t-=n*B,i=Math.floor(t/L),t-=i*L,r=Math.floor(t/1e3),t-=1e3*r,{hours:n,minutes:i,seconds:r,milliseconds:t}}function v(e){var t=p(e),n=g(e);return new Date(t.year,t.month,t.date,n.hours,n.minutes,n.seconds,n.milliseconds)}function _(e,t,n,i){return(e+(t+(n+i/1e3)/60)/60)/24}function b(e){var t=_(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());return e=m(e.getFullYear(),e.getMonth(),e.getDate()),e<0?e-1+t:e+t}function k(e){return kendo.parseDate(e)||kendo.parseDate(e,["MMMM dd yyyy","MMMM dd yy","MMM dd yyyy","MMM dd yy","dd MMMM yyyy","dd MMMM yy","dd MMM yyyy","dd MMM yy","MMMM dd, yyyy","MMMM dd, yy","MMM dd, yyyy","MMM dd, yy","MMMM dd","MMM dd","MMMM yyyy","MMM yyyy","dd MMMM","dd MMM"])}function w(t){return function(n,i){return"string"==typeof n&&"string"!=typeof i&&(i=null==i?"":i+""),"string"!=typeof n&&"string"==typeof i&&(n=null==n?"":n+""),"number"==typeof n&&null==i&&(i=0),"number"==typeof i&&null==n&&(n=0),"string"==typeof n&&"string"==typeof i&&(n=n.toLowerCase(),i=i.toLowerCase()),typeof i==typeof n?t(n,i):new e("VALUE")}}var y,x,C,T,S,D,E,F,R,I,A,M,z,H,N,P,L,B,O,V,W,U;kendo.support.browser.msie&&kendo.support.browser.version<9||(y={},x=kendo.spreadsheet,x.calc=y,C=y.runtime={},T=kendo.Class,S=x.Ref,D=x.CellRef,E=x.RangeRef,F=x.UnionRef,R=x.NULLREF,e.prototype.toString=function(){return"#"+this.code+("NAME"==this.code?"?":"!")},I=T.extend({init:function(e,t,n,i){this.callback=e,this.formula=t,this.ss=n,this.parent=i},resolve:function(e){var t=this;e instanceof S?t.resolveCells([e],function(){t._resolve(e)}):t._resolve(e)},error:function(t){return new e(t)},_resolve:function(e){e=void 0===e?null:Array.isArray(e)?this.asMatrix(e):r(e);var t=this.formula;t.value=e,this.ss.onFormula(t)&&this.callback&&this.callback.call(t,e)},resolveCells:function(e,t){function n(e){e.exec(a.ss,function(){--r||t.call(a)},a)}function i(e){var t,n;for(t=0;t<e.length;++t)n=e[t],n.formula&&s.push(n.formula);return!0}var r,o,a=this,s=[];if(function l(e){var t,n;for(t=0;t<e.length;++t)n=e[t],n instanceof S&&i(a.getRefCells(n)),Array.isArray(n)&&l(n)}(e),!s.length)return t.call(a);for(r=s.length,o=0;o<s.length;++o)n(s[o])},cellValues:function(e,t){var n,i,r=[];for(n=0;n<e.length;++n)i=e[n],i instanceof S?(i=this.getRefData(i),r=r.concat(i)):Array.isArray(i)?r=r.concat(this.cellValues(i)):i instanceof A?r=r.concat(this.cellValues(i.data)):r.push(i);return t?t.apply(this,r):r},fetchName:function(t,n){var i,r=this.formula,o=this.ss.nameValue(t,r.sheet,r.row,r.col);o instanceof M?(o=o.clone(r.sheet,r.row,r.col,!0),i=new x.ValidationFormulaContext(this.ss.workbook),o.exec(i,n,this)):(o instanceof S&&(o=o.absolute(r.row,r.col),o.sheet||(o.sheet=r.sheet)),n(null==o?new e("NAME"):o))},force:function(e){return e instanceof S?this.getRefData(e):e},func:function(t,n,i){t=t.toLowerCase();var r=z[t];return r?r.call(this,n,i):void n(new e("NAME"))},bool:function(e){return e instanceof S&&(e=this.getRefData(e)),"string"==typeof e?"true"==e.toLowerCase():"number"==typeof e?0!==e:"boolean"==typeof e?e:null!=e},asMatrix:function(e){var t,n,i,r,o,a,s;return e instanceof A?e:(t=this,e instanceof E?(n=e.topLeft,i=n.row,r=n.col,o=t.getRefCells(e),a=new A(t),isFinite(e.width())&&(a.width=e.width()),isFinite(e.height())&&(a.height=e.height()),isFinite(i)||(i=0),isFinite(r)||(r=0),o.forEach(function(e){a.set(e.row-i,e.col-r,e.value)}),a):Array.isArray(e)&&e.length>0?(a=new A(t),s=0,e.forEach(function(e){var n=0,i=1;e.forEach(function(e){var r=e instanceof E;e instanceof S&&!r&&(e=t.getRefData(e)),(r||Array.isArray(e))&&(e=t.asMatrix(e)),e instanceof A?(e.each(function(e,t,i){a.set(s+t,n+i,e)}),i=Math.max(i,e.height),n+=e.width):a.set(s,n++,e)}),s+=i}),a):void 0)},getRefCells:function(e,t){var n=this.formula;return this.ss.getRefCells(e,t,n.sheet,n.row,n.col)},getRefData:function(e){var t=this.formula;return this.ss.getData(e,t.sheet,t.row,t.col)},workbook:function(){return this.ss.workbook}}),A=T.extend({init:function(e){this.context=e,this.height=0,this.width=0,this.data=[]},clone:function(){var e=new A(this.context);return e.height=this.height,e.width=this.width,e.data=this.data.map(function(e){return e.slice()}),e},get:function(e,t){var n=this.data[e],i=n?n[t]:null;return i instanceof S?this.context.getRefData(i):i},set:function(e,t,n){var i=this.data[e];null==i&&(i=this.data[e]=[]),i[t]=n,e>=this.height&&(this.height=e+1),t>=this.width&&(this.width=t+1)},each:function(e,t){var n,i,r;for(n=0;n<this.height;++n)for(i=0;i<this.width;++i)if(r=this.get(n,i),(t||null!=r)&&(r=e.call(this.context,r,n,i),void 0!==r))return r},map:function(e,t){var n=new A(this.context);return this.each(function(t,i,r){n.set(i,r,e.call(this,t,i,r))},t),n},eachRow:function(e){var t,n;for(t=0;t<this.height;++t)if(n=e.call(this.context,t),void 0!==n)return n},eachCol:function(e){var t,n;for(t=0;t<this.width;++t)if(n=e.call(this.context,t),void 0!==n)return n},mapRow:function(e){var t=new A(this.context);return this.eachRow(function(n){t.set(n,0,e.call(this.context,n))}),t},mapCol:function(e){var t=new A(this.context);return this.eachCol(function(n){t.set(0,n,e.call(this.context,n))}),t},toString:function(){return JSON.stringify(this.data)},transpose:function(){var e=new A(this.context);return this.each(function(t,n,i){e.set(i,n,t)}),e},unit:function(e){var t,n,i,r;for(this.width=this.height=e,t=this.data=Array(e),n=e;--n>=0;)for(i=t[n]=Array(e),r=e;--r>=0;)i[r]=n==r?1:0;return this},multiply:function(t){var n,i,r,o,a,s,l=this,d=new A(l.context);for(n=0;n<l.height;++n)for(i=0;i<t.width;++i){for(r=0,o=0;o<l.width;++o){if(a=l.get(n,o),s=t.get(o,i),"number"!=typeof a||"number"!=typeof s)throw new e("VALUE");r+=a*s}d.set(n,i,r)}return d},adds:function(e,t){var n,i,r,o,a=this,s=new A(a.context),l=t?-1:1;for(n=0;n<a.height;++n)for(i=0;i<a.width;++i)r=a.get(n,i),o=e.get(n,i),s.set(n,i,r+l*o);return s},determinant:function(){var e,t,n,i,r,o=this.clone().data,a=o.length,s=1;for(e=0;e<a;e++){for(t=e;t<a&&!o[t][e];t++);if(t==a)return 0;if(t!=e)for(s=-s,i=e;i<a;i++)r=o[e][i],o[e][i]=o[t][i],o[t][i]=r;for(n=e+1;n<a;n++)for(i=e+1;i<a;i++)o[n][i]-=o[e][i]*o[n][e]/o[e][e];s*=o[e][e]}return s},inverse:function(){var e,n,i,r,o,a,s=this.width,l=this.augment(new A(this.context).unit(s)),d=l.data;for(n=0;n<s;++n){if(i=t(n,s,function(e){return d[e][n]}),!d[i][n])return null;for(n!=i&&(e=d[n],d[n]=d[i],d[i]=e),r=n+1;r<s;++r){for(o=n+1;o<2*s;++o)d[r][o]-=d[n][o]*d[r][n]/d[n][n];d[r][n]=0}}for(r=0;r<s;++r)for(a=d[r][r],o=0;o<2*s;++o)d[r][o]/=a;for(n=s;--n>=0;)for(r=n;--r>=0;)if(d[r][n])for(o=2*s;--o>=s;)d[r][o]-=d[n][o]*d[r][n];return l.slice(0,s,s,s)},augment:function(e){var t=this.clone(),n=t.width;return e.each(function(e,i,r){t.set(i,r+n,e)}),t},slice:function(e,t,n,i){var r,o,a=new A(this.context);for(r=0;r<n;++r)for(o=0;o<i;++o)a.set(r,o,this.get(e+r,t+o));return a}}),M=T.extend({init:function(e,t,n,i,r,o){this.refs=e,this.handler=t,this.print=n,this.absrefs=null,this.sheet=i,this.row=r,this.col=o,this.onReady=[],this.pending=!1},clone:function(e,t,n,i){var r=e.toLowerCase(),o=this.refs;return(i||r!=this.sheet.toLowerCase())&&(o=o.map(function(t){return t.hasSheet()||t.sheet&&t.sheet.toLowerCase()==r||(t=t.clone().setSheet(e)),t})),new M(o,this.handler,this.print,e,t,n)},resolve:function(e){this.pending=!1,this.onReady.forEach(function(t){t(e)})},exec:function(t,n,i){if("value"in this)n&&n(this.value);else{n&&this.onReady.push(n);for(var r=new I(this.resolve,this,t,i);i;){if(i.formula===this)return this.pending=!1,void r.resolve(new e("CIRCULAR"));i=i.parent}if(this.pending)return;this.pending=!0,this.absrefs||(this.absrefs=this.refs.map(function(e){return e.absolute(this.row,this.col)},this)),this.handler.call(r)}},reset:function(){this.onReady=[],this.pending=!1,delete this.value},renameSheet:function(e,t){e=e.toLowerCase(),this.absrefs=null,this.sheet.toLowerCase()==e&&(this.sheet=t),this.refs.forEach(function(n){n.renameSheet(e,t)})},adjust:function(e,t,n,i){var r,o,a,s,l,d;e=e.toLowerCase(),r=this.row,o=this.col,a=this.sheet.toLowerCase(),s=!1,a==e&&("row"==t&&r>=n&&(this.row+=i,s=!0),"col"==t&&o>=n&&(this.col+=i,s=!0)),l=this.row,d=this.col,this.absrefs=null,this.refs=this.refs.map(function(a){return a===R?a:a.sheet.toLowerCase()!=e?(s&&("row"==t&&r>=n&&(a=a.relative(i,0)),"col"==t&&o>=n&&(a=a.relative(0,i))),a):a.adjust(r,o,l,d,"row"==t,n,i)},this)},toString:function(){return this.print(this.row,this.col)}}),z=Object.create(null),z["if"]=function(t,n){var i=this,r=n[0],o=n[1],a=n[2];this.resolveCells([r],function(){var n=i.asMatrix(r);n?o(function(r){a(function(o){var a=i.asMatrix(r),s=i.asMatrix(o);t(n.map(function(t,n,l){return t instanceof e?t:i.bool(t)?a?a.get(n,l):r:s?s.get(n,l):o}))})}):(r=this.force(r),r instanceof e?t(r):i.bool(r)?o(t):a(t));
})},z["φ"]=function(e){e((1+Math.sqrt(5))/2)},H=d(1900,0,-1),N=[31,28,31,30,31,30,31,31,30,31,30,31],P=[[0,31,59,90,120,151,181,212,243,273,304,334],[0,31,60,91,121,152,182,213,244,274,305,335]],L=6e4,B=60*L,O=24*B,C.CalcError=e,C.Formula=M,C.Matrix=A,C.packDate=m,C.unpackDate=p,C.packTime=_,C.unpackTime=g,C.serialToDate=v,C.dateToSerial=b,C.daysInMonth=f,C.isLeapYear=u,C.daysInYear=h,C.parseDate=k,x.dateToNumber=b,x.numberToDate=v,x.defineFunction=l,x.CalcError=e,C.defineFunction=l,C.defineAlias=function(e,t){var n=z[t];if(!n)throw Error("Function "+t+" is not yet defined");n.kendoSpreadsheetAliases||(n.kendoSpreadsheetAliases=[t]),n.kendoSpreadsheetAliases.push(e),z[e]=n},C.FUNCS=z,V=["or","number",["null",0]],W=[["*a",V],["*b",V]],U=[["*a",["or","anyvalue",["null",0]]],["*b",["or","anyvalue",["null",0]]]],l("binary+",function(e,t){return e+t}).args(W),l("binary-",function(e,t){return e-t}).args(W),l("binary*",function(e,t){return e*t}).args(W),l("binary/",function(e,t){return e/t}).args([["*a",V],["*b","divisor"]]),l("binary^",function(e,t){return Math.pow(e,t)}).args(W),l("binary&",function(e,t){return null==e&&(e=""),null==t&&(t=""),""+e+t}).args([["*a",["or","number","string","boolean","null"]],["*b",["or","number","string","boolean","null"]]]),l("binary=",function(e,t){return e===t}).args(U),l("binary<>",function(e,t){return e!==t}).args(U),l("binary<",w(function(e,t){return e<t})).args(U),l("binary<=",w(function(e,t){return e<=t})).args(U),l("binary>",w(function(e,t){return e>t})).args(U),l("binary>=",w(function(e,t){return e>=t})).args(U),l("unary+",function(e){return e}).args([["*a",V]]),l("unary-",function(e){return-e}).args([["*a",V]]),l("unary%",function(e){return e/100}).args([["*a",V]]),l("binary:",function(e,t){return new E(e,t).setSheet(e.sheet||this.formula.sheet,e.hasSheet())}).args([["a","cell"],["b","cell"]]),l("binary,",function(e,t){return new F([e,t])}).args([["a","ref"],["b","ref"]]),l("binary ",function(e,t){return e.intersect(t)}).args([["a","ref"],["b","ref"]]),l("not",function(e){return!this.bool(e)}).args([["*a",["or","anyvalue",["null",0]]]]),l("isblank",function(e){return e instanceof D&&(e=this.getRefData(e),null==e)}).args([["*value","anything!"]]),l("iserror",function(t){return t instanceof e}).args([["*value","forced!"]]),l("iserr",function(t){return t instanceof e&&"N/A"!=t.code}).args([["*value","forced!"]]),l("isna",function(t){return t instanceof e&&"N/A"==t.code}).args([["*value","forced!"]]),l("islogical",function(e){return"boolean"==typeof e}).args([["*value","forced!"]]),l("isnontext",function(e){return"string"!=typeof e}).args([["*value","forced!"]]),l("istext",function(e){return"string"==typeof e}).args([["*value","forced!"]]),l("isnumber",function(e){return"number"==typeof e}).args([["*value","forced!"]]),l("isref",function(e){return e instanceof D||e instanceof E}).args([["*value","anything!"]]),z[",getname"]=function(e,t){this.fetchName(t[0],e)})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/validation.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e,t,r,s){var d,c,u,h;if("string"==typeof s&&(s=JSON.parse(s)),s.from&&("list"!==s.dataType||s.fromIsListValue||(s.from=kendo.format(o,s.from),s.fromIsListValue=!0),"date"===s.dataType&&(u=i.runtime.parseDate(s.from),u&&(s.from=kendo.format(a,s.from),s.fromIsDateValue=!0)),s.from=i.compile(i.parseFormula(e,t,r,s.from))),s.to&&("date"===s.dataType&&(h=i.runtime.parseDate(s.to),h&&(s.to=kendo.format(a,s.to),s.toIsDateValue=!0)),s.to=i.compile(i.parseFormula(e,t,r,s.to))),c="custom"==s.dataType?n.validationComparers.custom:"list"==s.dataType?n.validationComparers.list:n.validationComparers[s.comparerType],!c)throw kendo.format("'{0}' comparer is not implemented.",s.comparerType);return d=function(e){var t,n=this.to&&this.to_value?this.to_value:void 0;return null===e||""===e?this.value=!!this.allowNulls:"custom"==this.dataType?this.value=c(e,this.from_value,n):"list"==this.dataType?(t=this._getListData(),this.value=c(e,t,n)):this.value=c(e,this.from_value,n),this.value},new kendo.spreadsheet.validation.Validation(l.extend(s,{handler:d,sheet:e,row:t,col:r}))}var t,n,i,r,o,a,s,l=kendo.jQuery;kendo.support.browser.msie&&kendo.support.browser.version<9||(t=kendo.spreadsheet,n={},t.validation=n,i=t.calc,r=kendo.Class,o="_matrix({0})",a='DATEVALUE("{0}")',i.runtime.defineFunction("_matrix",function(e){return e}).args([["m","matrix"]]),s=r.extend({init:function(e){this.handler=e.handler,this.from=e.from,this.to=e.to,this.dataType=e.dataType,this.comparerType=e.comparerType,this.type=e.type?e.type:"warning",this.allowNulls=!!e.allowNulls,this.fromIsDateValue=!!e.fromIsDateValue,this.toIsDateValue=!!e.toIsDateValue,this.showButton=e.showButton,this.fromIsListValue=!!e.fromIsListValue,this.sheet=e.sheet,this.row=e.row,this.col=e.col,e.tooltipMessageTemplate&&(this.tooltipMessageTemplate=e.tooltipMessageTemplate),e.tooltipTitleTemplate&&(this.tooltipTitleTemplate=e.tooltipTitleTemplate),e.messageTemplate&&(this.messageTemplate=e.messageTemplate),e.titleTemplate&&(this.titleTemplate=e.titleTemplate)},_formatMessages:function(e){var t=this.from?this.from_value:"",n=this.to?this.to_value:"",i=this.from?""+this.from:"",r=this.to?""+this.to:"",o=this.dataType,a=this.type,s=this.comparerType;return kendo.format(e,t,n,i,r,o,a,s)},_setMessages:function(){this.title="",this.message="",this.tooltipTitleTemplate&&(this.tooltipTitle=this._formatMessages(this.tooltipTitleTemplate)),this.tooltipMessageTemplate&&(this.tooltipMessage=this._formatMessages(this.tooltipMessageTemplate)),this.titleTemplate&&(this.title=this._formatMessages(this.titleTemplate)),this.messageTemplate&&(this.message=this._formatMessages(this.messageTemplate))},_getListData:function(){var e,t,n,i,r;if(!this.from_value||!this.from_value.data)return[];for(e=this.from_value.data,i=[],t=0;t<e.length;t++)if(r=e[t])for(n=0;n<r.length;n++)i.push(r[n]);return i},clone:function(e,t,n){var i=this._getOptions();return i.from&&(i.from=i.from.clone(e,t,n)),i.to&&(i.to=i.to.clone(e,t,n)),new s(l.extend(i,{handler:this.handler},{sheet:e,row:t,col:n}))},exec:function(e,t,n,i){function r(t){return t instanceof kendo.spreadsheet.Ref&&(t=e.getData(t),Array.isArray(t)&&(t=t[0])),t}var o=this,a=function(e){o.from_value=r(e),o.value=o.handler.call(o,t,n),o._setMessages(),i&&i(o.value)};o.to?o.to.exec(e,function(t){o.to_value=r(t),o.from.exec(e,a)}):o.from.exec(e,a)},reset:function(){this.from&&this.from.reset(),this.to&&this.to.reset(),delete this.value},adjust:function(e,t,n,i){var r,o;if(this.from&&this.from.adjust(e,t,n,i),this.to&&this.to.adjust(e,t,n,i),this.sheet.toLowerCase()==e.toLowerCase())switch(r=this.row,o=this.col,t){case"row":r>=n&&(this.row+=i);break;case"col":o>=n&&(this.col+=i)}},toJSON:function(){var e=this._getOptions();return e.from&&(e.from=""+e.from,"list"===e.dataType&&(e.from=e.from.replace(/^_matrix\((.*)\)$/i,"$1"),delete e.fromIsListValue),"date"===e.dataType&&this.fromIsDateValue&&(e.from=e.from.replace(/^DATEVALUE\("(.*)"\)$/i,"$1"),delete e.fromIsDateValue)),e.to&&(e.to=""+e.to,"date"===e.dataType&&this.toIsDateValue&&(e.to=e.to.replace(/^DATEVALUE\("(.*)"\)$/i,"$1"),delete e.toIsDateValue)),e},_getOptions:function(){return{from:this.from,to:this.to,dataType:this.dataType,type:this.type,comparerType:this.comparerType,row:this.row,col:this.col,sheet:this.sheet,allowNulls:this.allowNulls,fromIsListValue:this.fromIsListValue,fromIsDateValue:this.fromIsDateValue,toIsDateValue:this.toIsDateValue,tooltipMessageTemplate:this.tooltipMessageTemplate,tooltipTitleTemplate:this.tooltipTitleTemplate,messageTemplate:this.messageTemplate,titleTemplate:this.titleTemplate,showButton:this.showButton}}}),n.compile=e,n.validationComparers={greaterThan:function(e,t){return e>t},lessThan:function(e,t){return e<t},between:function(e,t,n){return e>=t&&e<=n},equalTo:function(e,t){return e==t},notEqualTo:function(e,t){return e!=t},greaterThanOrEqualTo:function(e,t){return e>=t},lessThanOrEqualTo:function(e,t){return e<=t},notBetween:function(e,t,n){return e<t||e>n},custom:function(e,t){return t},list:function(e,t){return t.indexOf(e)>-1}},n.Validation=s)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheet.min",["kendo.core.min","kendo.color.min","spreadsheet/runtime.min","spreadsheet/validation.min","spreadsheet/references.min"],e)}(function(){!function(e){var t,n,i,r,o;e.support.browser.msie&&e.support.browser.version<9||(t=e.spreadsheet.RangeRef,n=e.spreadsheet.CellRef,i=e.spreadsheet.Range,r=e.Class.extend({init:function(t){this._sheet=t,this.selection=e.spreadsheet.FIRSTREF.toRangeRef(),this.originalSelection=e.spreadsheet.FIRSTREF.toRangeRef(),this._activeCell=e.spreadsheet.FIRSTREF.toRangeRef(),this.originalActiveCell=e.spreadsheet.FIRSTREF},currentSelectionRange:function(){return this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()},currentOriginalNavigationRange:function(){return this.originalSelection.rangeAt(this.selectionRangeIndex).toRangeRef()},currentNavigationRange:function(){return this.singleCellSelection()?this._sheet._sheetRef:this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()},nextNavigationRange:function(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.nextRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()},previousNavigationRange:function(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.previousRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()},activeCell:function(e){return e&&(this.originalActiveCell=e.first(),this._activeCell=this._sheet.unionWithMerged(e.toRangeRef()),this._sheet.focus(e),this._sheet.triggerChange({activeCell:!0,selection:!0})),this._activeCell},select:function(e,t,n){if(e){if(e.eq(this.originalSelection))return;this.originalSelection=e,this.selection=t,n!==!1?(this.activeCell(e.isCell()?e:this.selection.lastRange().first()),this.selectionRangeIndex=this.selection.size()-1):this._sheet.triggerChange({selection:!0})}return this.selection},singleCellSelection:function(){return this._activeCell.eq(this.selection)}}),o=e.Observable.extend({init:function(){e.Observable.prototype.init.call(this),this._reinit.apply(this,arguments)},_reinit:function(t,n,i,o,a,s){var l=t*n-1;this._rows=new e.spreadsheet.Axis(t,i),this._columns=new e.spreadsheet.Axis(n,o),this._mergedCells=[],this._frozenRows=0,this._frozenColumns=0,this._suspendChanges=!1,this._filter=null,this._showGridLines=!0,this._gridLinesColor=null,this._grid=new e.spreadsheet.Grid(this._rows,this._columns,t,n,a,s),this._sheetRef=this._grid.normalize(e.spreadsheet.SHEETREF),this._properties=new e.spreadsheet.PropertyBag(l),this._sorter=new e.spreadsheet.Sorter(this._grid,this._properties.sortable()),this._viewSelection=new r(this),this._editSelection=new r(this),this._formulaSelections=[]},_selectionState:function(){return this._inEdit?this._editSelection:this._viewSelection},navigator:function(){return this._navigator||(this._navigator=new e.spreadsheet.SheetNavigator(this)),this._navigator},axisManager:function(){return this._axisManager||(this._axisManager=new e.spreadsheet.AxisManager(this)),this._axisManager},_name:function(e){return e?(this._sheetName=e,this):this._sheetName},name:function(){return this._name()},_property:function(e,t,n){return void 0===t?e():(e(t),this.triggerChange(n))},_field:function(e,t,n){return void 0===t?this[e]:(this[e]=t,this.triggerChange(n))},suspendChanges:function(e){return void 0===e?this._suspendChanges:(this._suspendChanges=e,this)},triggerChange:function(e){return this._suspendChanges||this.trigger("change",e),this},setDataSource:function(t,n){this.dataSourceBinder&&this.dataSourceBinder.destroy(),this.dataSourceBinder=new e.spreadsheet.SheetDataSourceBinder({dataSource:t,sheet:this,columns:n}),this.dataSource=this.dataSourceBinder.dataSource},hideColumn:function(e){return this._property(this._columns.hide.bind(this._columns),e,{layout:!0})},unhideColumn:function(e){return this._property(this._columns.unhide.bind(this._columns),e,{layout:!0})},isHiddenColumn:function(e){return this._grid._columns.hidden(e)},_copyRange:function(e,t){var n=this._grid,i=n.rowCount,r=n.normalize(e.topLeft),o=n.normalize(e.bottomRight),a=r.col*i+r.row,s=o.col*i+o.row,l=t.col*i+t.row;this._properties.copy(a,s,l)},_adjustReferences:function(n,i,r,o){var a,s,l;this._mergedCells=o.reduce(function(e,o){return o=o.adjust(null,null,null,null,"row"==n,i,r),o instanceof t&&e.push(o),e},[]),this._workbook&&(a=this._name(),this._workbook._sheets.forEach(function(e){e._forFormulas(function(e){e.adjust(a,n,i,r)}),e._forValidations(function(e){e.adjust(a,n,i,r)})}),this._workbook.adjustNames(a,"row"==n,i,r)),s=this.select(),s=s.adjust(null,null,null,null,"row"==n,i,r),s!==e.spreadsheet.NULLREF&&this.select(s),l="col"==n?this._columns:this._rows,l.adjust(i,r)},_forFormulas:function(e){var t=this._properties,n=t.get("formula").values(),i=n.length;n.forEach(function(t,n){e.call(this,t.value,n,i)},this)},_forValidations:function(e){var t=this._properties;t.get("validation").values().forEach(function(t){e.call(this,t.value)},this)},canInsertRow:function(e,t){var n,i;return t=t||1,n=this._grid,i=this.range(n.rowCount-t,0,t,n.columnCount),!i.hasValue()},insertRow:function(e){if(!this.canInsertRow(e))throw Error("Shifting nonblank cells off the worksheet is not supported!");return this.batch(function(){var r,o,a,s,l,d,c=this._grid,u=c.columnCount,h=c.rowCount,f=this.frozenRows();for(e<f&&this.frozenRows(f+1),r=this._mergedCells.slice(),o=0;o<u;o++)a=new t(new n(e,o),new n(e,o)),s=c.normalize(a.topLeft),l=c.normalize(a.bottomRight),d=new t(new n(s.row,s.col),new n(h-2,l.col)),this._copyRange(d,new n(s.row+1,s.col)),new i(a,this).clear();this._adjustReferences("row",e,1,r)},{recalc:!0,layout:!0,insertRow:{index:e},ref:new t(new n(e,0),new n(1/0,1/0))}),this.trigger("insertRow",{index:e}),this},isEnabledRow:function(e){var r=new t(new n(e,0),new n(e,this._grid.columnCount));return new i(r,this).enable()},deleteRow:function(e){return this.isEnabledRow(e)?(this.batch(function(){var r,o,a,s,l,d,c,u=this._grid,h=u.columnCount,f=this.frozenRows();for(e<f&&this.frozenRows(f-1),r=this._mergedCells.slice(),o=0;o<h;o++)a=new t(new n(e,o),new n(e,o)),new i(a,this).clear(),s=u.normalize(a.topLeft),l=u.normalize(a.bottomRight),d=new t(new n(s.row+1,s.col),new n(1/0,l.col)),this._copyRange(d,s),c=u.normalize(d.bottomRight),new i(new t(c,c),this).clear();this._adjustReferences("row",e,-1,r)},{recalc:!0,layout:!0,deleteRow:{index:e},ref:new t(new n(e,0),new n(1/0,1/0))}),this.trigger("deleteRow",{index:e}),this):this},insertColumn:function(e){return this.batch(function(){var r,o,a,s,l,d,c=this._grid,u=c.columnCount,h=this.frozenColumns();for(e<h&&this.frozenColumns(h+1),r=this._mergedCells.slice(),o=u;o>=e&&(a=new t(new n(0,o),new n(1/0,o)),new i(a,this).clear(),o!=e);o--)s=c.normalize(a.topLeft),l=c.normalize(a.bottomRight),d=new t(new n(s.row,s.col-1),new n(l.row,l.col-1)),this._copyRange(d,s);this._adjustReferences("col",e,1,r)},{recalc:!0,layout:!0,insertColumn:{index:e},ref:new t(new n(0,e),new n(1/0,1/0))}),this},isEnabledColumn:function(e){var r=new t(new n(0,e),new n(1/0,e));return new i(r,this).enable()},deleteColumn:function(e){return this.isEnabledColumn(e)?(this.batch(function(){var r,o,a,s,l,d,c=this._grid,u=c.columnCount,h=this.frozenColumns();for(e<h&&this.frozenColumns(h-1),r=this._mergedCells.slice(),o=e;o<u&&(a=new t(new n(0,o),new n(1/0,o)),new i(a,this).clear(),o!=u-1);o++)s=c.normalize(a.topLeft),l=c.normalize(a.bottomRight),d=new t(new n(s.row,s.col+1),new n(l.row,l.col+1)),this._copyRange(d,s);this._adjustReferences("col",e,-1,r)},{recalc:!0,layout:!0,deleteColumn:{index:e},ref:new t(new n(0,e),new n(1/0,1/0))}),this):this},hideRow:function(e){return this._property(this._rows.hide.bind(this._rows),e,{layout:!0})},unhideRow:function(e){return this._property(this._rows.unhide.bind(this._rows),e,{layout:!0})},isHiddenRow:function(e){return this._grid._rows.hidden(e)},columnWidth:function(e,t){return this._property(this._columns.value.bind(this._columns,e,e),t,{layout:!0})},rowHeight:function(e,t){return this._property(this._rows.value.bind(this._rows,e,e),t,{layout:!0})},frozenRows:function(e){return this._field("_frozenRows",e,{layout:!0})},frozenColumns:function(e){return this._field("_frozenColumns",e,{layout:!0})},showGridLines:function(e){return this._field("_showGridLines",e,{layout:!0})},gridLinesColor:function(e){return this._field("_gridLinesColor",e,{layout:!0})},_ref:function(i,r,o,a){var s=null;return i instanceof e.spreadsheet.Ref?i:i instanceof e.spreadsheet.Range?i._ref.toRangeRef():("string"==typeof i?s=e.spreadsheet.calc.parseReference(i):(o||(o=1),a||(a=1),s=new t(new n(i,r),new n(i+o-1,r+a-1))),s)},range:function(e,t,n,r){return new i(this._ref(e,t,n,r),this)},forEachMergedCell:function(e,t){var n=!1;void 0===t&&(t=e,n=!0),this._mergedCells.forEach(function(i){(n||i.intersects(e))&&t(i)})},forEachFilterHeader:function(e,t){var n,i=!1;void 0===t&&(t=e,i=!0),this._filter&&(n=[],this._filter.ref.forEachColumn(function(t){(i||t.intersects(e))&&n.push(t.topLeft)}),this._mergedCells.forEach(function(e){n=n.map(function(t){return e.intersects(t)?e:t})}),n.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[]).forEach(t))},forEach:function(e,n){var i,r,o,a,s,l;for(e instanceof t||(e=this._ref(e)),i=this._grid.normalize(e.topLeft),r=this._grid.normalize(e.bottomRight),o=i.col;o<=r.col;o++)a=i.row,s=this._grid.index(a,o),l=this._grid.index(r.row,o),this._properties.forEach(s,l,function(e){n(a++,o,e)})},startResizing:function(e){this._initialPosition=e,this._resizeInProgress=!0},startAutoFill:function(){this._autoFillInProgress=!0;var e=this.select();this._autoFillOrigin=e,this._autoFillDest=e,this.triggerChange({selection:!0})},updateAutoFill:function(e,t,n,i){this._autoFillDest=e,this._autoFillPunch=t,this._autoFillHint=n,this._autoFillDirection=i,this.triggerChange({selection:!0})},autoFillRef:function(){return this._autoFillDest},autoFillPunch:function(){return this._autoFillPunch},autoFillInProgress:function(){return this._autoFillInProgress},resizingInProgress:function(){return this._resizeInProgress},completeResizing:function(){var e,t;this._resizeInProgress&&(this._resizeInProgress=!1,e=this.resizeHintPosition(),this._initialPosition&&e?(t=this.resizeHandlePosition(),t.col!==-(1/0)?this.trigger("commandRequest",{command:"ColumnWidthCommand",options:{target:t.col,value:this.columnWidth(t.col)-(this._initialPosition.x-e.x)}}):this.trigger("commandRequest",{command:"RowHeightCommand",options:{target:t.row,value:this.rowHeight(t.row)-(this._initialPosition.y-e.y)}})):this.trigger("change",{resize:!0}))},resizeHandlePosition:function(){return this._resizeHandlePosition},resizeHintPosition:function(e){return void 0!==e&&(this._resizeHintPosition=e,this.trigger("change",{resize:!0})),this._resizeHintPosition},removeResizeHandle:function(){this._resizeHandlePosition&&(this._resizeHintPosition=void 0,this._resizeHandlePosition=void 0,this._initialPosition=void 0,this.trigger("change",{resize:!0}))},positionResizeHandle:function(e){this._resizeHandlePosition=e,this.trigger("change",{resize:!0})},startSelection:function(){this._selectionInProgress=!0},completeSelection:function(){var e,t;this._selectionInProgress&&(this._selectionInProgress=!1,this._resizeHintPosition=void 0,this.trigger("change",{selection:!0})),this._autoFillInProgress&&(this._autoFillInProgress=!1,e=this._autoFillDest,t=this._autoFillOrigin,this._autoFillPunch?this.trigger("commandRequest",{command:"ClearContentCommand",options:{operatingRange:this.range(this._autoFillPunch)}}):e.eq(t)?this.triggerChange({selection:!0}):this.trigger("commandRequest",{command:"AutoFillCommand",options:{operatingRange:this.range(e),origin:this.range(t)}}),this._autoFillDest=null,this._autoFillPunch=null,this._autoFillOrigin=null,this.select(e))},selectionInProgress:function(){return this._selectionInProgress},select:function(e,t){var n,i=this._selectionState();return e&&(e=this._ref(e),e=this._grid.normalize(e),n=this._grid.isAxis(e)?e:this.unionWithMerged(e)),i.select(e,n,t)},originalSelect:function(){return this._selectionState().originalSelection},currentSelectionRange:function(){return this._selectionState().currentSelectionRange()},currentOriginalSelectionRange:function(){return this._selectionState().currentOriginalNavigationRange()},currentNavigationRange:function(){return this._selectionState().currentNavigationRange()},nextNavigationRange:function(){return this._selectionState().nextNavigationRange()},previousNavigationRange:function(){return this._selectionState().previousNavigationRange()},selectionRangeIndex:function(){return this._selectionState().selectionRangeIndex},activeCell:function(e){return this._selectionState().activeCell(e)},originalActiveCell:function(){return this._selectionState().originalActiveCell},singleCellSelection:function(){return this._selectionState().singleCellSelection()},unionWithMerged:function(e){var t=this._mergedCells;return e.map(function(e){return e.toRangeRef().union(t)})},trim:function(e){var t=[],n=this._grid;return this._properties.forEachProperty(function(i){t.push(n.trim(e,i.list))}),this.unionWithMerged(e.topLeft.toRangeRef().union(t))},focus:function(e){if(!e){var t=this._focus;return this._focus=null,t}this._focus=e.toRangeRef()},activeCellSelection:function(){return new i(this._grid.normalize(this.activeCell()),this)},selection:function(){return new i(this._grid.normalize(this._selectionState().selection),this)},selectedHeaders:function(){var e=this.select(),t={},n={},i=!1,r=!1,o=this._grid.rowCount-1,a=this._grid.columnCount-1;return e.forEach(function(e){var s,l,d,c,u="partial",h="partial";if(e=e.toRangeRef(),l=e.bottomRight,d=l.col>=a,c=l.row>=o,c&&(r=!0,h="full"),d&&(i=!0,u="full"),!c)for(s=e.topLeft.row;s<=l.row;s++)"full"!==t[s]&&(t[s]=u);if(!d)for(s=e.topLeft.col;s<=l.col;s++)"full"!==n[s]&&(n[s]=h)}),{rows:t,cols:n,allRows:r,allCols:i,all:r&&i}},isInEditMode:function(e){return void 0===e?this._inEdit:(this._inEdit=e,void(e&&(this._editSelection.selection=this._viewSelection.selection.clone(),this._editSelection.originalSelection=this._viewSelection.originalSelection.clone(),this._editSelection._activeCell=this._viewSelection._activeCell.clone(),this._editSelection.originalActiveCell=this._viewSelection.originalActiveCell.clone())))},_setFormulaSelections:function(e){this._formulaSelections=(e||[]).slice(),this.triggerChange({selection:!0})},_viewActiveCell:function(){return this._viewSelection._activeCell.toRangeRef()},toJSON:function(){var t,n={},i=this._rows.toJSON("height",n),r=this._columns.toJSON("width",{}),o=this._viewSelection,a=[];return this.forEach(e.spreadsheet.SHEETREF,function(t,r,o){if(0!==Object.keys(o).length){o.link&&a.push({ref:e.spreadsheet.Ref.display(null,t,r),target:o.link});var s=n[t];void 0===s&&(s=i.length,i.push({index:t}),n[t]=s),t=i[s],o.index=r,void 0===t.cells&&(t.cells=[]),o.formula&&(o.formula=""+o.formula),o.validation&&(o.validation=o.validation.toJSON()),o.color&&(o.color=e.parseColor(o.color).toCss()),o.background&&(o.background=e.parseColor(o.background).toCss()),o.borderTop&&o.borderTop.color&&(o.borderTop.color=e.parseColor(o.borderTop.color).toCss()),o.borderBottom&&o.borderBottom.color&&(o.borderBottom.color=e.parseColor(o.borderBottom.color).toCss()),o.borderRight&&o.borderRight.color&&(o.borderRight.color=e.parseColor(o.borderRight.color).toCss()),o.borderLeft&&o.borderLeft.color&&(o.borderLeft.color=e.parseColor(o.borderLeft.color).toCss()),t.cells.push(o)}}),t={name:this._name(),rows:i,columns:r,selection:""+o.selection,activeCell:""+o.activeCell(),frozenRows:this.frozenRows(),frozenColumns:this.frozenColumns(),showGridLines:this.showGridLines(),gridLinesColor:this.gridLinesColor(),mergedCells:this._mergedCells.map(function(e){return""+e}),hyperlinks:a},this._sort&&(t.sort={ref:""+this._sort.ref,columns:this._sort.columns.map(function(e){return{index:e.index,ascending:e.ascending}})}),this._filter&&(t.filter={ref:""+this._filter.ref,columns:this._filter.columns.map(function(e){var t=e.filter.toJSON();return t.index=e.index,t})}),t},fromJSON:function(t){this.batch(function(){var n,i,r,o,a,s,l,d,c;if(void 0!==t.name&&this._name(t.name),void 0!==t.frozenColumns&&this.frozenColumns(t.frozenColumns),void 0!==t.frozenRows&&this.frozenRows(t.frozenRows),void 0!==t.columns&&this._columns.fromJSON("width",t.columns),void 0!==t.rows)for(this._rows.fromJSON("height",t.rows),n=0;n<t.rows.length;n++)if(i=t.rows[n],r=i.index,void 0===r&&(r=n),i.cells)for(o=0;o<i.cells.length;o++)a=i.cells[o],s=a.index,void 0===s&&(s=o),a.formula&&(a.formula=this._compileFormula(r,s,a.formula)),a.validation&&(a.validation=this._compileValidation(r,s,a.validation)),this._properties.fromJSON(this._grid.index(r,s),a);t.selection&&(this._viewSelection.selection=this._viewSelection.originalSelection=this._ref(t.selection)),t.activeCell&&(l=this._ref(t.activeCell),this._viewSelection._activeCell=l.toRangeRef(),this._viewSelection.originalActiveCell=l),t.mergedCells&&t.mergedCells.forEach(function(e){this.range(e).merge()},this),t.sort&&(this._sort={ref:this._ref(t.sort.ref),columns:t.sort.columns.slice(0)}),t.filter&&(d=t.filter.ref,c=void 0===t.filter.columns?[]:t.filter.columns,d?(this._filter={ref:this._ref(d),columns:c.map(function(t){return{index:t.index,filter:e.spreadsheet.Filter.create(t)}})},this._refreshFilter()):e.logToConsole("Dropping filter for sheet '"+t.name+"' due to missing ref")),void 0!==t.showGridLines&&(this._showGridLines=t.showGridLines),this._gridLinesColor=t.gridLinesColor}),this._rows._refresh(),this._columns._refresh()},formula:function(e){return this._properties.get("formula",this._grid.cellRefIndex(e))},validation:function(e){return this._properties.get("validation",this._grid.cellRefIndex(e))},resetFormulas:function(){this._forFormulas(function(e){e.reset()})},resetValidations:function(){this._forValidations(function(e){e.reset()})},recalc:function(e,t){function n(){o--,a!=r||o||t()}var i=this._properties.get("formula").values(),r=i.length,o=0,a=0;if(!r&&t)return t();for(;a<r;)o++,i[a++].value.exec(e,t?n:null)},revalidate:function(e){var i=this;this._forValidations(function(r){var o=new n(r.row,r.col),a=new t(o,o);r.exec(e,i._get(a,"value"),i._get(a,"format"))})},_value:function(e,t,n){var i=this._grid.index(e,t);return void 0===n?this._properties.get("value",i):void this._properties.set("value",i,i,n)},_validation:function(e,t){var n=this._grid.index(e,t);return this._properties.get("validation",n)},_compileValidation:function(t,n,i){return i instanceof e.spreadsheet.validation.Validation?i.clone(this._name(),t,n):(null!=i.from&&(i.from=(i.from+"").replace(/^=/,"")),null!=i.to&&(i.to=(i.to+"").replace(/^=/,"")),e.spreadsheet.validation.compile(this._name(),t,n,i))},_compileFormula:function(t,n,i){return i=i.replace(/^=/,""),i=e.spreadsheet.calc.parseFormula(this._name(),t,n,i),e.spreadsheet.calc.compile(i)},_copyValuesInRange:function(e,t,n,i){var r,o,a,s,l;for(r=e.col;r<=t.col;r++)for(o=this._grid.index(e.row,r),a=this._grid.index(t.row,r),s=o,l=e.row;s<=a;++s,++l)n=n.clone(this._name(),l,r),this._properties.set(i,s,s,n);return n},_set:function(e,t,n){var i,r,o,a=this._grid.normalize(e.topLeft),s=this._grid.normalize(e.bottomRight);if(n&&"formula"==t)"string"==typeof n&&(n=this._compileFormula(a.row,a.col,n)),n=this._copyValuesInRange(a,s,n,"formula");else if(n&&"validation"==t)n=this._compileValidation(a.row,a.col,n),n=this._copyValuesInRange(a,s,n,"validation");else for(i=a.col;i<=s.col;i++)r=this._grid.index(a.row,i),o=this._grid.index(s.row,i),this._properties.set(t,r,o,n),"formula"==t&&this._properties.set("value",r,o,null)},_get:function(e,t){var n=this._grid.normalize(e.topLeft),i=this._grid.index(n.row,n.col);return this._properties.get(t,i)},batch:function(e,t){var n=this.suspendChanges();return this.suspendChanges(!0),e.call(this),this.suspendChanges(n).triggerChange(t||{recalc:!0})},_sortBy:function(e,t){var n=null;t.forEach(function(t){n=this._sorter.sortBy(e,t.index,this._properties.get("value"),t.ascending,n)},this),this._sort={ref:e,columns:t},this._refreshFilter(),this.triggerChange({recalc:!0})},_refreshFilter:function(){this._filter&&this._filterBy(this._filter.ref,this._filter.columns)},_filterBy:function(t,n){this.batch(function(){for(var i=t.topLeft.row;i<=t.bottomRight.row;i++)this._rows.hidden(i)&&this._rows.unhide(i);n.forEach(function(n){var i,r,o,a=t.resize({top:1}).toColumn(n.index),s=[];if(a!==e.spreadsheet.NULLREF)for(this.forEach(a,function(e,t,n){n.row=e,s.push(n)}),n.filter.prepare(s),i=0;i<s.length;i++)r=s[i],o=n.filter.value(r),n.filter.matches(o)===!1&&this.hideRow(r.row)},this),this._filter={ref:t,columns:n}},{layout:!0,filter:!0})},filterColumn:function(e){var t=this.filter().ref;return e.toRangeRef().topLeft.col-t.topLeft.col},filter:function(){return this._filter},clearFilter:function(e){this._clearFilter(e instanceof Array?e:[e])},_clearFilter:function(e){this._filter&&this.batch(function(){this._filter.columns=this._filter.columns.filter(function(t){return e.indexOf(t.index)<0}),this._refreshFilter()},{layout:!0,filter:!0})},getAxisState:function(){return{rows:this._rows.getState(),columns:this._columns.getState()}},setAxisState:function(e){this._rows.setState(e.rows),this._columns.setState(e.columns),this.triggerChange({layout:!0})},getState:function(){return{rows:this._rows.getState(),columns:this._columns.getState(),mergedCells:this._mergedCells.map(function(e){return e.clone()}),properties:this._properties.getState()}},setState:function(t){this._rows.setState(t.rows),this._columns.setState(t.columns),this._mergedCells=t.mergedCells,this._properties.setState(t.properties),this.triggerChange(e.spreadsheet.ALL_REASONS)},_merge:function(t){var n,r=this._mergedCells,o=this;return this.batch(function(){n=t.map(function(t){var n,a,s,l,d,c,u;return t instanceof e.spreadsheet.CellRef?t:(n=t.toRangeRef().union(r,function(e){r.splice(r.indexOf(e),1)}),a=new i(n,o),s=a._get("formula"),l=a.value(),d=a.format(),c=a.background(),a.value(null),a.format(null),a.background(null),u=new i(n.collapse(),o),s?u._set("formula",s):u.value(l),u.format(d),u.background(c),r.push(n),n)});var a=o._viewSelection;a.selection=o.unionWithMerged(a.originalSelection),a._activeCell=o.unionWithMerged(a.originalActiveCell)},{activeCell:!0,selection:!0}),n}}),e.spreadsheet.Sheet=o)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheetsbar.min",["kendo.core.min","kendo.sortable.min"],e)}(function(){!function(e){var t,n,i,r,o,a;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n=e._outerWidth,i=".",r=" ",o={sheetsBarWrapper:"k-widget k-header",sheetsBarSheetsWrapper:"k-tabstrip k-floatwrap k-tabstrip-bottom",sheetsBarActive:"k-spreadsheet-sheets-bar-active",sheetsBarInactive:"k-spreadsheet-sheets-bar-inactive",sheetsBarAdd:"k-spreadsheet-sheets-bar-add",sheetsBarRemove:"k-spreadsheet-sheets-remove",sheetsBarItems:"k-spreadsheet-sheets-items",sheetsBarEditor:"k-spreadsheet-sheets-editor",sheetsBarScrollable:"k-tabstrip-scrollable",sheetsBarNext:"k-tabstrip-next",sheetsBarPrev:"k-tabstrip-prev",sheetsBarKItem:"k-item k-state-default",sheetsBarKActive:"k-state-active k-state-tab-on-top",sheetsBarKTextbox:"k-textbox",sheetsBarKLink:"k-link",sheetsBarKIcon:"k-icon",sheetsBarKFontIcon:"k-font-icon",sheetsBarKButton:"k-button k-button-icon",sheetsBarKButtonBare:"k-button-bare",sheetsBarKArrowW:"k-i-arrow-w",sheetsBarKArrowE:"k-i-arrow-e",sheetsBarKReset:"k-reset k-tabstrip-items",sheetsBarKIconX:"k-i-x",sheetsBarKSprite:"k-sprite",sheetsBarKIconPlus:"k-i-plus",sheetsBarHintWrapper:"k-widget k-tabstrip k-tabstrip-bottom k-spreadsheet-sheets-items-hint",sheetsBarKResetItems:"k-reset k-tabstrip-items"},a=e.ui.Widget.extend({
init:function(t,n){var r=a.classNames;e.ui.Widget.call(this,t,n),t=this.element,t.addClass(r.sheetsBarWrapper),this._tree=new e.dom.Tree(t[0]),this._tree.render([this._addButton(),this._createSheetsWrapper([])]),this._toggleScrollEvents(!0),this._createSortable(),this._sortable.bind("start",this._onSheetReorderStart.bind(this)),this._sortable.bind("end",this._onSheetReorderEnd.bind(this)),t.on("click",i+r.sheetsBarRemove,this._onSheetRemove.bind(this)),t.on("click","li",this._onSheetSelect.bind(this)),t.on("dblclick","li"+i+r.sheetsBarActive,this._createEditor.bind(this)),t.on("click",i+r.sheetsBarAdd,this._onAddSelect.bind(this))},options:{name:"SheetsBar",scrollable:{distance:200}},events:["select","reorder","rename"],_createEditor:function(){this._editor||(this._renderSheets(this._sheets,this._selectedIndex,!0),this._editor=this.element.find(e.format("input{0}{1}",i,a.classNames.sheetsBarEditor)).focus().on("keydown",this._onEditorKeydown.bind(this)).on("blur",this._onEditorBlur.bind(this)))},_destroyEditor:function(e){var t=e?null:this._editor.val();this._editor.off(),this._editor=null,this._renderSheets(this._sheets,this._selectedIndex,!1),this._onSheetRename(t)},renderSheets:function(e,t){!e||t<0||this._renderSheets(e,t,!1)},_renderSheets:function(t,o,s){var l,d,c,u,h,f,p,m,g,v,_,b=this,k=a.classNames;b._isRtl=e.support.isRtl(b.element),b._sheets=t,b._selectedIndex=o,b._renderHtml(s,!0),b._scrollableAllowed()&&(c=b._sheetsWrapper(),u=c.children(i+k.sheetsBarPrev),h=c.children(i+k.sheetsBarNext),f=2,p=b.element.find(i+k.sheetsBarAdd),m=n(p)+p.position().left+f,g=n(u)+f,v=b._sheetsGroup(),u.css({left:m}),c.addClass(k.sheetsBarScrollable+r+k.sheetsBarSheetsWrapper),v.css({marginLeft:m}),l=c[0].offsetWidth,d=v[0].scrollWidth,d+m>l?(_=Math.ceil(e.parseFloat(h.css("right"))),b._scrollableModeActive||(b._nowScrollingSheets=!1,b._scrollableModeActive=!0),v.css({marginLeft:g+m,marginRight:n(h)+_+f})):b._scrollableModeActive&&d<=l?(b._scrollableModeActive=!1,v.css({marginLeft:m,marginRight:""})):v.css({marginLeft:m}),b._toggleScrollButtons())},_toggleScrollButtons:function(e){var t=this,n=t._sheetsGroup(),r=t._sheetsWrapper(),o=n.scrollLeft(),s=r.find(i+a.classNames.sheetsBarPrev),l=r.find(i+a.classNames.sheetsBarNext);e===!1?(s.toggle(!1),l.toggle(!1)):(s.toggle(t._isRtl?o<n[0].scrollWidth-n[0].offsetWidth-1:0!==o),l.toggle(t._isRtl?0!==o:o<n[0].scrollWidth-n[0].offsetWidth-1))},_toggleScrollEvents:function(e){var t=this,n=a.classNames,r=t.options,o=t._sheetsWrapper(),s=o.children(i+n.sheetsBarPrev),l=o.children(i+n.sheetsBarNext);e?(s.on("mousedown",function(){t._nowScrollingSheets=!0,t._scrollSheetsByDelta(r.scrollable.distance*(t._isRtl?1:-1))}),l.on("mousedown",function(){t._nowScrollingSheets=!0,t._scrollSheetsByDelta(r.scrollable.distance*(t._isRtl?-1:1))}),s.add(l).on("mouseup",function(){t._nowScrollingSheets=!1})):(s.off(),l.off())},_renderHtml:function(t,n){var i,o,s,l,d,c,u=[],h=e.dom,f=h.element,p=this._sheets,m=this._selectedIndex,g=a.classNames;for(i=0;i<p.length;i++)o=p[i],s=i===m,l={className:g.sheetsBarKItem+r},d=[],l.className+=s?g.sheetsBarKActive+r+g.sheetsBarActive:g.sheetsBarInactive,s&&t?d.push(f("input",{type:"text",value:o.name(),className:g.sheetsBarKTextbox+r+g.sheetsBarEditor,maxlength:50},[])):(d.push(f("span",{className:g.sheetsBarKLink,title:o.name()},[h.text(o.name())])),c=f("span",{className:g.sheetsBarKIcon+r+g.sheetsBarKFontIcon+r+g.sheetsBarKIconX},[]),d.push(f("span",{className:g.sheetsBarKLink+r+g.sheetsBarRemove},[c]))),u.push(f("li",l,d));this._tree.render([this._addButton(),this._createSheetsWrapper(u,n)])},_createSheetsWrapper:function(t,n){var i,o=e.dom.element,s=a.classNames,l=[o("ul",{className:s.sheetsBarKReset},t)];return n=!0,n&&(i=s.sheetsBarKButton+r+s.sheetsBarKButtonBare+r,l.push(o("span",{className:i+s.sheetsBarPrev},[o("span",{className:s.sheetsBarKIcon+r+s.sheetsBarKArrowW},[])])),l.push(o("span",{className:i+s.sheetsBarNext},[o("span",{className:s.sheetsBarKIcon+r+s.sheetsBarKArrowE},[])]))),o("div",{className:s.sheetsBarItems},l)},_createSortable:function(){var n=a.classNames;this._sortable=new e.ui.Sortable(this.element,{filter:e.format("ul li.{0},ul li.{1}",n.sheetsBarActive,n.sheetsBarInactive),container:i+n.sheetsBarItems,axis:"x",animation:!1,ignore:"input",end:function(){this.draggable.hint&&this.draggable.hint.remove()},hint:function(e){var i=t(e).clone();return i.wrap("<div class='"+n.sheetsBarHintWrapper+"'><ul class='"+n.sheetsBarKResetItems+"'></ul></div>").closest("div")}})},_onEditorKeydown:function(e){this._editor&&(13===e.which&&this._destroyEditor(),27===e.which&&this._destroyEditor(!0))},_onEditorBlur:function(){this._editor&&this._destroyEditor()},_onSheetReorderEnd:function(e){e.preventDefault(),this.trigger("reorder",{oldIndex:e.oldIndex,newIndex:e.newIndex})},_onSheetReorderStart:function(e){this._editor&&e.preventDefault()},_onSheetRemove:function(e){var n=t(e.target).closest("li").text();this._editor&&this._destroyEditor(),this.trigger("remove",{name:n})},_onSheetSelect:function(e){var n=t(e.target).text();return t(e.target).is(i+a.classNames.sheetsBarEditor)||!n?void e.preventDefault():(this._editor&&this._destroyEditor(),this._scrollSheetsToItem(t(e.target).closest("li")),void this.trigger("select",{name:n,isAddButton:!1}))},_onSheetRename:function(e){this.trigger("rename",{name:e,sheetIndex:this._selectedIndex})},_onAddSelect:function(){this.trigger("select",{isAddButton:!0})},_addButton:function(){var t=e.dom.element,n=a.classNames;return t("a",{className:n.sheetsBarAdd+r+n.sheetsBarKButton},[t("span",{className:n.sheetsBarKSprite+r+n.sheetsBarKIcon+r+n.sheetsBarKFontIcon+r+n.sheetsBarKIconPlus},[])])},destroy:function(){this._sortable.destroy()},_scrollableAllowed:function(){var e=this.options;return e.scrollable&&!isNaN(e.scrollable.distance)},_scrollSheetsToItem:function(e){var t,i,r,o,a,s,l,d=this;d._scrollableModeActive&&(t=d._sheetsGroup(),i=t.scrollLeft(),r=n(e),o=d._isRtl?e.position().left:e.position().left-t.children().first().position().left,a=t[0].offsetWidth,s=Math.ceil(parseFloat(t.css("padding-left"))),d._isRtl?o<0?l=i+o-(a-i)-s:o+r>a&&(l=i+o-r+2*s):i+a<o+r?l=o+r-a+2*s:i>o&&(l=o-s),t.finish().animate({scrollLeft:l},"fast","linear",function(){d._toggleScrollButtons()}))},_sheetsGroup:function(){return this._sheetsWrapper().children("ul")},_sheetsWrapper:function(){return this.element.find(i+a.classNames.sheetsBarItems)},_scrollSheetsByDelta:function(e){var t=this,n=t._sheetsGroup(),i=n.scrollLeft();n.finish().animate({scrollLeft:i+e},"fast","linear",function(){t._nowScrollingSheets?t._scrollSheetsByDelta(e):t._toggleScrollButtons()})}}),e.spreadsheet.SheetsBar=a,t.extend(!0,a,{classNames:o}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/calc.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e){e=e.toUpperCase();for(var t=0,n=0;n<e.length;++n)t=26*t+e.charCodeAt(n)-64;return t-1}function t(e){return parseInt(e,10)-1}function n(n,i){var r,o,a,s,l,c;if("#sheet"==n.toLowerCase())return g.SHEETREF;e:{if(!(r=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(n))){for(s=d(n,{}),l=[];;){if(c=s.next(),c instanceof b)c.rel=0;else{if(!(c instanceof _))break e;c.topLeft.rel=0,c.bottomRight.rel=0}if(l.push(c),s.eof())break;if(!s.is("op",","))break e;s.next()}return 1==l.length?l[0]:new g.UnionRef(l)}if(o=t(r[4]),a=e(r[2]),o<1048576&&a<16384)return new b(t(r[4]),e(r[2]))}if(!i)throw Error("Cannot parse reference: "+n)}function i(e,t,n,i){function r(e){return e.index=v.length,v.push(e),e}function o(e,t,n){if(g(e,t))return i.next();var r=i.peek();r?i.croak("Expected "+e+" «"+t+"» but found "+r.type+" «"+r.value+"»"):n||i.croak("Expected "+e+" «"+t+"»")}function a(e){return m(f(u(e)),0,e)}function s(e){return"TRUE"==e.upper||"FALSE"==e.upper?"TRUE"==e.upper?T:S:r(new k(e.value))}function l(){var e,t=i.next();for(t=t.value,o("punc","("),e=[];;){if(g("punc",")"))break;if(g("op",","))e.push({type:"null"}),i.next();else{if(e.push(a(!1)),i.eof()||g("punc",")"))break;o("op",",")}}return o("punc",")",!0),{type:"func",func:t,args:e}}function c(t){return t.hasSheet()||t.setSheet(e),r(t)}function u(e){var t;return g("ref")?t=c(i.next()):g("func")?t=l():g("punc","(")?(i.next(),t=a(!0),o("punc",")",!0)):g("punc","{")?(i.next(),t=h(),o("punc","}",!0)):g("num")||g("str")||g("error")?t=i.next():g("sym")?t=s(i.next()):g("op","+")||g("op","-")?t={type:"prefix",op:i.next().value,exp:u(e)}:i.croak(i.peek()?"Parse error":"Incomplete expression"),p(t)}function h(){for(var e=[],t=[e],n=!0;!i.eof()&&!g("punc","}");)n?n=!1:g("punc",";")?(t.push(e=[]),i.next()):o("op",","),e.push(a(!1));return{type:"matrix",value:t}}function f(e){return g("punc","(")||g("ref")||g("num")||g("func")?{type:"binary",op:" ",left:e,right:a(!1)}:e}function p(e){return g("op","%")?(i.next(),p({type:"postfix",op:"%",exp:e})):e}function m(e,t,n){var r,o,a=g("op");return a&&(n||","!=a.value)&&(r=x[a.value],r>t)?(i.next(),o=m(u(n),r,n),m({type:"binary",op:a.value,left:e,right:o},t,n)):e}var g,v=[];return i=d(i,{row:t,col:n}),g=i.is,{type:"exp",ast:a(!0),refs:v,sheet:e,row:t,col:n}}function r(e,t){var n,r=i(null,0,0,e);if(!(r.ast instanceof k))throw new C("Invalid name: "+e);return r=r.ast,t instanceof v||(n=i(r.sheet,0,0,t),t=n.ast instanceof v?n.ast:/^(?:str|num|bool|error)$/.test(n.ast.type)?n.ast.value:s(n)),{name:r,value:t}}function o(e){function t(e,i,r){function o(t){var o=e.op,a=x[o]<r||!r&&","==o||"binary"==i.type&&r==x[o]&&e===i.right;return n(t(),a)}switch(e.type){case"num":case"bool":return JSON.stringify(e.value);case"error":return JSON.stringify("#"+e.value);case"str":return JSON.stringify(JSON.stringify(e.value));case"ref":return"this.refs["+e.index+"].print(row, col, mod)";case"prefix":return o(function(){return JSON.stringify(e.op)+" + "+t(e.exp,e,x[e.op])});case"postfix":return o(function(){return t(e.exp,e,x[e.op])+" + "+JSON.stringify(e.op)});case"binary":return o(function(){var i=n(t(e.left,e,x[e.op]),e.left instanceof k&&":"==e.op),r=n(t(e.right,e,x[e.op]),e.right instanceof k&&":"==e.op);return i+" + "+JSON.stringify(e.op)+" + "+r});case"func":return JSON.stringify(e.func+"(")+" + "+(e.args.length>0?e.args.map(function(n){return t(n,e,0)}).join(" + ', ' + "):"''")+" + ')'";case"matrix":return"'{ ' + "+e.value.map(function(n){return n.map(function(n){return t(n,e,0)}).join(" + ', ' + ")}).join(" + '; ' + ")+"+ ' }'";case"null":return"''"}throw Error("Cannot make printer for node "+e.type)}function n(e,t){return t?"'(' + "+e+" + ')'":e}return D("function(row, col, mod){return("+t(e.ast,e,0)+")}")}function a(e,t){function n(e,t){switch(e.type){case"ref":return i(e,t);case"num":case"str":case"null":case"error":case"bool":return r(e,t);case"prefix":case"postfix":return a(e,t);case"binary":return s(e,t);case"func":return u(e,t);case"lambda":return h(e,t);case"matrix":return f(e.value,t,!0)}throw Error("Cannot CPS "+e.type)}function i(e,t){return"name"==e.ref?o(e,t):r(e,t)}function r(e,t){return t(e)}function o(e,t){return{type:"func",func:",getname",args:[p(t),e]}}function a(e,t){return n({type:"func",func:"unary"+e.op,args:[e.exp]},t)}function s(e,t){return n({type:"func",func:"binary"+e.op,args:[e.left,e.right]},t)}function l(e,t,i,r){return n(e,function(e){var o=p(r),a=m("T"),s=m("E");return{type:"func",func:"if",args:[o,e,{type:"lambda",vars:[a],body:n(t||T,function(e){return{type:"call",func:{type:"var",name:a},args:[e]}})},{type:"lambda",vars:[s],body:n(i||S,function(e){return{type:"call",func:{type:"var",name:s},args:[e]}})}]}})}function d(e,t){return 0===e.length?r(T,t):n({type:"func",func:"IF",args:[e[0],{type:"func",func:"AND",args:e.slice(1)},S]},t)}function c(e,t){return 0===e.length?r(S,t):n({type:"func",func:"IF",args:[e[0],T,{type:"func",func:"OR",args:e.slice(1)}]},t)}function u(e,t){switch(e.func.toLowerCase()){case"if":return l(e.args[0],e.args[1],e.args[2],t);case"and":return d(e.args,t);case"or":return c(e.args,t);case"true":return t(T);case"false":return t(S)}return function i(t,r){return r==e.args.length?{type:"func",func:e.func,args:t}:n(e.args[r],function(e){return i(t.concat([e]),r+1)})}([p(t)],0)}function h(e,t){var i=m("K"),r=n(e.body,function(e){return{type:"call",func:{type:"var",value:i},args:[e]}});return t({type:"lambda",vars:[i].concat(e.vars),body:r})}function f(e,t,i){var r=[];return function o(a){return a==e.length?t({type:"matrix",value:r}):(i?f:n)(e[a],function(e){return r[a]=e,o(a+1)})}(0)}function p(e){var t=m("R");return{type:"lambda",vars:[t],body:e({type:"var",name:t})}}function m(e){return e||(e=""),e="_"+e,e+ ++g}var g=0;return n(e,t)}function s(e){function t(e){var i=e.type;if("num"==i)return e.value+"";if("str"==i)return JSON.stringify(e.value);if("error"==i)return"context.error("+JSON.stringify(e.value)+")";if("return"==i)return"context.resolve("+t(e.value)+")";if("func"==i)return"context.func("+JSON.stringify(e.func)+", "+t(e.args[0])+", "+n(e.args.slice(1))+")";if("call"==i)return t(e.func)+"("+e.args.map(t).join(", ")+")";if("ref"==i)return"refs["+e.index+"]";if("bool"==i)return""+e.value;if("if"==i)return"(context.bool("+t(e.co)+") ? "+t(e.th)+" : "+t(e.el)+")";if("lambda"==i)return"(function("+e.vars.join(", ")+"){ return("+t(e.body)+") })";if("var"==i)return e.name;if("matrix"==i)return n(e.value);if("null"==i)return"null";throw Error("Cannot compile expression "+i)}function n(e){return"[ "+e.map(t).join(", ")+" ]"}var i,r=o(e),s=r.call(e),l=E[s];return l?l.clone(e.sheet,e.row,e.col):(i=t(a(e.ast,function(e){return{type:"return",value:e}})),i=["function(){","var context = this, refs = context.formula.absrefs",i,"}"].join(";\n"),l=new y.Formula(e.refs,D(i),r,e.sheet,e.row,e.col),E[s]=l,l)}function l(e){return e}function d(n,i){function r(e,t){var n=o();return null==n||null!=e&&n.type!==e||null!=t&&n.value!==t?null:n}function o(){return null==C&&(C=s()),C}function a(){if(null!=C){var e=C;return C=null,e}return s()}function s(){var e,t=n.peek();return t&&("sym"!=t.type&&"rc"!=t.type&&"num"!=t.type||(e=y(8,c)||y(6,f)||y(6,p)||y(4,m)||y(4,g)||y(2,v)||y(2,w)),e||(e=n.next())),e}function d(r,o){var a,s,l,d,c;if("rc"==r.type)return!r.rel||i.forEditor||null!=i.row&&null!=i.col||n.croak("Cannot read relative cell in RC notation"),new b(r.row,r.col,r.rel);if("num"==r.type)return r.value<=1048577?T(new b(t(r.value),o?-(1/0):+(1/0),2)):null;if(a=r.value,s=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(a))return l=t(s[4]),d=e(s[2]),l<=1048576&&d<=16383?T(new b(t(s[4]),e(s[2]),(s[1]?0:1)|(s[3]?0:2))):null;if(c="$"==a.charAt(0),c&&(a=a.substr(1)),/^\d+$/.test(a)){if(l=t(a),l<=1048576)return T(new b(t(a),o?-(1/0):+(1/0),c?0:2))}else if(d=e(a),d<=16383)return T(new b(o?-(1/0):+(1/0),e(a),c?0:1))}function c(e,t,n,i,r,o,a,s){if("sym"==e.type&&"op"==t.type&&":"==t.value&&"sym"==n.type&&"punc"==i.type&&"!"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&"op"==o.type&&":"==o.value&&("sym"==a.type||"rc"==a.type||"num"==a.type&&a.value==a.value|0)&&a.type==r.type&&("punc"!=s.type||"("!=s.value||a.space)){var l=d(r,!0),c=d(a,!1);if(l&&c)return x(7),S(new _(l.setSheet(e.value,!0),c.setSheet(n.value,!0)).setSheet(e.value,!0),e,a)}}function f(e,t,n,i,r,o){var a,s;if("sym"==e.type&&"op"==t.type&&":"==t.value&&"sym"==n.type&&"punc"==i.type&&"!"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&("punc"!=o.type||"("!=o.value||r.space)&&(a=d(r)))return x(5),s=a.clone(),S(new _(a.setSheet(e.value,!0),s.setSheet(n.value,!0)).setSheet(e.value,!0),e,r)}function p(e,t,n,i,r,o){if("sym"==e.type&&"punc"==t.type&&"!"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&"op"==i.type&&":"==i.value&&("sym"==r.type||"rc"==r.type||"num"==r.type&&r.value==r.value|0)&&("punc"!=o.type||"("!=o.value||r.space)){var a=d(n,!0),s=d(r,!1);if(a&&s)return x(5),S(new _(a,s).setSheet(e.value,!0),e,r)}}function m(e,t,n,i){if("sym"==e.type&&"punc"==t.type&&"!"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&("punc"!=i.type||"("!=i.value||n.space)){x(3);var r=d(n);return r&&isFinite(r.row)||(r=new k(n.value)),S(r.setSheet(e.value,!0),e,n)}}function g(e,t,n,i){if(("sym"==e.type||"rc"==e.type||"num"==e.type&&e.value==e.value|0)&&"op"==t.type&&":"==t.value&&("sym"==n.type||"rc"==n.type||"num"==n.type&&n.value==n.value|0)&&("punc"!=i.type||"("!=i.value||n.space)){var r=d(e,!0),o=d(n,!1);if(r&&o)return x(3),S(new _(r,o),e,n)}}function v(e,t){if(("sym"==e.type||"rc"==e.type)&&("punc"!=t.type||"("!=t.value||e.space)){var n=d(e);if(n&&isFinite(n.row)&&isFinite(n.col))return x(1),S(n,e,e)}}function w(e,t){if("sym"==e.type&&"punc"==t.type&&"("==t.value&&!e.space)return e.type="func",x(1),e}var y,x,C,T,S;return n=u(h(n),i),y=n.ahead,x=n.skip,C=null,T=null!=i.row&&null!=i.col?function(e){return 1&e.rel&&(e.col-=i.col),2&e.rel&&(e.row-=i.row),e}:l,S=i.forEditor?function(e,t,n){return e.begin=t.begin,e.end=n.end,e}:l,{peek:o,next:a,croak:n.croak,eof:n.eof,is:r}}function c(e){return" \t\n ​".indexOf(e)>=0}function u(e,t){function n(e){return/[0-9]/i.test(e)}function i(e){return/[a-z$_]/i.test(e)||e.toLowerCase()!=e.toUpperCase()}function r(e){return i(e)||n(e)||"."==e}function o(e){return e in x}function a(e){return"!;(){}[]".indexOf(e)>=0}function s(){var e=!1,t=T(function(t){return"."==t?!e&&(e=!0,!0):n(t)});return{type:"num",value:parseFloat(t)}}function l(t,n){return{type:"sym",value:t,upper:t.toUpperCase(),space:c(e.peek()),quote:n}}function d(e,t,n){var i,r;return e||t||n?!e&&!n||e&&n?(i=e&&/-$/.test(e),r=parseInt(t,10),i&&(r=-r),e||r--,r):void 0:0}function u(){var t,n,i=e.lookingAt(/^R(\[-?)?([0-9]+)?(\])?C(\[-?)?([0-9]+)?(\])?/i);return i&&(t=d(i[1],i[2],i[3]),n=d(i[4],i[5],i[6]),null!=t&&null!=n)?(e.skip(i),{type:"rc",row:t,col:n,rel:(i[4]||!(i[4]||i[5]||i[6])?1:0)|(i[1]||!(i[1]||i[2]||i[3])?2:0)}):l(T(r))}function h(){return e.next(),{type:"str",value:e.readEscaped('"')}}function f(){return e.next(),l(e.readEscaped("'"),!0)}function p(){return{type:"op",value:T(function(e,t){return t+e in x})}}function m(){return{type:"punc",value:e.next()}}function g(){if(e.eof())return null;var r,l=e.peek();return'"'==l?h():"'"==l?f():n(l)||"."==l?s():i(l)?u():o(l)?p():a(l)?m():(r=e.lookingAt(/^#([a-z\/]+)[?!]?/i))?(e.skip(r),{type:"error",value:r[1]}):(t.forEditor||e.croak("Can't handle character: "+l),{type:"error",value:e.next()})}function v(){for(var n,i;y.length<=C;)T(c),n=e.pos(),i=g(),t.forEditor&&i&&(i.begin=n,i.end=e.pos()),y.push(i);return y[C]}function _(){var e=v();return e&&C++,e}function b(e,t){for(var n=C,i=[];e-- >0;)i.push(_()||F);return C=n,t.apply(i,i)}function k(e){C+=e}function w(){return null==v()}var y=[],C=0,T=e.readWhile;return{next:_,peek:v,eof:w,croak:e.croak,ahead:b,skip:k}}function h(e){function t(){return u}function n(){var t=e.charAt(u++);return"\n"==t?(h++,f=0):f++,t}function i(){return e.charAt(u)}function r(){return""===i()}function o(t){throw new C(t+" (input: "+e+")",u)}function a(t){if("string"==typeof t)e.substr(u,t.length)!=t&&o("Expected "+t),s(t.length);else if(t instanceof RegExp){var n=t.exec(e.substr(u));if(n)return s(n[0].length),n}else s(t[0].length)}function s(e){for(;e-- >0;)n()}function l(e){for(var t,i=!1,o="";!r();)if(t=n(),i)o+=t,i=!1;else if("\\"==t)i=!0;else{if(t==e)break;o+=t}return o}function d(e){for(var t="";!r()&&e(i(),t);)t+=n();return t}function c(t){return t.exec(e.substr(u))}var u=0,h=1,f=0;return{next:n,peek:i,eof:r,croak:o,readWhile:d,readEscaped:l,lookingAt:c,skip:a,forward:s,pos:t}}function f(e,t,n){function i(){var i=e.next();return"sym"==i.type?"TRUE"==i.upper?(i.type="bool",i.value=!0):"FALSE"==i.upper&&(i.type="bool",i.value=!1):"ref"==i.type&&(i={type:"ref",ref:null!=t&&null!=n?i.absolute(t,n):i,begin:i.begin,end:i.end}),i}var r,o=[];for(e=d(e,{forEditor:!0,row:t,col:n});!e.eof();)o.push(i());return r=o[0],"op"==r.type&&"="==r.value&&(r.type="startexp"),o}function p(e,t){var n=e+t,i=A[n];return i||(i="^(\\d+(COM\\d{3})*(DOT\\d+)?)",i=i.replace(/DOT/g,"\\"+t).replace(/COM/g,"\\"+e),i=RegExp(i),A[n]=i),i}function m(e,t){for(var n="";t-- >0;)n+=e;return n}var g,v,_,b,k,w,y,x,C,T,S,D,E,F,R,I,A;kendo.support.browser.msie&&kendo.support.browser.version<9||(g=kendo.spreadsheet,v=g.Ref,_=g.RangeRef,b=g.CellRef,k=g.NameRef,w=g.calc,y=w.runtime,x=Object.create(null),C=kendo.Class.extend({init:function(e,t){this.message=e,this.pos=t},toString:function(){return this.message}}),function(e){e.forEach(function(t,n){t.forEach(function(t){x[t]=e.length-n})})}([[":"],[" "],[","],["%"],["^"],["*","/"],["+","-"],["&"],["=","<",">","<=",">=","<>"]]),T={type:"bool",value:!0},S={type:"bool",value:!1},D=function(e){return function(t){var n=e[t];return n||(n=e[t]=Function("'use strict';return("+t+")")()),n}}(Object.create(null)),E=Object.create(null),F={type:"eof"},R=[],I=w.registerFormatParser=function(e){R.push(e)},w.parse=function(e,t,n,r){var o,a,s,l,d;if(r instanceof Date)return{type:"date",value:y.dateToSerial(r)};if("number"==typeof r)return{type:"number",value:r};if("boolean"==typeof r)return{type:"boolean",value:r};if(r+="",/^'/.test(r))return{type:"string",value:r.substr(1)};if(/^[0-9.]+%$/.test(r)&&(o=r.substr(0,r.length-1),a=parseFloat(o),!isNaN(a)&&a==o))return{type:"percent",value:a/100};if(/^=/.test(r))return r=r.substr(1),/\S/.test(r)?i(e,t,n,r):{type:"string",value:"="+r};for(s=0;s<R.length;++s)if(l=R[s](r))return l;return"true"==r.toLowerCase()?{type:"boolean",value:!0}:"false"==r.toLowerCase()?{type:"boolean",value:!1}:(d=y.parseDate(r))?{type:"date",value:y.dateToSerial(d)}:(a=parseFloat(r),!isNaN(a)&&r.length>0&&a==r?{type:"number",value:a}:{type:"string",value:r})},w.parseNameDefinition=r,w.parseFormula=i,w.parseReference=n,w.compile=s,w.InputStream=h,w.ParseError=C,w.tokenize=f,I(function(e){var t,n,i,r,o;return(t=/^(\d+):(\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),{type:"date",format:"hh:mm",value:y.packTime(n,i,0,0)}):(t=/^(\d+):(\d+)(\.\d+)$/.exec(e))?(i=parseInt(t[1],10),r=parseInt(t[2],10),o=1e3*parseFloat(t[3]),{type:"date",format:"mm:ss.00",value:y.packTime(0,i,r,o)}):(t=/^(\d+):(\d+):(\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),r=parseInt(t[3],10),{type:"date",format:"hh:mm:ss",value:y.packTime(n,i,r,0)}):(t=/^(\d+):(\d+):(\d+)(\.\d+)$/.exec(e))?(n=parseInt(t[1],10),i=parseInt(t[2],10),r=parseInt(t[3],10),o=1e3*parseFloat(t[4]),{type:"date",format:"hh:mm:ss.00",value:y.packTime(n,i,r,o)}):void 0}),I(function(e){var t,n,i,r=kendo.culture(),o=r.numberFormat[","],a=r.numberFormat["."],s=r.numberFormat.currency.symbol,l=p(o,a),d=RegExp("^\\s*\\"+s+"\\s*"),c=1,u="",f="",g=!1;if(e=h(e.replace(/^\s+|\s+$/g,"")),e.skip(/^-\s*/)&&(c=-1),(t=e.skip(d))&&(g=!0,u+='"'+t[0]+'"'),e.skip(/^-\s*/)){if(c<0)return null;c=-1}if(!(n=e.skip(l)))return null;if(u+="#",t=e.skip(d)){if(g)return null;g=!0,f='"'+t[0]+'"'}return e.eof()?((n[2]||g)&&(u+=",#"),n[3]&&(u+="."+m("0",n[3].length-1)),i=n[0].replace(RegExp("\\"+o,"g"),"").replace(RegExp("\\"+a,"g"),"."),u+=f,g&&(u+=";-"+u),{type:"number",format:u,value:c*parseFloat(i)}):null}),A={})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/excel-reader.min",["kendo.core.min","kendo.color.min","util/parse-xml.min","spreadsheet/calc.min"],e)}(function(){"use strict";function e(e,t,i){var r=new FileReader;r.onload=function(e){var r=new JSZip(e.target.result);n(r,t,i)},r.readAsArrayBuffer(e)}function t(e){return e=/^\//.test(e)?e.substr(1):"xl/"+e}function n(e,t,n){var r,s=h(e),l=f(e,"_rels/workbook.xml"),d=m(e,l.byType.theme[0]),c=p(e,d),_=[],k=0;u(e,"xl/workbook.xml",{enter:function(n,i){var r,o,d,u;this.is(R)?(r=i["r:id"],o=l.byId[r],d=i.name,u=a(e,o),_.push({workbook:t,zip:e,strings:s,styles:c,file:o,options:{name:d,rows:Math.max(t.options.rows||0,u.rows),columns:Math.max(t.options.columns||0,u.cols),columnWidth:u.columnWidth,rowHeight:u.rowHeight}})):this.is(H)&&i.activeTab&&(k=g(i.activeTab))},text:function(e){var n,i,r,o=this.is(C);!o||v(o["function"])||v(o.vbProcedure)||(n=o.localSheetId,i=null,null!=n&&(i=_[n].options.name),r=o.name,i&&(r="'"+i.replace(/\'/g,"\\'")+"'!"+r),t.defineName(r,e,v(o.hidden)))}}),r=new b.Deferred,r.progress(function(e){n&&n.notify(e)}).then(function(){var e=t.sheets();o(e),t.activeSheet(e[k]),n&&n.resolve()}),i(_,t,r)}function i(e,t,n){var i,o=(new b.Deferred).resolve();for(i=0;i<e.length;i++)!function(i,a){o=o.then(function(){var o,s,l=t.insertSheet(i.options);return l.suspendChanges(!0),o=r(l,i),s={sheet:l,progress:a/(e.length-1)},o.then(function(){n.notify(s)}),o})}(e[i],i);o.then(function(){n.resolve()})}function r(e,t){var n=new b.Deferred;return setTimeout(function(){d(t.zip,t.file,e,t.strings,t.styles),n.resolve()},0),n}function o(e){for(var t=0;t<e.length;t++)e[t].suspendChanges(!1).triggerChange({recalc:!0})}function a(e,n){var i={rows:0,cols:0};return u(e,t(n),{enter:function(e,t){if("dimension"==e){var n=w(t.ref);n.bottomRight&&(i.cols=n.bottomRight.col+1,i.rows=n.bottomRight.row+1)}else"sheetFormatPr"===e?(t.defaultColWidth&&(i.columnWidth=s(parseFloat(t.defaultColWidth))),t.defaultRowHeight&&(i.rowHeight=l(parseFloat(t.defaultRowHeight)))):this.is(E)&&this.exit()}}),i}function s(e){var t=7,n=(256*e+Math.floor(128/t))/256;return Math.floor(n)*t}function l(e){return 1.5625*e}function d(e,n,i,r,o){var a,d,h,p,m,_=i._columns._count,b=null,k=n.replace(/worksheets\//,"worksheets/_rels/"),C=f(e,k);u(e,t(n),{enter:function(e,t){var n,r,u,f,k,T,R,I,A,M;if(this.is(y))h=null,p=null,m=null,a=t.r,null==a&&(a=w(b),a.col++,a=""+a),b=a,d=t.t,n=t.s,null!=n&&c(i,a,o,n);else if(this.is(S))i.range(t.ref).merge();else if(this.is(x)){if(r=g(t.min)-1,u=Math.min(_,g(t.max))-1,t.width&&(f=s(parseFloat(t.width)),0!==f&&i._columns.values.value(r,u,f)),"1"===t.hidden||0===f)for(k=r;k<=u;k++)i.hideColumn(k)}else this.is(E)?(T=g(t.r)-1,t.ht&&(R=l(parseFloat(t.ht)),0!==R&&i._rows.values.value(T,T,R)),"1"!==t.hidden&&0!==R||i.hideRow(T)):this.is(F)?t.activeCell&&(I=w(t.activeCell),i.select(I,!0)):this.is(D)?"frozen"==t.state&&(t.xSplit&&i.frozenColumns(g(t.xSplit)),t.ySplit&&i.frozenRows(g(t.ySplit))):this.is(N)?i.showGridLines(v(t.showGridLines,!0)):this.is(P)&&(A=t["r:id"],M=C.byId[A],M&&i.range(t.ref).link(M))},leave:function(e){if(this.is(y)){if(null!=p)try{i.range(m||a).formula(p)}catch(t){i.range(m||a).value(p).background("#ffaaaa")}else if(null!=h){var n=i.range(a);n._get("formula")||(d&&"n"!=d?"s"==d?h=r[g(h)]:"b"==d?h="1"===h:"d"==d&&(h=kendo.parseDate(h)):h=parseFloat(h),null!=h&&n.value(h))}}else"cols"==e?i._columns._refresh():"sheetData"==e&&i._rows._refresh()},text:function(e){var t;this.is(z)||this.is(I)?h=e:(t=this.is(T))&&(p=e,"shared"==t.t&&(m=t.ref))}})}function c(e,t,n,i){function r(e){var t="string"==typeof e?e:e.formatCode;null==t||/^general$/i.test(t)||(t=t.replace(/^\[\$-[0-9]+\]/,""),u.format(t))}function o(e){"solid"==e.type&&u.background(e.color)}function a(e){u.fontFamily(e.name),u._property("fontSize",e.size),e.bold&&u.bold(!0),e.italic&&u.italic(!0)}function s(e){function t(t,n){var i,r,o=e[t];o&&(i=L[o.style],0!==i&&(r=o.color,null==r&&(r="#000"),u._property(n,{size:i,color:r})))}t("left","borderLeft"),t("top","borderTop"),t("right","borderRight"),t("bottom","borderBottom")}function l(e,t){var n=h[e];if(null!=n&&!n)return!1;if(c=h[t],d&&null==c){if(n=d[e],null!=n&&!n)return!1;c=d[t]}return null!=c}var d,c,u=e.range(t),h=n.inlineStyles[i];h.xfId&&(d=n.namedStyles[h.xfId]),l("applyBorder","borderId")&&s(n.borders[c]),l("applyFont","fontId")&&a(n.fonts[c]),l("applyAlignment","textAlign")&&u.textAlign(c),l("applyAlignment","verticalAlign")&&u.verticalAlign(c),l("applyAlignment","wrapText")&&u._property("wrap",c),l("applyFill","fillId")&&o(n.fills[c]),l("applyNumberFormat","numFmtId")&&r(n.numFmts[c]||B[c])}function u(e,t,n){var i=e.files[t];i&&k(i.asUint8Array(),n)}function h(e){var t=[],n=null;return u(e,"xl/sharedStrings.xml",{leave:function(){this.is(M)&&(t.push(n),n=null)},text:function(e){this.is(A)&&(null==n&&(n=""),n+=e)}}),t}function f(e,n){var i={byId:{},byType:{theme:[]}};return u(e,t(n)+".rels",{enter:function(e,t){var n,r;"Relationship"==e&&(i.byId[t.Id]=t.Target,n=t.Type.match(/\w+$/)[0],r=i.byType[n]||[],r.push(t.Target),i.byType[n]=r)}}),i}function p(e,t){function n(e){function t(t){null!=e[t]&&(n[t]=v(e[t]))}var n={borderId:g(e.borderId),fillId:g(e.fillId),fontId:g(e.fontId),numFmtId:g(e.numFmtId),pivotButton:v(e.pivotButton),quotePrefix:v(e.quotePrefix),xfId:g(e.xfId)};return t("applyAlignment"),t("applyBorder"),t("applyFill"),t("applyFont"),t("applyNumberFormat"),t("applyProtection"),n}function i(e){var n,i,r;return e.rgb?_(e.rgb):e.indexed?$[g(e.indexed)]:e.theme?(n=t.colorScheme[g(e.theme)])?(i=kendo.parseColor(n),e.tint&&(i=i.toHSL(),r=parseFloat(e.tint),i.l=r<0?i.l*(1+r):i.l*(1-r)+(100-100*(1-r))),i.toCssRgba()):$[0]:void 0}var r={fonts:[],numFmts:{},fills:[],borders:[],namedStyles:[],inlineStyles:[]},o=null,a=null,s=null,l=null;return u(e,"xl/styles.xml",{enter:function(e,t,d){if(this.is(j))r.numFmts[t.numFmtId]=t;else if(this.is(W))r.fonts.push(o={});else if(o)"sz"==e?o.size=parseFloat(t.val):"name"==e?o.name=t.val:"b"==e?o.bold=v(t.val,!0):"i"==e&&(o.italic=v(t.val,!0));else if(this.is(V))r.fills.push(a={});else if(a)"patternFill"==e?a.type=t.patternType:"fgColor"==e&&"solid"===a.type?a.color=i(t):"bgColor"==e&&"solid"!==a.type&&(a.color=i(t));else if(this.is(O))r.borders.push(s={});else if(s){if(/^(?:left|top|right|bottom)$/.test(e)&&t.style&&(s[e]={style:t.style}),"color"==e){var c=this.stack[this.stack.length-2].$tag;s[c].color=i(t)}}else this.is(q)?(l=n(t),r.namedStyles.push(l),d&&(l=null)):this.is(U)?(l=n(t),r.inlineStyles.push(l),d&&(l=null)):l&&"alignment"==e&&(/^(?:left|center|right|justify)$/.test(t.horizontal)&&(l.textAlign=t.horizontal),/^(?:top|center|bottom)$/.test(t.vertical)&&(l.verticalAlign=t.vertical),null!=t.wrapText&&(l.wrapText=v(t.wrapText)))},leave:function(e){this.is(W)?o=null:this.is(V)?a=null:this.is(O)?s=null:"xf"==e&&(l=null)}}),r}function m(e,n){function i(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}var r=[],o={colorScheme:r},a=t(n);return e.files[a]&&(u(e,a,{enter:function(e,t){this.is(Y)?r.push(_("window"==t.val?"FFFFFFFF":"FF000000")):this.is(G)&&r.push(_("FF"+t.val))}}),r.length>3&&(i(r,0,1),i(r,2,3))),o}function g(e){return null==e?null:parseInt(e,10)}function v(e,t){return null==e?t:"true"==e||e===!0||1==e}function _(e){var t=/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);return"rgba("+parseInt(t[2],16)+", "+parseInt(t[3],16)+", "+parseInt(t[4],16)+", "+parseInt(t[1],16)/255+")"}var b,k,w,y,x,C,T,S,D,E,F,R,I,A,M,z,H,N,P,L,B,O,V,W,U,q,j,$,G,Y;kendo.support.browser.msie&&kendo.support.browser.version<9||(b=kendo.jQuery,k=kendo.util.parseXML,w=kendo.spreadsheet.calc.parseReference,y=["sheetData","row","c"],x=["cols","col"],C=["definedNames","definedName"],T=["sheetData","row","c","f"],S=["mergeCells","mergeCell"],D=["sheetViews","sheetView","pane"],E=["sheetData","row"],F=["sheetViews","sheetView","selection"],R=["sheets","sheet"],I=["sheetData","row","c","is"],A=["t"],M=["si"],z=["sheetData","row","c","v"],H=["bookViews","workbookView"],N=["sheetViews","sheetView"],P=["hyperlinks","hyperlink"],L={none:0,thin:1,medium:2,dashed:1,dotted:1,thick:3,"double":3,hair:1,mediumDashed:2,dashDot:1,mediumDashDot:2,dashDotDot:1,mediumDashDotDot:2,slantDashDot:1},B={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"mm-dd-yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"},O=["borders","border"],V=["fills","fill"],W=["fonts","font"],U=["cellXfs","xf"],q=["cellStyleXfs","xf"],j=["numFmts","numFmt"],$=[_("FF000000"),_("FFFFFFFF"),_("FFFF0000"),_("FF00FF00"),_("FF0000FF"),_("FFFFFF00"),_("FFFF00FF"),_("FF00FFFF"),_("FF000000"),_("FFFFFFFF"),_("FFFF0000"),_("FF00FF00"),_("FF0000FF"),_("FFFFFF00"),_("FFFF00FF"),_("FF00FFFF"),_("FF800000"),_("FF008000"),_("FF000080"),_("FF808000"),_("FF800080"),_("FF008080"),_("FFC0C0C0"),_("FF808080"),_("FF9999FF"),_("FF993366"),_("FFFFFFCC"),_("FFCCFFFF"),_("FF660066"),_("FFFF8080"),_("FF0066CC"),_("FFCCCCFF"),_("FF000080"),_("FFFF00FF"),_("FFFFFF00"),_("FF00FFFF"),_("FF800080"),_("FF800000"),_("FF008080"),_("FF0000FF"),_("FF00CCFF"),_("FFCCFFFF"),_("FFCCFFCC"),_("FFFFFF99"),_("FF99CCFF"),_("FFFF99CC"),_("FFCC99FF"),_("FFFFCC99"),_("FF3366FF"),_("FF33CCCC"),_("FF99CC00"),_("FFFFCC00"),_("FFFF9900"),_("FFFF6600"),_("FF666699"),_("FF969696"),_("FF003366"),_("FF339966"),_("FF003300"),_("FF333300"),_("FF993300"),_("FF993366"),_("FF333399"),_("FF333333"),_("FF000000"),_("FFFFFFFF")],
G=["a:clrScheme","*","a:srgbClr"],Y=["a:clrScheme","*","a:sysClr"],kendo.spreadsheet.readExcel=e,kendo.spreadsheet._readSheet=d,kendo.spreadsheet._readStrings=h,kendo.spreadsheet._readStyles=p,kendo.spreadsheet._readTheme=m,kendo.spreadsheet._readWorkbook=n)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/workbook.min",["kendo.core.min","spreadsheet/runtime.min","spreadsheet/references.min","spreadsheet/excel-reader.min"],e)}(function(){!function(e){function t(e,t){function n(e,t,n){return void 0!==e?e:void 0!==t?t:n}var i,r,o,a,s,l,d=n(e.rowCount,t.rows,200),c=n(e.columnCount,t.columns,50),u=n(e.rowHeight,t.rowHeight,20),h=n(e.columnWidth,t.columnWidth,64),f=n(e.headerHeight,t.headerHeight,20),p=n(e.headerWidth,t.headerWidth,32);if(void 0!==e.rows)for(i=0;i<e.rows.length;++i)if(r=e.rows[i],o=n(r.index,i),o>=d&&(d=o+1),r.cells)for(a=0;a<r.cells.length;++a)s=r.cells[a],l=n(s.index,a),l>=c&&(c=l+1);return{rowCount:d,columnCount:c,rowHeight:u,columnWidth:h,headerHeight:f,headerWidth:p}}var n,i,r,o,a;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=e.spreadsheet.calc.runtime.Formula,r=e.spreadsheet.Ref,o=e.spreadsheet.CalcError,a=e.Observable.extend({init:function(t,n){e.Observable.fn.init.call(this),this.options=t,this._view=n,this._sheets=[],this._sheetsSearchCache={},this._sheet=this.insertSheet({rows:this.options.rows,columns:this.options.columns,rowHeight:this.options.rowHeight,columnWidth:this.options.columnWidth,headerHeight:this.options.headerHeight,headerWidth:this.options.headerWidth,dataSource:this.options.dataSource}),this.undoRedoStack=new e.util.UndoRedoStack,this.undoRedoStack.bind(["undo","redo"],this._onUndoRedo.bind(this)),this._context=new e.spreadsheet.FormulaContext(this),this._validationContext=new e.spreadsheet.ValidationFormulaContext(this),this._names=Object.create(null),this.fromJSON(this.options)},clipboard:function(){return this._clipboard||(this._clipboard=new e.spreadsheet.Clipboard(this)),this._clipboard},destroy:function(){this.unbind(),this._clipboard&&this._clipboard.destroy()},events:["change","excelImport","excelExport"],_sheetChange:function(e){this.trigger("change",e)},_sheetCommandRequest:function(e){this.trigger("commandRequest",e)},_inputForRef:function(t){return new e.spreadsheet.Range(t,this._sheet).input()},_onUndoRedo:function(e){e.command.range().select()},execute:function(t){var i,r=n.extend({workbook:this},t.options),o=new e.spreadsheet[t.command](r),a=this.activeSheet();return r.origin&&o.origin(r.origin),o.range(r.operatingRange?r.operatingRange:r.editActiveCell?a.activeCellSelection():a.selection()),i=o.exec(),i&&"error"===i.reason||(o.cannotUndo?this.undoRedoStack.clear():this.undoRedoStack.push(o)),i},resetFormulas:function(){this._sheets.forEach(function(e){e.resetFormulas()})},resetValidations:function(){this._sheets.forEach(function(e){e.resetValidations()})},refresh:function(e){e.recalc&&(this.resetFormulas(),this.resetValidations(),this._sheet.recalc(this._context),this._sheet.revalidate(this._validationContext))},activeSheet:function(t){return void 0===t?this._sheet:void(this.sheetByName(t.name())&&(this._sheet=t,t.triggerChange(e.spreadsheet.ALL_REASONS)))},moveSheetToIndex:function(e,t){var n=this.sheetIndex(e),i=this._sheets;n!==-1&&(this._sheetsSearchCache={},i.splice(t,0,i.splice(n,1)[0]),this.trigger("change",{sheetSelection:!0}))},insertSheet:function(t){var n,i,r,o,a,s;if(t=t||{},n=this,i="number"==typeof t.index?t.index:n._sheets.length,o=n._sheets,a=function(e){e=e?e:1;var t="Sheet"+e;return n.sheetByName(t)?a(e+1):t},!t.name||!n.sheetByName(t.name))return this._sheetsSearchCache={},r=t.name||a(),s=new e.spreadsheet.Sheet(t.rows||this.options.rows,t.columns||this.options.columns,t.rowHeight||this.options.rowHeight,t.columnWidth||this.options.columnWidth,t.headerHeight||this.options.headerHeight,t.headerWidth||this.options.headerWidth),s._workbook=this,s._name(r),s.bind("change",this._sheetChange.bind(this)),s.bind("commandRequest",this._sheetCommandRequest.bind(this)),o.splice(i,0,s),t.data&&s.fromJSON(t.data),t.dataSource&&s.setDataSource(t.dataSource),this.trigger("change",{sheetSelection:!0}),s},sheets:function(){return this._sheets.slice()},sheetByName:function(e){return this._sheets[this.sheetIndex(e)]},sheetByIndex:function(e){return this._sheets[e]},sheetIndex:function(e){var t,n=this._sheets,i=("string"==typeof e?e:e.name()).toLowerCase(),r=this._sheetsSearchCache[i];if(r>=0)return r;for(r=0;r<n.length;r++)if(t=n[r].name().toLowerCase(),this._sheetsSearchCache[t]=r,t===i)return r;return-1},renameSheet:function(e,t){var n=e.name().toLowerCase();if(t&&n!==t.toLowerCase()&&!this.sheetByName(t)&&(e=this.sheetByName(n)))return this._sheetsSearchCache={},this._sheets.forEach(function(e){e._forFormulas(function(e){e.renameSheet(n,t)})}),this.forEachName(function(e,o){e.nameref.renameSheet(n,t)&&(this.undefineName(o),e.name=e.nameref.print(),this.nameDefinition(e.name,e)),(e.value instanceof r||e.value instanceof i)&&e.value.renameSheet(n,t)}.bind(this)),e._name(t),this.trigger("change",{sheetSelection:!0}),e},removeSheet:function(e){var t,n=this,i=n._sheets,r=e.name(),o=n.sheetIndex(e);1!==i.length&&(this._sheetsSearchCache={},o>-1&&(e.unbind(),i.splice(o,1),n.activeSheet().name()===r?(t=i[o===i.length?o-1:o],n.activeSheet(t)):this.trigger("change",{recalc:!0,sheetSelection:!0})))},_clearSheets:function(){for(var e=0;e<this._sheets.length;e++)this._sheets[e].unbind();this._sheets=[],this._sheetsSearchCache={},this._names={}},fromJSON:function(e){var n,i,r,o;if(e.sheets)for(this._clearSheets(),n=0;n<e.sheets.length;n++)i=e.sheets[n],r=t(i,this.options),o=this.insertSheet({rows:r.rowCount,columns:r.columnCount,rowHeight:r.rowHeight,columnWidth:r.columnWidth,headerHeight:r.headerHeight,headerWidth:r.headerWidth,data:i}),i.dataSource&&o.setDataSource(i.dataSource);this.activeSheet(e.activeSheet?this.sheetByName(e.activeSheet):this._sheets[0]),e.names&&e.names.forEach(function(e){this.defineName(e.name,e.value,e.hidden)},this)},toJSON:function(){this.resetFormulas(),this.resetValidations();var e=Object.keys(this._names).map(function(e){var t=this._names[e],n=t.value;return n instanceof r||n instanceof i?n=n.print(0,0,!0):n instanceof o?n+="":n=JSON.stringify(n),{value:n,hidden:t.hidden,name:t.name,sheet:t.nameref.sheet,localName:t.nameref.name}},this);return{activeSheet:this.activeSheet().name(),sheets:this._sheets.map(function(e){return e.recalc(this._context),e.revalidate(this._validationContext),e.toJSON()},this),names:e}},fromFile:function(t){var i=new n.Deferred,r=i.promise(),o={file:t,promise:r};return t&&!this.trigger("excelImport",o)?(this._clearSheets(),e.spreadsheet.readExcel(t,this,i)):i.reject(),r},saveAsExcel:function(t){var i,r;t=n.extend({},this.options.excel,t),i=this.toJSON(),this.trigger("excelExport",{workbook:i})||(r=new e.ooxml.Workbook(i),e.saveAs({dataURI:r.toDataURL(),fileName:i.fileName||t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy}))},draw:function(t,n){"function"!=typeof t||n||(n=t,t={});var i=[],r=this._sheets;!function o(a){if(a<r.length)r[a].draw(e.spreadsheet.SHEETREF,t,function(e){i.push(e),o(a+1)});else{var s=i[0];for(a=1;a<i.length;++a)s.children=s.children.concat(i[a].children);n(s)}}(0)},nameForRef:function(e,t){var n,i,o,a;void 0===t&&(t=e.sheet),t=t.toLowerCase(),n=e+"";for(i in this._names)if(o=this._names[i],a=o.value,a instanceof r&&(!a.sheet||a.sheet&&t==a.sheet.toLowerCase())&&a+""==n)return o;return{name:n}},defineName:function(t,n,i){var r=e.spreadsheet.calc.parseNameDefinition(t,n);t=r.name.print(),this._names[t.toLowerCase()]={value:r.value,hidden:i,name:t,nameref:r.name}},undefineName:function(e){delete this._names[e.toLowerCase()]},nameValue:function(e){return e=e.toLowerCase(),e in this._names?this._names[e].value:null},nameDefinition:function(e,t){return e=e.toLowerCase(),arguments.length>1&&(void 0===t?delete this._names[e]:this._names[e]=t),this._names[e]},forEachName:function(e){Object.keys(this._names).forEach(function(t){e(this._names[t],t)},this)},adjustNames:function(e,t,n,o){e=e.toLowerCase(),Object.keys(this._names).forEach(function(a){var s=this._names[a],l=s.value;l instanceof r&&l.sheet.toLowerCase()==e?s.value=l.adjust(null,null,null,null,t,n,o):l instanceof i&&l.adjust(e,t?"row":"col",n,o)},this)},options:{}}),e.spreadsheet.Workbook=a,e.PDFMixin&&(e.PDFMixin.extend(a.prototype),a.prototype.saveAsPDF=function(t){var i=new n.Deferred,r=i.promise(),o={promise:r};if(!this.trigger("pdfExport",o))return this._drawPDF(t,i).then(function(t){return e.drawing.exportPDF(t)}).done(function(n){e.saveAs({dataURI:n,fileName:t.fileName,proxyURL:t.proxyURL,forceProxy:t.forceProxy,proxyTarget:t.proxyTarget}),i.resolve()}).fail(function(e){i.reject(e)}),r},a.prototype._drawPDF=function(e){var t=new n.Deferred,i=function(e){t.resolve(e)};switch(e.area){case"workbook":e.workbook.draw(e,i);break;case"sheet":e.workbook.activeSheet().draw(e,i);break;case"selection":e.workbook.activeSheet().selection().draw(e,i)}return t.promise()}))}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/formulacontext.min",["kendo.core.min"],e)}(function(){var e,t,n,i,r,o,a,s;kendo.support.browser.msie&&kendo.support.browser.version<9||(e=kendo.spreadsheet,t=e.CellRef,n=e.RangeRef,i=e.UnionRef,r=e.NameRef,o=e.Ref,a=kendo.Class.extend({init:function(e){this.workbook=e},getRefCells:function(e,a,s,l,d){var c,u,h,f,p,m,g,v,_,b,k,w,y,x,C,T,S;if(e instanceof t)return c=this.workbook.sheetByName(e.sheet),c&&e.valid()?(u=c.formula(e),h=c.range(e.row,e.col).value(),null!=u||null!=h?[{formula:u,value:h,row:e.row,col:e.col,sheet:e.sheet,hidden:!!a&&(0===c.columnWidth(e.col)||0===c.rowHeight(e.row))}]:[]):[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];if(e instanceof n){if(f=this.workbook.sheetIndex(e.sheet),p=[],m=f,e.endSheet&&(m=this.workbook.sheetIndex(e.endSheet),f>m&&(g=f,f=m,m=g)),f<0||m<0||!e.valid())return[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];for(;f<=m;)for(c=this.workbook.sheetByIndex(f++),v=c._grid.normalize(e.topLeft),_=c._grid.normalize(e.bottomRight),b=c._grid.cellRefIndex(v),k=c._grid.cellRefIndex(_),w=c._properties.iterator("value",b,k),y=v.col;y<=_.col;++y)for(x=v.row;x<=_.row;++x)C=c._grid.index(x,y),u=c._properties.get("formula",C),h=w.at(C),null==u&&null==h||p.push({formula:u,value:h,row:x,col:y,sheet:c.name(),hidden:!!a&&(0===c.columnWidth(y)||0===c.rowHeight(x))});return p}if(e instanceof i){for(T=[],f=0;f<e.refs.length;++f)T=T.concat(this.getRefCells(e.refs[f],a,s,l,d));return T}return e instanceof r?(S=this.nameValue(e,s,l,d),S instanceof o?this.getRefCells(S,a,s,l,d):[{value:null==S?new kendo.spreadsheet.calc.runtime.CalcError("NAME"):S}]):[]},nameValue:function(e,t,n,i){var r;return e.hasSheet()?r=this.workbook.nameValue(e.print()):(e=e.clone().setSheet(t,!0),r=this.workbook.nameValue(e.print()),null==r&&(r=this.workbook.nameValue(e.name))),r instanceof o&&(r=r.absolute(n,i)),r},getData:function(e,n,i,o){var a,s=e instanceof t;return e instanceof r&&(s=this.workbook.nameValue(e.name)instanceof t),a=this.getRefCells(e,!1,n,i,o).map(function(e){var t=e.value;return t instanceof kendo.spreadsheet.calc.runtime.Formula&&(t=t.value),t}),s?a[0]:a},onFormula:function(e){var t=this.workbook.sheetByName(e.sheet),n=e.row,i=e.col,r=e.value,a=t.formula({row:n,col:i});return a===e&&(r instanceof o&&(r=this.getData(r,e.sheet,n,i),Array.isArray(r)&&(r=r[0]),void 0===r&&(r=null)),r instanceof kendo.spreadsheet.calc.runtime.Matrix?r.each(function(e,r,o){t._value(n+r,i+o,e)}):t._value(n,i,r),clearTimeout(t._formulaContextRefresh),t._formulaContextRefresh=setTimeout(function(){t.batch(function(){},{layout:!0})},50),!0)}}),s=a.extend({onFormula:function(){return!0}}),e.FormulaContext=a,e.ValidationFormulaContext=s)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/controller.min",["kendo.core.min"],e)}(function(){!function(e){"use strict";function t(e){return e.map(function(e){return'[data-action="'+e+'"]'}).join(",")}var n,i,r,o,a,s,l,d,c,u,h,f,p,m,g,v,_;if(!(e.support.browser.msie&&e.support.browser.version<9)){n=e.jQuery,i=/:alphanum$/,r={up:"up",down:"down",left:"left",right:"right",home:"first-col","ctrl+left":"first-col",end:"last-col","ctrl+right":"last-col","ctrl+up":"first-row","ctrl+down":"last-row","ctrl+home":"first","ctrl+end":"last",pageup:"prev-page",pagedown:"next-page"},o={tab:"next","shift+tab":"previous",enter:"lower","shift+enter":"upper","delete":"clearContents",backspace:"clearContents","shift+:alphanum":"edit",":alphanum":"edit","ctrl+:alphanum":"ctrl","alt+ctrl+:alphanum":"edit",":edit":"edit"},a={wheel:"onWheel","*+mousedown":"onMouseDown",contextmenu:"onContextMenu","*+mousedrag":"onMouseDrag","*+mouseup":"onMouseUp","*+dblclick":"onDblClick",mousemove:"onMouseMove"},s={"*+pageup":"onPageUp","*+pagedown":"onPageDown",mouseup:"onMouseUp","*+cut":"onCut","*+paste":"onPaste","*+copy":"onCopy"},l={esc:"onEditorEsc",enter:"onEditorBlur","alt+enter":"insertNewline","shift+enter":"onEditorBlur",tab:"onEditorBlur","shift+tab":"onEditorBlur"},d=n.extend({focus:"onEditorBarFocus"},l),c=n.extend({focus:"onEditorCellFocus"},l),u={cell:"range",rowheader:"row",columnheader:"column",topcorner:"sheet",autofill:"autofill"},h=t(["cut","copy","paste","insert-left","insert-right","insert-above","insert-below"]),f=t(["unhide-row","unhide-column"]),p=[],m=[],g=[];for(v in r)p.push(v),m.push("shift+"+v);for(v in o)g.push(v);s[p]="onAction",s[m]="onShiftAction",s[g]="onEntryAction",c[p]="onEditorAction",c[m]="onEditorShiftAction",_=e.Class.extend({init:function(t,i){this.view=t,this.workbook(i),this.container=n(t.container),this.clipboardElement=n(t.clipboard),this.cellContextMenu=t.cellContextMenu,this.rowHeaderContextMenu=t.rowHeaderContextMenu,this.colHeaderContextMenu=t.colHeaderContextMenu,this.scroller=t.scroller,this.tabstrip=t.tabstrip,this.sheetsbar=t.sheetsbar,t.nameEditor.bind("enter",this.onNameEditorEnter.bind(this)),t.nameEditor.bind("cancel",this.onNameEditorCancel.bind(this)),t.nameEditor.bind("select",this.onNameEditorSelect.bind(this)),t.nameEditor.bind("delete",this.onNameEditorDelete.bind(this)),this.editor=t.editor,this.editor.bind("change",this.onEditorChange.bind(this)),this.editor.bind("activate",this.onEditorActivate.bind(this)),this.editor.bind("deactivate",this.onEditorDeactivate.bind(this)),this.editor.bind("update",this.onEditorUpdate.bind(this)),n(t.scroller).on("scroll",this.onScroll.bind(this)),this.listener=new e.spreadsheet.EventListener(this.container,this,a),this._enableEditorEvents(),this.sheetsbar&&(this.sheetsbar.bind("select",this.onSheetBarSelect.bind(this)),this.sheetsbar.bind("reorder",this.onSheetBarReorder.bind(this)),this.sheetsbar.bind("rename",this.onSheetBarRename.bind(this)),this.sheetsbar.bind("remove",this.onSheetBarRemove.bind(this))),this.cellContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.rowHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.colHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.cellContextMenu.element.add(this.rowHeaderContextMenu.element).add(this.colHeaderContextMenu.element).on("contextmenu",!1),this.tabstrip&&(this.tabstrip.bind("action",this.onCommandRequest.bind(this)),this.tabstrip.bind("dialog",this.onDialogRequest.bind(this)))},_enableEditorEvents:function(t){void 0===t||t?(this.keyListener=new e.spreadsheet.EventListener(this.clipboardElement,this,s),this.barKeyListener=new e.spreadsheet.EventListener(this.editor.barElement(),this,d),this.inputKeyListener=new e.spreadsheet.EventListener(this.editor.cellElement(),this,c)):(this.keyListener.destroy(),this.barKeyListener.destroy(),this.inputKeyListener.destroy())},_execute:function(e){var t,n=this._workbook.execute(e);return"EditCommand"!==e.command||n||this._workbook.trigger("change",{editorClose:!0}),n&&(this.view.editor.isActive()&&(this.enableEditor(!1),t=this.enableEditor.bind(this,!0,!0)),"error"===n.reason?(this._lastCommandRequest=null,this.view.showError(n,t)):this.view.openDialog(n.reason,{close:t})),n},_activeTooltip:function(){return""+this._workbook.activeSheet().activeCell().simplify()},onContextMenuSelect:function(e){var t,i=n(e.item).data("action");switch(i){case"cut":t={command:"ToolbarCutCommand",options:{workbook:this._workbook}};break;case"copy":t={command:"ToolbarCopyCommand",options:{workbook:this._workbook}};break;case"paste":t={command:"ToolbarPasteCommand",options:{workbook:this._workbook}};break;case"unmerge":t={command:"MergeCellCommand",options:{value:"unmerge"}};break;case"merge":this.view.openDialog("merge");break;case"hide-row":t={command:"HideLineCommand",options:{axis:"row"}};break;case"hide-column":t={command:"HideLineCommand",options:{axis:"column"}};break;case"unhide-row":t={command:"UnHideLineCommand",options:{axis:"row"}};break;case"unhide-column":t={command:"UnHideLineCommand",options:{axis:"column"}};break;case"delete-row":t={command:"DeleteRowCommand"};break;case"delete-column":t={command:"DeleteColumnCommand"}}t&&this._execute(t)},onSheetBarRemove:function(e){var t=this._workbook.sheetByName(e.name);t&&this._workbook.removeSheet(t)},destroy:function(){this.listener.destroy(),this._enableEditorEvents(!1),this.keyListener.destroy(),this.inputKeyListener.destroy()},onSheetBarSelect:function(e){var t,n=this._workbook;t=e.isAddButton?n.insertSheet():n.sheetByName(e.name),n.activeSheet().name()!==t.name()&&n.activeSheet(t)},onSheetBarReorder:function(e){var t=this._workbook.sheetByIndex(e.oldIndex);this._workbook.moveSheetToIndex(t,e.newIndex),this._workbook.activeSheet(t)},onSheetBarRename:function(e){var t=this._workbook.sheetByIndex(e.sheetIndex);return this._workbook.sheetByName(e.name)?void this.view.showError({reason:"error",type:"duplicateSheetName"}):(this._workbook.renameSheet(t,e.name),void this.clipboardElement.focus())},sheet:function(e){this.navigator=e.navigator(),this.axisManager=e.axisManager()},workbook:function(e){this._workbook=e,this.clipboard=e.clipboard(),e.bind("commandRequest",this.onCommandRequest.bind(this))},refresh:function(){var e,t,n=this.editor,i=this._workbook,r=i.activeSheet();this._viewPortHeight=this.view.scroller.clientHeight,this.navigator.height(this._viewPortHeight),n.isActive()||this.isEditorDisabled||(n.enable(r.selection().enable()!==!1),n.value(i._inputForRef(r.activeCell()))),e=r.selection()._ref.simplify(),t=this._workbook.nameForRef(e,r.name()),this.view.nameEditor.value(t.name)},onScroll:function(){this.view.render()},onWheel:function(e){var t=e.originalEvent.deltaX,n=e.originalEvent.deltaY;1===e.originalEvent.deltaMode&&(t*=10,n*=10),this.scrollWith(t,n),e.preventDefault()},onAction:function(e,t){this.navigator.moveActiveCell(r[t]),e.preventDefault()},onPageUp:function(){this.scrollDown(-this._viewPortHeight)},onPageDown:function(){this.scrollDown(this._viewPortHeight)},onEntryAction:function(e,t){var n,r,a;if(e.mod){switch(n=!0,r=String.fromCharCode(e.keyCode)){case"A":this.navigator.selectAll();break;case"Y":this._workbook.undoRedoStack.redo();break;case"Z":this._workbook.undoRedoStack.undo();break;default:n=!1}n&&e.preventDefault()}else if(a=this._workbook.activeSheet().selection().enable()===!1,"delete"==t||"backspace"==t)a||this._execute({command:"ClearContentCommand"}),e.preventDefault();else if(i.test(t)||":edit"===t){if(a)return void e.preventDefault();":edit"!==t&&this.editor.value(""),this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus()}else this.navigator.navigateInSelection(o[t]),e.preventDefault()},onShiftAction:function(e,t){this.navigator.modifySelection(r[t.replace("shift+","")],this.appendSelection),e.preventDefault()},onMouseMove:function(e){var t,n=this._workbook.activeSheet();n.resizingInProgress()||n.selectionInProgress()||(t=this.objectAt(e),"columnresizehandle"===t.type||"rowresizehandle"===t.type?n.positionResizeHandle(t.ref):n.removeResizeHandle())},onMouseDown:function(e){var t,n=this.objectAt(e);return n.pane&&(this.originFrame=n.pane),"editor"===n.type?(this.onEditorEsc(),this.openCustomEditor(),void e.preventDefault()):this.editor.canInsertRef(!1)&&n.ref?(this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs()),this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection,e.shiftKey),void e.preventDefault()):(this.editor.deactivate(),this.editor.isActive()?void e.preventDefault():(t=this._workbook.activeSheet(),"columnresizehandle"===n.type||"rowresizehandle"===n.type?(t.startResizing({x:n.x,y:n.y}),void e.preventDefault()):"filtericon"===n.type?(this.openFilterMenu(e),void e.preventDefault()):(this._selectionMode=u[n.type],this.appendSelection=e.mod,void this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection,e.shiftKey))))},onContextMenu:function(t){var n,i,r,o,a,s,l=this._workbook.activeSheet();l.resizingInProgress()||(t.preventDefault(),this.cellContextMenu.close(),this.colHeaderContextMenu.close(),this.rowHeaderContextMenu.close(),i={pageX:t.pageX,pageY:t.pageY},r=this.objectAt(i),"columnresizehandle"!==r.type&&"rowresizehandle"!==r.type&&(this.navigator.selectForContextMenu(r.ref,u[r.type]),o=this.navigator._sheet.select()instanceof e.spreadsheet.UnionRef,a=!1,s=!1,"columnheader"==r.type?(n=this.colHeaderContextMenu,a=!o&&this.axisManager.selectionIncludesHiddenColumns()):"rowheader"==r.type?(n=this.rowHeaderContextMenu,a=!o&&this.axisManager.selectionIncludesHiddenRows()):(n=this.cellContextMenu,s=this.navigator.selectionIncludesMergedCells()),n.element.find(h).toggle(!o),n.element.find(f).toggle(a),n.element.find("[data-action=unmerge]").toggle(s),setTimeout(function(){n.open(t.pageX,t.pageY)})))},prevent:function(e){e.preventDefault()},constrainResize:function(e,t){var n=this._workbook.activeSheet(),i=n.resizeHandlePosition();return!i||"outside"===e||"topcorner"===e||t.col<i.col||t.row<i.row},onMouseDrag:function(e){var t,n,i,r;if("sheet"!==this._selectionMode){if(t={pageX:e.pageX,pageY:e.pageY},n=this.objectAt(t),i=this._workbook.activeSheet(),i.resizingInProgress())return void(this.constrainResize(n.type,n.ref)||i.resizeHintPosition({x:n.x,y:n.y}));if("outside"===n.type)return void this.startAutoScroll(n);this.originFrame===n.pane?this.selectToLocation(t):(r=this.originFrame._grid,n.x>r.right&&this.scrollLeft(),n.y>r.bottom&&this.scrollTop(),n.y<r.top||n.x<r.left?this.startAutoScroll(n,t):this.selectToLocation(t)),e.preventDefault()}},onMouseUp:function(e){var t,n,i,r=this._workbook.activeSheet();if(r.completeResizing(),this.navigator.completeSelection(),this.stopAutoScroll(),t=this.editor.activeEditor()){for(n=e.target;n;){if(n===t.element[0])return;n=n.parentNode}i=this.objectAt(e),i&&i.ref&&t.canInsertRef(!1)&&(t.refAtPoint(r.selection()._ref),r._setFormulaSelections(t.highlightedRefs()))}},onDblClick:function(e){var t=this.objectAt(e),n=this._workbook.activeSheet().selection().enable()===!1;"cell"!==t.type||n||(this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus(),this.onEditorUpdate())},onCut:function(e){if(e){var t=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach();this.clipboardElement.append(t.clone(!1)),setTimeout(function(){this.clipboardElement.empty().append(t)}.bind(this))}this._execute({command:"CutCommand",options:{workbook:this.view._workbook}})},clipBoardValue:function(){return this.clipboardElement.html()},onPaste:function(t){var n,i,r,o="",a="";if(this.clipboard.menuInvoked=void 0===t,t){if(!t.originalEvent.clipboardData||!t.originalEvent.clipboardData.getData)return r=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach(),this.clipboardElement.empty(),void setTimeout(function(){var e=this.clipboardElement.html(),t=window.clipboardData.getData("Text").trim();(e||t)&&(this.clipboard.external({html:e,plain:t}),this.clipboardElement.empty().append(r),this._execute({command:"PasteCommand",options:{workbook:this.view._workbook}}),this.clipboard.menuInvoked=!0)}.bind(this));t.preventDefault(),n=!1,i=!1,window.DOMStringList&&t.originalEvent.clipboardData.types instanceof window.DOMStringList?(n=t.originalEvent.clipboardData.types.contains("text/html"),i=t.originalEvent.clipboardData.types.contains("text/plain")):(n=/text\/html/.test(t.originalEvent.clipboardData.types),i=/text\/plain/.test(t.originalEvent.clipboardData.types)),n&&(o=t.originalEvent.clipboardData.getData("text/html")),i&&(a=t.originalEvent.clipboardData.getData("text/plain").trim())}else{if(e.support.browser.msie)return this.clipboardElement.focus().select(),void document.execCommand("paste");this.clipboard.menuInvoked=!0}(o||a)&&(this.clipboard.external({html:o,plain:a}),this._execute({command:"PasteCommand",options:{workbook:this.view._workbook}}))},onCopy:function(e){this.clipboard.menuInvoked=void 0===e,this._execute({command:"CopyCommand",options:{workbook:this.view._workbook}})},scrollTop:function(){this.scroller.scrollTop=0},scrollLeft:function(){this.scroller.scrollLeft=0},scrollDown:function(e){this.scroller.scrollTop+=e},scrollRight:function(e){this.scroller.scrollLeft+=e},scrollWith:function(e,t){this.scroller.scrollTop+=t,this.scroller.scrollLeft+=e},objectAt:function(e){var t=this.container.offset(),n={left:e.pageX-t.left,top:e.pageY-t.top};return this.view.objectAt(n.left,n.top)},selectToLocation:function(e){var t=this.objectAt(e);t.pane&&(this.extendSelection(t),this.lastKnownCellLocation=e,this.originFrame=t.pane),this.stopAutoScroll()},extendSelection:function(e){this.navigator.extendSelection(e.ref,this._selectionMode,this.appendSelection)},autoScroll:function(){var e=this._autoScrollTarget.x,t=this._autoScrollTarget.y,n=this.originFrame._grid,i=this.view.scroller,r=8,o=i.scrollLeft,a=i.scrollTop;e<n.left&&this.scrollRight(-r),e>n.right&&this.scrollRight(r),t<n.top&&this.scrollDown(-r),t>n.bottom&&this.scrollDown(r),a===i.scrollTop&&o===i.scrollLeft?this.selectToLocation(this.finalLocation):this.extendSelection(this.objectAt(this.lastKnownCellLocation))},startAutoScroll:function(e,t){this._scrollInterval||(this._scrollInterval=setInterval(this.autoScroll.bind(this),50)),this.finalLocation=t||this.lastKnownCellLocation,this._autoScrollTarget=e},stopAutoScroll:function(){clearInterval(this._scrollInterval),this._scrollInterval=null},openCustomEditor:function(){this.view.openCustomEditor()},openFilterMenu:function(e){var t=this.objectAt(e),n=this._workbook.activeSheet(),i=n.filterColumn(t.ref),r=this.view.createFilterMenu(i);r.bind("action",this.onCommandRequest.bind(this)),r.bind("action",r.close.bind(r)),r.openFor(e.target)},onEditorChange:function(e){this._workbook.activeSheet().isInEditMode(!1);var t=this._execute({command:"EditCommand",options:{editActiveCell:!0,value:e.value}});t&&"error"===t.reason&&e.preventDefault()},onEditorActivate:function(){var e=this._workbook,t=e.activeSheet();t._setFormulaSelections(this.editor.highlightedRefs()),t.isInEditMode(!0)},onEditorDeactivate:function(){var e=this._workbook.activeSheet();e.isInEditMode(!1),e._setFormulaSelections([])},onEditorUpdate:function(){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs())},onEditorBarFocus:function(){var e=this._workbook.activeSheet().selection().enable()===!1;e||this.editor.activate({range:this._workbook.activeSheet()._viewActiveCell(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()})},onEditorCellFocus:function(){this.editor.scale()},onEditorEsc:function(){this.resetEditorValue(),this.editor.deactivate(),this.clipboardElement.focus()},insertNewline:function(e){e.preventDefault(),this.editor.insertNewline()},onEditorBlur:function(e,t){this.editor.isFiltered()||(this.editor.deactivate(),this.editor.isActive()||(this.clipboardElement.focus(),this.navigator.navigateInSelection(o[t])))},onEditorAction:function(e,t){var n=this.editor,i=this._workbook.activeSheet();n.canInsertRef(!0)&&(this.navigator.moveActiveCell(r[t]),n.activeEditor().refAtPoint(i.selection()._ref),i._setFormulaSelections(n.highlightedRefs()),e.preventDefault())},onEditorShiftAction:function(e,t){var n=this.editor,i=this._workbook.activeSheet();n.canInsertRef(!0)&&(this.navigator.modifySelection(r[t.replace("shift+","")],this.appendSelection),n.activeEditor().refAtPoint(i.selection()._ref),i._setFormulaSelections(n.highlightedRefs()),e.preventDefault())},resetEditorValue:function(){this.editor.value(this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell()))},deactivateEditor:function(e,t){var n=this.view.editor;this._lastCommandRequest={callback:e,options:t},this.isEditorDeactivateBound||(this.isEditorDeactivateBound=!0,n.one("deactivate",function(){this.isEditorDeactivateBound=!1,this._lastCommandRequest&&(this._lastCommandRequest.callback(this._lastCommandRequest.options),this._lastCommandRequest=null)}.bind(this))),n.deactivate(),this.enableEditor(!1)},enableEditor:function(e,t,n){n&&"revert"===n.action&&this.resetEditorValue(),e=void 0===e||e,this._enableEditorEvents(e),this.editor.enableEditing(e),this.isEditorDisabled=!e,this.view.enableClipboard(e),t&&this.editor.focusLastActive()},executeRequest:function(e,t){this.view.editor.isActive()?this.deactivateEditor(e,t):e(t)},onCommandRequest:function(e){var t=function(e){e.command?this._execute(e):this._workbook.undoRedoStack[e.action]()}.bind(this);this.executeRequest(t,e)},onDialogRequest:function(e){var t=function(e){this.enableEditor(!1);var t={pdfExport:this._workbook.options.pdf,excelExport:this._workbook.options.excel,close:this.enableEditor.bind(this,!0,!1)};e.options?n.extend(!0,e.options,t):e.options=t,this.view.openDialog(e.name,e.options)}.bind(this);this.executeRequest(t,e)},onNameEditorEnter:function(){var t,n=this._workbook,i=n.activeSheet(),r=this.view.nameEditor.value(),o=e.spreadsheet.calc.parseReference(r,!0)||n.nameValue(r);return o instanceof e.spreadsheet.Ref?(o.sheet&&o.sheet.toLowerCase()!=i.name().toLowerCase()&&(t=n.sheetByName(o.sheet),t&&(n.activeSheet(t),i=t)),void i.range(o).select()):(o=i.selection()._ref.clone().simplify().setSheet(i.name(),!0),this._execute({command:"DefineNameCommand",options:{name:r,value:o}}),void this.clipboardElement.focus())},onNameEditorCancel:function(){this.clipboardElement.focus()},onNameEditorSelect:function(t){var n,i=t.name,r=this._workbook,o=r.activeSheet(),a=r.nameValue(i);return a instanceof e.spreadsheet.Ref?(a.sheet&&a.sheet.toLowerCase()!=o.name().toLowerCase()&&(n=r.sheetByName(a.sheet),n&&(r.activeSheet(n),o=n)),void o.range(a).select()):void this.clipboardElement.focus()},onNameEditorDelete:function(e){this._execute({command:"DeleteNameCommand",options:{name:e.name}}),this.clipboardElement.focus()}}),e.spreadsheet.Controller=_}}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/view.min",["kendo.core.min","kendo.menu.min","spreadsheet/sheetsbar.min"],e)}(function(){!function(e){function t(e){var t,n=window.getSelection();n.removeAllRanges(),t=document.createRange(),t.selectNodeContents(e),n.addRange(t)}function n(e,t){var n=e.trs[t].children;return n[n.length-2]}function i(e,t){var n=e.trs[t-1],i=e.trs[t].children.length-1;if(n&&i>=0)return n.children[i]}function r(e){return["solid",(e.size||1)+"px",e.color||"#000"].join(" ")}function o(e){return/:\/\//.test(e)||(e="http://"+e),e}function a(t,n,i,a,s,l){function d(t){var i,r=n.link;return r||"object"==typeof n.value&&(r=n.value.link),r?(i={textDecoration:"none"},n.color&&(i.color=n.color),n.underline&&(i.textDecoration="underline"),e.dom.element("a",{href:o(r),style:i,target:"_blank"},t?[t]:[])):t}var c,u,h,f,p,m,g,v,_,b,w,y,x,C,T;if(i||e.spreadsheet.draw.shouldDrawCell(n)){if(c=n.left,u=n.top,h=n.width+1,f=n.height+1,p={},m=n.background,
g=null,m&&(g=m,l&&(g=e.parseColor(g).toHSV(),g.v*=.9,g=g.toCssRgba()),g=r({color:g})),m&&(p.backgroundColor=m),n.color&&(p.color=n.color),n.fontFamily&&(p.fontFamily=n.fontFamily),n.underline&&(p.textDecoration="underline"),n.italic&&(p.fontStyle="italic"),n.textAlign&&(p.textAlign=n.textAlign),n.bold&&(p.fontWeight="bold"),n.fontSize&&(p.fontSize=n.fontSize+"px"),n.wrap===!0&&(p.whiteSpace="pre-wrap",p.wordBreak="break-all"),n.borderLeft?(p.borderLeft=r(n.borderLeft),s&&(s[n.left]=!0)):g&&s&&!s[n.left]?p.borderLeft=g:(c++,h--),n.borderTop?(p.borderTop=r(n.borderTop),a&&(a[n.top]=!0)):g&&a&&!a[n.top]?p.borderTop=g:(u++,f--),n.borderRight?(p.borderRight=r(n.borderRight),s&&(s[n.right]=!0)):g&&s&&!s[n.right]?p.borderRight=g:h--,n.borderBottom?(p.borderBottom=r(n.borderBottom),a&&(a[n.bottom]=!0)):g&&a&&!a[n.bottom]?p.borderBottom=g:f--,p.left=c+"px",p.top=u+"px",p.width=h+"px",p.height=f+"px",v=n.value,_=typeof v,n.format&&null!=v?(v=e.spreadsheet.formatting.format(v,n.format),v.__dataType&&(_=v.__dataType)):null!==v&&void 0!==v&&(v=e.dom.text(v)),!p.textAlign)switch(_){case"number":case"date":case"percent":p.textAlign="right";break;case"boolean":p.textAlign="center"}return b=[k.cell],i&&b.push(i),n.enable===!1&&b.push("k-state-disabled"),n.merged&&b.push("k-spreadsheet-merged-cell"),w=n.verticalAlign||"bottom",v=w&&v?e.dom.element("div",{className:"k-vertical-align-"+w},[d(v)]):d(v),y=v?[v]:[],x={style:p},C=n.validation,C&&!C.value&&(y.push(e.dom.element("span",{className:"k-dirty"})),b.push("k-dirty-cell"),x.title=C._getOptions().messageTemplate),x.className=b.join(" "),T=e.dom.element("div",x,y),t.push(T),T}}function s(t,o,a){var s,l,d,c,u,h,f={};if(a.background&&(f.backgroundColor=a.background),a.color&&(f.color=a.color),a.fontFamily&&(f.fontFamily=a.fontFamily),a.underline&&(f.textDecoration="underline"),a.italic&&(f.fontStyle="italic"),a.textAlign&&(f.textAlign=a.textAlign),a.verticalAlign&&(f.verticalAlign="center"===a.verticalAlign?"middle":a.verticalAlign),a.bold&&(f.fontWeight="bold"),a.fontSize&&(f.fontSize=a.fontSize+"px"),a.wrap===!0&&(f.whiteSpace="pre-wrap",f.wordBreak="break-all"),a.borderRight?f.borderRight=r(a.borderRight):a.background&&(f.borderRightColor=a.background),a.borderBottom?f.borderBottom=r(a.borderBottom):a.background&&(f.borderBottomColor=a.background),s=a.value,l=typeof s,a.format&&null!=s&&(s=e.spreadsheet.formatting.format(s,a.format),s.__dataType&&(l=s.__dataType)),!f.textAlign)switch(l){case"number":case"date":case"percent":f.textAlign="right";break;case"boolean":f.textAlign="center"}return d=null,a.enable===!1&&(d="k-state-disabled"),c=t.addCell(o,s,f,d,a.validation),a.borderLeft?(h=n(t,o),u=r(a.borderLeft),h&&u&&(h.attr.style.borderRight=u)):a.background&&(f.borderLeftColor=a.background),a.borderTop?(h=i(t,o),u=r(a.borderTop),h&&u&&(h.attr.style.borderBottom=u)):a.background&&(f.borderTopColor=a.background),c}function l(e,t,n){return e>=t&&e<=n}var d,c,u,h,f,p,m,g,v,_,b,k,w;e.support.browser.msie&&e.support.browser.version<9||(d=e.jQuery,c=e.spreadsheet.CellRef,u=".",h=7,f={view:"k-spreadsheet-view",fixedContainer:"k-spreadsheet-fixed-container",editContainer:"k-spreadsheet-edit-container",scroller:"k-spreadsheet-scroller",viewSize:"k-spreadsheet-view-size",clipboard:"k-spreadsheet-clipboard",cellEditor:"k-spreadsheet-cell-editor",barEditor:"k-spreadsheet-editor",topCorner:"k-spreadsheet-top-corner",filterHeadersWrapper:"k-filter-wrapper",filterRange:"k-filter-range",filterButton:"k-spreadsheet-filter",filterButtonActive:"k-state-active",horizontalResize:"k-horizontal-resize",verticalResize:"k-vertical-resize",icon:"k-icon k-font-icon",iconFilterDefault:"k-i-arrow-s",sheetsBar:"k-spreadsheet-sheets-bar",sheetsBarActive:"k-spreadsheet-sheets-bar-active",sheetsBarInactive:"k-spreadsheet-sheets-bar-inactive",cellContextMenu:"k-spreadsheet-cell-context-menu",rowHeaderContextMenu:"k-spreadsheet-row-header-context-menu",colHeaderContextMenu:"k-spreadsheet-col-header-context-menu"},e.spreadsheet.messages.view={errors:{openUnsupported:"Unsupported format. Please select an .xlsx file.",shiftingNonblankCells:"Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.",filterRangeContainingMerges:"Cannot create a filter within a range containing merges",sortRangeContainingMerges:"Cannot sort a range containing merges",validationError:"The value that you entered violates the validation rules set on the cell."},tabs:{home:"Home",insert:"Insert",data:"Data"}},p=e.Class.extend({init:function(){this.cols=[],this.trs=[],this._height=0,this._width=0},addColumn:function(t){this._width+=t;var n=e.dom.element("col",{style:{width:t+"px"}});n.visible=t>0,this.cols.push(n)},addRow:function(t){var n,i=null;i={style:{height:t+"px"}},this._height+=t,n=e.dom.element("tr",i),n.visible=t>0,this.trs.push(n)},addCell:function(t,n,i,r,o){var a,s,l;return null!==n&&void 0!==n||(n=""),n instanceof e.dom.Node||(n=e.dom.text(n)),a=[n],s={style:i},o&&!o.value&&(a.push(e.dom.element("span",{className:"k-dirty"})),r=(r||"")+(r?" ":"")+"k-dirty-cell",s.title=o._getOptions().messageTemplate),r&&(s.className=r),l=e.dom.element("td",s,a),this.trs[t].children.push(l),l},toDomTree:function(t,n,i){this.trs=this.trs.filter(function(e){return e.visible});var r=0;return this.cols=this.cols.filter(function(e,t){return e.visible||(this.trs.forEach(function(e){e.children.splice(t-r,1)}),r++),e.visible},this),e.dom.element("table",{style:{left:t+"px",top:n+"px",height:this._height+"px",width:this._width+"px"},className:i},[e.dom.element("colgroup",null,this.cols),e.dom.element("tbody",null,this.trs)])}}),m='<ul class="#=classNames.cellContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action=merge>Merge</li><li data-action=unmerge>Unmerge</li></ul>',g='<ul class="#=classNames.rowHeaderContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action="delete-row">Delete</li><li data-action="hide-row">Hide</li><li data-action="unhide-row">Unhide</li></ul>',v='<ul class="#=classNames.colHeaderContextMenu#"><li data-action=cut>Cut</li><li data-action=copy>Copy</li><li data-action=paste>Paste</li><li class="k-separator"></li><li data-action="delete-column">Delete</li><li data-action="hide-column">Hide</li><li data-action="unhide-column">Unhide</li></ul>',e.spreadsheet.ContextMenu=e.ui.ContextMenu,_=e.template('<div class="#=classNames.view#"><div class="#=classNames.fixedContainer#"></div><div class="#=classNames.scroller#"><div class="#=classNames.viewSize#"></div></div><div tabindex="0" class="#=classNames.clipboard#" contenteditable=true></div><div class="#=classNames.cellEditor#"></div></div><div class="#=classNames.sheetsBar#"></div>'+m+g+v),b=e.Class.extend({init:function(t,n){var i,r,o=b.classNames;this.element=t,this.options=d.extend(!0,{messages:e.spreadsheet.messages.view},this.options,n),this._chrome(),this._dialogs=[],t.append(_({classNames:o})),this._formulaInput(),this.wrapper=t.find(u+o.view),this.container=t.find(u+o.fixedContainer)[0],this.scroller=t.find(u+o.scroller)[0],this.clipboard=t.find(u+o.clipboard),this.viewSize=d(this.scroller.firstChild),this.tree=new e.dom.Tree(this.container),this.clipboardContents=new e.dom.Tree(this.clipboard[0]),this.editor=new e.spreadsheet.SheetEditor(this),this._sheetsbar(),i={target:t,animation:!1,showOn:"never"},this.cellContextMenu=new e.spreadsheet.ContextMenu(t.find(u+o.cellContextMenu),i),this.colHeaderContextMenu=new e.spreadsheet.ContextMenu(t.find(u+o.colHeaderContextMenu),i),this.rowHeaderContextMenu=new e.spreadsheet.ContextMenu(t.find(u+o.rowHeaderContextMenu),i),r=e.support.scrollbar(),d(this.container).css({width:this.wrapper[0].clientWidth-r,height:this.wrapper[0].clientHeight-r})},enableClipboard:function(e){this.isClipboardDeactivated=!e,e?this.clipboard.attr("contenteditable",e):this.clipboard.removeAttr("contenteditable")},_resize:function(){var t=e._outerHeight,n=this.tabstrip?t(this.tabstrip.element):0,i=this.formulaBar?t(this.formulaBar.element):0,r=this.sheetsbar?t(this.sheetsbar.element):0;this.wrapper.height(this.element.height()-(n+i+r)),this.tabstrip&&this.tabstrip.quickAccessAdjust()},_chrome:function(){var t,n=d("<div class='k-spreadsheet-action-bar' />").prependTo(this.element),i=d("<div class='k-spreadsheet-name-editor' />").appendTo(n);this.nameEditor=new e.spreadsheet.NameEditor(i),t=d("<div />").appendTo(n),this.formulaBar=new e.spreadsheet.FormulaBar(t),this.options.toolbar&&this._tabstrip()},_formulaInput:function(){var t=this.element.find(u+b.classNames.cellEditor);this.formulaInput=new e.spreadsheet.FormulaInput(t,{autoScale:!0})},_sheetsbar:function(){this.options.sheetsbar&&(this.sheetsbar=new e.spreadsheet.SheetsBar(this.element.find(u+b.classNames.sheetsBar),d.extend(!0,{},this.options.sheetsbar)))},_tabstrip:function(){var t,n=this.options.messages.tabs,i=d.extend(!0,{home:!0,insert:!0,data:!0},this.options.toolbar),r=[];this.tabstrip&&(this.tabstrip.destroy(),this.element.children(".k-tabstrip").remove());for(t in i)(i[t]===!0||i[t]instanceof Array)&&r.push({id:t,text:n[t],content:""});this.tabstrip=new e.spreadsheet.TabStrip(d("<div />").prependTo(this.element),{animation:!1,dataTextField:"text",dataContentField:"content",dataSource:r,toolbarOptions:i,view:this}),this.tabstrip.select(0)},_executeCommand:function(e){this._sheet.trigger("commandRequest",e)},workbook:function(e){this._workbook=e,this.nameEditor._workbook=e},sheet:function(e){this._sheet=e},activeCellRectangle:function(){return this.cellRectangle(this._sheet._viewActiveCell())},_rectangle:function(e,t){return e._grid.boundingRectangle(t.toRangeRef())},isColumnResizer:function(e,t,n){var i,r,o=this._rectangle(t,n);return e-=this._sheet._grid._headerWidth,i=h/2,r=o.right-this.scroller.scrollLeft,r-i<=e&&e<=r+i},isRowResizer:function(e,t,n){var i,r,o=this._rectangle(t,n);return e-=this._sheet._grid._headerHeight,i=h/2,r=o.bottom-this.scroller.scrollTop,r-i<=e&&e<=r+i},isFilterIcon:function(e,t,n,i){var r,o=n._grid,a=o.rows.frozen?0:this.scroller.scrollTop,s=o.columns.frozen?0:this.scroller.scrollLeft;return e-=this._sheet._grid._headerWidth-s,t-=this._sheet._grid._headerHeight-a,r=!1,this._sheet.forEachFilterHeader(i,function(i){if(!r){var o=this._rectangle(n,i);r=n.filterIconRect(o).intersects(e,t)}}.bind(this)),r},isAutoFill:function(e,t,n){var i,r=this._sheet.select();return!(r.size>1)&&(e-=this._sheet._grid._headerWidth,t-=this._sheet._grid._headerHeight,n._grid.columns.frozen||(e+=this.scroller.scrollLeft),n._grid.rows.frozen||(t+=this.scroller.scrollTop),i=this._rectangle(n,r),Math.abs(i.right-e)<8&&Math.abs(i.bottom-t)<8)},isEditButton:function(e,t){var n,i=this._sheet.activeCellCustomEditor();if(i&&(n=this.activeCellRectangle(),e>n.right&&e<=n.right+20&&t>=n.top&&t<=n.bottom))return!0},objectAt:function(e,t){var n,i,r,o,a,s,l,d=this._sheet._grid;return e<0||t<0||e>this.scroller.clientWidth||t>this.scroller.clientHeight?n={type:"outside"}:e<d._headerWidth&&t<d._headerHeight?n={type:"topcorner"}:(i=this.paneAt(e,t),i?(r=i._grid.rows.index(t,this.scroller.scrollTop),o=i._grid.columns.index(e,this.scroller.scrollLeft),a="cell",s=new c(r,o),l=this._sheet.selectionInProgress(),this.isAutoFill(e,t,i)?a="autofill":this.isFilterIcon(e,t,i,s)?a="filtericon":!l&&e<d._headerWidth?(s=new c(r,(-(1/0))),a=this.isRowResizer(t,i,s)?"rowresizehandle":"rowheader"):!l&&t<d._headerHeight?(s=new c((-(1/0)),o),a=this.isColumnResizer(e,i,s)?"columnresizehandle":"columnheader"):this.isEditButton(e,t)&&(a="editor"),n={type:a,ref:s}):n={type:"outside"}),n.pane=i,n.x=e,n.y=t,n},paneAt:function(e,t){return this.panes.filter(function(n){var i=n._grid;return l(t,i.top,i.bottom)&&l(e,i.left,i.right)})[0]},containingPane:function(e){return this.panes.filter(function(t){return!!t._grid.contains(e)})[0]},cellRectangle:function(e){var t=this.containingPane(e)._grid,n=this._sheet._grid.rectangle(e);return n.offset(t.headerWidth-(t.columns.frozen?0:this.scroller.scrollLeft),t.headerHeight-(t.rows.frozen?0:this.scroller.scrollTop))},refresh:function(e){var t,n,i=this._sheet;this.tabstrip&&this.tabstrip.refreshTools(i.range(i.activeCell())),e.sheetSelection&&this.sheetsbar&&this.sheetsbar.renderSheets(this._workbook.sheets(),this._workbook.sheetIndex(this._sheet)),this._resize(),this.viewSize[0].style.height=i._grid.totalHeight()+"px",this.viewSize[0].style.width=i._grid.totalWidth()+"px",e.layout&&(t=i.frozenColumns(),n=i.frozenRows(),this.panes=[this._pane(n,t)],t>0&&this.panes.push(this._pane(n,0,null,t)),n>0&&this.panes.push(this._pane(0,t,n,null)),n>0&&t>0&&this.panes.push(this._pane(0,0,n,t))),e.filter&&this._destroyFilterMenu(),e.activeCell&&(this._focus=i.activeCell().toRangeRef())},createFilterMenu:function(t){var n,i,r,o,a,s;return this._filterMenu&&this._filterMenu.options.column==t?this._filterMenu:(this._destroyFilterMenu(),n=this._sheet,i=n.filter().ref,r=new e.spreadsheet.Range(i,n),o=d("<div />").appendTo(this.element),a={column:t,range:r},s=new e.spreadsheet.FilterMenu(o,a),this._filterMenu=s,s)},selectClipBoardContents:function(){this.isClipboardDeactivated||(this.clipboard.focus(),t(this.clipboard[0]))},scrollIntoView:function(e){var t=!1,n=this.containingPane(e)._grid,i=n.scrollBoundaries(e),r=this.scroller,o=n.rows.frozen?0:r.scrollTop,a=n.columns.frozen?0:r.scrollLeft;return i.top<o&&(t=!0,r.scrollTop=i.scrollTop),i.bottom>o&&(t=!0,r.scrollTop=i.scrollBottom),i.left<a&&(t=!0,r.scrollLeft=i.scrollLeft),i.right>a&&(t=!0,r.scrollLeft=i.scrollRight),t},_destroyDialog:function(){this._dialogs.pop()},openCustomEditor:function(){var e=this,t=e._sheet.activeCell().first(),n=e._sheet.activeCellCustomEditor(),i=e._sheet.range(t);n.edit({range:i,rect:e.activeCellRectangle(),view:this,validation:this._sheet.validation(t),callback:function(t,n){e._executeCommand({command:"EditCommand",options:{property:n?"input":"value",value:t}})}})},openDialog:function(t,n){var i=this._sheet,r=i.activeCell(),o=new e.spreadsheet.Range(r,i),a=e.spreadsheet.dialogs.create(t,n);if(a)return a.bind("action",this._executeCommand.bind(this)),a.bind("deactivate",this._destroyDialog.bind(this)),this._dialogs.push(a),a.open(o),a},showError:function(t,n){var i,r=this.options.messages.errors;e.spreadsheet.dialogs.registered(t.type)?(i={close:n},"validationError"===t.type&&(i=d.extend(i,{title:t.title||"Error",text:t.body?t.body:r[t.type]})),this.openDialog(t.type,i)):this.openDialog("message",{title:t.title||"Error",text:t.body?t.body:r[t.type],activate:function(e){e.sender.dialog().element.find(".k-button").focus()}.bind(this),close:n})},destroy:function(){this._dialogs.forEach(function(e){e.destroy()}),this.cellContextMenu.destroy(),this.rowHeaderContextMenu.destroy(),this.colHeaderContextMenu.destroy(),this.tabstrip&&this.tabstrip.destroy(),this._destroyFilterMenu()},_destroyFilterMenu:function(){this._filterMenu&&(this._filterMenu.destroy(),this._filterMenu=void 0,this._filterMenuColumn=void 0)},render:function(){var t,n,i,r,o,a,s,l,d;this.element.is(":visible")&&(t=this._sheet,n=t.focus(),n&&this.scrollIntoView(n)||(i=t.resizingInProgress()?t.resizeHandlePosition().col===-(1/0)?"column":"row":"none",this.wrapper.toggleClass(f.editContainer,this.editor.isActive()).toggleClass(f.horizontalResize,"row"==i).toggleClass(f.verticalResize,"column"==i),r=t._grid,o=this.scroller.scrollTop,a=this.scroller.scrollLeft,o<0&&(o=0),a<0&&(a=0),s=this.panes.map(function(e){return e.render(a,o)},this),l=[],l=Array.prototype.concat.apply(l,s),d=e.dom.element("div",{style:{width:r._headerWidth+"px",height:r._headerHeight+"px"},className:b.classNames.topCorner}),l.push(d),t.resizeHandlePosition()&&t.resizeHintPosition()&&l.push(this.renderResizeHint()),this.tree.render(l),this.editor.isActive()?this.editor.toggleTooltip(this.activeCellRectangle()):t.selectionInProgress()||t.resizingInProgress()||t.isInEditMode()||this.renderClipboardContents()))},renderResizeHint:function(){var t,n,i=this._sheet,r=i.resizeHandlePosition(),o=r.col!==-(1/0);return t=o?{height:this.scroller.clientHeight+"px",width:h+"px",left:i.resizeHintPosition().x+"px",top:"0px"}:{height:h+"px",width:this.scroller.clientWidth+"px",top:i.resizeHintPosition().y+"px",left:"0px"},n=w.classNames,e.dom.element("div",{className:n.resizeHint+(o?"":" "+n.resizeHintVertical),style:t},[e.dom.element("div",{className:n.resizeHintHandle}),e.dom.element("div",{className:n.resizeHintMarker})])},renderClipboardContents:function(){var e,t,n,i,r=this._sheet,o=r._grid,a=r.select().toRangeRef(),l=this._workbook.clipboard().canCopy();return l.canCopy===!1&&l.multiSelection?(this.clipboardContents.render([]),void this.selectClipBoardContents()):(a=r.trim(a),e=new p,t=o.rangeDimensions(a),t.rows.forEach(function(t){e.addRow(t)}),t.columns.forEach(function(t){e.addColumn(t)}),n={},i={},r.forEachMergedCell(a,function(e){var t=e.topLeft;o.forEach(e,function(r){t.eq(r)?n[r.print()]=e:i[r.print()]=!0})}),r.forEach(a,function(t,r,o){var l,d,u=new c(t,r).print();i[u]||(l=s(e,t-a.topLeft.row,o),d=n[u],d&&(l.attr.colspan=d.width(),l.attr.rowspan=d.height()))}),this.clipboardContents.render([e.toDomTree(0,0,"kendo-clipboard-"+this._workbook.clipboard()._uid)]),void this.selectClipBoardContents())},_pane:function(e,t,n,i){var r=new w(this._sheet,this._sheet._grid.pane({row:e,column:t,rowCount:n,columnCount:i}));return r.refresh(this.scroller.clientWidth,this.scroller.clientHeight),r}}),k={cell:"k-spreadsheet-cell",vaxis:"k-spreadsheet-vaxis",haxis:"k-spreadsheet-haxis",rowHeader:"k-spreadsheet-row-header",columnHeader:"k-spreadsheet-column-header",pane:"k-spreadsheet-pane",data:"k-spreadsheet-data",mergedCell:"k-spreadsheet-merged-cell",mergedCellsWrapper:"k-merged-cells-wrapper",activeCell:"k-spreadsheet-active-cell",selection:"k-spreadsheet-selection",selectionWrapper:"k-selection-wrapper",autoFillWrapper:"k-auto-fill-wrapper",single:"k-single",top:"k-top",right:"k-right",bottom:"k-bottom",left:"k-left",resizeHandle:"k-resize-handle",columnResizeHandle:"k-column-resize-handle",rowResizeHandle:"k-row-resize-handle",resizeHint:"k-resize-hint",resizeHintHandle:"k-resize-hint-handle",resizeHintMarker:"k-resize-hint-marker",resizeHintVertical:"k-resize-hint-vertical",selectionHighlight:"k-spreadsheet-selection-highlight",series:["k-series-a","k-series-b","k-series-c","k-series-d","k-series-e","k-series-f"]},w=e.Class.extend({init:function(e,t){this._sheet=e,this._grid=t},refresh:function(e,t){this._grid.refresh(e,t)},isVisible:function(e,t,n){return this._grid.view(e,t).ref.intersects(n)},render:function(t,n){var i,r,o,a,s,l,d=w.classNames,c=this._sheet,u=this._grid,h=u.view(t,n);return this._currentView=h,this._currentRect=this._rectangle(h.ref),this._selectedHeaders=c.selectedHeaders(),i=[],i.push(this.renderData()),i.push(this.renderSelection()),i.push(this.renderAutoFill()),i.push(this.renderEditorSelection()),i.push(this.renderFilterHeaders()),u.hasRowHeader&&(r=e.dom.element("div",{className:d.rowHeader,style:{width:u.headerWidth+"px",top:h.rowOffset+"px"}}),i.push(r),c.forEach(h.ref.leftColumn(),function(t){if(!c.isHiddenRow(t)){var n=t+1,i=c.rowHeight(t);r.children.push(e.dom.element("div",{className:this.headerClassName(t,"row"),style:{width:u.headerWidth+"px",height:i+"px"}},[e.dom.element("div",{className:"k-vertical-align-center"},[e.dom.text(n+"")])]))}}.bind(this))),u.hasColumnHeader&&(o=e.dom.element("div",{className:d.columnHeader,style:{top:"0px",left:h.columnOffset+"px",width:this._currentRect.width+"px",height:u.headerHeight+"px"}}),i.push(o),a=0,c.forEach(h.ref.topRow(),function(t,n){if(!c.isHiddenColumn(n)){var i=e.spreadsheet.Ref.display(null,1/0,n),r=c.columnWidth(n);o.children.push(e.dom.element("div",{className:this.headerClassName(n,"col"),style:{position:"absolute",left:a+"px",width:r+"px",height:u.headerHeight+"px"}},[e.dom.element("div",{className:"k-vertical-align-center"},[e.dom.text(i+"")])])),a+=r}}.bind(this))),c.resizeHandlePosition()&&(u.hasColumnHeader||u.hasRowHeader)&&(s=c._grid.normalize(c.resizeHandlePosition()),h.ref.intersects(s)&&(c.resizeHintPosition()||i.push(this.renderResizeHandle()))),l=[d.pane],u.hasColumnHeader&&l.push(d.top),u.hasRowHeader&&l.push(d.left),e.dom.element("div",{style:u.style,className:l.join(" ")},i)},headerClassName:function(e,t){var n,i,r,o=this._selectedHeaders;return"row"===t?(n=o.rows[e],i=o.allRows):(n=o.cols[e],i=o.allCols),r=n||(o.all?"full":i?"partial":"none"),r&&(r="k-selection-"+r),r},renderData:function(){var t,n,i,r=this._sheet,o=this._currentView,s=e.dom.element("div",{className:w.classNames.data,style:{position:"relative",left:o.columnOffset+"px",top:o.rowOffset+"px"}}),l=this._currentRect,d=e.spreadsheet.draw.doLayout(r,o.ref,{forScreen:!0}),c=r._showGridLines;return c&&(t=null,d.xCoords.forEach(function(n){n!==t&&(t=n,s.children.push(e.dom.element("div",{className:k.vaxis,style:{left:n+"px",height:l.height+"px",borderColor:r.gridLinesColor()}})))}),t=null,d.yCoords.forEach(function(n){n!==t&&(t=n,s.children.push(e.dom.element("div",{className:k.haxis,style:{top:n+"px",width:l.width+"px",borderColor:r.gridLinesColor()}})))})),n={},i={},d.cells.forEach(function(e){var t=i[e.col]||(i[e.col]={}),r=n[e.row]||(n[e.row]={});a(s.children,e,null,t,r,c)}),s},renderResizeHandle:function(){var t,n=this._sheet,i=n.resizeHandlePosition(),r=this._rectangle(i),o=[w.classNames.resizeHandle];return i.col!==-(1/0)?(t={height:this._grid.headerHeight+"px",width:h+"px",left:r.right-h/2+"px",top:"0px"},o.push(f.horizontalResize)):(t={height:h+"px",width:this._grid.headerWidth+"px",top:r.bottom-h/2+"px",left:"0px"},o.push(f.verticalResize)),e.dom.element("div",{className:o.join(" "),style:t})},filterIconRect:function(t){var n=16,i=3;return new e.spreadsheet.Rectangle(t.right-n-i,t.top+i,n,n)},renderFilterHeaders:function(){function t(t){return e.dom.element("span",{className:o.icon+" "+t})}function n(n,i,r){var o,s={left:i.left+"px",top:i.top+"px"},l=a&&a.columns.some(function(e){return e.index===r}),d=n.filterButton;return l&&(d+=" "+n.filterButtonActive),o=e.dom.element("span",{className:d,style:s},[t(n.iconFilterDefault)])}var i=this._sheet,r=[],o=b.classNames,a=i.filter();return a&&this._addDiv(r,a.ref,o.filterRange),i.forEachFilterHeader(this._currentView.ref,function(e){var t=this._rectangle(e),i=this.filterIconRect(t),a=this._sheet.filterColumn(e),s=n(o,i,a);r.push(s)}.bind(this)),e.dom.element("div",{className:o.filterHeadersWrapper},r)},renderEditorSelection:function(){var t=w.classNames,n=this._sheet,i=[];return n._formulaSelections.forEach(function(n){var r=n.ref;r!==e.spreadsheet.NULLREF&&this._addDiv(i,r,t.selectionHighlight+" "+n.colorClass)}.bind(this)),e.dom.element("div",{className:t.selectionWrapper},i)},renderSelection:function(){var t=w.classNames,n=[],i=[t.activeCell],r=[t.selection],o=this._sheet,a=o.activeCell().toRangeRef(),s=this._activeFormulaColor(),l=o.select();return i=i.concat(s,this._directionClasses(a)),r=r.concat(s),o.singleCellSelection()&&i.push(t.single),1===l.size()&&r.push("k-single-selection"),this._sheet.autoFillPunch()&&r.push("k-dim-auto-fill-handle"),l.forEach(function(t){t!==e.spreadsheet.NULLREF&&this._addDiv(n,t,r.join(" "))}.bind(this)),this._addTable(n,a,i.join(" ")),e.dom.element("div",{className:t.selectionWrapper},n)},renderAutoFill:function(){var t,n,i,r,o,a,s,l=[];if(this._sheet.autoFillInProgress())if(t=this._sheet.autoFillRef(),n=this._sheet.autoFillPunch(),i=this._sheet._autoFillDirection,this._addDiv(l,t,"k-auto-fill"),n)this._addDiv(l,n,"k-auto-fill-punch");else if(void 0!==i){switch(i){case 0:r=t.bottomRight,o="k-auto-fill-br-hint";break;case 1:r=t.bottomRight,o="k-auto-fill-br-hint";break;case 2:r=new c(t.topLeft.row,t.bottomRight.col),o="k-auto-fill-tr-hint";break;case 3:r=new c(t.bottomRight.row,t.topLeft.col),o="k-auto-fill-bl-hint"}a=e.dom.element("span",{className:"k-tooltip"},[e.dom.text(this._sheet._autoFillHint)]),s=this._addDiv(l,r,o),s&&s.children.push(a)}return e.dom.element("div",{className:w.classNames.autoFillWrapper},l)},_addDiv:function(e,t,n){var i,r=this._currentView;return r.ref.intersects(t)&&(i=this._rectangle(t).resize(1,1).toDiv(n),e.push(i)),i},_addTable:function(t,n,i){var r,o,s=this,l=s._sheet,d=s._currentView;d.ref.intersects(n)&&(r=s._rectangle(n),o=s._sheet.activeCellCustomEditor(),l.forEach(n.collapse(),function(n,s,l){if(l.left=r.left,l.top=r.top,l.width=r.width,l.height=r.height,a(t,l,i,null,null,!0),o){var d=e.dom.element("div",{className:"k-button k-spreadsheet-editor-button",style:{left:l.left+l.width+"px",top:l.top+"px",height:l.height+"px"}});o.icon&&d.children.push(e.dom.element("span",{className:"k-icon "+o.icon})),t.push(d)}}))},_activeFormulaColor:function(){var e,t=[];return this._sheet.isInEditMode()&&(e=this._sheet._formulaSelections.filter(function(e){return e.active&&"ref"==e.type})[0],e&&t.push(e.colorClass)),t},_directionClasses:function(e){var t=[],n=w.classNames,i=this._currentView.ref;return e.move(0,-1).intersects(i)||t.push(n.left),e.move(-1,0).intersects(i)||t.push(n.top),e.move(0,1).intersects(i)||t.push(n.right),e.move(1,0).intersects(i)||t.push(n.bottom),t},_rectangle:function(e){return this._grid.boundingRectangle(e.toRangeRef()).offset(-this._currentView.mergedCellLeft,-this._currentView.mergedCellTop)}}),e.spreadsheet.View=b,e.spreadsheet.Pane=w,e.spreadsheet.drawCell=a,d.extend(!0,b,{classNames:f}),d.extend(!0,w,{classNames:k}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/customeditors.min",["kendo.core.min","kendo.popup.min","kendo.calendar.min","kendo.listview.min","spreadsheet/sheet.min"],e)}(function(){!function(e){"use strict";var t,n;e.support.browser.msie&&e.support.browser.version<9||(t={},n=e.spreadsheet.registerEditor=function(e,n){t[e]=n},e.spreadsheet.Sheet.prototype.activeCellCustomEditor=function(){var e,n,i,r=this.activeCell().first();if(this.range(r).enable())return e=this.validation(r),n=this._properties.get("editor",this._grid.cellRefIndex(r)),null!=n?i=t[n]:e&&e.showButton&&(n="_validation_"+e.dataType,i=t[n]),"function"==typeof i&&(i=t[n]=i()),i},n("_validation_date",function(){function t(){r||(r=$("<div>").kendoCalendar(),o=$("<div>").kendoPopup(),r.appendTo(o),r=r.getKendoCalendar(),o=o.getKendoPopup(),r.bind("change",function(){o.close();var t=r.value();i.range.format()||i.range.format("yyyy-mm-dd"),i.callback(e.spreadsheet.dateToNumber(t))})),o.setOptions({anchor:i.view.element.find(".k-spreadsheet-editor-button")})}function n(){var n,a,s,l;t(),n=i.range.value(),null!=n&&r.value(e.spreadsheet.numberToDate(n)),a=i.validation,a?(s=e.ui.Calendar.fn.options.min,l=e.ui.Calendar.fn.options.max,/^(?:greaterThan|between)/.test(a.comparerType)&&(s=e.spreadsheet.numberToDate(a.from.value)),"between"==a.comparerType&&(l=e.spreadsheet.numberToDate(a.to.value)),"lessThan"==a.comparerType&&(l=e.spreadsheet.numberToDate(a.from.value)),r.setOptions({disableDates:function(t){var n=a.from?0|a.from.value:0,i=a.to?0|a.to.value:0;return t=0|e.spreadsheet.dateToNumber(t),!e.spreadsheet.validation.validationComparers[a.comparerType](t,n,i)},min:s,max:l})):r.setOptions({disableDates:null,min:null,max:null}),o.open()}var i,r,o;return{edit:function(e){i=e,n()},icon:"k-i-calendar"}}),n("_validation_list",function(){function t(){r||(r=$("<div/>").kendoStaticList({template:"<div>#:value#</div>",selectable:!0,autoBind:!1}),o=$("<div>").kendoPopup(),r.appendTo(o),o=o.getKendoPopup(),r=r.getKendoStaticList(),r.bind("change",function(){o.close();var e=r.value()[0];e&&i.callback(e.value)})),o.setOptions({anchor:i.view.element.find(".k-spreadsheet-editor-button")})}function n(){var n,a,s;t(),n=i.validation.from.value,a=[],n&&n.each(function(e){a.push({value:e})}),s=new e.data.DataSource({data:a}),r.setDataSource(s),s.read(),o.open()}var i,r,o;return{edit:function(e){i=e,n()},icon:"k-i-arrow-s"}}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/grid.min",["kendo.core.min","spreadsheet/references.min"],e)}(function(){!function(e){var t,n,i,r,o,a;e.support.browser.msie&&e.support.browser.version<9||(t=e.spreadsheet.CellRef,n=e.spreadsheet.RangeRef,i=e.spreadsheet.UnionRef,r=e.Class.extend({init:function(e,t,n,i){this.left=e,this.width=n,this.right=e+n,this.top=t,this.height=i,this.bottom=t+i},offset:function(e,t){return new r(this.left+e,this.top+t,this.width,this.height)},resize:function(e,t){return new r(this.left,this.top,this.width+e,this.height+t)},intersects:function(e,t){return this.left<e&&e<this.left+this.width&&this.top<t&&t<this.top+this.height},toDiv:function(t){return e.dom.element("div",{className:t,style:{width:this.width+"px",height:this.height+"px",top:this.top+"px",left:this.left+"px"}})}}),o=e.Class.extend({init:function(e,t,n,i,r,o){this.rowCount=n,this.columnCount=i,this._columns=t,this._rows=e,this._headerHeight=r,this._headerWidth=o},isAxis:function(e){var t,n;return e=e.toRangeRef(),t=e.topLeft,n=e.bottomRight,0===t.row&&n.row===this.rowCount-1||0===t.col&&n.col===this.columnCount-1},width:function(e,t){return this._columns.sum(e,t)},height:function(e,t){return this._rows.sum(e,t)},totalHeight:function(){return this._rows.total+this._headerHeight},totalWidth:function(){return this._columns.total+this._headerWidth},index:function(e,t){return t*this.rowCount+e},cellRef:function(e){return new t(e%this.rowCount,e/this.rowCount>>0)},rowRef:function(e){return new n(new t(e,0),new t(e,this.columnCount-1))},colRef:function(e){return new n(new t(0,e),new t(this.rowCount-1,e))},cellRefIndex:function(e){return this.index(e.row,e.col)},normalize:function(e){return e instanceof n?new n(this.normalize(e.topLeft),this.normalize(e.bottomRight)).setSheet(e.sheet,e.hasSheet()):e instanceof i?e.map(function(e){return this.normalize(e)},this):(e instanceof t&&(e=e.clone(),e.col=Math.max(0,Math.min(this.columnCount-1,e.col)),e.row=Math.max(0,Math.min(this.rowCount-1,e.row))),e)},rectangle:function(e){var t=this.normalize(e.topLeft),n=this.normalize(e.bottomRight);return new r(this.width(0,t.col-1),this.height(0,t.row-1),this.width(t.col,n.col),this.height(t.row,n.row))},pane:function(t){return new a(new e.spreadsheet.PaneAxis(this._rows,t.row,t.rowCount,this._headerHeight),new e.spreadsheet.PaneAxis(this._columns,t.column,t.columnCount,this._headerWidth),this)},rangeDimensions:function(e){return{rows:this._rows.values.iterator(e.topLeft.row,e.bottomRight.row),columns:this._columns.values.iterator(e.topLeft.col,e.bottomRight.col)}},forEach:function(e,n){var i,r,o=this.normalize(e.topLeft),a=this.normalize(e.bottomRight);for(i=o.col;i<=a.col;i++)for(r=o.row;r<=a.row;r++)n(new t(r,i))},trim:function(e,i){var r,o,a,s,l,d=e.topLeft,c=e.bottomRight,u=d.row,h=d.col;for(r=d.col;r<=c.col;r++)o=this.index(d.row,r),a=this.index(c.row,r),s=i.tree.intersecting(o,a),s.length&&(l=this.cellRef(s[s.length-1].end),u=Math.max(u,l.row),h=r);return new n(e.topLeft,new t(Math.min(u,e.bottomRight.row),h))}}),a=e.Class.extend({init:function(e,t,n){this.rows=e,this.columns=t,this._grid=n,this.headerHeight=e.headerSize,this.headerWidth=t.headerSize,this.hasRowHeader=t.hasHeader,this.hasColumnHeader=e.hasHeader},refresh:function(e,t){var n,i;this.columns.viewSize(e),this.rows.viewSize(t),n=this.columns.paneSegment(),i=this.rows.paneSegment(),this.left=n.offset,this.top=i.offset,this.right=n.offset+n.length,this.bottom=i.offset+i.length,this.style={top:i.offset+"px",left:n.offset+"px",height:i.length+"px",width:n.length+"px"}},view:function(e,i){var r=this.rows.visible(i),o=this.columns.visible(e);return{rows:r,columns:o,rowOffset:r.offset,columnOffset:o.offset,mergedCellLeft:o.start,mergedCellTop:r.start,ref:new n(new t(r.values.start,o.values.start),new t(r.values.end,o.values.end))}},contains:function(e){return this.rows.contains(e.topLeft.row,e.bottomRight.row)&&this.columns.contains(e.topLeft.col,e.bottomRight.col);
},index:function(e,t){return this._grid.index(e,t)},boundingRectangle:function(e){return this._grid.rectangle(e)},cellRefIndex:function(e){return this._grid.cellRefIndex(e)},scrollBoundaries:function(e){var t=this.boundingRectangle(e),n={top:Math.max(0,t.top-this.top+(this.hasColumnHeader?0:this.headerHeight)),left:Math.max(0,t.left-this.left+(this.hasRowHeader?0:this.headerWidth)),right:t.right-this.columns._viewSize+this.headerWidth,bottom:t.bottom-this.rows._viewSize+this.headerHeight},i=this.columns.defaultValue/2,r=this.rows.defaultValue/2;return n.scrollTop=n.top-r,n.scrollBottom=n.bottom+r,n.scrollLeft=n.left-i,n.scrollRight=n.right+i,n}}),e.spreadsheet.Grid=o,e.spreadsheet.PaneGrid=a,e.spreadsheet.Rectangle=r)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/axis.min",["kendo.core.min"],e)}(function(){!function(e){var t,n;e.support.browser.msie&&e.support.browser.version<9||(t=e.Class.extend({init:function(t,n){this._value=n,this._count=t,this.values=new e.spreadsheet.RangeList(0,t-1,n),this._hidden=new e.spreadsheet.RangeList(0,t-1,0),this.scrollBarSize=e.support.scrollbar(),this._refresh()},adjust:function(e,t){t<0?(this.values.copy(e-t,this._count-1,e),this._hidden.copy(e-t,this._count-1,e)):(this.values.copy(e,this._count,e+t),this._hidden.copy(e,this._count,e+t),this.values.value(e,e+t-1,this._value),this._hidden.value(e,e+t-1,0))},toJSON:function(e,t){var n,i,r,o,a=[],s=this.values.iterator(0,this._count-1);for(n=0;n<this._count;n++)i=s.at(n),i!==this._value&&(r=t[n],void 0===r&&(r=a.length,o={index:n},o[e]=i,a.push(o),t[n]=r));return a},fromJSON:function(e,t){var n,i,r;for(n=0;n<t.length;n++)i=t[n][e],r=t[n].index,void 0===r&&(r=n),this.value(r,r,i)},hide:function(e){if(!this.hidden(e)){var t=this.value(e,e);this._hidden.value(e,e,t),this.value(e,e,0)}},hidden:function(e){return 0!==this._hidden.value(e,e)},includesHidden:function(e,t){return this._hidden.intersecting(e,t).length>1},nextVisible:function(e,t){var n,i=this._count-1;return e===i?t?e+1:e:(e+=1,n=this._hidden.intersecting(e,e)[0],0!==n.value?n.end===i?e-1:n.end+1:e)},nextPage:function(e,t){return this.index(this.sum(0,e-1)+t)},prevPage:function(e,t){return this.index(this.sum(0,e)-t)},firstVisible:function(){var e=this._hidden.first();return 0===e.value?0:e.end+1},lastVisible:function(){var e=this._hidden.last();return 0===e.value?this._count-1:e.start-1},prevVisible:function(e,t){if(0===e)return t?-1:0;e-=1;var n=this._hidden.intersecting(e,e)[0];return 0!==n.value?0===n.start?e+1:n.start-1:e},unhide:function(e){if(this.hidden(e)){var t=this._hidden.value(e,e);this._hidden.value(e,e,0),this.value(e,e,t)}},value:function(e,t,n){return void 0===n?this.values.iterator(e,t).at(0):(this.values.value(e,t,n),void this._refresh())},sum:function(e,t){var n,i=this.values.iterator(e,t),r=0;for(n=e;n<=t;n++)r+=i.at(n);return r},visible:function(e,t){var n,i,r,o,a,s,l=null,d=null,c=!1;return t>=this.total+this.scrollBarSize&&(c=!0),n=this._pixelValues.intersecting(e,t),l=n[0],d=n[n.length-1],l?(i=e-l.start,r=(i/l.value.value>>0)+l.value.start,o=i-(r-l.value.start)*l.value.value,a=t-d.start,s=(a/d.value.value>>0)+d.value.start,s>d.value.end&&(s=d.value.end),c&&(o+=d.value.value-(a-(s-d.value.start)*d.value.value)),o=Math.min(-o,0),{values:this.values.iterator(r,s),offset:o}):{values:this.values.iterator(0,0),offset:0}},index:function(e){for(var t=0,n=this.values.iterator(0,this._count-1),i=n.at(0);i<e&&t<this._count-1;)i+=n.at(++t);return t},_refresh:function(){var t=0;this._pixelValues=this.values.map(function(n){var i,r=t;return t+=(n.end-n.start+1)*n.value,i=t-1,new e.spreadsheet.ValueRange(r,i,n)}),this.total=t},getState:function(){return{values:this.values.getState(),hidden:this._hidden.getState()}},setState:function(e){this.values.setState(e.values),this._hidden.setState(e.hidden),this._refresh()}}),n=e.Class.extend({init:function(e,t,n,i){this._axis=e,this._start=t,this._count=n,this.hasHeader=0===t,this.headerSize=i,this.defaultValue=e._value,this.frozen=n>0},viewSize:function(e){this._viewSize=e},sum:function(e,t){return this._axis.sum(e,t-1)},start:function(){return this.sum(0,this._start)},size:function(){return this.sum(this._start,this._start+this._count)},index:function(e,t){return this._axis.index(e+(this.frozen?0:t)-this.headerSize)},paneSegment:function(){var e,t=this.start();return this.hasHeader||(t+=this.headerSize),this.frozen?(e=this.size(),this.hasHeader?e+=this.headerSize:e-=this.headerSize):e=this._viewSize-t,{offset:t,length:e}},visible:function(e){var t,n,i=this.start();return this.frozen?(t=this.size(),this.hasHeader||(t-=this.headerSize)):(t=this._viewSize-i-this.headerSize,i+=e),n=this._axis.visible(i,i+t-1),this.frozen&&(n.offset=0),n.start=i,this.hasHeader&&(n.offset+=this.headerSize,n.start-=this.headerSize),n},contains:function(e,t){return this.frozen?!(e>this._start+this._count)&&!(t<this._start):t>=this._start}}),e.spreadsheet.Axis=t,e.spreadsheet.PaneAxis=n)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/filter.min",["kendo.core.min","kendo.data.min"],e)}(function(){!function(e){function t(e){var t=e.getMonth()+1;return t>=1&&t<=3?1:t>=4&&t<=6?2:t>=7&&t<=9?3:4}function n(t,n){if(t instanceof Date){var i=e.date.today();return i.setFullYear(i.getFullYear()+n),i.getFullYear()===t.getFullYear()}return!1}function i(t,n){if(t instanceof Date){var i=e.date.firstDayOfMonth(e.date.today());return i.setMonth(i.getMonth()+n,1),i.getTime()===e.date.firstDayOfMonth(t).getTime()}return!1}function r(t,n){var i,r;return n instanceof Date&&(i=e.date.dayOfWeek(e.date.getDate(t),1),r=e.date.dayOfWeek(e.date.getDate(n),1),i.getTime()===r.getTime())}if(!(e.support.browser.msie&&e.support.browser.version<9)){var o=e.spreadsheet.Filter=e.Class.extend({prepare:function(){},value:function(e){return e.value},matches:function(){throw Error("The 'matches' method is not implemented.")},toJSON:function(){throw Error("The 'toJSON' method is not implemented.")}});o.create=function(t){var n,i=t.filter;if(!i)throw Error("Filter type not specified.");if(n=e.spreadsheet[i.charAt(0).toUpperCase()+i.substring(1)+"Filter"],!n)throw Error("Filter type not recognized.");return new n(t)},e.spreadsheet.ValueFilter=o.extend({_values:[],_dates:[],_blanks:!1,init:function(e){void 0!==e.values&&(this._values=e.values),void 0!==e.blanks&&(this._blanks=e.blanks),void 0!==e.dates&&(this._dates=e.dates)},value:function(t){var n,i=t.value;return this._dates.length>0&&t.format&&"number"==typeof i&&(n=e.spreadsheet.formatting.type(i,t.format),"date"===n&&(i=e.spreadsheet.numberToDate(i))),i},matches:function(e){return null===e||void 0===e?this._blanks:e instanceof Date?this._dates.some(function(t){return!(t.year!==e.getFullYear()||void 0!==t.month&&t.month!==e.getMonth()||void 0!==t.day&&t.day!==e.getDate()||void 0!==t.hours&&t.hours!==e.getHours()||void 0!==t.minutes&&t.minutes!==e.getMinutes()||void 0!==t.seconds&&t.seconds!==e.getSeconds())}):this._values.indexOf(e)>=0},toJSON:function(){return{filter:"value",values:this._values.slice(0)}}}),e.spreadsheet.CustomFilter=o.extend({_logic:"and",init:function(t){if(void 0!==t.logic&&(this._logic=t.logic),void 0===t.criteria)throw Error("Must specify criteria.");this._criteria=t.criteria;var n=e.data.Query.filterExpr({logic:this._logic,filters:this._criteria}).expression;this._matches=Function("d","return "+n)},matches:function(e){return null!==e&&this._matches(e)},value:function(t){var n=t.value,i=this._criteria[0].value,r=i instanceof Date?"date":typeof i,o=typeof n;return t.format&&(o=e.spreadsheet.formatting.type(n,t.format)),o!=r?"string"==r&&(t.format&&(n=e.spreadsheet.formatting.text(n,t.format)),n+=""):"date"==o&&(n=e.spreadsheet.numberToDate(n)),n},toJSON:function(){return{filter:"custom",logic:this._logic,criteria:this._criteria}}}),e.spreadsheet.TopFilter=o.extend({init:function(e){this._type=e.type,this._value=e.value,this._values=[]},prepare:function(e){var t,n=e.map(this.value).sort().filter(function(e,t,n){return 0===t||e!==n[t-1]});n.sort("topNumber"===this._type||"topPercent"==this._type?function(e,t){return t-e}:function(e,t){return e-t}),t=this._value,"topPercent"!==this._type&&"bottomPercent"!==this._type||(t=n.length*t/100>>0),this._values=n.slice(0,t)},matches:function(e){return this._values.indexOf(e)>=0},toJSON:function(){return{filter:"top",type:this._type,value:this._value}}}),e.spreadsheet.DynamicFilter=o.extend({init:function(e){if(this._type=e.type,this._predicate=this[e.type],"function"!=typeof this._predicate)throw Error("DynamicFilter type '"+e.type+"' not recognized.")},value:function(t){var n,i=t.value;return t.format&&(n=e.spreadsheet.formatting.type(i,t.format),"date"===n&&(i=e.spreadsheet.numberToDate(i))),i},prepare:function(e){var t,n,i=0,r=0;for(t=0;t<e.length;t++)n=this.value(e[t]),"number"==typeof n&&(i+=n,r++);this._average=r>0?i/r:0},matches:function(e){return this._predicate(e)},aboveAverage:function(t){return t instanceof Date&&(t=e.spreadsheet.dateToNumber(t)),"number"==typeof t&&t>this._average},belowAverage:function(t){return t instanceof Date&&(t=e.spreadsheet.dateToNumber(t)),"number"==typeof t&&t<this._average},tomorrow:function(t){if(t instanceof Date){var n=e.date.addDays(e.date.today(),1);return e.date.getDate(t).getTime()===n.getTime()}return!1},today:function(t){return t instanceof Date&&e.date.isToday(t)},yesterday:function(t){if(t instanceof Date){var n=e.date.addDays(e.date.today(),-1);return e.date.getDate(t).getTime()===n.getTime()}return!1},nextWeek:function(t){return r(e.date.addDays(e.date.today(),7),t)},thisWeek:function(t){return r(e.date.today(),t)},lastWeek:function(t){return r(e.date.addDays(e.date.today(),-7),t)},nextMonth:function(e){return i(e,1)},thisMonth:function(e){return i(e,0)},lastMonth:function(e){return i(e,-1)},nextQuarter:function(n){var i,r;return n instanceof Date&&(i=e.date.today(),r=t(n)-t(i),1===r&&i.getFullYear()===n.getFullYear()||r==-3&&i.getFullYear()+1===n.getFullYear())},thisQuarter:function(n){var i,r;return n instanceof Date&&(i=e.date.today(),r=t(n)-t(i),0===r&&i.getFullYear()===n.getFullYear())},lastQuarter:function(n){var i,r;return n instanceof Date&&(i=e.date.today(),r=t(i)-t(n),1===r&&i.getFullYear()===n.getFullYear()||r==-3&&i.getFullYear()-1===n.getFullYear())},nextYear:function(e){return n(e,1)},thisYear:function(e){return n(e,0)},lastYear:function(e){return n(e,-1)},yearToDate:function(t){if(t instanceof Date){var n=e.date.today();return t.getFullYear()===n.getFullYear()&&t<=n}return!1},toJSON:function(){return{filter:"dynamic",type:this._type}}}),[1,2,3,4].forEach(function(n){e.spreadsheet.DynamicFilter.prototype["quarter"+n]=function(e){return e instanceof Date&&t(e)===n}}),e.cultures["en-US"].calendar.months.names.forEach(function(t,n){e.spreadsheet.DynamicFilter.prototype[t.toLowerCase()]=function(e){return e instanceof Date&&e.getMonth()===n}})}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sorter.min",["kendo.core.min"],e)}(function(){!function(e){if(!(e.support.browser.msie&&e.support.browser.version<9)){var t=e.Class.extend({init:function(e,t){this._grid=e,this._lists=t},indices:function(e,n,i,r){var o=t.ascendingComparer;return i===!1&&(o=t.descendingComparer),n.sortedIndices(this._grid.cellRefIndex(e.topLeft),this._grid.cellRefIndex(e.bottomRight),o,r)},sortBy:function(e,t,n,i,r){var o,a,s,l,d=this.indices(e.toColumn(t),n,i,r);for(o=e.topLeft.col;o<=e.bottomRight.col;o++)for(a=this._grid.index(e.topLeft.row,o),s=this._grid.index(e.bottomRight.row,o),l=0;l<this._lists.length;l++)a<this._lists[l].lastRangeStart()&&this._lists[l].sort(a,s,d);return d}});t.ascendingComparer=function(t,n){var i,r;if(null===t&&null===n)return 0;if(null===t)return 1;if(null===n)return-1;if(i=typeof t,r=typeof n,"number"===i)return"number"===r?t-n:-1;if("string"===i)switch(r){case"number":return 1;case"string":return t.localeCompare(n);default:return-1}if("boolean"===i)switch(r){case"number":return 1;case"string":return 1;case"boolean":return t-n;default:return-1}if(t instanceof e.spreadsheet.calc.runtime.CalcError)return n instanceof e.spreadsheet.calc.runtime.CalcError?0:1;throw Error("Cannot compare "+t+" and "+n)},t.descendingComparer=function(e,n){return null===e&&null===n?0:null===e?1:null===n?-1:t.ascendingComparer(n,e)},e.spreadsheet.Sorter=t}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/numformat.min",["spreadsheet/calc.min","kendo.dom.min"],e)}(function(){"use strict";function e(e){function t(){var t=e.skip(c);if(t)return t[1].toLowerCase()}function n(){var t,n=e.skip(u);if(n&&(t=parseFloat(n[2]),!isNaN(t)))return{op:n[1],value:t}}function i(){for(var t,n=[],i=null;!e.eof()&&(t=o());)"date"==t.type?i&&/^(el)?time$/.test(i.type)&&"h"==i.part&&"m"==t.part&&t.format<3&&(t.type="time"):/^(el)?time$/.test(t.type)&&"s"==t.part&&i&&"date"==i.type&&"m"==i.part&&i.format<3&&(i.type="time"),/^(?:str|space|fill)$/.test(t.type)||(i=t),n.push(t);return n}function r(t){if("date"!=t.type||"m"==t.part&&t.format<3){var n=e.skip(/^\.(0+)/);n&&(t.fraction=n[1].length,"date"==t.type&&(t.type="time"))}return t}function o(){var t,n;if(n=e.skip(/^([#0?]+)(?:,([#0?]+))+/))return{type:"digit",sep:!0,format:n[1]+n[2],decimal:h};if(n=e.skip(/^[#0?]+/))return{type:"digit",sep:!1,format:n[0],decimal:h};if(n=e.skip(/^(e)([+-])/i))return{type:"exp",ch:n[1],sign:n[2]};if(n=e.skip(/^(d{1,4}|m{1,5}|yyyy|yy)/i))return n=n[1].toLowerCase(),r({type:"date",part:n.charAt(0),format:n.length});if(n=e.skip(/^(hh?|ss?)/i))return n=n[1].toLowerCase(),r({type:"time",part:n.charAt(0),format:n.length});if(n=e.skip(/^\[(hh?|mm?|ss?)\]/i))return n=n[1].toLowerCase(),r({type:"eltime",part:n.charAt(0),format:n.length});if(n=e.skip(/^(am\/pm|a\/p)/i))return n=n[1].split("/"),{type:"ampm",am:n[0],pm:n[1]};switch(t=e.next()){case";":return null;case"\\":return{type:"str",value:e.next()};case'"':return{type:"str",value:e.readEscaped(t)};case"@":return{type:"text"};case"_":return{type:"space",value:e.next()};case"*":return{type:"fill",value:e.next()};case".":return e.lookingAt(/^\s*[#0?]/)?(h=!0,{type:"dec"}):{type:"str",value:"."};case"%":return{type:"percent"};case",":return{type:"comma"}}return{type:"str",value:t}}function a(){h=!1;var e=t(),r=n();return!e&&r&&(e=t()),{color:e,cond:r,body:i()}}var s,d,h,f;for(e=l.InputStream(e),s=[],d=!1;!e.eof();)f=a(),s.push(f),f.cond&&(d=!0);return d||(1==s.length?s[0].cond="num":2==s.length?(s[0].cond={op:">=",value:0},s[1].cond={op:"<",value:0}):s.length>=3&&(s[0].cond={op:">",value:0},s[1].cond={op:"<",value:0},s[2].cond={op:"=",value:0},s.length>3&&(s[3].cond="text",s=s.slice(0,4)))),s}function t(e){function t(e){var t="";return e.color&&(t+="["+e.color+"]"),e.cond&&"text"!=e.cond&&"num"!=e.cond&&(t+="["+e.cond.op+e.cond.value+"]"),t+=e.body.map(i).join("")}function n(e,t){return t.fraction&&(e+="."+a("",t.fraction,"0")),e}function i(e){return"digit"==e.type?e.sep?e.format.charAt(0)+","+e.format.substr(1):e.format:"exp"==e.type?e.ch+e.sign:"date"==e.type||"time"==e.type?n(a("",e.format,e.part),e):"eltime"==e.type?n("["+a("",e.format,e.part)+"]",e):"ampm"==e.type?e.am+"/"+e.pm:"str"==e.type?JSON.stringify(e.value):"text"==e.type?"@":"space"==e.type?"_"+e.value:"fill"==e.type?"*"+e.value:"dec"==e.type?".":"percent"==e.type?"%":"comma"==e.type?",":void 0}return e.map(t).join(";")}function n(e,t){e.forEach(function(e){var n,i,r,o,s,l=t;if("text"!=e.cond){for(n=e.body,i=!1,r=n.length;0!==l&&--r>=0;)if(o=n[r],"digit"==o.type){if(o.decimal&&(i=!0,l>0?o.format+=a("",l,"0"):l<0&&(s=o.format.length,o.format=o.format.substr(0,s+l),l+=s-o.format.length),0===o.format.length))for(n.splice(r,1);--r>=0;){if(o=n[r],"digit"==o.type&&o.decimal){++r;break}if("dec"==o.type){n.splice(r,1);break}}if(l>0)break}!i&&l>0&&n.splice(r+1,0,{type:"dec"},{type:"digit",sep:!1,decimal:!0,format:a("",l,"0")})}})}function i(e){var t=0;return{next:function(){return e[t++]},eof:function(){return t>=e.length},ahead:function(n,i){if(t+n<=e.length){var r=i.apply(null,e.slice(t,t+n));return r&&(t+=n),r}},restart:function(){t=0}}}function r(e){function t(e,t){("digit"==e.type&&"comma"==t.type||"comma"==e.type&&e.hidden&&"comma"==t.type)&&(t.hidden=!0,c++)}var n,r,o=i(e.body),a=!1,s=!1,l=!1,d=0,c=0,u="",h=!1,f=0,p=[],m=[],g=e.cond,v="";for("text"==g?v="if (typeof value == 'string' || value instanceof kendo.spreadsheet.CalcError) { ":"num"==g?v="if (typeof value == 'number') { ":g&&(n="="==g.op?"==":g.op,v="if (typeof value == 'number' && value "+n+" "+g.value+") { ",u+="value = Math.abs(value); "),e.color&&(u+="result.color = "+JSON.stringify(e.color)+"; ");!o.eof();)o.ahead(2,t),r=o.next(),"percent"==r.type?d++:"digit"==r.type?r.decimal?(f+=r.format.length,m.push(r.format)):(p.push(r.format),r.sep&&(h=!0)):"time"==r.type?s=!0:"date"==r.type?a=!0:"ampm"==r.type&&(l=s=!0);for(d>0&&(u+="value *= "+Math.pow(100,d)+"; "),c>0&&(u+="value /= "+Math.pow(1e3,c)+"; "),p.length&&(u+="var intPart = runtime.formatInt(culture, value, "+JSON.stringify(p)+", "+f+", "+h+"); "),m.length&&(u+="var decPart = runtime.formatDec(value, "+JSON.stringify(m)+", "+f+"); "),(p.length||m.length)&&(u+="type = 'number'; "),a&&(u+="var date = runtime.unpackDate(value); "),s&&(u+="var time = runtime.unpackTime(value); "),(a||s)&&(u+="type = 'date'; "),(d>0||c>0||p.length||m.length||a||s)&&(v||(v="if (typeof value == 'number') { ")),o.restart();!o.eof();)r=o.next(),"dec"==r.type?u+="output += culture.numberFormat['.']; ":"comma"!=r.type||r.hidden?"percent"==r.type?(u+="type = 'percent'; ",u+="output += culture.numberFormat.percent.symbol; "):"str"==r.type?u+="output += "+JSON.stringify(r.value)+"; ":"text"==r.type?(u+="type = 'text'; ",u+="output += value; "):"space"==r.type?(u+="if (output) result.body.push(output); ",u+="output = ''; ",u+="result.body.push({ type: 'space', value: "+JSON.stringify(r.value)+" }); "):"fill"==r.type?u+="output += runtime.fill("+JSON.stringify(r.value)+"); ":"digit"==r.type?u+="output += "+(r.decimal?"decPart":"intPart")+".shift(); ":"date"==r.type?u+="output += runtime.date(culture, date, "+JSON.stringify(r.part)+", "+r.format+"); ":"time"==r.type?u+="output += runtime.time(time, "+JSON.stringify(r.part)+", "+r.format+", "+l+", "+r.fraction+"); ":"eltime"==r.type?u+="output += runtime.eltime(value, "+JSON.stringify(r.part)+", "+r.format+", "+r.fraction+"); ":"ampm"==r.type&&(u+="output += time.hours < 12 ? "+JSON.stringify(r.am)+" : "+JSON.stringify(r.pm)+"; "):u+="output += ','; ";return u+="if (output) result.body.push(output); ",u+="result.type = type; ",u+="return result; ",v&&(u=v+u+"}"),u}function o(t){var n,i,o=h[t];return o||(n=e(t),i=n.map(r),i.push(f),i=i.join("\n"),i="'use strict'; return function(value, culture){ if (!culture) culture = kendo.culture(); var output = '', type = null, result = { body: [] }; "+i+"; return result; };",o=h[t]=Function("runtime",i)(p)),o}function a(e,t,n){for(e+="";e.length<t;)e=n+e;return e}function s(e){var t,n,i=e.body,r="";for(t=0;t<i.length;++t)n=i[t],"string"==typeof n?r+=n:"space"==n.type&&(r+=" ");return r}var l,d,c,u,h,f,p;kendo.support.browser.msie&&kendo.support.browser.version<9||(l=kendo.spreadsheet.calc,d=kendo.dom,c=/^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i,u=/^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/,h=Object.create(null),f=r({cond:"text",body:[{type:"text"}]}),p={unpackDate:l.runtime.unpackDate,unpackTime:l.runtime.unpackTime,date:function(e,t,n,i){switch(n){case"d":switch(i){case 1:return t.date;case 2:return a(t.date,2,"0");case 3:return e.calendars.standard.days.namesAbbr[t.day];case 4:return e.calendars.standard.days.names[t.day]}break;case"m":switch(i){case 1:return t.month+1;case 2:return a(t.month+1,2,"0");case 3:return e.calendars.standard.months.namesAbbr[t.month];case 4:return e.calendars.standard.months.names[t.month];case 5:return e.calendars.standard.months.names[t.month].charAt(0)}break;case"y":switch(i){case 2:return t.year%100;case 4:return t.year}}return"##"},time:function(e,t,n,i,r){var o,s;switch(t){case"h":o=a(i?e.hours%12||12:e.hours,n,"0"),r&&(s=(e.minutes+(e.seconds+e.milliseconds/1e3)/60)/60);break;case"m":o=a(e.minutes,n,"0"),r&&(s=(e.seconds+e.milliseconds/1e3)/60);break;case"s":o=a(e.seconds,n,"0"),r&&(s=e.milliseconds/1e3)}return s&&(o+=s.toFixed(r).replace(/^0+/,"")),o},eltime:function(e,t,n,i){var r,o;switch(t){case"h":r=24*e;break;case"m":r=24*e*60;break;case"s":r=24*e*60*60}return i&&(o=r-(0|r)),r=a(0|r,n,"0"),o&&(r+=o.toFixed(i).replace(/^0+/,"")),r},fill:function(e){return e},formatInt:function(e,t,n,i,r){function o(t){r&&l&&l%3===0&&/^[0-9]$/.test(t)&&(d=e.numberFormat[","]+d),d=t+d,l++}var a,s,l,d,c,u,h,f;for(t=t.toFixed(i).replace(/\..*$/,""),i>0&&("0"===t?t="":"-0"===t&&(t="-")),a=t.length-1,s=[],l=0,c=n.length;--c>=0;){for(u=n[c],d="",h=u.length;--h>=0;)f=u.charAt(h),a<0?"0"==f?o("0"):"?"==f&&o(" "):o(t.charAt(a--));if(0===c)for(;a>=0;)o(t.charAt(a--));s.unshift(d)}return s},formatDec:function(e,t,n){var i,r,o,a,s,l,d,c;for(e=e.toFixed(n),i=e.indexOf("."),e=i>=0?e.substr(i+1).replace(/0+$/,""):"",r=0,o=[],a=0;a<t.length;++a){for(s=t[a],l="",d=0;d<s.length;++d)c=s.charAt(d),r<e.length?l+=e.charAt(r++):"0"==c?l+="0":"?"==c&&(l+=" ");o.push(l)}return o}},kendo.spreadsheet.formatting={compile:o,parse:e,format:function(e,t,n){var i,r,a,s=o(t)(e,n),l=d.element("span");for(l.__dataType=s.type,i=s.body,s.color&&(l.attr.style={color:s.color}),r=0;r<i.length;++r)a=i[r],"string"==typeof a?l.children.push(d.text(a)):"space"==a.type&&l.children.push(d.element("span",{style:{visibility:"hidden"}},[d.text(a.value)]));return l},text:function(e,t,n){var i=o(t)(e,n);return s(i)},textAndColor:function(e,t,n){var i=o(t)(e,n);return{text:s(i),color:i.color,type:i.type}},type:function(e,t){return o(t)(e).type},adjustDecimals:function(i,r){var o=e(i);return n(o,r),t(o)}})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.functions.min",["spreadsheet/runtime.min","util/main.min"],e)}(function(){"use strict";function e(e){return(Math.exp(e)+Math.exp(-e))/2}function t(e){return(Math.exp(e)-Math.exp(-e))/2}function n(n){return t(n)/e(n)}function i(e,t){for(;t;){var n=e%t;e=t,t=n}return e}function r(e,t){return Math.abs(e*t)/i(e,t)}function o(e,t){for(var n,i,r,o=[],a=0,s=e[0];a<e.length;)o.push({matrix:e[a++],pred:$(e[a++])});for(n=0;n<s.height;++n)e:for(i=0;i<s.width;++i){for(a=0;a<o.length;++a)if(r=o[a].matrix.get(n,i),!o[a].pred(null==r||""===r?0:r))continue e;t(n,i)}}function a(e){return e.reduce(function(e,t){return e+t},0)/e.length}function s(e,t,n){return null==n&&(n=a(e)),e.reduce(function(e,t){return e+Math.pow(t-n,2)},0)/t}function l(e,t){return Math.sqrt(s(e,t))}function d(e,t,n){var i=0,r=0,o=null,a=null,s=!1;return e.forEach(function(e){e<t?(i++,o=null==o?e:Math.max(o,e)):e>t?(r++,a=null==a?e:Math.min(a,e)):s=!0}),i||r?s?n?(i+1)/(e.length+1):i/(i+r):((a-t)*d(e,o,n)+(t-o)*d(e,a,n))/(a-o):new E("N/A")}function c(e,t,n){var i,r=0,o=a(e),s=a(t),l=e.length;for(i=0;i<l;++i)r+=(e[i]-o)*(t[i]-s);return r/n}function u(e,t){var n,i,r;return e.sort(k),n=e.length,i=0|t,r=t-i,0===i?e[0]:i>=n?e[n-1]:(--i,e[i]+r*(e[i+1]-e[i]))}function h(e,t){var n=t*(e.length-1)+1;return u(e,n)}function f(e,t){var n=t*(e.length+1);return u(e,n)}function p(e,t,n){var i=[],r=1,o=2,a=4;return function s(t){if(t instanceof M)e.getRefCells(t,!0).forEach(function(e){var t,s=e.value;if(!(n&r&&e.hidden)){if(e.formula){if(t=e.formula.print(e.row,e.col),/^\s*(?:aggregate|subtotal)\s*\(/i.test(t)&&!(n&a))return;"value"in e.formula&&(s=e.formula.value)}n&o&&s instanceof E||("number"==typeof s||s instanceof E)&&i.push(s)}});else if(Array.isArray(t))for(var l=0;l<t.length;++l)s(t[l]);else t instanceof A?t.each(s):"number"==typeof t?i.push(t):t instanceof E&&!(n&o)&&i.push(t)}(t),i}function m(e,t,n,i){var r,o;if(i){for(r=0,o=0;o<=e;++o)r+=U(t,o)*Math.pow(n,o)*Math.pow(1-n,t-o);return r}return U(t,e)*Math.pow(n,e)*Math.pow(1-n,t-e)}function g(e){var t=N(H(e,0,1));return 4==t.day||3==t.day&&T.isLeapYear(e)?53:52}function v(e,t,n){var i=N(e),r=N(t);return n?(31==i.date&&(i.date=30),31==r.date&&(r.date=30)):(1==i.month&&1==r.month&&i.date==z(i.year,1)&&r.date==z(r.year,1)&&(r.date=30),i.date==z(i.year,i.month)?(i.date=30,31==r.date&&(r.date=30)):30==i.date&&31==r.date&&(r.date=30)),360*(r.year-i.year)+30*(r.month-i.month)+(r.date-i.date)}function _(e,t){this.link=e,this.text=t}function b(e){return"number"==typeof e||"boolean"==typeof e||null==e||""===e}function k(e,t){return e===t?0:e<t?-1:1}function w(e,t){return e===t?0:e<t?1:-1}var y,x,C,T,S,D,E,F,R,I,A,M,z,H,N,P,L,B,O,V,W,U,q,j,$;kendo.support.browser.msie&&kendo.support.browser.version<9||(y=kendo.util,x=kendo.spreadsheet,C=x.calc,T=C.runtime,S=T.defineFunction,D=T.defineAlias,E=T.CalcError,F=x.RangeRef,R=x.CellRef,I=x.UnionRef,A=T.Matrix,M=x.Ref,z=T.daysInMonth,H=T.packDate,N=T.unpackDate,P=T.daysInYear,["abs","cos","sin","acos","asin","tan","atan","exp","sqrt"].forEach(function(e){S(e,Math[e]).args([["*n","number"]])}),S("ln",Math.log).args([["*n","number"]]),S("log",function(e,t){return Math.log(e)/Math.log(t)}).args([["*num","number++"],["*base",["or","number++",["null",10]]],["?",["assert","$base != 1","DIV/0"]]]),S("log10",function(e){return Math.log(e)/Math.log(10)}).args([["*num","number++"]]),S("pi",function(){return Math.PI}).args([]),S("sqrtpi",function(e){return Math.sqrt(e*Math.PI)}).args([["*num","number+"]]),S("degrees",function(e){return 180*e/Math.PI%360}).args([["*radians","number"]]),S("radians",function(e){return Math.PI*e/180}).args([["*degrees","number"]]),S("cosh",e).args([["*num","number"]]),S("acosh",function(e){return Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1))}).args([["*num","number"],["?",["assert","$num >= 1"]]]),S("sinh",t).args([["*num","number"]]),S("asinh",function(e){return Math.log(e+Math.sqrt(e*e+1))}).args([["*num","number"]]),S("sec",function(e){return 1/Math.cos(e)}).args([["*num","number"]]),S("sech",function(t){return 1/e(t)}).args([["*num","number"]]),S("csc",function(e){return 1/Math.sin(e)}).args([["*num","number"]]),S("csch",function(e){return 1/t(e)}).args([["*num","number"]]),S("atan2",function(e,t){return Math.atan(t/e)}).args([["*x","divisor"],["*y","number"]]),S("tanh",n).args([["*num","number"]]),S("atanh",function(e){return Math.log(Math.sqrt(1-e*e)/(1-e))}).args([["*num",["and","number",["(between)",-1,1]]]]),S("cot",function(e){return 1/Math.tan(e)}).args([["*num","divisor"]]),S("coth",function(e){return 1/n(e)}).args([["*num","divisor"]]),S("acot",function(e){return Math.PI/2-Math.atan(e)}).args([["*num","number"]]),S("acoth",function(e){return Math.log((e+1)/(e-1))/2}).args([["*num","number"],["?",["or",["assert","$num < -1"],["assert","$num > 1"]]]]),S("power",function(e,t){return Math.pow(e,t)}).args([["*a","number"],["*b","number"]]),S("mod",function(e,t){return e%t}).args([["*a","number"],["*b","divisor"]]),S("quotient",function(e,t){return Math.floor(e/t)}).args([["*a","number"],["*b","divisor"]]),S("ceiling",function(e,t){return t?t*Math.ceil(e/t):0}).args([["*number","number"],["*significance","number"],["?",["assert","$significance >= 0 || $number < 0"]]]),S("ceiling.precise",function(e,t){return t=Math.abs(t),t?t*Math.ceil(e/t):0}).args([["*number","number"],["*significance",["or","number",["null",1]]]]),D("iso.ceiling","ceiling.precise"),S("ceiling.math",function(e,t,n){return t&&e?(e<0&&(!n&&t<0||n&&t>0)&&(t=-t),t?t*Math.ceil(e/t):0):0}).args([["*number","number"],["*significance",["or","number",["null","$number < 0 ? -1 : 1"]]],["*mode",["or","logical",["null",0]]]]),S("floor",function(e,t){return t?t*Math.floor(e/t):0}).args([["*number","number"],["*significance","number"],["?",["assert","$significance >= 0 || $number < 0"]]]),S("floor.precise",function(e,t){return t=Math.abs(t),t?t*Math.floor(e/t):0}).args([["*number","number"],["*significance",["or","number",["null",1]]]]),S("floor.math",function(e,t,n){return t&&e?(e<0&&(!n&&t<0||n&&t>0)&&(t=-t),t?t*Math.floor(e/t):0):0}).args([["*number","number"],["*significance",["or","number",["null","$number < 0 ? -1 : 1"]]],["*mode",["or","logical",["null",0]]]]),S("int",Math.floor).args([["*number","number"]]),S("mround",function(e,t){return t?t*Math.round(e/t):0}).args([["*number","number"],["*multiple","number"]]),S("round",function(e,t){var n=e<0?-1:1;return n<0&&(e=-e),t=Math.pow(10,t),e*=t,e=Math.round(e),n*e/t}).args([["*number","number"],["*digits","number"]]),S("roundup",function(e,t){return t=Math.pow(10,t),e*=t,e=e<0?Math.floor(e):Math.ceil(e),e/t}).args([["*number","number"],["*digits","number"]]),S("rounddown",function(e,t){return t=Math.pow(10,t),e*=t,e=e<0?Math.ceil(e):Math.floor(e),e/t}).args([["*number","number"],["*digits","number"]]),S("even",function(e){var t=e<0?Math.floor(e):Math.ceil(e);return t%2?t+(t<0?-1:1):t}).args([["*number","number"]]),S("odd",function(e){var t=e<0?Math.floor(e):Math.ceil(e);return t%2?t:t+(t<0?-1:1)}).args([["*number","number"]]),S("sign",function(e){return e<0?-1:e>0?1:0}).args([["*number","number"]]),S("gcd",function(e){var t,n=e[0];for(t=1;t<e.length;++t)n=i(n,e[t]);return n}).args([["numbers",["collect","number"]]]),S("lcm",function(e){var t,n=e[0];for(t=1;t<e.length;++t)n=r(n,e[t]);return n}).args([["numbers",["collect","number"]]]),S("sum",function(e){return e.reduce(function(e,t){return e+t},0)}).args([["numbers",["collect","number"]]]),S("product",function(e){return e.reduce(function(e,t){return e*t},1)}).args([["numbers",["collect","number"]]]),S("sumproduct",function(e,t){var n=0;return e.each(function(e,i,r){var o,a;if("number"==typeof e){for(o=0;o<t.length;++o){if(a=t[o].get(i,r),"number"!=typeof a)return;e*=a}n+=e}}),n}).args([["a1","matrix"],["+",["a2",["and","matrix",["assert","$a2.width == $a1.width"],["assert","$a2.height == $a1.height"]]]]]),S("sumsq",function(e){return e.reduce(function(e,t){return e+t*t},0)}).args([["numbers",["collect","number"]]]),S("sumx2my2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=e*e-o*o)}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),S("sumx2py2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=e*e+o*o)}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),S("sumxmy2",function(e,t){var n=0;return e.each(function(e,i,r){var o=t.get(i,r);"number"==typeof e&&"number"==typeof o&&(n+=(e-o)*(e-o))}),n}).args([["a","matrix"],["b",["and","matrix",["assert","$b.width == $a.width"],["assert","$b.height == $a.height"]]]]),S("seriessum",function(e,t,n,i){var r=0;return i.each(function(i){if("number"!=typeof i)throw new E("VALUE");r+=i*Math.pow(e,t),t+=n}),r}).args([["x","number"],["y","number"],["m","number"],["a","matrix"]]),S("min",function(e){return Math.min.apply(Math,e)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),S("max",function(e){return Math.max.apply(Math,e)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),S("counta",function(e){return e.length}).args([["values",["#collect","anyvalue"]]]),S("count",function(e){return e.length}).args([["numbers",["#collect","number"]]]),S("countunique",function(e){var t=0,n=[];return e.forEach(function(e){n.indexOf(e)<0&&(t++,n.push(e))}),t}).args([["values",["#collect","anyvalue"]]]),S("countblank",function(e){function t(e){null!=e&&""!==e||i++}function n(e){var n,i;for(n=0;n<e.length;++n)i=e[n],i instanceof A?i.each(t,!0):t(i)}var i=0;return n(e),i}).args([["+",["args",["or","matrix","anyvalue"]]]]),S("iseven",function(e){return e%2===0}).args([["*number","number"]]),S("isodd",function(e){return e%2!==0}).args([["*number","number"]]),S("n",function(e){return"boolean"==typeof e?e?1:0:"number"==typeof e?e:0;
}).args([["*value","anyvalue"]]),S("na",function(){return new E("N/A")}).args([]),L=[["m1","matrix"],["c1","anyvalue"],[["m2","matrix"],["c2","anyvalue"]]],S("countifs",function(e,t,n){var i=0;return n.unshift(e,t),o(n,function(){i++}),i}).args(L),B=[["range","matrix"]].concat(L),S("sumifs",function(e,t,n,i){i.unshift(e,b,t,n);var r=0;return o(i,function(t,n){var i=e.get(t,n);i&&(r+=i)}),r}).args(B),S("averageifs",function(e,t,n,i){i.unshift(e,b,t,n);var r=0,a=0;return o(i,function(t,n){var i=e.get(t,n);null!=i&&""!==i||(i=0),r+=i,a++}),a?r/a:new E("DIV/0")}).args(B),S("countif",function(e,t){t=$(t);var n=0;return e.each(function(e){t(e)&&n++}),n}).args([["range","matrix"],["*criteria","anyvalue"]]),O=[["range","matrix"],["*criteria","anyvalue"],["sumRange",["or",["and","matrix",["assert","$sumRange.width == $range.width"],["assert","$sumRange.height == $range.height"]],["null","$range"]]]],S("sumif",function(e,t,n){var i=0;return t=$(t),e.each(function(e,r,o){if(t(e)){var a=n.get(r,o);b(a)&&(i+=a||0)}}),i}).args(O),S("averageif",function(e,t,n){var i=0,r=0;return t=$(t),e.each(function(e,o,a){if(t(e)){var s=n.get(o,a);b(s)&&(i+=s||0,r++)}}),r?i/r:new E("DIV/0")}).args(O),function(e){e("large",function(e,t){return e.sort(w)[t]}),e("small",function(e,t){return e.sort(k)[t]})}(function(e,t){S(e,function(e,n){var i=[],r=e.each(function(e){return e instanceof E?e:void("number"==typeof e&&i.push(e))});return r?r:n>i.length?new E("NUM"):t(i,n-1)}).args([["array","matrix"],["*nth","number++"]])}),S("stdev.s",function(e){return l(e,e.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),S("stdev.p",function(e){return l(e,e.length)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),S("var.s",function(e){return s(e,e.length-1)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),S("var.p",function(e){return s(e,e.length)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),S("median",function(e){var t=e.length;return e.sort(k),t%2?e[t>>1]:(e[t>>1]+e[t>>2])/2}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","N/A"]]]),S("mode.sngl",function(e){var t,n,i,r,o,a;for(e.sort(k),t=null,n=0,i=1,r=null,o=0;o<e.length;++o)a=e[o],a!=t?(n=1,t=a):n++,n>i&&(i=n,r=a);return null==r?new E("N/A"):r}).args([["numbers",["collect","number"]]]),S("mode.mult",function(e){var t,n=Object.create(null),i=2,r=[];return e.forEach(function(e){var t=n[e]||0;n[e]=++t,t==i?r.push(e):t>i&&(i=t,r=[e])}),t=new A(this),r.forEach(function(e,n){t.set(n,0,e)}),t}).args([["numbers",["collect","number"]]]),S("geomean",function(e){var t=e.length,n=e.reduce(function(e,t){if(t<0)throw new E("NUM");return e*t},1);return Math.pow(n,1/t)}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","NUM"]]]),S("harmean",function(e){var t=e.length,n=e.reduce(function(e,t){if(!t)throw new E("DIV/0");return e+1/t},0);return t/n}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length > 0","NUM"]]]),S("trimmean",function(e,t){var n,i,r,o=e.length;for(e.sort(k),n=Math.floor(o*t),n%2&&--n,n/=2,i=0,r=n;r<o-n;++r)i+=e[r];return i/(o-2*n)}).args([["numbers",["collect","number",1]],["percent",["and","number",["[between)",0,1]]],["?",["assert","$numbers.length > 0","NUM"]]]),S("frequency",function(e,t){function n(t){for(var n=0;r<e.length&&e[r]>i&&e[r]<=t;)++n,++r;return n}var i,r,o;return e.sort(k),t.sort(k),i=-(1/0),r=0,o=new A(this),t.forEach(function(e,t){var r=n(e);i=e,o.set(t,0,r)}),o.set(o.height,0,e.length-r),o}).args([["data",["collect","number",1]],["bins",["collect","number",1]]]),S("rank.eq",function(e,t,n){t.sort(n?k:w);var i=t.indexOf(e);return i<0?new E("N/A"):i+1}).args([["value","number"],["numbers",["collect","number"]],["order",["or","logical",["null",!1]]]]),D("rank","rank.eq"),S("rank.avg",function(e,t,n){var i,r;if(t.sort(n?k:w),i=t.indexOf(e),i<0)return new E("N/A");for(r=i;t[r]==e;++r);return(i+r+1)/2}).args([["value","number"],["numbers",["collect","number"]],["order",["or","logical",["null",!1]]]]),S("kurt",function(e){var t=e.length,n=a(e),i=s(e,t-1,n),r=Math.sqrt(i),o=e.reduce(function(e,t){return e+Math.pow((t-n)/r,4)},0);return t*(t+1)/((t-1)*(t-2)*(t-3))*o-3*Math.pow(t-1,2)/((t-2)*(t-3))}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 4","NUM"]]]),V=[["array",["collect","number",1]],["x","number"],["significance",["or",["null",3],"integer++"]],["?",["assert","$array.length > 0","NUM"]]],S("percentrank.inc",function(e,t,n){var i=d(e,t,0);return i=i.toFixed(n+1),parseFloat(i.substr(0,i.length-1))}).args(V),S("percentrank.exc",function(e,t,n){var i=d(e,t,1);return i=i.toFixed(n+1),parseFloat(i.substr(0,i.length-1))}).args(V),D("percentrank","percentrank.inc"),S("covariance.p",function(e,t){return c(e,t,e.length)}).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length == $array2.length","N/A"]],["?",["assert","$array1.length > 0","DIV/0"]]]),S("covariance.s",function(e,t){return c(e,t,e.length-1)}).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length == $array2.length","N/A"]],["?",["assert","$array1.length > 1","DIV/0"]]]),D("covar","covariance.p"),W=y.memoize(function(e){for(var t=2,n=1;t<=e;++t)n*=t;return n}),S("fact",W).args([["*n","integer+"]]),S("factdouble",function(e){for(var t=2+(1&e),n=1;t<=e;t+=2)n*=t;return n}).args([["*n","integer+"]]),S("multinomial",function(e){var t=1,n=0;return e.forEach(function(e){if(e<0)throw new E("NUM");n+=e,t*=W(e)}),W(n)/t}).args([["numbers",["collect","number"]]]),U=y.memoize(function(e,t){for(var n=t+1,i=1,r=1,o=1;i<=e-t;++n,++i)r*=n,o*=i;return r/o}),S("combin",U).args([["*n","integer++"],["*k",["and","integer",["[between]",0,"$n"]]]]),S("combina",function(e,t){return U(e+t-1,e-1)}).args([["*n","integer++"],["*k",["and","integer",["[between]",1,"$n"]]]]),S("average",function(e){var t=e.reduce(function(e,t){return e+t},0);return t/e.length}).args([["numbers",["collect",["and","number",["not","boolean"]]]],["?",["assert","$numbers.length > 0","DIV/0"]]]),S("averagea",function(e){var t=0,n=0;return e.forEach(function(e){"string"!=typeof e&&(t+=e),++n}),n?t/n:new E("DIV/0")}).args([["values",["collect","anyvalue"]]]),S("percentile.inc",h).args([["numbers",["collect","number",1]],["p",["and","number",["[between]",0,1]]]]),S("percentile.exc",f).args([["numbers",["collect","number",1]],["p",["and","number",["(between)",0,1]]]]),S("quartile.inc",function(e,t){return h(e,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]),S("quartile.exc",function(e,t){return f(e,t/4)}).args([["numbers",["collect","number",1]],["quarter",["values",0,1,2,3,4]]]),D("quartile","quartile.inc"),D("percentile","percentile.inc"),q=["AVERAGE","COUNT","COUNTA","MAX","MIN","PRODUCT","STDEV.S","STDEV.P","SUM","VAR.S","VAR.P","MEDIAN","MODE.SNGL","LARGE","SMALL","PERCENTILE.INC","QUARTILE.INC","PERCENTILE.EXC","QUARTILE.EXC"],S("aggregate",function(e,t,n,i){var r=this;r.resolveCells(i,function(){var o,a;if(t>12){if(o=p(r,i[0],n),a=i[1],a instanceof R&&(a=r.getRefData(a)),"number"!=typeof a)return e(new E("VALUE"))}else o=p(r,i,n);r.func(q[t-1],e,o)})}).argsAsync([["funcId",["values",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]],["options",["or",["null",0],["values",0,1,2,3,4,5,6,7]]],["args","rest"]]),S("subtotal",function(e,t){var n,i,r=this,o=t>100;for(o&&(t-=100),n=[],i=2;i<arguments.length;++i)n.push(arguments[i]);r.resolveCells(n,function(){var i=p(r,n,o?1:0);r.func(q[t-1],e,i)})}).argsAsync([["funcId",["values",1,2,3,4,5,6,7,8,9,10,11,101,102,103,104,105,106,107,108,109,110,111]],["+",["ref",["or","ref","#matrix"]]]]),S("avedev",function(e){var t=e.reduce(function(e,t){return e+t},0)/e.length;return e.reduce(function(e,n){return e+Math.abs(n-t)},0)/e.length}).args([["numbers",["collect","number"]],["?",["assert","$numbers.length >= 2","NUM"]]]),S("binom.dist",m).args([["successes","integer+"],["trials",["and","integer",["assert","$trials >= $successes"]]],["probability",["and","number",["[between]",0,1]]],["cumulative","logical"]]),D("binomdist","binom.dist"),S("binom.inv",function(e,t,n){for(var i=0;i<=e;++i)if(m(i,e,t,!0)>=n)return i;return new E("N/A")}).args([["trials","integer+"],["probability",["and","number",["[between]",0,1]]],["alpha",["and","number",["[between]",0,1]]]]),D("critbinom","binom.inv"),S("binom.dist.range",function(e,t,n,i){var r,o=0;for(r=n;r<=i;++r)o+=U(e,r)*Math.pow(t,r)*Math.pow(1-t,e-r);return o}).args([["trials","integer+"],["probability",["and","number",["[between]",0,1]]],["successes_min",["and","integer",["[between]",0,"$trials"]]],["successes_max",["or",["and","integer",["[between]","$successes_min","$trials"]],["null","$successes_min"]]]]),S("negbinom.dist",function(e,t,n,i){if(i){for(var r=0;e>=0;)r+=U(e+t-1,e)*Math.pow(n,t)*Math.pow(1-n,e),e--;return r}return U(e+t-1,e)*Math.pow(n,t)*Math.pow(1-n,e)}).args([["number_f","integer+"],["number_s","integer+"],["probability_s",["and","number",["[between]",0,1]]],["cumulative","logical"]]),D("negbinomdist","negbinom.dist"),S("address",function(e,t,n,i,r){var o=new R(e-1,t-1,n-1);return r&&o.setSheet(r,!0),i?o.print(0,0):o.print()}).args([["row","integer++"],["col","integer++"],["abs",["or",["null",1],["values",1,2,3,4]]],["a1",["or",["null",!0],"logical"]],["sheet",["or","null","string"]]]),S("areas",function(e){var t=0;return function n(e){e instanceof R||e instanceof F?t++:e instanceof I&&e.refs.forEach(n)}(e),t}).args([["ref","ref"]]),S("choose",function(e,t){return e>t.length?new E("N/A"):t[e-1]}).args([["*index","integer"],["+",["value","anything"]]]),S("column",function(e){return e?e instanceof R?e.col+1:this.asMatrix(e).mapCol(function(t){return t+e.topLeft.col+1}):this.formula.col+1}).args([["ref",["or","area","null"]]]),S("columns",function(e){return e instanceof M?e.width():e.width}).args([["ref",["or","area","#matrix"]]]),S("formulatext",function(e){var t=this.getRefCells(e)[0];return t.formula?t.formula.print(t.row,t.col):new E("N/A")}).args([["ref","ref"]]),S("hlookup",function(e,t,n,i){var r=null;return t.eachCol(function(n){var o=t.get(0,n);if(i){if(o>e)return!0;r=n}else if(o===e)return r=n,!0}),null==r?new E("N/A"):t.get(n-1,r)}).args([["value","anyvalue"],["range","matrix"],["row","integer++"],["approx",["or","logical",["null",!0]]]]),S("index",function(e,t,n,i,r){var o,a,s,l=this;if(t instanceof I&&(t=t.refs[r-1]),!n&&!i||!t)return e(new E("N/A"));if(t instanceof R&&(t=t.toRangeRef()),t instanceof F){if(n&&i)return i>t.width()||n>t.height()?e(new E("REF")):(o=t.toCell(n-1,i-1),void l.resolveCells([o],function(){e(l.getRefData(o))}));if(!n)return a=t.toColumn(i-1),void l.resolveCells([a],function(){e(l.asMatrix(a))});if(!i)return s=t.toRow(n-1),void l.resolveCells([s],function(){e(l.asMatrix(s))})}else if(t instanceof A){if(t.width>1&&t.height>1){if(n&&i)return e(t.get(n-1,i-1));if(!n)return e(t.mapRow(function(e){return t.get(e,i-1)}));if(!i)return e(t.mapCol(function(e){return t.get(n-1,e)}))}if(1==t.width)return e(t.get(n-1,0));if(1==t.height)return e(t.get(0,i-1))}else e(new E("REF"))}).argsAsync([["range",["or","ref","matrix"]],["row",["or","integer+","null"]],["col",["or","integer+","null"]],["areanum",["or","integer++",["null",1]]]]),S("indirect",function(e){var t,n;try{if(t=this.formula,n=C.parseFormula(t.sheet,t.row,t.col,e),!(n.ast instanceof M))throw 1;return n.ast.absolute(t.row,t.col)}catch(i){return new E("REF")}}).args([["thing","string"]]),S("match",function(e,t,n){var i,r=1;return 0===n?i=$(e):n===-1?i=$("<="+e):1===n&&(i=$(">="+e)),t.each(function(t){return null!=t&&i(t)?(0!==n&&e!=t&&--r,!0):void r++},!0)&&r>0?r:new E("N/A")}).args([["value","anyvalue"],["range","matrix"],["type",["or",["values",-1,0,1],["null",1]]]]),S("offset",function(e,t,n,i,r){var o=(e instanceof R?e:e.topLeft).clone();return o.row+=t,o.col+=n,o.row<0||o.col<0?new E("VALUE"):i>1||r>1?new F(o,new R(o.row+i-1,o.col+r-1)).setSheet(e.sheet,e.hasSheet()):o}).args([["ref","area"],["*rows","integer"],["*cols","integer"],["*height",["or","integer++",["null","$ref.height()"]]],["*width",["or","integer++",["null","$ref.width()"]]]]),S("row",function(e){return e?e instanceof R?e.row+1:this.asMatrix(e).mapRow(function(t){return t+e.topLeft.row+1}):this.formula.row+1}).args([["ref",["or","area","null"]]]),S("rows",function(e){return e instanceof M?e.height():e.height}).args([["ref",["or","area","#matrix"]]]),S("vlookup",function(e,t,n,i){var r=null;return"number"!=typeof e&&(i=!1),"string"==typeof e&&(e=e.toLowerCase()),t.eachRow(function(n){var o=t.get(n,0);if(i){if(o>e)return!0;r=n}else if("string"==typeof o&&(o=o.toLowerCase()),o===e)return r=n,!0}),null==r?new E("N/A"):t.get(r,n-1)}).args([["value","anyvalue"],["range","matrix"],["col","integer++"],["approx",["or","logical",["null",!0]]]]),S("date",function(e,t,n){return H(e,t-1,n)}).args([["*year","integer"],["*month","integer"],["*date","integer"]]),S("day",function(e){return N(e).date}).args([["*date","date"]]),S("month",function(e){return N(e).month+1}).args([["*date","date"]]),S("year",function(e){return N(e).year}).args([["*date","date"]]),S("weekday",function(e){return N(e).day+1}).args([["*date","date"]]),S("weeknum",function(e,t){var n,i=H(N(e).year,0,1),r=N(i);return 21==t?(n=3-(r.day+6)%7,n<0&&(n+=7),i+=n,r.date+=n,r.day=4,t=1):t=1==t?0:2==t?1:(t-10)%7,n=r.day-t,n<0&&(n+=7),i-=n,Math.ceil((e+1-i)/7)}).args([["*date","date"],["*type",["or",["null",1],["values",1,2,11,12,13,14,15,16,17,21]]]]),S("isoweeknum",function(e){var t=N(e),n=t.day||7,i=Math.floor((t.ord-n+10)/7);return i<1?g(t.year-1):53==i&&i>g(t.year)?1:i}).args([["*date","date"]]),S("now",function(){return T.dateToSerial(new Date)}).args([]),S("today",function(){return 0|T.dateToSerial(new Date)}).args([]),S("time",function(e,t,n){return T.packTime(e,t,n,0)}).args([["*hours","integer"],["*minutes","integer"],["*seconds","integer"]]),S("hour",function(e){return T.unpackTime(e).hours}).args([["*time","datetime"]]),S("minute",function(e){return T.unpackTime(e).minutes}).args([["*time","datetime"]]),S("second",function(e){return T.unpackTime(e).seconds}).args([["*time","datetime"]]),S("edate",function(e,t){var n=N(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),n=Math.min(n.date,z(r,i)),H(r,i,n)}).args([["*start_date","date"],["*months","integer"]]),S("eomonth",function(e,t){var n=N(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),n=z(r,i),H(r,i,n)}).args([["*start_date","date"],["*months","integer"]]),S("workday",function(e,t,n){var i,r=t>0?1:-1;for(t=Math.abs(t),i=N(e).day;t>0;)e+=r,i=(i+r)%7,i>0&&i<6&&n.indexOf(e)<0&&--t;return e}).args([["start_date","date"],["days","integer"],["holidays",["collect","date"]]]),S("networkdays",function(e,t,n){var i,r,o;for(e>t&&(i=e,e=t,t=i),r=0,o=N(e).day;e<=t;)o>0&&o<6&&n.indexOf(e)<0&&r++,e++,o=(o+1)%7;return r}).args([["start_date","date"],["end_date","date"],["holidays",["collect","date"]]]),S("days",function(e,t){return t-e}).args([["*start_date","date"],["*end_date","date"]]),T._days_360=v,S("days360",v).args([["*start_date","date"],["*end_date","date"],["*method",["or","logical",["null",!1]]]]),S("yearfrac",function(e,t,n){switch(n){case 0:return v(e,t,!1)/360;case 1:return(t-e)/P(N(e).year);case 2:return(t-e)/360;case 3:return(t-e)/365;case 4:return v(e,t,!0)/360}}).args([["*start_date","date"],["*end_date","date"],["*method",["or",["null",0],["values",0,1,2,3,4]]]]),S("datevalue",function(e){var t=T.parseDate(e);return t?T.dateToSerial(t):new E("VALUE")}).args([["*text","string"]]),S("timevalue",function(e){var t,n,i,r,o=e.toLowerCase().match(/(\d+):(\d+)(:(\d+)(\.(\d+))?)?\s*(am?|pm?)?/);return o?(t=parseFloat(o[1]),n=parseFloat(o[2]),i=o[3]?parseFloat(o[4]):0,r=o[7],r&&(t>12||t<1)?new E("VALUE"):(/^p/.test(r)&&(t+=12),T.packTime(t,n,i,0))):new E("VALUE")}).args([["*text","string"]]),S("mdeterm",function(e){var t=e.each(function(e){if("number"!=typeof e)return new E("VALUE")},!0);return t||e.determinant()}).args([["m",["and","matrix",["assert","$m.width == $m.height"]]]]),S("transpose",function(e){return e.transpose()}).args([["range","matrix"]]),S("mmult",function(e,t){return e.multiply(t)}).args([["a","matrix"],["b",["and","matrix",["assert","$b.height == $a.width"]]]]),S("munit",function(e){return new A(this).unit(e)}).args([["n","integer+"]]),S("minverse",function(e){var t=e.each(function(e){if("number"!=typeof e)return new E("VALUE")},!0);return t||e.inverse()||new E("VALUE")}).args([["m",["and","matrix",["assert","$m.width == $m.height"]]]]),S("rand",function(){return Math.random()}).args([]),S("randbetween",function(e,t){return e+Math.floor((t-e+1)*Math.random())}).args([["min","integer"],["max",["and","integer",["assert","$max >= $min"]]]]),S("true",function(){return!0}).args([]),S("false",function(){return!0}).args([]),S("roman",function(e){return y.arabicToRoman(e).toUpperCase()}).args([["*number","integer"]]),S("arabic",function(e){var t=y.romanToArabic(e);return null==t?new E("VALUE"):t}).args([["*roman","string"]]),S("base",function(e,t,n){for(var i=e.toString(t).toUpperCase();i.length<n;)i="0"+i;return i}).args([["*number","integer"],["*radix",["and","integer",["[between]",2,36]]],["*minLen",["or","integer+",["null",0]]]]),S("decimal",function(e,t){var n,i,r;for(e=e.toUpperCase(),n=0,i=0;i<e.length;++i){if(r=e.charCodeAt(i),r>=48&&r<=57)r-=48;else{if(!(r>=65&&r<55+t))return new E("VALUE");r-=55}n=n*t+r}return n}).args([["*text","string"],["*radix",["and","integer",["[between]",2,36]]]]),S("char",function(e){return String.fromCharCode(e)}).args([["*code","integer+"]]),j=/[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,S("clean",function(e){return e.replace(j,"")}).args([["*text","string"]]),S("code",function(e){return e.charAt(0)}).args([["*text","string"]]),D("unichar","char"),D("unicode","code"),S("concatenate",function(e){var t,n="";for(t=0;t<e.length;++t)n+=e[t];return n}).args([["+",["*text","string"]]]),S("dollar",function(e,t){for(var n="$#,##0.DECIMALS;($#,##0.DECIMALS)",i="";t-- >0;)i+="0";return n=n.replace(/DECIMALS/g,i),x.formatting.text(e,n)}).args([["*number","number"],["*decimals",["or","integer++",["null",2]]]]),S("exact",function(e,t){return e===t}).args([["*text1","string"],["*text2","string"]]),S("find",function(e,t,n){var i=t.indexOf(e,n-1);return i<0?new E("VALUE"):i+1}).args([["*substring","string"],["*string","string"],["*start",["or","integer++",["null",1]]]]),S("fixed",function(e,t,n){for(var i=n?"0.DECIMALS":"#,##0.DECIMALS",r="";t-- >0;)r+="0";return i=i.replace(/DECIMALS/g,r),x.formatting.text(e,i)}).args([["*number","number"],["*decimals",["or","integer++",["null",2]]],["*noCommas",["or","boolean",["null",!1]]]]),S("left",function(e,t){return e.substr(0,t)}).args([["*text","string"],["*length",["or","integer+",["null",1]]]]),S("right",function(e,t){return e.substr(-t)}).args([["*text","string"],["*length",["or","integer+",["null",1]]]]),S("len",function(e){return e.length}).args([["*text","string"]]),S("lower",function(e){return e.toLowerCase()}).args([["*text","string"]]),S("upper",function(e){return e.toUpperCase()}).args([["*text","string"]]),S("ltrim",function(e){return e.replace(/^\s+/,"")}).args([["*text","string"]]),S("rtrim",function(e){return e.replace(/\s+$/,"")}).args([["*text","string"]]),S("trim",function(e){return e.replace(/^\s+|\s+$/,"")}).args([["*text","string"]]),S("mid",function(e,t,n){return e.substr(t-1,n)}).args([["*text","string"],["*start","integer++"],["*length","integer+"]]),S("proper",function(e){return e.toLowerCase().replace(/\b./g,function(e){return e.toUpperCase()})}).args([["*text","string"]]),S("replace",function(e,t,n,i){return e.substr(0,--t)+i+e.substr(t+n)}).args([["*text","string"],["*start","integer++"],["*length","integer+"],["*newText","string"]]),S("rept",function(e,t){for(var n="";t-- >0;)n+=e;return n}).args([["*text","string"],["*number","integer+"]]),S("search",function(e,t,n){var i=t.toLowerCase().indexOf(e.toLowerCase(),n-1);return i<0?new E("VALUE"):i+1}).args([["*substring","string"],["*string","string"],["*start",["or","integer++",["null",1]]]]),S("substitute",function(e,t,n,i){function r(){e=e.substring(0,o)+n+e.substring(o+t.length)}if(t===n)return e;for(var o=-1;(o=e.indexOf(t,o+1))>=0;)if(null==i)r();else if(0===--i){r();break}return e}).args([["*text","string"],["*oldText","string"],["*newText","string"],["*nth",["or","integer++","null"]]]),S("t",function(e){return"string"==typeof e?e:""}).args([["*value","anyvalue"]]),S("text",function(e,t){return x.formatting.text(e,t)}).args([["*value","anyvalue"],["*format","string"]]),S("value",function(e){return"number"==typeof e?e:"boolean"==typeof e?+e:(e=(e+"").replace(/[$€,]/g,""),e=parseFloat(e),isNaN(e)?new E("VALUE"):e)}).args([["*value","anyvalue"]]),_.prototype.toString=function(){return this.text},S("hyperlink",function(e,t){return new _(e,t)}).args([["*link","string"],["*text",["or","string",["null","$link"]]]]),S("iferror",function(e,t){return e instanceof E?t:e}).args([["*value","forced!"],["*value_if_error","anyvalue!"]]),$=function(){function e(e,t){if("string"==typeof t){var n=parseFloat(t);isNaN(n)||n!=t||(t=n)}return function(n){var i=t;return"string"==typeof n&&"string"==typeof i&&(n=n.toLowerCase(),i=i.toLowerCase()),e(n,i)}}function t(e){var t,n;return"string"==typeof e&&(e=e.toLowerCase()),/^[0-9.]+%$/.test(e)?(n=e.substr(0,e.length-1),t=parseFloat(n),isNaN(t)||t!=n||(e=t/100)):/^[0-9.]+$/.test(e)&&(t=parseFloat(e),isNaN(t)||t!=e||(e=t)),e}function n(e,n){return t(e)<t(n)}function i(e,n){return t(e)<=t(n)}function r(e,n){return t(e)>t(n)}function o(e,n){return t(e)>=t(n)}function a(e,t){return!s(e,t)}function s(e,n){return n instanceof RegExp?n.test(e):("string"!=typeof e&&"string"!=typeof n||(e+="",n+=""),t(e)==t(n))}var l=Object.create(null);return function(t){var d,c;return"function"==typeof t?t:(d=/^=(.*)$/.exec(t))?e(s,d[1]):(d=/^<>(.*)$/.exec(t))?e(a,d[1]):(d=/^<=(.*)$/.exec(t))?e(i,d[1]):(d=/^<(.*)$/.exec(t))?e(n,d[1]):(d=/^>=(.*)$/.exec(t))?e(o,d[1]):(d=/^>(.*)$/.exec(t))?e(r,d[1]):/[?*]/.exec(t)?(c=l[t],c||(c=t.replace(/(~\?|~\*|[\]({\+\.\|\^\$\\})\[]|[?*])/g,function(e){switch(e){case"~?":return"\\?";case"~*":return"\\*";case"?":return".";case"*":return".*";default:return"\\"+e}}),c=l[t]=RegExp("^"+c+"$","i")),e(s,c)):e(s,t)}}())},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/runtime.functions.2.min",["spreadsheet/runtime.min"],e)}(function(){"use strict";function e(e){var n,i,r,o;if(dt(e)>=3.3)return 1-t(e);for(n=e>0?1:-1,n==-1&&(e=-e),i=0,r=1,o=1;o<100;o++)i+=r,r*=2*e*e/(2*o+1);return 2*n/Math.sqrt(Math.PI)*e*Math.exp(-e*e)*i}function t(t){var n,i,r;if(dt(t)<3.3)return 1-e(t);for(n=1,t<0&&(n=-1,t=-t),i=t,r=8;r>=1;r-=.5)i=t+r/i;return i=1/(t+i),1==n?Math.exp(-t*t)/Math.sqrt(Math.PI)*i:2-Math.exp(-t*t)/Math.sqrt(Math.PI)*i}function n(e){var t,n=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],i=e,r=e+5.5,o=n[0];for(r-=(e+.5)*Math.log(r),t=1;t<=6;t++)i+=1,o+=n[t]/i;return-r+Math.log(Math.sqrt(2*Math.PI)*o/e)}function i(e){if(e>0)return Math.exp(n(e));var t=Math.PI,r=-e;return-t/(r*i(r)*Math.sin(t*r))}function r(e,t){return n(e)+n(t)-n(e+t)}function o(e,t){return Math.exp(r(e,t))}function a(e,t){return t<e+1?s(e,t):1-l(e,t)}function s(e,t){var i,r=1/e,o=r,a=e,s=n(e);for(i=1;i<=at&&(a++,o*=t/a,r+=o,!(dt(o)<dt(r)*st));i++);return r*Math.exp(-t+e*Math.log(t)-s)}function l(e,t){var i,r,o=lt,a=o,s=0,l=1,d=t+1-e,c=n(e);for(i=1;i<=at&&(s=d+l*s,dt(s)<lt&&(s=lt),a=d+l/a,dt(a)<lt&&(a=lt),s=1/s,r=a*s,o*=r,!(dt(r-1)<st));i++)d+=2,l=-i*(i-e);return o*Math.exp(-t-c+e*Math.log(t))}function d(e,t,n,r){return r?a(t,e/n):Math.pow(e/n,t-1)*Math.exp(-e/n)/(n*i(t))}function c(e,t,n){var i,r,o,a,s,l;if(0===e)return 0;if(1==e)return 1/0;for(i=0,r=10,o=0,a=t*n,a>1&&(r*=a),s=0;s<at&&(o=.5*(i+r),l=d(o,t,n,!0),!(dt(e-l)<1e-16));s++)l>e?r=o:i=o;return o}function u(t,n){return n?.5+.5*e(t/Math.sqrt(2)):Math.exp(-t*t/2)/Math.sqrt(2*Math.PI)}function h(e){var t,n,i=[-39.69683028665376,220.9460984245205,-275.9285104469687,138.357751867269,-30.66479806614716,2.506628277459239],r=[-54.47609879822406,161.5858368580409,-155.6989798598866,66.80131188771972,-13.28068155288572],o=[-.007784894002430293,-.3223964580411365,-2.400758277161838,-2.549732539343734,4.374664141464968,2.938163982698783],a=[.007784695709041462,.3224671290700398,2.445134137142996,3.754408661907416],s=.02425,l=1-s;return e<s?(t=Math.sqrt(-2*Math.log(e)),(((((o[0]*t+o[1])*t+o[2])*t+o[3])*t+o[4])*t+o[5])/((((a[0]*t+a[1])*t+a[2])*t+a[3])*t+1)):l<e?(t=Math.sqrt(-2*Math.log(1-e)),-(((((o[0]*t+o[1])*t+o[2])*t+o[3])*t+o[4])*t+o[5])/((((a[0]*t+a[1])*t+a[2])*t+a[3])*t+1)):(t=e-.5,n=t*t,(((((i[0]*n+i[1])*n+i[2])*n+i[3])*n+i[4])*n+i[5])*t/(((((r[0]*n+r[1])*n+r[2])*n+r[3])*n+r[4])*n+1))}function f(e,t,n,i){return i?u((e-t)/n,!0):Math.exp(-(e-t)*(e-t)/(2*n*n))/(n*Math.sqrt(2*Math.PI))}function p(e,t,n){return t+n*h(e)}function m(e,t,n){return Math.exp((t-1)*Math.log(e)+(n-1)*Math.log(1-e)-r(t,n))}function g(e,t,n){var i=Math.exp(t*Math.log(e)+n*Math.log(1-e)-r(t,n));return e<(t+1)/(t+n+2)?i*v(t,n,e)/t:1-i*v(n,t,1-e)/n}function v(e,t,n){var i,r,o,a,s,l=e+t,d=e+1,c=e-1,u=1,h=1-l*n/d;for(dt(h)<lt&&(h=lt),h=1/h,s=h,i=1;i<=at&&(r=2*i,o=i*(t-i)*n/((c+r)*(e+r)),h=1+o*h,dt(h)<lt&&(h=lt),u=1+o/u,dt(u)<lt&&(u=lt),h=1/h,s*=h*u,o=-(e+i)*(l+i)*n/((e+r)*(d+r)),h=1+o*h,dt(h)<lt&&(h=lt),u=1+o/u,dt(u)<lt&&(u=lt),h=1/h,a=h*u,s*=a,!(dt(a-1)<st));i++);return s}function _(e,t,n){var i,r,o=0,a=1,s=0;for(i=0;i<at&&(s=.5*(o+a),r=g(s,t,n),!(dt(e-r)<st));i++)r>e?a=s:o=s;return s}function b(e,t,n,i,r){return g((e-i)/(r-i),t,n)}function k(e,t,n,i,r,o){return i?g((e-r)/(o-r),t,n):m((e-r)/(o-r),t,n)/(o-r)}function w(e,t,n,i,r){return i+(r-i)*_(e,t,n)}function y(e,t,n){return d(e,t/2,2,n)}function x(e,t){return 1-y(e,t,!0)}function C(e,t){return c(e,t/2,2)}function T(e,t){return C(1-e,t)}function S(e,t){var n,i,r,o,a,s=e.length,l=e[0].length,d=0;for(n=0;n<s;n++)for(i=0;i<l;i++)r=t[n][i],o=e[n][i]-r,o*=o,d+=o/r;return a=(s-1)*(l-1),x(d,a)}function D(e,t,n){return n?1-Math.exp(-t*e):t*Math.exp(-t*e)}function E(e,t,n){var i,r;if(n)return 1-y(2*t,2*(e+1),!0);for(i=0,r=2;r<=e;r++)i+=Math.log(r);return Math.exp(e*Math.log(t)-t-i)}function F(e,t,n,i){if(i)return g(t*e/(n+t*e),t/2,n/2);var r=t/n;return t/=2,n/=2,r/o(t,n)*Math.pow(r*e,t-1)/Math.pow(1+r*e,t+n)}function R(e,t,n){return 1-F(e,t,n,!0)}function I(e,t,n){return n/t*(1/w(e,n/2,t/2,0,1)-1)}function A(e,t,n){return n/t*(1/w(1-e,n/2,t/2,0,1)-1)}function M(e){var t,n=0,i=e.length;for(t=0;t<i;t++)n+=e[t];return n/i}function z(e,t){var n,i,r=0,o=e.length;for(n=0;n<o;n++)i=e[n]-t,r+=i*i;return r/(o-1)}function H(e,t){var n=e.length-1,i=t.length-1,r=z(e,M(e)),o=z(t,M(t));if(!r||!o)throw new Ze("DIV/0");return 2*F(r/o,n,i,!0)}function N(e){return.5*Math.log((1+e)/(1-e))}function P(e){var t=Math.exp(2*e);return(t-1)/(t+1)}function L(e,t,n){return n?1-.5*g(t/(e*e+t),t/2,.5):1/(Math.sqrt(t)*o(.5,t/2))*Math.pow(1+e*e/t,-(t+1)/2)}function B(e,t){return 1-L(e,t,!0)}function O(e,t){return e<0&&(e=-e),2*B(e,t)}function V(e,t){var n=_(2*Math.min(e,1-e),t/2,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}function W(e,t){return V(1-e/2,t)}function U(e,t,n,i){var r,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,k=e.length,w=t.length;if(1==i){for(a=0,s=0,l=0;l<k;l++)d=e[l]-t[l],a+=d,s+=d*d;return c=a/k,r=c/Math.sqrt((s-a*c)/(k*(k-1))),1==n?B(r,k-1):O(r,k-1)}return u=M(e),h=M(t),f=z(e,u),p=z(t,h),3==i?(m=f/k,g=p/w,v=m+g,_=m/v,b=g/v,o=1/(_*_/(k-1)+b*b/(w-1)),r=dt(u-h)/Math.sqrt(v),1==n?B(r,o):O(r,o)):(o=k+w-2,r=dt(u-h)*Math.sqrt(o*k*w/((k+w)*((k-1)*f+(w-1)*p))),1==n?B(r,o):O(r,o))}function q(e,t,n){return-V(e/2,n-1)*t/Math.sqrt(n)}function j(e,t,n){return-h(e/2)*t/Math.sqrt(n)}function $(e){return u(e,!0)-.5}function G(e){return u(e)}function Y(t,n,i,r){if(r)return.5+.5*e((Math.log(t)-n)/(i*Math.sqrt(2)));var o=Math.log(t)-n;return Math.exp(-o*o/(2*i*i))/(t*i*Math.sqrt(2*Math.PI))}function K(e,t,n){return Math.exp(p(e,t,n))}function Q(e,t,n,i){var r,o,a,s=e.length,l=0;for(r=0;r<s;r++){
if(t[r]<=0||t[r]>1)throw new Ze("NUM");l+=t[r]}if(1!=l)throw new Ze("NUM");for(o=0,r=0;r<s;r++)a=e[r],a>=n&&a<=i&&(o+=t[r]);return o}function X(e,t){var n,i,r,o=M(t),a=M(e),s=0,l=0;for(n=0,i=e.length;n<i;n++)r=t[n]-o,s+=r*(e[n]-a),l+=r*r;return s/l}function J(e,t){var n,i,r,o=M(t),a=M(e),s=0,l=0;for(n=0,i=e.length;n<i;n++)r=t[n]-o,s+=r*(e[n]-a),l+=r*r;return a-s*o/l}function Z(e,t){var n,i,r,o,a=M(e),s=M(t),l=0,d=0,c=0;for(n=0,i=e.length;n<i;n++)r=e[n]-a,o=t[n]-s,l+=r*o,d+=r*r,c+=o*o;return l/Math.sqrt(d*c)}function ee(e,t){var n=Z(e,t);return n*n}function te(e,t){var n,i,r,o=t.length,a=M(t),s=M(e),l=0,d=0,c=0;for(n=0;n<o;n++)i=t[n]-a,r=e[n]-s,l+=r*r,d+=i*r,c+=i*i;return Math.sqrt((l-d*d/c)/(o-2))}function ne(e,t,n){var i,r,o,a,s,l,d=M(n),c=M(t),u=0,h=0;for(i=0,r=n.length;i<r;i++)o=n[i]-d,a=t[i]-c,u+=o*a,h+=o*o;if(0===h)throw new Ze("N/A");return s=u/h,l=c-s*d,l+s*e}function ie(e){var t,n=e.height,i=0;for(t=0;t<n;t++)i+=e.data[t][0];return i/n}function re(e,t){var n,i,r=e.height,o=0;for(n=0;n<r;n++)i=e.data[n][0]-t,o+=i*i;return o}function oe(e,t,n,i){var r,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,k,w,y=0;for(t||(t=e.map(function(){return++y})),n&&(t=t.clone(),t.eachRow(function(e){t.data[e].unshift(1)}),++t.width),r=t.transpose(),o=r.multiply(t).inverse().multiply(r).multiply(e),a=[],y=o.height-1;y>=0;y--)a.push(o.data[y][0]);if(n||a.push(0),!i)return this.asMatrix([a]);for(s=t.multiply(o),l=e.adds(s,!0),d=n?ie(s):0,c=re(s,d),u=n?ie(l):0,h=re(l,u),f=[],f.push(c,h),p=c/(c+h),m=e.height-t.width,g=Math.sqrt(h/m),v=[],v.push(p,g),_=n?c/(t.width-1)/(h/m):p/t.width/((1-p)/m),b=[],b.push(_,m),k=r.multiply(t).inverse(),w=[],y=k.height-1;y>=0;y--)w.push(Math.sqrt(k.data[y][y]*h/m));return this.asMatrix([a,w,v,b,f])}function ae(e,t,n,i){return oe.call(this,e.map(Math.log),t,n,i).map(Math.exp)}function se(e,t,n,i){var r,o,a=0;return t||(t=e.map(function(){return++a})),i&&(t=t.clone(),t.eachRow(function(e){t.data[e].unshift(1)}),++t.width),r=t.transpose(),o=r.multiply(t).inverse().multiply(r).multiply(e),n?i&&(n=n.clone(),n.eachRow(function(e){n.data[e].unshift(1)}),++n.width):n=t,n.multiply(o)}function le(e,t,n,i){return se.call(this,e.map(Math.log),t,n,i).map(Math.exp)}function de(e,t,n,i){var r,o,a,s,l,d=n||20,c=i||1e-7,u=t;for(r=1;r<=d;r++)if(o=e(u),a=o[0],s=o[1],l=a/s,u-=l,Math.abs(l)<c)return u;return new Ze("NUM")}function ce(e,t,n,i,r){var o=Math.pow(1+e,t),a=e?(o-1)/e:t;return-(i*o+n*a*(1+e*r))}function ue(e,t,n,i,r){if(!e)return-i-n*t;var o=Math.pow(1+e,t);return-(i+n*(o-1)/e*(1+e*r))/o}function he(e,t,n,i,r){if(!e)return-(i+n)/t;var o=Math.pow(1+e,t);return-e*(i+n*o)/((1+e*r)*(o-1))}function fe(e,t,n,i,r){if(!e)return-(i+n)/t;var o=t*(1+e*r);return Math.log((o-i*e)/(o+n*e))/Math.log(1+e)}function pe(e,t,n,i,r,o){function a(o){var a=Math.pow(1+o,e-1),s=a*(1+o);return[n*s+t*(1/o+r)*(s-1)+i,e*n*a+t*(-(s-1)/(o*o)+(1/o+r)*e*a)]}return de(a,o)}function me(e,t,n,i,r,o){var a,s;return 1==o&&1==t?0:(a=he(e,n,i,r,o),s=ce(e,t-1,a,i,o)*e,o?s/(1+e):s)}function ge(e,t,n,i,r,o){var a=he(e,n,i,r,o);return a-me(e,t,n,i,r,o)}function ve(e,t,n,i,r,o){var a,s,l,d,c,u;return 1==o&&(i--,r--),a=Math.pow(1+e,t),s=Math.pow(1+e,i-1),l=Math.pow(1+e,r),d=e*n*a/(a-1),c=s*n-(s-1)/e*d,u=l*n-(l-1)/e*d,u-c}function _e(e,t,n,i,r,o){var a,s=0;for(a=i;a<=r;a++)s+=me(e,a,t,n,0,o);return s}function be(e,t){var n,i,r=0;for(n=0,i=t.length;n<i;n++)r+=t[n]*Math.pow(1+e,-n-1);return r}function ke(e,t){function n(t){var n,i,r=0,o=0;for(n=0,i=e.length;n<i;n++)r+=e[n]*Math.pow(1+t,-n-1),o+=-n*e[n]*Math.pow(1+t,-n-2);return[r,o]}return de(n,t)}function we(e,t){return Math.pow(1+e/t,t)-1}function ye(e,t){return t*(Math.pow(e+1,1/t)-1)}function xe(e,t,n){var i,r,o=0;for(i=0,r=t.length;i<r;i++)o+=t[i]*Math.pow(1+e,(n[0]-n[i])/365);return o}function Ce(e,t,n){function i(n){var i,r,o,a=e[0],s=0;for(i=1,r=e.length;i<r;i++)o=(t[0]-t[i])/365,a+=e[i]*Math.pow(1+n,o),s+=o*e[i]*Math.pow(1+n,o-1);return[a,s]}return de(i,n)}function Te(e,t,n,i){var r=-i*e;return r*(1-t/n)}function Se(e,t,n,i,r){var o,a,s=1-Math.pow(t/e,1/n);if(s=Math.floor(1e3*s+.5)/1e3,o=e*s*r/12,1==i)return o;for(a=1;a<n;a++){if(a==i-1)return(e-o)*s;o+=(e-o)*s}return(e-o)*s*(12-r)/12}function De(e,t,n,i,r){var o=r/n,a=-e*(Math.pow(1-o,i-1)-1),s=(e-a)*o;return s=Math.min(s,Math.max(0,e-a-t))}function Ee(e,t,n){return(e-t)/n}function Fe(e,t,n,i){return(e-t)*(n-i+1)*2/(n*(n+1))}function Re(e,t,n,i,r,o,a){function s(e,n){var i,r,o;return r=1==f?1==n?e:0:e*Math.pow(1-f,n-1),o=e*Math.pow(1-f,n),i=o<t?r-t:r-o,i<0?0:i}function l(e,n,i){var r,o,a,l=e-t,d=Math.ceil(i),c=0,u=0,h=!1;for(o=1;o<=d;o++)h?r=c:(a=s(e,o),c=l/(n-o+1),c>a?(r=c,h=!0):(r=a,l-=a)),o==d&&(r*=i+1-d),u+=r;return u}var d,c,u,h,f=o>=n?1:o/n,p=Math.floor(i),m=Math.ceil(r),g=0;if(a)for(d=p+1;d<=m;d++)c=s(e,d),d==p+1?c*=Math.min(r,p+1)-i:d==m&&(c*=r+1-m),g+=c;else u=n,i!=Math.floor(i)&&o>1&&i>=n/2&&(h=i-n/2,i=n/2,r-=h,u+=1),e-=l(e,u,i),g=l(e,n-i,r-i);return g}function Ie(e,t){var n=tt(e),i=n.month+t,r=n.year+Math.floor(i/12);return i%=12,i<0&&(i+=12),n=Math.min(n.date,it(r,i)),et(r,i,n)}function Ae(e,t,n){return 1==n||2==n||3==n?t-e:rt(e,t,n)}function Me(e,t,n){var i,r,o,a=tt(e),s=tt(t),l=s.year-a.year;l>0&&(l=(l-1)*n),o=12/n;do l++,i=Ie(t,-l*o);while(e<i);return l--,r=Ie(t,-l*o),[i,r]}function ze(e,t,n){var i,r,o,a=tt(t),s=tt(e),l=a.year-s.year;for(l>0&&(l=(l-1)*n),i=e,o=12/n;t>i;)r=i,l++,i=Ie(e,l*o);return[r,i]}function He(e,t,n,i){var r=Me(e,t,n)[0];return Ae(r,e,i)}function Ne(e,t,n,i){if(1==i){var r=Me(e,t,n);return Ae(r[0],r[1],1)}return 3==i?365/n:360/n}function Pe(e,t,n,i){var r=Me(e,t,n)[1];return Ae(e,r,i)}function Le(e,t,n){return Me(e,t,n)[0]}function Be(e,t,n){return Me(e,t,n)[1]}function Oe(e,t,n){var i=tt(e),r=tt(t),o=12*(r.year-i.year)+r.month-i.month;return 1+(o*n/12|0)}function Ve(e,t){return 3==t?365:1==t?nt(e)?366:365:360}function We(e,t,n,i,r){var o=Ve(tt(t).year,r);return n*i*Ae(e,t,r)/o}function Ue(e,t,n,i,r,o,a,s){function l(e,t){return(t-e)*o/v|0}var d,c,u,h,f,p,m=0,g=r*i/o,v=a%2===0?360:365;return n<=t?(d=Me(n,t,o),c=d[0],u=d[1],c<=e?g*Ae(e,n,a)/Ae(c,u,a):(d=Me(e,c,o),h=d[0],f=d[1],p=l(f,n),g*(p+Ae(e,f,a)/Ae(h,f,a)+(n<u?Ae(c,n,a)/Ae(c,u,a):0)))):(d=ze(t,n,o),c=d[0],u=d[1],p=l(t,n),m=u==n?g*p:g*(p+Ae(c,n,a)/Ae(c,u,a)),s?(d=Me(e,t,o),c=d[0],u=d[1],p=l(e,t),m+=g*(p+Ae(e,u,a)/Ae(c,u,a))):m)}function qe(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return(i-n)/i*o/Ae(e,t,r)}function je(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return(i-n)/n*o/Ae(e,t,r)}function $e(e,t,n,i,r){var o=r%2===0?360:nt(tt(e).year)?366:365;return n/(1-i*Ae(e,t,r)/o)}function Ge(e,t,n,i,r,o,a){var s=1+((t-e)*o/(a%2===0?360:365)|0),l=Me(e,t,o),d=l[0],c=l[1],u=Ae(d,e,a),h=Ae(e,c,a),f=Ae(d,c,a),p=100*n/o,m=i/o,g=h/f;return 1==s?(r+p)/(1+g*m)-u/f*p:r/Math.pow(1+m,s-1+g)+p*Math.pow(1+m,1-s-g)*(Math.pow(1+m,s)-1)/m-u/f*p}function Ye(e,t,n,i,r){var o=Ae(e,t,r),a=Ve(tt(t).year,r);return i-n*i*o/a}var Ke,Qe,Xe,Je,Ze,et,tt,nt,it,rt,ot,at,st,lt,dt;kendo.support.browser.msie&&kendo.support.browser.version<9||(Ke=kendo.spreadsheet,Qe=Ke.calc,Xe=Qe.runtime,Je=Xe.defineFunction,Ze=Xe.CalcError,et=Xe.packDate,tt=Xe.unpackDate,nt=Xe.isLeapYear,it=Xe.daysInMonth,rt=Xe._days_360,Je("ERF",function(t,n){return null==n?e(t):e(n)-e(t)}).args([["lower_limit","number"],["upper_limit",["or","number","null"]]]),Je("ERFC",t).args([["x","number"]]),Je("GAMMALN",n).args([["x","number++"]]),Je("GAMMA",i).args([["x","number"]]),Je("GAMMA.DIST",d).args([["x","number+"],["alpha","number++"],["beta","number++"],["cumulative","logical"]]),Je("GAMMA.INV",c).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"]]),Je("NORM.S.DIST",u).args([["z","number"],["cumulative","logical"]]),Je("NORM.S.INV",h).args([["p",["and","number",["[between]",0,1]]]]),Je("NORM.DIST",f).args([["x","number"],["mean","number"],["stddev","number++"],["cumulative","logical"]]),Je("NORM.INV",p).args([["p",["and","number",["[between]",0,1]]],["mean","number"],["stddev","number++"]]),Je("BETADIST",b).args([["x","number"],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]],["?",["assert","$x >= $A","NUM"]],["?",["assert","$x <= $B","NUM"]],["?",["assert","$A < $B","NUM"]]]),Je("BETA.DIST",k).args([["x","number"],["alpha","number++"],["beta","number++"],["cumulative","logical"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]],["?",["assert","$x >= $A","NUM"]],["?",["assert","$x <= $B","NUM"]],["?",["assert","$A < $B","NUM"]]]),Je("BETA.INV",w).args([["p",["and","number",["[between]",0,1]]],["alpha","number++"],["beta","number++"],["A",["or","number",["null",0]]],["B",["or","number",["null",1]]]]),Je("CHISQ.DIST",y).args([["x","number+"],["deg_freedom","integer++"],["cumulative","logical"]]),Je("CHISQ.DIST.RT",x).args([["x","number+"],["deg_freedom","integer++"]]),Je("CHISQ.INV",C).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]),Je("CHISQ.INV.RT",T).args([["p",["and","number",["[between]",0,1]]],["deg_freedom","integer++"]]),Je("CHISQ.TEST",function(e,t){return S(e.data,t.data)}).args([["actual_range","matrix"],["expected_range","matrix"],["?",["assert","$actual_range.width == $expected_range.width"]],["?",["assert","$actual_range.height == $expected_range.height"]]]),Je("EXPON.DIST",D).args([["x","number+"],["lambda","number++"],["cumulative","logical"]]),Je("POISSON.DIST",E).args([["x","integer+"],["mean","number+"],["cumulative","logical"]]),Je("F.DIST",F).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"],["cumulative","logical"]]),Je("F.DIST.RT",R).args([["x","number+"],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Je("F.INV",A).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Je("F.INV.RT",I).args([["p",["and","number",["[between]",0,1]]],["deg_freedom1","integer++"],["deg_freedom2","integer++"]]),Je("F.TEST",H).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]),Je("FISHER",N).args([["x",["and","number",["(between)",-1,1]]]]),Je("FISHERINV",P).args([["y","number"]]),Je("T.DIST",L).args([["x","number"],["deg_freedom","integer++"],["cumulative","logical"]]),Je("T.DIST.RT",B).args([["x","number"],["deg_freedom","integer++"]]),Je("T.DIST.2T",O).args([["x","number+"],["deg_freedom","integer++"]]),Je("T.INV",V).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]),Je("T.INV.2T",W).args([["p",["and","number",["(between]",0,1]]],["deg_freedom","integer++"]]),Je("T.TEST",U).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["tails",["and","integer",["values",1,2]]],["type",["and","integer",["values",1,2,3]]],["?",["assert","$type != 1 || $array1.length == $array2.length","N/A"]],["?",["assert","$array1.length >= 2","DIV/0"]],["?",["assert","$array2.length >= 2","DIV/0"]]]),Je("CONFIDENCE.T",q).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++",["assert","$size != 1","DIV/0"]]]]),Je("CONFIDENCE.NORM",j).args([["alpha",["and","number",["(between)",0,1]]],["standard_dev","number++"],["size",["and","integer++"]]]),Je("GAUSS",$).args([["z","number"]]),Je("PHI",G).args([["x","number"]]),Je("LOGNORM.DIST",Y).args([["x","number++"],["mean","number"],["standard_dev","number++"],["cumulative","logical"]]),Je("LOGNORM.INV",K).args([["probability",["and","number",["(between)",0,1]]],["mean","number"],["standard_dev","number++"]]),Je("PROB",Q).args([["x_range",["collect","number",1]],["prob_range",["collect","number",1]],["lower_limit","number"],["upper_limit",["or","number",["null","$lower_limit"]]],["?",["assert","$prob_range.length == $x_range.length","N/A"]]]),Je("SLOPE",X).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Je("INTERCEPT",J).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Je("PEARSON",Z).args([["array1",["collect","number",1]],["array2",["collect","number",1]],["?",["assert","$array2.length == $array1.length","N/A"]],["?",["assert","$array2.length > 0 && $array1.length > 0","N/A"]]]),Je("RSQ",ee).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]],["?",["assert","$known_x.length != 1 && $known_y.length != 1","N/A"]]]),Je("STEYX",te).args([["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length >= 3 && $known_y.length >= 3","DIV/0"]]]),Je("FORECAST",ne).args([["x","number"],["known_y",["collect","number",1]],["known_x",["collect","number",1]],["?",["assert","$known_x.length == $known_y.length","N/A"]],["?",["assert","$known_x.length > 0 && $known_y.length > 0","N/A"]]]),Je("LINEST",oe).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]),Je("LOGEST",ae).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]],["stats",["or","logical",["null",!1]]]]),Je("TREND",se).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]),Je("GROWTH",le).args([["known_y","matrix"],["known_x",["or","matrix","null"]],["new_x",["or","matrix","null"]],["const",["or","logical",["null",!0]]]]),Je("FV",ce).args([["rate","number"],["nper","number"],["pmt",["or","number",["null",0]]],["pv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$pmt || $pv"]]]),Je("PV",ue).args([["rate","number"],["nper","number"],["pmt",["or","number",["null",0]]],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$pmt || $fv"]]]),Je("PMT",he).args([["rate","number"],["nper","number"],["pmt","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]),Je("NPER",fe).args([["rate","number"],["pmt","number"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]]]),Je("RATE",pe).args([["nper","number"],["pmt",["or","number",["null",0]]],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["guess",["or","number++",["null",.01]]],["?",["assert","$pmt || $fv"]]]),Je("IPMT",me).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$per >= 1 && $per <= $nper"]]]),Je("PPMT",ge).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["fv",["or","number",["null",0]]],["type",["or",["values",0,1],["null",0]]],["?",["assert","$per >= 1 && $per <= $nper"]]]),Je("CUMPRINC",ve).args([["rate","number++"],["nper","number++"],["pv","number++"],["start_period","number++"],["end_period","number++"],["type",["or",["values",0,1],["null",0]]],["?",["assert","$end_period >= $start_period","NUM"]]]),Je("CUMIPMT",_e).args([["rate","number++"],["nper","number++"],["pv","number++"],["start_period","number++"],["end_period","number++"],["type",["or",["values",0,1],["null",0]]],["?",["assert","$end_period >= $start_period","NUM"]]]),Je("NPV",be).args([["rate","number"],["values",["collect","number"]],["?",["assert","$values.length > 0","N/A"]]]),Je("IRR",ke).args([["values",["collect","number",1]],["guess",["or","number",["null",.1]]]]),Je("EFFECT",we).args([["nominal_rate","number++"],["npery","integer++"]]),Je("NOMINAL",ye).args([["effect_rate","number++"],["npery","integer++"]]),Je("XNPV",xe).args([["rate","number"],["values",["collect","number",1]],["dates",["collect","date",1]],["?",["assert","$values.length == $dates.length","NUM"]]]),Je("XIRR",Ce).args([["values",["collect","number",1]],["dates",["collect","date",1]],["guess",["or","number",["null",.1]]],["?",["assert","$values.length == $dates.length","NUM"]]]),Je("ISPMT",Te).args([["rate","number"],["per","number++"],["nper","number++"],["pv","number"],["?",["assert","$per >= 1 && $per <= $nper"]]]),Je("DB",Se).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["month",["or","number",["null",12]]]]),Je("DDB",De).args([["cost","number"],["salvage","number"],["life","number++"],["period","number++"],["factor",["or","number",["null",2]]]]),Je("SLN",Ee).args([["cost","number"],["salvage","number"],["life","number++"]]),Je("SYD",Fe).args([["cost","number"],["salvage","number"],["life","number++"],["per","number++"]]),Je("VDB",Re).args([["cost","number+"],["salvage","number+"],["life","number++"],["start_period","number+"],["end_period","number+"],["factor",["or","number+",["null",2]]],["no_switch",["or","logical",["null",!1]]],["?",["assert","$end_period >= $start_period","NUM"]]]),ot=[["settlement","date"],["maturity","date"],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]],Je("COUPDAYBS",He).args(ot),Je("COUPDAYS",Ne).args(ot),Je("COUPDAYSNC",Pe).args(ot),Je("COUPPCD",Le).args(ot),Je("COUPNCD",Be).args(ot),Je("COUPNUM",Oe).args(ot),Je("ACCRINTM",We).args([["issue","date"],["settlement","date"],["rate","number++"],["par",["or",["null",1e3],"number++"]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$issue < $settlement","NUM"]]]),Je("ACCRINT",Ue).args([["issue","date"],["first_interest","date"],["settlement","date"],["rate","number++"],["par",["or",["null",1e3],"number++"]],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["calc_method",["or","logical",["null",!0]]],["?",["assert","$issue < $settlement","NUM"]]]),Je("DISC",qe).args([["settlement","date"],["maturity","date"],["pr","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Je("INTRATE",je).args([["settlement","date"],["maturity","date"],["investment","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Je("RECEIVED",$e).args([["settlement","date"],["maturity","date"],["investment","number++"],["discount","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Je("PRICE",Ge).args([["settlement","date"],["maturity","date"],["rate","number++"],["yld","number++"],["redemption","number++"],["frequency",["and","integer",["values",1,2,4]]],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),Je("PRICEDISC",Ye).args([["settlement","date"],["maturity","date"],["discount","number++"],["redemption","number++"],["basis",["or",["null",0],["and","integer",["values",0,1,2,3,4]]]],["?",["assert","$settlement < $maturity","NUM"]]]),at=300,st=2.2204e-16,lt=1e-30,dt=Math.abs)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/borderpalette.min",["kendo.core.min","kendo.colorpicker.min","kendo.popup.min"],e)}(function(){!function(e){function t(e){return function(t){return t.preventDefault(),e.apply(this,arguments)}}var n,i,r,o,a;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=["allBorders","insideBorders","insideHorizontalBorders","insideVerticalBorders","outsideBorders","leftBorder","topBorder","rightBorder","bottomBorder","noBorders"],r=e.spreadsheet.messages.borderPalette={allBorders:"All borders",insideBorders:"Inside borders",insideHorizontalBorders:"Inside horizontal borders",insideVerticalBorders:"Inside vertical borders",outsideBorders:"Outside borders",leftBorder:"Left border",topBorder:"Top border",rightBorder:"Right border",bottomBorder:"Bottom border",noBorders:"No border",reset:"Reset color",customColor:"Custom color...",apply:"Apply",cancel:"Cancel"},o=e.ui.Widget.extend({init:function(n,i){e.ui.Widget.call(this,n,i),this.element=n,this.color=i.color,this._resetButton(),this._colorPalette(),this._customColorPalette(),this._customColorButton(),this.resetButton.on("click",t(this.resetColor.bind(this))),this.customColorButton.on("click",t(this.customColor.bind(this)))},options:{name:"ColorChooser"},events:["change"],destroy:function(){e.unbind(this.dialog.element.find(".k-action-buttons")),this.dialog.destroy(),this.colorPalette.destroy(),this.resetButton.off("click"),this.customColorButton.off("click")},value:function(e){return void 0===e?this.color:(this.color=e,this.customColorButton.find(".k-icon").css("background-color",this.color),this.colorPalette.value(null),this.flatColorPicker.value(this.color),void 0)},_change:function(e){this.color=e,this.trigger("change",{value:e})},_colorPalette:function(){var e=n("<div />",{"class":"k-spreadsheet-color-palette"}),t=this.colorPalette=n("<div />").kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],value:this.color,change:function(e){this.customColorButton.find(".k-icon").css("background-color","transparent"),this.flatColorPicker.value(null),this._change(e.value)}.bind(this)}).data("kendoColorPalette");e.append(t.wrapper).appendTo(this.element)},_customColorPalette:function(){var t,i,o=n("<div />",{"class":"k-spreadsheet-window",html:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>"+r.apply+"</button><button class='k-button' data-bind='click: close'>"+r.cancel+"</button></div>"}),a=this.dialog=o.appendTo(document.body).kendoWindow({animation:!1,scrollable:!1,resizable:!1,maximizable:!1,modal:!0,visible:!1,width:268,open:function(){this.center()}}).data("kendoWindow");a.one("activate",function(){this.element.find("[data-role=flatcolorpicker]").data("kendoFlatColorPicker")._hueSlider.resize()}),t=this.flatColorPicker=a.element.children().first().kendoFlatColorPicker().data("kendoFlatColorPicker"),i=e.observable({apply:function(){this.customColorButton.find(".k-icon").css("background-color",t.value()),this.colorPalette.value(null),this._change(t.value()),a.close()}.bind(this),close:function(){t.value(null),a.close()}}),e.bind(a.element.find(".k-action-buttons"),i)},_resetButton:function(){this.resetButton=n("<a class='k-button k-reset-color' href='#'><span class='k-icon k-font-icon k-i-reset-color'></span>"+r.reset+"</a>").appendTo(this.element)},_customColorButton:function(){this.customColorButton=n("<a class='k-button k-custom-color' href='#'><span class='k-icon'></span>"+r.customColor+"</a>").appendTo(this.element)},resetColor:function(){this.colorPalette.value(null),this.flatColorPicker.value(null),this._change(null)},customColor:function(){this.dialog.open()}}),a=e.ui.Widget.extend({init:function(n,i){e.ui.Widget.call(this,n,i),this.element=n,this.color="#000",this.element.addClass("k-spreadsheet-border-palette"),this._borderTypePalette(),this._borderColorPalette(),this.element.on("click",".k-spreadsheet-border-type-palette .k-button",t(this._click.bind(this)))},options:{name:"BorderPalette"},events:["change"],destroy:function(){this.colorChooser.destroy(),this.element.off("click")},_borderTypePalette:function(){var t=r,o=i.map(function(n){return'<a title="'+t[n]+'" href="#" data-border-type="'+n+'" class="k-button k-button-icon"><span class="k-sprite k-font-icon k-icon k-i-'+e.toHyphens(n)+'"></span></a>'}).join(""),a=n("<div />",{"class":"k-spreadsheet-border-type-palette",html:o});a.appendTo(this.element)},_borderColorPalette:function(){var e=n("<div />",{"class":"k-spreadsheet-border-color-palette"});e.appendTo(this.element),this.colorChooser=new o(e,{color:this.color,change:this._colorChange.bind(this)})},_click:function(e){this.type=n(e.currentTarget).data("borderType"),this.trigger("change",{type:this.type,color:this.color})},_colorChange:function(e){this.color=e.value,this.type&&this.trigger("change",{type:this.type,color:this.color})}}),e.spreadsheet.ColorChooser=o,e.spreadsheet.BorderPalette=a)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/toolbar.min",["kendo.toolbar.min","kendo.colorpicker.min","kendo.combobox.min","kendo.dropdownlist.min","kendo.popup.min","spreadsheet/borderpalette.min"],e)}(function(){!function(e){var t,n,i,r,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,k,w,y,x,C,T,S,D,E,F,R,I,A,M,z,H;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n=e.ui.ToolBar,i=e.spreadsheet.messages.toolbar={addColumnLeft:"Add column left",addColumnRight:"Add column right",addRowAbove:"Add row above",addRowBelow:"Add row below",alignment:"Alignment",alignmentButtons:{justtifyLeft:"Align left",justifyCenter:"Center",justifyRight:"Align right",justifyFull:"Justify",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom"},backgroundColor:"Background",bold:"Bold",borders:"Borders",colorPicker:{reset:"Reset color",customColor:"Custom color..."},copy:"Copy",cut:"Cut",deleteColumn:"Delete column",deleteRow:"Delete row",filter:"Filter",fontFamily:"Font",fontSize:"Font size",format:"Custom format...",formatTypes:{automatic:"Automatic",number:"Number",percent:"Percent",financial:"Financial",currency:"Currency",date:"Date",time:"Time",dateTime:"Date time",duration:"Duration",moreFormats:"More formats..."},formatDecreaseDecimal:"Decrease decimal",formatIncreaseDecimal:"Increase decimal",freeze:"Freeze panes",freezeButtons:{freezePanes:"Freeze panes",freezeRows:"Freeze rows",freezeColumns:"Freeze columns",unfreeze:"Unfreeze panes"},italic:"Italic",merge:"Merge cells",mergeButtons:{mergeCells:"Merge all",mergeHorizontally:"Merge horizontally",mergeVertically:"Merge vertically",unmerge:"Unmerge"},open:"Open...",paste:"Paste",quickAccess:{redo:"Redo",undo:"Undo"},exportAs:"Export...",toggleGridlines:"Toggle gridlines",sortAsc:"Sort ascending",sortDesc:"Sort descending",sortButtons:{sortSheetAsc:"Sort sheet A to Z",sortSheetDesc:"Sort sheet Z to A",sortRangeAsc:"Sort range A to Z",sortRangeDesc:"Sort range Z to A"},textColor:"Text Color",textWrap:"Wrap text",underline:"Underline",validation:"Data validation...",hyperlink:"Link"},r={home:["open","exportAs",["cut","copy","paste"],["bold","italic","underline"],"hyperlink","backgroundColor","textColor","borders","fontSize","fontFamily","alignment","textWrap",["formatDecreaseDecimal","formatIncreaseDecimal"],"format","merge","freeze","filter","toggleGridlines"],insert:[["addColumnLeft","addColumnRight","addRowBelow","addRowAbove"],["deleteColumn","deleteRow"]],data:["sort","filter","validation"]},o={open:{type:"open",overflow:"never",iconClass:"xlsa"},exportAs:{type:"exportAsDialog",dialogName:"exportAs",overflow:"never",text:"",iconClass:"xlsa"},bold:{type:"button",command:"PropertyChangeCommand",property:"bold",value:!0,iconClass:"bold",togglable:!0},italic:{type:"button",command:"PropertyChangeCommand",property:"italic",value:!0,iconClass:"italic",togglable:!0},underline:{type:"button",command:"PropertyChangeCommand",property:"underline",value:!0,iconClass:"underline",togglable:!0},formatDecreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:-1,iconClass:"decrease-decimal"},formatIncreaseDecimal:{type:"button",command:"AdjustDecimalsCommand",value:1,iconClass:"increase-decimal"},textWrap:{type:"button",command:"TextWrapCommand",property:"wrap",value:!0,iconClass:"text-wrap",togglable:!0},cut:{type:"button",command:"ToolbarCutCommand",iconClass:"cut"},copy:{type:"button",command:"ToolbarCopyCommand",iconClass:"copy"},paste:{type:"button",command:"ToolbarPasteCommand",iconClass:"paste"},separator:{type:"separator"},alignment:{type:"alignment",iconClass:"justify-left"},backgroundColor:{type:"colorPicker",property:"background",iconClass:"background"},textColor:{type:"colorPicker",property:"color",iconClass:"text"},fontFamily:{type:"fontFamily",property:"fontFamily",iconClass:"text"},fontSize:{type:"fontSize",property:"fontSize",iconClass:"font-size"},format:{type:"format",property:"format",iconClass:"format-number"},filter:{type:"filter",property:"hasFilter",iconClass:"filter"},merge:{type:"merge",iconClass:"merge-cells"},freeze:{type:"freeze",iconClass:"freeze-panes"},borders:{type:"borders",iconClass:"all-borders"},formatCells:{type:"dialog",dialogName:"formatCells",overflow:"never"},hyperlink:{type:"dialog",dialogName:"hyperlink",iconClass:"hyperlink",overflow:"never",text:""},toggleGridlines:{type:"button",command:"GridLinesChangeCommand",property:"gridLines",value:!0,iconClass:"no-borders",togglable:!0},addColumnLeft:{type:"button",command:"AddColumnCommand",value:"left",iconClass:"add-column-left"},addColumnRight:{type:"button",command:"AddColumnCommand",value:"right",iconClass:"add-column-right"},addRowBelow:{type:"button",command:"AddRowCommand",value:"below",iconClass:"add-row-below"},addRowAbove:{type:"button",command:"AddRowCommand",value:"above",iconClass:"add-row-above"},deleteColumn:{type:"button",command:"DeleteColumnCommand",iconClass:"delete-column"},deleteRow:{type:"button",command:"DeleteRowCommand",iconClass:"delete-row"},sort:{type:"sort",iconClass:"sort-desc"},validation:{type:"dialog",dialogName:"validation",iconClass:"exception",overflow:"never"}},a=n.extend({init:function(e,t){t.items=this._expandTools(t.tools||a.prototype.options.tools[t.toolbarName]),n.fn.init.call(this,e,t);var i=this._click.bind(this);this.element.addClass("k-spreadsheet-toolbar"),this._addSeparators(this.element),this.bind({click:i,toggle:i})},_addSeparators:function(e){var t=e.children(".k-widget, a.k-button, .k-button-group");t.before("<span class='k-separator' />")},_expandTools:function(e){function n(e){var r=t.isPlainObject(e)?e:o[e]||{},a="k-icon k-font-icon k-i-"+r.iconClass,s=r.type,l={splitButton:{spriteCssClass:a},button:{showText:"overflow"},colorPicker:{toolIcon:a}},d=t.extend({name:r.name||e,text:i[r.name||e],spriteCssClass:a,attributes:{title:i[r.name||e]}},l[s],r);return"splitButton"==s&&(d.menuButtons=d.menuButtons.map(n)),d.attributes["data-tool"]=e,r.property&&(d.attributes["data-property"]=r.property),d}return e.reduce(function(e,i){return e.push(t.isArray(i)?{type:"buttonGroup",buttons:i.map(n)}:n.call(this,i)),e},[])},_click:function(e){var t,n=e.target.attr("data-tool"),i=o[n]||{},r=i.command;r&&(t={command:r,options:{property:i.property||null,value:i.value||null}},"boolean"==typeof t.options.value&&(t.options.value=!!e.checked||null),this.action(t))},events:["click","toggle","open","close","overflowOpen","overflowClose","action","dialog"],options:{name:"SpreadsheetToolBar",resizable:!0,tools:r},action:function(e){this.trigger("action",e)},dialog:function(e){this.trigger("dialog",e)},refresh:function(t){function n(e,t){var n,i=e.toolbar,r=e.overflow,o=i&&i.options.togglable||r&&r.options.togglable;o&&(n=!1,"boolean"==typeof t?n=t:"string"==typeof t&&(n=i.options.value===t),i.toggle(n),r&&r.toggle(n))}function i(e,t){var n=e.toolbar,i=e.overflow;n&&n.update&&n.update(t),i&&i.update&&i.update(t);
}var r,o,a,s,l=t,d=this._tools();for(r=0;r<d.length;r++)o=d[r].property,a=d[r].tool,s=e.isFunction(l[o])?l[o]():l,"gridLines"==o&&(s=l.sheet().showGridLines()),"button"===a.type?n(a,s):i(a,s)},_tools:function(){return this.element.find("[data-property]").toArray().map(function(e){return e=t(e),{property:e.attr("data-property"),tool:this._getItem(e)}}.bind(this))},destroy:function(){this.element.find("[data-command],.k-button").each(function(){var e=t(this),n=e.data("instance");n&&n.destroy&&n.destroy()}),n.fn.destroy.call(this)}}),e.spreadsheet.ToolBar=a,s=e.toolbar.Item.extend({init:function(e,n){var i=t("<select />").kendoDropDownList({height:"auto"}).data("kendoDropDownList");this.dropDownList=i,this.element=i.wrapper,this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),i.bind("open",this._open.bind(this)),i.bind("change",this._change.bind(this)),this.element.width(e.width).attr({"data-command":"PropertyChangeCommand","data-property":e.property})},_open:function(){var t,n=this.dropDownList,i=n.list;i.css({whiteSpace:"nowrap",width:"auto"}),t=i.width(),t?t+=20:t=n._listWidth,i.css("width",t+e.support.scrollbar()),n._listWidth=t},_change:function(e){var t=e.sender,n=t.value(),i=t.dataItem(),r=i?i.popup:void 0;r?this.toolbar.dialog({name:r}):this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:"null"==n?null:n}})},value:function(e){return void 0===e?this.dropDownList.value():void this.dropDownList.value(e)}}),l=e.toolbar.Item.extend({init:function(e,n){this.element=t("<a href='#' class='k-button k-button-icon'><span class='"+e.spriteCssClass+"'></span><span class='k-icon k-i-arrow-s'></span></a>"),this.element.on("click touchend",this.open.bind(this)).attr("data-command",e.command),this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this._popup()},destroy:function(){this.popup.destroy()},open:function(e){e.preventDefault(),this.popup.toggle()},_popup:function(){var e=this.element;this.popup=t("<div class='k-spreadsheet-popup' />").appendTo(e).kendoPopup({anchor:e}).data("kendoPopup")}}),e.toolbar.registerComponent("dialog",e.toolbar.ToolBarButton.extend({init:function(t,n){e.toolbar.ToolBarButton.fn.init.call(this,t,n),this._dialogName=t.dialogName,this.element.bind("click touchend",this.open.bind(this)).data("instance",this)},open:function(){this.toolbar.dialog({name:this._dialogName})}})),e.toolbar.registerComponent("exportAsDialog",e.toolbar.Item.extend({init:function(e,n){this._dialogName=e.dialogName,this.toolbar=n,this.element=t("<button class='k-button k-button-icon' title='"+e.attributes.title+"'><span class='k-icon k-font-icon k-i-xls' /></button>").data("instance",this),this.element.bind("click",this.open.bind(this)).data("instance",this)},open:function(){this.toolbar.dialog({name:this._dialogName})}})),d=e.toolbar.OverflowButton.extend({init:function(t,n){e.toolbar.OverflowButton.fn.init.call(this,t,n),this.element.on("click touchend",this._click.bind(this)),this.message=this.options.text;var i=this.element.data("button");this.element.data(this.options.type,i)},_click:t.noop}),c=l.extend({init:function(t,n){l.fn.init.call(this,t,n),this.popup.element.addClass("k-spreadsheet-colorpicker"),this.colorChooser=new e.spreadsheet.ColorChooser(this.popup.element,{change:this._colorChange.bind(this)}),this.element.attr({"data-property":t.property}),this.element.data({type:"colorPicker",colorPicker:this,instance:this})},destroy:function(){this.colorChooser.destroy(),l.fn.destroy.call(this)},update:function(e){this.value(e)},value:function(e){this.colorChooser.value(e)},_colorChange:function(e){this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:e.sender.value()}}),this.popup.close()}}),u=d.extend({init:function(e,t){e.iconName="text",d.fn.init.call(this,e,t)},_click:function(){this.toolbar.dialog({name:"colorPicker",options:{title:this.options.property,property:this.options.property}})}}),e.toolbar.registerComponent("colorPicker",c,u),h=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],f=12,p=e.toolbar.Item.extend({init:function(e,n){var i=t("<input />").kendoComboBox({change:this._valueChange.bind(this),clearButton:!1,dataSource:e.fontSizes||h,value:f}).data("kendoComboBox");this.comboBox=i,this.element=i.wrapper,this.options=e,this.toolbar=n,this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.element.width(e.width).attr({"data-command":"PropertyChangeCommand","data-property":e.property}),this.element.data({type:"fontSize",fontSize:this})},_valueChange:function(t){this.toolbar.action({command:"PropertyChangeCommand",options:{property:this.options.property,value:e.parseInt(t.sender.value())}})},update:function(t){this.value(e.parseInt(t)||f)},value:function(e){return void 0===e?this.comboBox.value():void this.comboBox.value(e)}}),m=d.extend({_click:function(){this.toolbar.dialog({name:"fontSize",options:{sizes:h,defaultSize:f}})},update:function(e){this._value=e||f,this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}}),e.toolbar.registerComponent("fontSize",p,m),g=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],v="Arial",_=s.extend({init:function(e,t){s.fn.init.call(this,e,t);var n=this.dropDownList;n.setDataSource(e.fontFamilies||g),n.value(v),this.element.data({type:"fontFamily",fontFamily:this})},update:function(e){this.value(e||v)}}),b=d.extend({_click:function(){this.toolbar.dialog({name:"fontFamily",options:{fonts:g,defaultFont:v}})},update:function(e){this._value=e||v,this.element.find(".k-text").text(this.message+" ("+this._value+") ...")}}),e.toolbar.registerComponent("fontFamily",_,b),k=e.spreadsheet.formats={automatic:null,number:"#,0.00",percent:"0.00%",financial:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',currency:"$#,##0.00;[Red]$#,##0.00",date:"m/d/yyyy",time:"h:mm:ss AM/PM",dateTime:"m/d/yyyy h:mm",duration:"[h]:mm:ss"},w=s.extend({_revertTitle:function(e){e.sender.value(""),e.sender.wrapper.width("auto")},init:function(e,t){var n,r;s.fn.init.call(this,e,t),n=this.dropDownList,r="<span class='k-icon k-font-icon k-i-"+e.iconClass+"' style='line-height: 1em; width: 1.35em;'></span>",n.bind("change",this._revertTitle.bind(this)),n.bind("dataBound",this._revertTitle.bind(this)),n.setOptions({dataValueField:"format",dataTextField:"name",dataValuePrimitive:!0,valueTemplate:r,template:"# if (data.sample) { #<span class='k-spreadsheet-sample'>#: data.sample #</span># } ##: data.name #"}),n.text(r),n.setDataSource([{format:k.automatic,name:i.formatTypes.automatic},{format:k.number,name:i.formatTypes.number,sample:"1,499.99"},{format:k.percent,name:i.formatTypes.percent,sample:"14.50%"},{format:k.financial,name:i.formatTypes.financial,sample:"(1,000.12)"},{format:k.currency,name:i.formatTypes.currency,sample:"$1,499.99"},{format:k.date,name:i.formatTypes.date,sample:"4/21/2012"},{format:k.time,name:i.formatTypes.time,sample:"5:49:00 PM"},{format:k.dateTime,name:i.formatTypes.dateTime,sample:"4/21/2012 5:49:00"},{format:k.duration,name:i.formatTypes.duration,sample:"168:05:00"},{popup:"formatCells",name:i.formatTypes.moreFormats}]),this.element.data({type:"format",format:this})}}),y=d.extend({_click:function(){this.toolbar.dialog({name:"formatCells"})}}),e.toolbar.registerComponent("format",w,y),x=l.extend({init:function(e,t){l.fn.init.call(this,e,t),this._borderPalette(),this.element.data({type:"borders",instance:this})},destroy:function(){this.borderPalette.destroy(),l.fn.destroy.call(this)},_borderPalette:function(){var n=t("<div />").appendTo(this.popup.element);this.borderPalette=new e.spreadsheet.BorderPalette(n,{change:this._action.bind(this)})},_action:function(e){this.toolbar.action({command:"BorderChangeCommand",options:{border:e.type,style:{size:1,color:e.color}}})}}),C=d.extend({_click:function(){this.toolbar.dialog({name:"borders"})}}),e.toolbar.registerComponent("borders",x,C),T=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this.element.attr({"data-property":"alignment"}),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"alignment",alignment:this,instance:this})},buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:i.alignmentButtons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:i.alignmentButtons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:i.alignmentButtons.justifyRight},{property:"textAlign",value:"justify",iconClass:"justify-full",text:i.alignmentButtons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:i.alignmentButtons.alignTop},{property:"verticalAlign",value:"center",iconClass:"align-middle",text:i.alignmentButtons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:i.alignmentButtons.alignBottom}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},update:function(e){var t=e.textAlign(),n=e.verticalAlign(),i=this.popup.element;i.find(".k-button").removeClass("k-state-active"),t&&i.find("[data-property=textAlign][data-value="+t+"]").addClass("k-state-active"),n&&i.find("[data-property=verticalAlign][data-value="+n+"]").addClass("k-state-active")},_commandPalette:function(){var e=this.buttons,n=t("<div />").appendTo(this.popup.element);e.forEach(function(i,r){var o="<a title='"+i.text+"' data-property='"+i.property+"' data-value='"+i.value+"' class='k-button k-button-icon'><span class='k-icon k-font-icon k-i-"+i.iconClass+"'></span></a>";0!==r&&e[r-1].property!==i.property&&n.append(t("<span class='k-separator' />")),n.append(o)})},_action:function(e){var t=e.attr("data-property"),n=e.attr("data-value");this.toolbar.action({command:"PropertyChangeCommand",options:{property:t,value:n}})}}),S=d.extend({_click:function(){this.toolbar.dialog({name:"alignment"})}}),e.toolbar.registerComponent("alignment",T,S),D=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"merge",merge:this,instance:this})},buttons:[{value:"cells",iconClass:"merge-cells",text:i.mergeButtons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:i.mergeButtons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:i.mergeButtons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:i.mergeButtons.unmerge}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},_commandPalette:function(){var e=t("<div />").appendTo(this.popup.element);this.buttons.forEach(function(t){var n="<a title='"+t.text+"' data-value='"+t.value+"' class='k-button k-button-icontext'><span class='k-icon k-font-icon k-i-"+t.iconClass+"'></span>"+t.text+"</a>";e.append(n)})},_action:function(e){var t=e.attr("data-value");this.toolbar.action({command:"MergeCellCommand",options:{value:t}})}}),E=d.extend({_click:function(){this.toolbar.dialog({name:"merge"})}}),e.toolbar.registerComponent("merge",D,E),F=l.extend({init:function(e,n){l.fn.init.call(this,e,n),this._commandPalette(),this.popup.element.on("click",".k-button",function(e){this._action(t(e.currentTarget))}.bind(this)),this.element.data({type:"freeze",freeze:this,instance:this})},buttons:[{value:"panes",iconClass:"freeze-panes",text:i.freezeButtons.freezePanes},{value:"rows",iconClass:"freeze-row",text:i.freezeButtons.freezeRows},{value:"columns",iconClass:"freeze-col",text:i.freezeButtons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:i.freezeButtons.unfreeze}],destroy:function(){this.popup.element.off(),l.fn.destroy.call(this)},_commandPalette:function(){var e=t("<div />").appendTo(this.popup.element);this.buttons.forEach(function(t){var n="<a title='"+t.text+"' data-value='"+t.value+"' class='k-button k-button-icontext'><span class='k-icon k-font-icon k-i-"+t.iconClass+"'></span>"+t.text+"</a>";e.append(n)})},_action:function(e){var t=e.attr("data-value");this.toolbar.action({command:"FreezePanesCommand",options:{value:t}})}}),R=d.extend({_click:function(){this.toolbar.dialog({name:"freeze"})}}),e.toolbar.registerComponent("freeze",F,R),I=s.extend({_revertTitle:function(e){e.sender.value(""),e.sender.wrapper.width("auto")},init:function(e,t){s.fn.init.call(this,e,t);var n=this.dropDownList;n.bind("change",this._revertTitle.bind(this)),n.bind("dataBound",this._revertTitle.bind(this)),n.setOptions({valueTemplate:"<span class='k-icon k-font-icon k-i-"+e.iconClass+"' style='line-height: 1em; width: 1.35em;'></span>",template:"<span class='k-icon k-font-icon k-i-#= iconClass #' style='line-height: 1em; width: 1.35em;'></span>#=text#",dataTextField:"text",dataValueField:"value"}),n.setDataSource([{value:"asc",sheet:!1,text:i.sortButtons.sortRangeAsc,iconClass:"sort-asc"},{value:"desc",sheet:!1,text:i.sortButtons.sortRangeDesc,iconClass:"sort-desc"}]),n.select(0),this.element.data({type:"sort",sort:this})},_change:function(e){var t=e.sender,n=t.dataItem();n&&this.toolbar.action({command:"SortCommand",options:{value:n.value,sheet:n.sheet}})},value:t.noop}),A=d.extend({_click:function(){this.toolbar.dialog({name:"sort"})}}),e.toolbar.registerComponent("sort",I,A),M=e.toolbar.ToolBarButton.extend({init:function(t,n){t.showText="overflow",e.toolbar.ToolBarButton.fn.init.call(this,t,n),this.element.on("click",this._click.bind(this)),this.element.data({type:"filter",filter:this})},_click:function(){this.toolbar.action({command:"FilterCommand"})},update:function(e){this.toggle(e)}}),z=d.extend({init:function(e,t){d.fn.init.call(this,e,t),this.element.data({type:"filter",filter:this})},_click:function(){this.toolbar.action({command:"FilterCommand"})},update:function(e){this.toggle(e)}}),e.toolbar.registerComponent("filter",M,z),H=e.toolbar.Item.extend({init:function(e,n){this.toolbar=n,this.element=t("<div class='k-button k-upload-button k-button-icon'><span class='k-icon k-font-icon k-i-folder-open' /></div>").data("instance",this),this._title=e.attributes.title,this._reset()},_reset:function(){this.element.remove("input"),t("<input type='file' autocomplete='off' accept='.xlsx'/>").attr("title",this._title).one("change",this._change.bind(this)).appendTo(this.element)},_change:function(e){this.toolbar.action({command:"OpenCommand",options:{file:e.target.files[0]}}),this._reset()}}),e.toolbar.registerComponent("open",H),e.spreadsheet.TabStrip=e.ui.TabStrip.extend({init:function(n,i){e.ui.TabStrip.fn.init.call(this,n,i),n.addClass("k-spreadsheet-tabstrip"),this._quickAccessButtons(),this.toolbars={};var r=i.dataSource;this.contentElements.each(function(e,n){this._toolbar(t(n),r[e].id,i.toolbarOptions[r[e].id])}.bind(this)),this.one("activate",function(){this.toolbars[this.options.dataSource[0].id].resize()})},events:e.ui.TabStrip.fn.events.concat(["action","dialog"]),destroy:function(){this.quickAccessToolBar.off("click"),e.ui.TabStrip.fn.destroy.call(this);for(var t in this.toolbars)this.toolbars[t].destroy()},action:function(e){this.trigger("action",e)},dialog:function(e){this.trigger("dialog",e)},refreshTools:function(e){var t,n=this.toolbars;for(t in n)n.hasOwnProperty(t)&&n[t].refresh(e)},_quickAccessButtons:function(){var n=[{title:i.quickAccess.undo,iconClass:"undo-large",action:"undo"},{title:i.quickAccess.redo,iconClass:"redo-large",action:"redo"}],r=e.template("<a href='\\#' title='#= title #' data-action='#= action #' class='k-button k-button-icon'><span class='k-icon k-font-icon k-i-#=iconClass#'></span></a>");this.quickAccessToolBar=t("<div />",{"class":"k-spreadsheet-quick-access-toolbar",html:e.render(r,n)}).insertBefore(this.wrapper),this.quickAccessToolBar.on("click",".k-button",function(e){e.preventDefault();var n=t(e.currentTarget).attr("data-action");this.action({action:n})}.bind(this)),this.quickAccessAdjust()},quickAccessAdjust:function(){this.tabGroup.css("padding-left",e._outerWidth(this.quickAccessToolBar))},_toolbar:function(t,n,i){var r,o;this.toolbars[n]&&(this.toolbars[n].destroy(),t.children(".k-toolbar").remove()),i&&(r=t.html("<div />").children("div"),o={tools:"boolean"==typeof i?void 0:i,toolbarName:n,action:this.action.bind(this),dialog:this.dialog.bind(this)},this.toolbars[n]=new e.spreadsheet.ToolBar(r,o))}}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/dialogs.min",["kendo.core.min","kendo.binder.min","kendo.validator.min"],e)}(function(){!function(e){function t(t,n){return e.spreadsheet.formatting.text(t,n)}function n(e,t){var n,i=[],o=[];for(n=0;n<t.length;n++)r.inArray(t[n][e],o)==-1&&(i.push(t[n]),o.push(t[n][e]));return i}function i(t,n){e.spreadsheet.dialogs.register(t,u.extend({options:{messageId:n}}))}var r,o,a,s,l,d,c,u,h,f,p,m,g,v,_,b,k,w,y,x,C,T,S;e.support.browser.msie&&e.support.browser.version<9||(r=e.jQuery,o=e.data.ObservableObject,a=e.spreadsheet.messages.dialogs={apply:"Apply",save:"Save",cancel:"Cancel",remove:"Remove",retry:"Retry",revert:"Revert",okText:"OK",formatCellsDialog:{title:"Format",categories:{number:"Number",currency:"Currency",date:"Date"}},fontFamilyDialog:{title:"Font"},fontSizeDialog:{title:"Font size"},bordersDialog:{title:"Borders"},alignmentDialog:{title:"Alignment",buttons:{justtifyLeft:"Align left",justifyCenter:"Center",justifyRight:"Align right",justifyFull:"Justify",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom"}},mergeDialog:{title:"Merge cells",buttons:{mergeCells:"Merge all",mergeHorizontally:"Merge horizontally",mergeVertically:"Merge vertically",unmerge:"Unmerge"}},freezeDialog:{title:"Freeze panes",buttons:{freezePanes:"Freeze panes",freezeRows:"Freeze rows",freezeColumns:"Freeze columns",unfreeze:"Unfreeze panes"}},validationDialog:{title:"Data Validation",hintMessage:"Please enter a valid {0} value {1}.",hintTitle:"Validation {0}",criteria:{any:"Any value",number:"Number",text:"Text",date:"Date",custom:"Custom Formula",list:"List"},comparers:{greaterThan:"greater than",lessThan:"less than",between:"between",notBetween:"not between",equalTo:"equal to",notEqualTo:"not equal to",greaterThanOrEqualTo:"greater than or equal to",lessThanOrEqualTo:"less than or equal to"},comparerMessages:{greaterThan:"greater than {0}",lessThan:"less than {0}",between:"between {0} and {1}",notBetween:"not between {0} and {1}",equalTo:"equal to {0}",notEqualTo:"not equal to {0}",greaterThanOrEqualTo:"greater than or equal to {0}",lessThanOrEqualTo:"less than or equal to {0}",custom:"that satisfies the formula: {0}"},labels:{criteria:"Criteria",comparer:"Comparer",min:"Min",max:"Max",value:"Value",start:"Start",end:"End",onInvalidData:"On invalid data",rejectInput:"Reject input",showWarning:"Show warning",showHint:"Show hint",hintTitle:"Hint title",hintMessage:"Hint message",ignoreBlank:"Ignore blank",showListButton:"Display button to show list",showCalendarButton:"Display button to show calendar"},placeholders:{typeTitle:"Type title",typeMessage:"Type message"}},exportAsDialog:{title:"Export...",labels:{scale:"Scale",fit:"Fit to page",fileName:"File name",saveAsType:"Save as type",exportArea:"Export",paperSize:"Paper size",margins:"Margins",orientation:"Orientation",print:"Print",guidelines:"Guidelines",center:"Center",horizontally:"Horizontally",vertically:"Vertically"}},modifyMergedDialog:{errorMessage:"Cannot change part of a merged cell."},rangeDisabledDialog:{errorMessage:"Destination range contains disabled cells."},incompatibleRangesDialog:{errorMessage:"Incompatible ranges"},noFillDirectionDialog:{errorMessage:"Cannot determine fill direction"},duplicateSheetNameDialog:{errorMessage:"Duplicate sheet name"},overflowDialog:{errorMessage:"Cannot paste, because the copy area and the paste area are not the same size and shape."},useKeyboardDialog:{title:"Copying and pasting",errorMessage:"These actions cannot be invoked through the menu. Please use the keyboard shortcuts instead:",labels:{forCopy:"for copy",forCut:"for cut",forPaste:"for paste"}},unsupportedSelectionDialog:{errorMessage:"That action cannot be performed on multiple selection."},linkDialog:{title:"Hyperlink",labels:{text:"Text",url:"Address",removeLink:"Remove link"}}},s={},e.spreadsheet.dialogs={register:function(e,t){s[e]=t},registered:function(e){return!!s[e]},create:function(e,t){var n=s[e];if(n)return new n(t)}},l=e.spreadsheet.SpreadsheetDialog=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this,t),this.options=r.extend(!0,{},this.options,t),this.bind(this.events,t)},events:["close","activate"],options:{autoFocus:!0},dialog:function(){return this._dialog||(this._dialog=r("<div class='k-spreadsheet-window k-action-window' />").addClass(this.options.className||"").append(e.template(this.options.template)({messages:e.spreadsheet.messages.dialogs||a})).appendTo(document.body).kendoWindow({autoFocus:this.options.autoFocus,scrollable:!1,resizable:!1,modal:!0,visible:!1,width:this.options.width||320,title:this.options.title,open:function(){this.center()},close:this._onDialogClose.bind(this),activate:this._onDialogActivate.bind(this),deactivate:this._onDialogDeactivate.bind(this)}).data("kendoWindow")),this._dialog},_onDialogClose:function(){this.trigger("close",{action:this._action})},_onDialogActivate:function(){this.trigger("activate")},_onDialogDeactivate:function(){this.trigger("deactivate"),this.destroy()},destroy:function(){this._dialog&&(this._dialog.destroy(),this._dialog=null)},open:function(){this.dialog().open()},apply:function(){this.close()},close:function(){this._action="close",this.dialog().close()}}),d=e.spreadsheet.FormatCellsViewModel=o.extend({init:function(e){o.fn.init.call(this,e),this.useCategory(this.category)},useCategory:function(e){var t=e&&e.type||"number",n="currency"==t;this.category=e,this.set("showCurrencyFilter",n&&this.currencies.length>1),n?this.currency(this.currencies[0]):this.set("formats",this.allFormats[t+"Formats"]),this.useFirstFormat()},useFirstFormat:function(){this.formats.length&&this.set("format",this.formats[0].value)},currency:function(e){var n,i;return void 0!==e&&(this._currency=e,n=e.value,i=[{currency:n,decimals:!0},{currency:n,decimals:!0,iso:!0},{currency:n,decimals:!1}],i=i.map(function(e){return e=d.convert.currency(e),{value:e,name:t(1e3,e)}}),this.set("formats",i),this.useFirstFormat()),this._currency||this.currencies[0]},categoryFilter:function(e){return void 0!==e&&this.useCategory(e),this.category},preview:function(){var e=this.get("format"),n=this.value||0;return e&&e.length?t(n,e):n}}),d.convert={currency:function(e){function t(e,t){return Array(t+1).join(e)}var n=e.currency,i=n.pattern[1];return e.decimals&&(i=i.replace(/n/g,"n"+n["."]+t("0",n.decimals))),i=e.iso?'"'+n.abbr+'" '+i.replace(/\s*\$\s*/g,""):i.replace(/\$/g,n.symbol),i=i.replace(/n/g,"?")},date:function(e){return/T|Z/.test(e)?"":e.toLowerCase().replace(/tt/g,"AM/PM").replace(/'/g,'"')}},c=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.formatCellsDialog||a,i={title:n.title,categories:[{type:"number",name:n.categories.number},{type:"currency",name:n.categories.currency},{type:"date",name:n.categories.date}]};l.fn.init.call(this,r.extend(i,t)),this._generateFormats()},options:{className:"k-spreadsheet-format-cells",template:"<div class='k-root-tabs' data-role='tabstrip' data-text-field='name' data-bind='source: categories, value: categoryFilter' data-animation='false' /><div class='k-spreadsheet-preview' data-bind='text: preview' /><script type='text/x-kendo-template' id='format-item-template'>\\#: data.name \\#</script><select data-role='dropdownlist' class='k-format-filter' data-text-field='description' data-value-field='value.name' data-bind='visible: showCurrencyFilter, value: currency, source: currencies' /><ul data-role='staticlist' tabindex='0' class='k-list k-reset' data-template='format-item-template' data-value-primitive='true' data-value-field='value' data-bind='source: formats, value: format' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.apply #</button><button class='k-button' data-bind='click: close'>#: messages.cancel #</button></div>"},_generateFormats:function(){var i,o=this.options;o.currencies||(o.currencies=c.currenciesFrom(e.cultures)),o.numberFormats||(o.numberFormats=[{value:"#.00%",name:"100.00%"},{value:"#%",name:"100%"},{value:"#.00",name:"1024.00"},{value:"#,###.00",name:"1,024.00"}]),o.dateFormats||(i=e.cultures.current.calendars.standard.patterns,o.dateFormats=n("value",r.map(i,function(e){if(e=d.convert.date(e))return{value:e,name:t(34567.7678,e)}})))},open:function(t){var n,i,r=this.options,o=t.value(),a=r.categories.slice(0);this.viewModel=new d({currencies:r.currencies.slice(0),allFormats:{numberFormats:r.numberFormats.slice(0),dateFormats:r.dateFormats.slice(0)},categories:a,format:t.format(),category:o instanceof Date?a[2]:a[0],apply:this.apply.bind(this),close:this.close.bind(this),value:o}),l.fn.open.call(this),n=this.dialog().element,e.bind(n,this.viewModel),i=n.find("select.k-format-filter").data("kendoDropDownList"),r.currencies.length>10&&i.setOptions({filter:"contains"}),n.find(e.roleSelector("staticlist")).parent().addClass("k-list-wrapper")},apply:function(){var e=this.viewModel.format;l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"format",value:e}})}}),c.currenciesFrom=function(t){return n("description",r.map(t,function(t,n){var i,r;if(/-/.test(n))return i=t.numberFormat.currency,r=e.format("{0} ({1}, {2})",i.name,i.abbr,i.symbol),{description:r,value:i}}))},e.spreadsheet.dialogs.register("formatCells",c),e.spreadsheet.dialogs.FormatCellsDialog=c,u=l.extend({options:{className:"k-spreadsheet-message",title:"",messageId:"",text:"",template:"<div class='k-spreadsheet-message-content' data-bind='text: text' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: close'>#= messages.okText #</button></div>"},open:function(){var t,n;l.fn.open.call(this),t=this.options,n=t.text,t.messageId&&(n=e.getter(t.messageId,!0)(e.spreadsheet.messages.dialogs)),e.bind(this.dialog().element,{text:n,close:this.close.bind(this)})}}),e.spreadsheet.dialogs.register("message",u),h=l.extend({options:{className:"k-spreadsheet-message",title:"",messageId:"",text:"",template:"<div class='k-spreadsheet-message-content' data-bind='text: text' /><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: close'>#= messages.retry #</button><button class='k-button' data-bind='click: revert'>#= messages.revert #</button></div>"},open:function(){var t,n;l.fn.open.call(this),t=this.options,n=t.text,t.messageId&&(n=e.getter(t.messageId,!0)(e.spreadsheet.messages.dialogs)),e.bind(this.dialog().element,{text:n,close:this.close.bind(this),revert:this.revert.bind(this)})},activate:function(e){e.sender.dialog().element.find(".k-button").focus()},revert:function(){this._action="revert",this.dialog().close()}}),e.spreadsheet.dialogs.register("validationError",h),f=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.fontFamilyDialog||a;l.fn.init.call(this,r.extend({title:n.title},t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul"),n=this.options.fonts,i=this.options.defaultFont;this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:n}),template:"#: data #",value:i,change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontFamily",value:e.sender.value()[0]}})}}),e.spreadsheet.dialogs.register("fontFamily",f),p=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.fontSizeDialog||a;l.fn.init.call(this,r.extend({title:n.title},t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul"),n=this.options.sizes,i=this.options.defaultSize;this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:n}),template:"#: data #",value:i,change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(t){l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:"fontSize",value:e.parseInt(t.sender.value()[0])}})}}),e.spreadsheet.dialogs.register("fontSize",p),m=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.bordersDialog||a;l.fn.init.call(this,r.extend({title:n.title},t)),this.element=this.dialog().element,this._borderPalette(),this.viewModel=e.observable({apply:this.apply.bind(this),close:this.close.bind(this)}),e.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{width:177,template:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.apply #</button><button class='k-button' data-bind='click: close'>#: messages.cancel #</button></div>"},apply:function(){l.fn.apply.call(this);var e=this.value();this.trigger("action",{command:"BorderChangeCommand",options:{border:e.type,style:{size:1,color:e.color}}})},_borderPalette:function(){var t=this.dialog().element.find("div:first");this.borderPalette=new e.spreadsheet.BorderPalette(t,{change:this.value.bind(this)})},value:function(e){return void 0===e?this._state:void(this._state=e)}}),e.spreadsheet.dialogs.register("borders",m),g=l.extend({init:function(t){l.fn.init.call(this,t),this.element=this.dialog().element,this.property=t.property,this.options.title=t.title,this.viewModel=e.observable({apply:this.apply.bind(this),close:this.close.bind(this)}),e.bind(this.element.find(".k-action-buttons"),this.viewModel)},options:{template:"<div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.apply #</button><button class='k-button' data-bind='click: close'>#: messages.cancel #</button></div>"},apply:function(){l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:this.property,value:this.value()}})},value:function(e){return void 0===e?this._value:void(this._value=e.value)}}),v=g.extend({init:function(e){e.width=177,g.fn.init.call(this,e),this._colorPalette()},_colorPalette:function(){var e=this.dialog().element.find("div:first");this.colorPalette=e.kendoColorPalette({palette:["#ffffff","#000000","#d6ecff","#4e5b6f","#7fd13b","#ea157a","#feb80a","#00addc","#738ac8","#1ab39f","#f2f2f2","#7f7f7f","#a7d6ff","#d9dde4","#e5f5d7","#fad0e4","#fef0cd","#c5f2ff","#e2e7f4","#c9f7f1","#d8d8d8","#595959","#60b5ff","#b3bcca","#cbecb0","#f6a1c9","#fee29c","#8be6ff","#c7d0e9","#94efe3","#bfbfbf","#3f3f3f","#007dea","#8d9baf","#b2e389","#f272af","#fed46b","#51d9ff","#aab8de","#5fe7d5","#a5a5a5","#262626","#003e75","#3a4453","#5ea226","#af0f5b","#c58c00","#0081a5","#425ea9","#138677","#7f7f7f","#0c0c0c","#00192e","#272d37","#3f6c19","#750a3d","#835d00","#00566e","#2c3f71","#0c594f"],change:this.value.bind(this)}).data("kendoColorPalette")}}),e.spreadsheet.dialogs.register("colorPicker",v),_=g.extend({init:function(e){e.width=268,g.fn.init.call(this,e),this.dialog().setOptions({animation:!1}),this.dialog().one("activate",this._colorPicker.bind(this))},_colorPicker:function(){var e=this.dialog().element.find("div:first");this.colorPicker=e.kendoFlatColorPicker({change:this.value.bind(this)}).data("kendoFlatColorPicker")}}),e.spreadsheet.dialogs.register("customColor",_),b=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.alignmentDialog||a,i={title:n.title,buttons:[{property:"textAlign",value:"left",iconClass:"justify-left",text:n.buttons.justtifyLeft},{property:"textAlign",value:"center",iconClass:"justify-center",text:n.buttons.justifyCenter},{property:"textAlign",value:"right",iconClass:"justify-right",text:n.buttons.justifyRight},{property:"textAlign",
value:"justify",iconClass:"justify-full",text:n.buttons.justifyFull},{property:"verticalAlign",value:"top",iconClass:"align-top",text:n.buttons.alignTop},{property:"verticalAlign",value:"center",iconClass:"align-middle",text:n.buttons.alignMiddle},{property:"verticalAlign",value:"bottom",iconClass:"align-bottom",text:n.buttons.alignBottom}]};l.fn.init.call(this,r.extend(i,t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-property='#=property#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];l.fn.apply.call(this),this.trigger("action",{command:"PropertyChangeCommand",options:{property:t.property,value:t.value}})}}),e.spreadsheet.dialogs.register("alignment",b),k=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.mergeDialog||a,i={title:n.title,buttons:[{value:"cells",iconClass:"merge-cells",text:n.buttons.mergeCells},{value:"horizontally",iconClass:"merge-horizontally",text:n.buttons.mergeHorizontally},{value:"vertically",iconClass:"merge-vertically",text:n.buttons.mergeVertically},{value:"unmerge",iconClass:"normal-layout",text:n.buttons.unmerge}]};l.fn.init.call(this,r.extend(i,t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];l.fn.apply.call(this),this.trigger("action",{command:"MergeCellCommand",options:{value:t.value}})}}),e.spreadsheet.dialogs.register("merge",k),w=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.freezeDialog||a,i={title:n.title,buttons:[{value:"panes",iconClass:"freeze-panes",text:n.buttons.freezePanes},{value:"rows",iconClass:"freeze-row",text:n.buttons.freezeRows},{value:"columns",iconClass:"freeze-col",text:n.buttons.freezeColumns},{value:"unfreeze",iconClass:"normal-layout",text:n.buttons.unfreeze}]};l.fn.init.call(this,r.extend(i,t)),this._list()},options:{template:"<ul class='k-list k-reset'></ul>"},_list:function(){var t=this.dialog().element.find("ul");this.list=new e.ui.StaticList(t,{dataSource:new e.data.DataSource({data:this.options.buttons}),template:"<a title='#=text#' data-value='#=value#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</a>",change:this.apply.bind(this)}),this.list.dataSource.fetch()},apply:function(e){var t=e.sender.value()[0];l.fn.apply.call(this),this.trigger("action",{command:"FreezePanesCommand",options:{value:t.value}})}}),e.spreadsheet.dialogs.register("freeze",w),y=e.spreadsheet.ValidationCellsViewModel=o.extend({init:function(e){o.fn.init.call(this,e),this.bind("change",function(e){"criterion"===e.field&&(this.reset(),"custom"!==this.criterion&&"list"!==this.criterion||this.setHintMessageTemplate()),"comparer"===e.field&&this.setHintMessageTemplate(),"hintMessage"!=e.field&&"hintTitle"!=e.field||this._mute||(this.shouldBuild=!1),"from"!=e.field&&"to"!=e.field&&"hintMessageTemplate"!=e.field&&"type"!=e.field||!this.shouldBuild||this.buildMessages()}.bind(this)),this.reset()},buildMessages:function(){this._mute=!0,this.set("hintTitle",this.hintTitleTemplate?e.format(this.hintTitleTemplate,this.type):""),this.set("hintMessage",this.hintMessageTemplate?e.format(this.hintMessageTemplate,this.from,this.to):""),this._mute=!1},reset:function(){this.setComparers(),this.set("comparer",this.comparers[0].type),this.set("from",null),this.set("to",null),this.set("useCustomMessages",!1),this.shouldBuild=!0,this.hintTitleTemplate=this.defaultHintTitle,this.buildMessages()},setComparers:function(){var e,t,n=this.defaultComparers,i=[];if("text"===this.criterion)for(e=["equalTo","notEqualTo"],t=0;t<n.length;t++)e[0]==n[t].type&&(i.push(n[t]),e.shift());else i=n.slice();this.set("comparers",i)},setHintMessageTemplate:function(){"custom"!==this.criterion&&"list"!==this.criterion?this.set("hintMessageTemplate",e.format(this.defaultHintMessage,this.criterion,this.comparerMessages[this.comparer])):(this.set("hintMessageTemplate",""),this.set("hintMessage",""))},isAny:function(){return"any"===this.get("criterion")},isNumber:function(){return"number"===this.get("criterion")},showToForNumber:function(){return this.showTo()&&this.isNumber()},showToForDate:function(){return this.showTo()&&this.isDate()},isText:function(){return"text"===this.get("criterion")},isDate:function(){return"date"===this.get("criterion")},isList:function(){return"list"===this.get("criterion")},isCustom:function(){return"custom"===this.get("criterion")},showRemove:function(){return this.get("hasValidation")},showTo:function(){return"between"==this.get("comparer")||"notBetween"==this.get("comparer")},update:function(e){this.set("hasValidation",!!e),e&&this.fromValidationObject(e)},fromValidationObject:function(e){this.set("criterion",e.dataType),this.set("comparer",e.comparerType),this.set("from",e.from),this.set("to",e.to),this.set("type",e.type),this.set("ignoreBlank",e.allowNulls),this.set("showButton",e.showButton),e.messageTemplate||e.titleTemplate?(this.hintMessageTemplate=e.messageTemplate,this.hintMessage=e.messageTemplate,this.hintTitleTemplate=e.titleTemplate,this.hintTitle=e.titleTemplate,this.useCustomMessages=!0,this.buildMessages()):this.useCustomMessages=!1},toValidationObject:function(){if("any"===this.criterion)return null;var e={type:this.type,dataType:this.criterion,comparerType:this.comparer,from:this.from,to:this.to,allowNulls:this.ignoreBlank,showButton:this.showButton};return this.useCustomMessages&&(e.messageTemplate=this.shouldBuild?this.hintMessageTemplate:this.hintMessage,e.titleTemplate=this.hintTitle),e}}),x=l.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.validationDialog||a,i={title:n.title,hintMessage:n.hintMessage,hintTitle:n.hintTitle,criteria:[{type:"any",name:n.criteria.any},{type:"number",name:n.criteria.number},{type:"text",name:n.criteria.text},{type:"date",name:n.criteria.date},{type:"custom",name:n.criteria.custom},{type:"list",name:n.criteria.list}],comparers:[{type:"greaterThan",name:n.comparers.greaterThan},{type:"lessThan",name:n.comparers.lessThan},{type:"between",name:n.comparers.between},{type:"notBetween",name:n.comparers.notBetween},{type:"equalTo",name:n.comparers.equalTo},{type:"notEqualTo",name:n.comparers.notEqualTo},{type:"greaterThanOrEqualTo",name:n.comparers.greaterThanOrEqualTo},{type:"lessThanOrEqualTo",name:n.comparers.lessThanOrEqualTo}],comparerMessages:n.comparerMessages};l.fn.init.call(this,r.extend(i,t))},options:{width:450,criterion:"any",type:"reject",ignoreBlank:!0,showButton:!0,useCustomMessages:!1,errorTemplate:'<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-i-warning"> </span>#= message #<div class="k-callout k-callout-n"></div></div>',template:'<div class="k-edit-form-container"><div class="k-edit-label"><label>#: messages.validationDialog.labels.criteria #:</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: criterion, source: criteria" /></div><div data-bind="visible: isNumber"><div class="k-edit-label"><label>#: messages.validationDialog.labels.comparer #:</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.min #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.min #" placeholder="e.g. 10" class="k-textbox" data-bind="value: from, enabled: isNumber" required="required" /></div><div data-bind="visible: showTo"><div class="k-edit-label"><label>#: messages.validationDialog.labels.max #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.max #" placeholder="e.g. 100" class="k-textbox" data-bind="value: to, enabled: showToForNumber" required="required" /></div></div></div><div data-bind="visible: isText"><div class="k-edit-label"><label>#: messages.validationDialog.labels.comparer #:</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isText" required="required" /></div></div><div data-bind="visible: isDate"><div class="k-edit-label"><label>#: messages.validationDialog.labels.comparer #:</label></div><div class="k-edit-field"><select data-role="dropdownlist" data-text-field="name" data-value-field="type" data-bind="value: comparer, source: comparers" /></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.start #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.start #" class="k-textbox" data-bind="value: from, enabled: isDate" required="required" /></div><div data-bind="visible: showTo"><div class="k-edit-label"><label>#: messages.validationDialog.labels.end #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.end #" class="k-textbox" data-bind="value: to, enabled: showToForDate" required="required" /></div></div></div><div data-bind="visible: isCustom"><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isCustom" required="required" /></div></div><div data-bind="visible: isList"><div class="k-edit-label"><label>#: messages.validationDialog.labels.value #:</label></div><div class="k-edit-field"><input name="#: messages.validationDialog.labels.value #" class="k-textbox" data-bind="value: from, enabled: isList" required="required" /></div></div><div data-bind="visible: isList"><div class="k-edit-field"><input type="checkbox" name="showButton" id="showButton" class="k-checkbox" data-bind="checked: showButton"/><label for="showButton" class="k-checkbox-label"> #: messages.validationDialog.labels.showListButton #</label></div></div><div data-bind="visible: isDate"><div class="k-edit-field"><input type="checkbox" name="showButton" id="showButton" class="k-checkbox" data-bind="checked: showButton"/><label for="showButton" class="k-checkbox-label"> #: messages.validationDialog.labels.showCalendarButton #</label></div></div><div data-bind="invisible: isAny"><div class="k-edit-field"><input type="checkbox" name="ignoreBlank" id="ignoreBlank" class="k-checkbox" data-bind="checked: ignoreBlank"/><label for="ignoreBlank" class="k-checkbox-label"> #: messages.validationDialog.labels.ignoreBlank #</label></div></div><div data-bind="invisible: isAny"><div class="k-action-buttons"></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.onInvalidData #:</label></div><div class="k-edit-field"><input type="radio" id="validationTypeReject" name="validationType" value="reject" data-bind="checked: type" class="k-radio" /><label for="validationTypeReject" class="k-radio-label">#: messages.validationDialog.labels.rejectInput #</label> <input type="radio" id="validationTypeWarning" name="validationType" value="warning" data-bind="checked: type" class="k-radio" /><label for="validationTypeWarning" class="k-radio-label">#: messages.validationDialog.labels.showWarning #</label></div></div><div data-bind="invisible: isAny" class="hint-wrapper"><div class="k-edit-field"><input type="checkbox" name="useCustomMessages" id="useCustomMessages" class="k-checkbox" data-bind="checked: useCustomMessages" /><label class="k-checkbox-label" for="useCustomMessages"> #: messages.validationDialog.labels.showHint #</label></div><div data-bind="visible: useCustomMessages"><div class="k-edit-label"><label>#: messages.validationDialog.labels.hintTitle #:</label></div><div class="k-edit-field"><input class="k-textbox" placeholder="#: messages.validationDialog.placeholders.typeTitle #" data-bind="value: hintTitle" /></div><div class="k-edit-label"><label>#: messages.validationDialog.labels.hintMessage #:</label></div><div class="k-edit-field"><input class="k-textbox" placeholder="#: messages.validationDialog.placeholders.typeMessage #" data-bind="value: hintMessage" /></div></div></div><div class="k-action-buttons"><button class="k-button" data-bind="visible: showRemove, click: remove">#: messages.remove #</button><button class="k-button k-primary" data-bind="click: apply">#: messages.apply #</button><button class="k-button" data-bind="click: close">#: messages.cancel #</button></div></div>'},open:function(t){var n,i=this.options;this.viewModel=new y({type:i.type,defaultHintMessage:i.hintMessage,defaultHintTitle:i.hintTitle,defaultComparers:i.comparers.slice(0),comparerMessages:i.comparerMessages,criteria:i.criteria.slice(0),criterion:i.criterion,ignoreBlank:i.ignoreBlank,showButton:i.showButton,apply:this.apply.bind(this),close:this.close.bind(this),remove:this.remove.bind(this)}),this.viewModel.update(t.validation()),l.fn.open.call(this),n=this.dialog().element,this.validatable&&this.validatable.destroy(),e.bind(n,this.viewModel),this.validatable=new e.ui.Validator(n.find(".k-edit-form-container"),{validateOnBlur:!1,errorTemplate:this.options.errorTemplate||void 0})},apply:function(){this.validatable.validate()&&(l.fn.apply.call(this),this.trigger("action",{command:"EditValidationCommand",options:{value:this.viewModel.toValidationObject()}}))},remove:function(){this.viewModel.set("criterion","any"),this.apply()}}),e.spreadsheet.dialogs.register("validation",x),e.spreadsheet.dialogs.ValidationDialog=x,C=l.extend({init:function(t){var n,i=e.spreadsheet.messages.dialogs.exportAsDialog||a;l.fn.init.call(this,r.extend({title:i.title},t)),this.viewModel=e.observable({title:this.options.title,name:this.options.name,extension:this.options.extension,fileFormats:this.options.fileFormats,excel:t.excelExport,pdf:{proxyURL:t.pdfExport.proxyURL,forceProxy:t.pdfExport.forceProxy,title:t.pdfExport.title,author:t.pdfExport.author,subject:t.pdfExport.subject,keywords:t.pdfExport.keywords,creator:t.pdfExport.creator,date:t.pdfExport.date,fitWidth:this.options.pdf.fitWidth,area:this.options.pdf.area,areas:this.options.pdf.areas,paperSize:this.options.pdf.paperSize,paperSizes:this.options.pdf.paperSizes,margin:this.options.pdf.margin,margins:this.options.pdf.margins,landscape:this.options.pdf.landscape,guidelines:this.options.pdf.guidelines,hCenter:this.options.pdf.hCenter,vCenter:this.options.pdf.vCenter},apply:this.apply.bind(this),close:this.close.bind(this)}),n=this.dialog(),this.viewModel.bind("change",function(e){"extension"===e.field&&(this.set("showPdfOptions",".pdf"===this.extension),n.center())}),e.bind(n.element,this.viewModel)},options:{name:"Workbook",extension:".xlsx",fileFormats:[{description:"Excel Workbook (.xlsx)",extension:".xlsx"},{description:"Portable Document Format(.pdf)",extension:".pdf"}],pdf:{fitWidth:!0,area:"workbook",areas:[{area:"workbook",text:"Entire Workbook"},{area:"sheet",text:"Active Sheet"},{area:"selection",text:"Selection"}],paperSize:"a4",paperSizes:[{value:"a2",text:"A2 (420 mm × 594 mm)     "},{value:"a3",text:"A3 (297 mm x 420 mm)     "},{value:"a4",text:"A4 (210 mm x 297 mm)     "},{value:"a5",text:"A5 (148 mm x 210 mm)     "},{value:"b3",text:"B3 (353 mm × 500 mm)     "},{value:"b4",text:"B4 (250 mm x 353 mm)     "},{value:"b5",text:"B5 (176 mm x 250 mm)     "},{value:"folio",text:'Folio (8.5" x 13")       '},{value:"legal",text:'Legal (8.5" x 14")       '},{value:"letter",text:'Letter (8.5" x 11")      '},{value:"tabloid",text:'Tabloid (11" x 17")      '},{value:"executive",text:'Executive (7.25" x 10.5")'}],margin:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},margins:[{value:{bottom:"0.75in",left:"0.7in",right:"0.7in",top:"0.75in"},text:"Normal"},{value:{bottom:"0.75in",left:"0.25in",right:"0.25in",top:"0.75in"},text:"Narrow"},{value:{bottom:"1in",left:"1in",right:"1in",top:"1in"},text:"Wide"}],landscape:!0,guidelines:!0,hCenter:!0,vCenter:!0},width:520,template:"<div class='k-edit-label'><label>#: messages.exportAsDialog.labels.fileName #:</label></div><div class='k-edit-field'><input class='k-textbox' data-bind='value: name' /></div><div ><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.saveAsType #:</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='description' data-value-field='extension' data-bind='value: extension, source: fileFormats' /></div></div><div class='export-config' data-bind='visible: showPdfOptions'><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.exportArea #:</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='text' data-value-field='area' data-bind='value: pdf.area, source: pdf.areas' /></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.paperSize#:</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-text-field='text' data-value-field='value' data-bind='value: pdf.paperSize, source: pdf.paperSizes' /></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.margins #:</label></div><div class='k-edit-field'><select data-role='dropdownlist' class='k-file-format' data-value-primitive='true'data-text-field='text' data-value-field='value' data-bind='value: pdf.margin, source: pdf.margins' /></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.orientation #:</label></div><div class='k-edit-field'><input type='radio' id='k-orientation-portrait' name='orientation' data-type='boolean' data-bind='checked: pdf.landscape' value='false' /><label class='k-orientation-label k-orientation-portrait-label' for='k-orientation-portrait'></label><input type='radio' id='k-orientation-landscape' name='orientation' data-type='boolean' data-bind='checked: pdf.landscape' value='true' /><label class='k-orientation-label k-orientation-landscape-label' for='k-orientation-landscape'></label></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.print #:</label></div><div class='k-edit-field'><input class='k-checkbox' id='guidelines' type='checkbox' data-bind='checked: pdf.guidelines'/><label class='k-checkbox-label' for='guidelines'>#: messages.exportAsDialog.labels.guidelines#</label></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.scale #:</label></div><div class='k-edit-field'><input class='k-checkbox' id='fitWidth' type='checkbox' data-bind='checked: pdf.fitWidth'/><label class='k-checkbox-label' for='fitWidth'>#: messages.exportAsDialog.labels.fit #</label></div><div class='k-edit-label'><label>#: messages.exportAsDialog.labels.center #:</label></div><div class='k-edit-field'><input class='k-checkbox' id='hCenter' type='checkbox' data-bind='checked: pdf.hCenter'/><label class='k-checkbox-label' for='hCenter'>#: messages.exportAsDialog.labels.horizontally #</label><input class='k-checkbox' id='vCenter' type='checkbox' data-bind='checked: pdf.vCenter'/><label class='k-checkbox-label' for='vCenter'>#: messages.exportAsDialog.labels.vertically #</label></div><div class='k-page-orientation' data-bind='css: {k-page-landscape: pdf.landscape}'><div class='k-margins-horizontal'></div><div class='k-margins-vertical'></div></div></div><div class='k-action-buttons'><button class='k-button k-primary' data-bind='click: apply'>#: messages.save #</button><button class='k-button' data-bind='click: close'>#: messages.cancel #</button></div>"},apply:function(){l.fn.apply.call(this),this.trigger("action",{command:"SaveAsCommand",options:this.viewModel})}}),e.spreadsheet.dialogs.register("exportAs",C),i("modifyMerged","modifyMergedDialog.errorMessage"),i("rangeDisabled","rangeDisabledDialog.errorMessage"),i("overflow","overflowDialog.errorMessage"),i("unsupportedSelection","unsupportedSelectionDialog.errorMessage"),i("incompatibleRanges","incompatibleRangesDialog.errorMessage"),i("noFillDirection","noFillDirectionDialog.errorMessage"),i("duplicateSheetName","duplicateSheetNameDialog.errorMessage"),T=u.extend({init:function(t){var n=e.spreadsheet.messages.dialogs.useKeyboardDialog||a;l.fn.init.call(this,r.extend({title:n.title},t))},options:{template:"#: messages.useKeyboardDialog.errorMessage #<div>Ctrl+C #: messages.useKeyboardDialog.labels.forCopy #</div><div>Ctrl+X #: messages.useKeyboardDialog.labels.forCut #</div><div>Ctrl+V #: messages.useKeyboardDialog.labels.forPaste #</div><div class=\"k-action-buttons\"><button class='k-button k-primary' data-bind='click: close'>#= messages.okText #</button></div>"}}),e.spreadsheet.dialogs.register("useKeyboard",T),S=l.extend({options:{template:"<div class='k-edit-label'><label>#: messages.linkDialog.labels.url #:</label></div><div class='k-edit-field'><input class='k-textbox' data-bind='value: url' /></div><div class='k-action-buttons'><button style='float: left' class='k-button' data-bind='click: remove'>#= messages.linkDialog.labels.removeLink #</button><button class='k-button k-primary' data-bind='click: apply'>#= messages.okText #</button><button class='k-button' data-bind='click: cancel'>#= messages.cancel #</button></div>",title:a.linkDialog.title,autoFocus:!1},open:function(t){var n,i,o=this;l.fn.open.apply(o,arguments),n=o.dialog().element,i=e.observable({url:t.link(),apply:function(){/\S/.test(i.url)||(i.url=null),o.trigger("action",{command:"HyperlinkCommand",options:{link:i.url}}),o.close()},remove:function(){i.url=null,i.apply()},cancel:o.close.bind(o)}),e.bind(n,i),n.find("input").focus().on("keydown",function(e){13==e.keyCode?(i.url=r(this).val(),e.stopPropagation(),e.preventDefault(),i.apply()):27==e.keyCode&&(e.stopPropagation(),e.preventDefault(),i.cancel())})}}),e.spreadsheet.dialogs.register("hyperlink",S))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/sheetbinder.min",["kendo.core.min","kendo.data.min","spreadsheet/sheet.min"],e)}(function(){!function(e){var t,n;e.support.browser.msie&&e.support.browser.version<9||(t=function(e){return e},n=e.Class.extend({init:function(e){this.options=$.extend({},this.options,e),this.columns=this._normalizeColumns(this.options.columns),this._sheet(),this._dataSource(),this._header(),this._boundRowsCount=0,this.dataSource.fetch()},_sheet:function(){this.sheet=this.options.sheet,this._sheetChangeHandler=this._sheetChange.bind(this),this._sheetDeleteRowHandler=this._sheetDeleteRow.bind(this),this._sheetInsertRowHandler=this._sheetInsertRow.bind(this),this.sheet.bind("change",this._sheetChangeHandler).bind("deleteRow",this._sheetDeleteRowHandler).bind("insertRow",this._sheetInsertRowHandler)},_sheetInsertRow:function(e){void 0!==e.index&&this.dataSource.insert(Math.max(e.index-1,0),{})},_sheetDeleteRow:function(e){var t,n;void 0!==e.index&&(t=this.dataSource,n=t.view()[e.index-1],n&&t.remove(n))},_header:function(){this.sheet.batch(function(){this.columns.forEach(function(e,t){this.sheet.range(0,t).value(e.title)}.bind(this))}.bind(this))},_sheetChange:function(n){var i,r,o,a,s,l;n.insertRow||n.deleteRow||n.recalc&&n.ref&&(i=this.dataSource,r=i.view(),o=this.columns,i.reader.model&&(a=i.reader.model.fields),!o.length&&r.length&&(o=Object.keys(r[0].toJSON())),s=o.map(function(n){var i=n.field;return i&&a&&a[i]&&"date"==a[i].type?e.spreadsheet.numberToDate:t}),this._skipRebind=!0,l=this.sheet.range(n.ref).values(),n.ref.forEach(function(e){var t,n,a,d,c;for(e=e.toRangeRef(),n=0,a=e.topLeft.row;a<=e.bottomRight.row;a++){for(t=r[a-1],t||(t=i.insert(a-1,{}),r=i.view()),d=0,c=e.topLeft.col;c<=e.bottomRight.col&&c<o.length;c++)t.set(o[c].field,s[c](l[n][d++]));n++}}),this._boundRowsCount=i.view().length,this._skipRebind=!1)},_normalizeColumns:function(e){return e.map(function(e){var t=e.field||e;return{field:t,title:e.title||t}})},_dataSource:function(){var t=this.options,n=t.dataSource;n=Array.isArray(n)?{data:n}:n,this.dataSource&&this._changeHandler?this.dataSource.unbind("change",this._changeHandler):this._changeHandler=this._change.bind(this),this.dataSource=e.data.DataSource.create(n).bind("change",this._changeHandler)},_change:function(){var t,n,i;this._skipRebind||(t=this.dataSource.view(),n=this.columns,!n.length&&t.length&&(this.columns=n=this._normalizeColumns(Object.keys(t[0].toJSON())),this._header()),i=n.map(function(t){return e.getter(t.field)}),this.sheet.batch(function(){var e,n,r,o=Math.max(t.length,this._boundRowsCount);for(e=0;e<o;e++)for(n=0;n<i.length;n++)r=t[e]?i[n](t[e]):null,this.sheet.range(e+1,n).value(r)}.bind(this)),this._boundRowsCount=t.length)},destroy:function(){this.dataSource.unbind("change",this._changeHandler),this.sheet.unbind("change",this._sheetChangeHandler).unbind("deleteRow",this._sheetDeleteRowHandler).unbind("insertRow",this._sheetInsertRowHandler)},options:{columns:[]}}),e.spreadsheet.SheetDataSourceBinder=n)}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/filtermenu.min",["kendo.core.min","kendo.popup.min","kendo.treeview.min","kendo.numerictextbox.min","kendo.datepicker.min","kendo.datetimepicker.min"],e)}(function(){!function(e){function t(e){var t,n={},i=[];for(t=0;t<e.length;t++)n[e[t].value]?!n[e[t].value].checked&&e[t].checked&&(n[e[t].value].checked=!0):(n[e[t].value]=e[t],i.push(e[t]));return i}function n(t,i){var r,o,a,s,l,d=!1,c=t instanceof e.data.HierarchicalDataSource&&t.data();for(r=0;r<c.length;r++)o=c[r],a=(""+o.text).toLowerCase(),s=i===!0||""===i||a.indexOf(i)>=0,l=n(o.children,s||i),d=d||l||s,o.hidden=!s&&!l,o.checked=!o.hidden;return c&&t.filter({field:"hidden",operator:"neq",value:!0}),d}function i(t){var n,r,o=t instanceof e.data.HierarchicalDataSource&&t.data();for(n=0;n<o.length;n++)r=o[n],r.checked=!1,r.hasChildren&&i(r.children)}function r(e){var t,n,i=d.operators,r=[];for(t in e)if(e.hasOwnProperty(t))for(n in e[t])e[t].hasOwnProperty(n)&&r.push({text:i[t][n],value:n,unique:t+"_"+n,type:t});return r}var o,a,s,l,d,c,u,h,f;e.support.browser.msie&&e.support.browser.version<9||(o=e.jQuery,a=e.ui.Widget,s={details:"k-details",button:"k-button",detailsSummary:"k-details-summary",detailsContent:"k-details-content",icon:"k-icon k-font-icon",iconCollapse:"k-i-collapse-se",iconExpand:"k-i-expand-e",iconSearch:"k-i-search",textbox:"k-textbox",wrapper:"k-spreadsheet-filter-menu",filterByCondition:"k-spreadsheet-condition-filter",filterByValue:"k-spreadsheet-value-filter",valuesTreeViewWrapper:"k-spreadsheet-value-treeview-wrapper",actionButtons:"k-action-buttons"},l=a.extend({init:function(t,n){a.fn.init.call(this,t,n),this.element.addClass(f.classNames.details),this._summary=this.element.find("."+f.classNames.detailsSummary).on("click",this._toggle.bind(this));var i=n.expanded?f.classNames.iconCollapse:f.classNames.iconExpand;this._icon=o("<span />",{"class":f.classNames.icon+" "+i}).prependTo(this._summary),this._container=e.wrap(this._summary.next(),!0),n.expanded||this._container.hide()},options:{name:"Details"},events:["toggle"],visible:function(){return this.options.expanded},toggle:function(t){var n=e.fx(this._container).expand("vertical");n.stop()[t?"reverse":"play"](),this._icon.toggleClass(f.classNames.iconExpand,t).toggleClass(f.classNames.iconCollapse,!t),this.options.expanded=!t},_toggle:function(){var e=this.visible();this.toggle(e),this.trigger("toggle",{show:e})}}),d=e.spreadsheet.messages.filterMenu={sortAscending:"Sort range A to Z",sortDescending:"Sort range Z to A",filterByValue:"Filter by value",filterByCondition:"Filter by condition",apply:"Apply",search:"Search",addToCurrent:"Add to current selection",clear:"Clear",blanks:"(Blanks)",operatorNone:"None",and:"AND",or:"OR",operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},e.data.binders.spreadsheetFilterValue=e.data.Binder.extend({init:function(t,n,i){e.data.Binder.fn.init.call(this,t,n,i),this._change=o.proxy(this.change,this),o(this.element).on("change",this._change)},refresh:function(){var e=this,t=e.bindings.spreadsheetFilterValue.get();o(e.element).val(t instanceof Date?"":t)},change:function(){var e=this.element.value;this.bindings.spreadsheetFilterValue.set(e)}}),e.data.binders.widget.spreadsheetFilterValue=e.data.Binder.extend({init:function(t,n,i){e.data.Binder.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=o.proxy(this.change,this),this.widget.first("change",this._change)},refresh:function(){var e=this.bindings.spreadsheetFilterValue,t=e.get(),n=o(this.widget.element).data("filterType");this.widget.value("date"===n&&t instanceof Date||"number"===n&&!isNaN(t)?t:null)},change:function(){var e=this.widget.value(),t=this.bindings.spreadsheetFilterValue;t.set(e)}}),c={filterByValue:"<div class='"+s.detailsSummary+"'>#= messages.filterByValue #</div><div class='"+s.detailsContent+"'><div class='k-textbox k-space-right'><input placeholder='#= messages.search #' data-#=ns#bind='events: { input: filterValues }' /><span class='k-icon k-font-icon k-i-search' /></div><div data-#=ns#bind='visible: hasActiveSearch'><input class='k-checkbox' type='checkbox' data-#=ns#bind='checked: appendToSearch' id='_#=guid#' /><label class='k-checkbox-label' for='_#=guid#'>#= messages.addToCurrent #</label></div><div class='"+s.valuesTreeViewWrapper+"'><div data-#=ns#role='treeview' data-#=ns#checkboxes='{ checkChildren: true }' data-#=ns#bind='source: valuesDataSource, events: { check: valuesChange, select: valueSelect }' /></div></div>",filterByCondition:"<div class='"+s.detailsSummary+"'>#= messages.filterByCondition #</div><div class='"+s.detailsContent+'\'><div><select data-#=ns#role="dropdownlist"data-#=ns#bind="value: operator, source: operators, events: { change: operatorChange } "data-value-primitive="false"data-option-label="#=messages.operatorNone#"data-height="auto"data-text-field="text"data-value-field="unique"></select></div><div data-#=ns#bind="visible: isString"><input data-filter-type="string" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" class="k-textbox" /></div><div data-#=ns#bind="visible: isNumber"><input data-filter-type="number" data-#=ns#role="numerictextbox" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" /></div><div data-#=ns#bind="visible: isDate"><input data-filter-type="date" data-#=ns#role="datepicker" data-#=ns#bind="spreadsheetFilterValue: customFilter.criteria[0].value" /></div></div>',menuItem:"<li data-command='#=command#' data-dir='#=dir#'><span class='k-icon k-font-icon k-i-#=iconClass#'></span>#=text#</li>",actionButtons:"<button data-#=ns#bind='click: apply' class='k-button k-primary'>#=messages.apply#</button><button data-#=ns#bind='click: clear' class='k-button'>#=messages.clear#</button>"},u=e.spreadsheet.FilterMenuViewModel=e.data.ObservableObject.extend({valuesChange:function(t){var n=t?t.sender.dataSource:this.valuesDataSource,i=function(e){return e.checked},r=function(t){return"date"===t.dataType?e.spreadsheet.dateToNumber(t.value):t.value;
},o=function(e,t,n){return n.lastIndexOf(e)===t},a=n.data(),s=a[0].children.data().toJSON(),l=s.filter(function(e){return"blank"===e.dataType});l=!!l.length&&l[0].checked,s=s.filter(i).map(r),this.appendToSearch&&this.valueFilter&&this.valueFilter.values.length&&(s=s.concat(this.valueFilter.values.toJSON()).sort().filter(o)),this.set("valueFilter",{values:s,blanks:l})},valueSelect:function(e){e.preventDefault();var t=e.sender.dataItem(e.node);t.set("checked",!t.checked)},hasActiveSearch:!1,appendToSearch:!1,filterValues:function(e){var t="string"==typeof e?e:o(e.target).val().toLowerCase(),r=this.valuesDataSource;this.set("hasActiveSearch",!!t),i(r),n(r,t)},reset:function(){this.set("customFilter",{logic:"and",criteria:[{operator:null,value:null}]}),this.set("valueFilter",{values:[]})},operatorChange:function(e){var t=e.sender.dataItem();this.set("operatorType",t.type),this.set("customFilter.criteria[0].operator",t.value)},isNone:function(){return void 0===this.get("operatorType")},isString:function(){return"string"===this.get("operatorType")},isNumber:function(){return"number"===this.get("operatorType")},isDate:function(){return"date"===this.get("operatorType")}}),h=e.spreadsheet.FilterMenuController={valuesTree:function(e,t){return[{text:"All",expanded:!0,checked:!0,items:this.values(e.resize({top:1}),t)}]},values:function(n,i){var r=[],o=d,a=n.column(i),s=n.sheet();return a.forEachCell(function(t,n,i){var a,l,d;s.isHiddenRow(t)||(a=i.value,l=i.dataType,d=i.text,l=void 0===a?"blank":i.format?e.spreadsheet.formatting.type(a,i.format):typeof a,d=null!==a&&i.format?e.spreadsheet.formatting.text(a,i.format):"blank"==l?o.blanks:a,"percent"===l&&(l="number"),"date"===l&&(a=e.spreadsheet.numberToDate(a)),r.push({dataType:l,value:a,text:d,checked:!0}))}),r=t(r),r.sort(function(e,t){return e.dataType===t.dataType?0:"blank"===e.dataType||"blank"===t.dataType?"blank"===e.dataType?-1:1:"number"===e.dataType||"number"===t.dataType?"number"===e.dataType?-1:1:"date"===e.dataType||"date"===t.dataType?"date"===e.dataType?-1:1:0}),r},filterType:function(e,t){var n,i,r,o=e.sheet(),a=this.filterForColumn(t,o);return a=a&&a.filter.toJSON(),a&&"custom"==a.filter&&(i=a.criteria[0].value,i instanceof Date?n="date":"string"==typeof i?n="string":"number"==typeof i&&(n="number")),n||(r=this.values(e.row(1),t)[0],n=r&&r.dataType,"blank"==n&&(n=null)),n},filterForColumn:function(e,t){var n,i=t.filter();return i&&(n=i.columns.filter(function(t){return t.index===e})[0]),n},filter:function(e,t){var n,i,r,o,a=this.filterForColumn(e,t);if(a)return n=a.filter.toJSON(),i=n.filter,delete n.filter,r={type:i,options:n},o=n.criteria,o&&o.length&&(r.operator=o[0].operator),r}},f=a.extend({init:function(e,t){a.call(this,e,t),this.element.addClass(f.classNames.wrapper),this.viewModel=new u({active:"value",operator:null,operators:r(this.options.operators),clear:this.clear.bind(this),apply:this.apply.bind(this)}),this._filterInit(),this._popup(),this._sort(),this._filterByCondition(),this._filterByValue(),this._actionButtons()},options:{name:"FilterMenu",column:0,range:null,operators:{string:{contains:"Text contains",doesnotcontain:"Text does not contain",startswith:"Text starts with",endswith:"Text ends with"},date:{eq:"Date is",neq:"Date is not",lt:"Date is before",gt:"Date is after"},number:{eq:"Is equal to",neq:"Is not equal to",gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"}}},events:["action"],destroy:function(){a.fn.destroy.call(this),this.menu.destroy(),this.valuesTreeView.destroy(),this.popup.destroy()},openFor:function(e){this.popup.setOptions({anchor:e}),this.popup.open()},close:function(){this.popup.close()},clear:function(){this.action({command:"ClearFilterCommand",options:{column:this.options.column}}),this.viewModel.reset(),this.close()},apply:function(){var e,t,n;this._active(),e={operatingRange:this.options.range,column:this.options.column},"value"===this.viewModel.active?(this.viewModel.valuesChange({sender:this.valuesTreeView}),t=this.viewModel.valueFilter.toJSON(),(t.blanks||t.values&&t.values.length)&&(e.valueFilter=t)):"custom"===this.viewModel.active&&(n=this.viewModel.customFilter.toJSON(),n.criteria.length&&null!==n.criteria[0].value&&(e.customFilter=n)),(e.valueFilter||e.customFilter)&&this.action({command:"ApplyFilterCommand",options:e})},action:function(e){this.trigger("action",o.extend({},e))},_filterInit:function(){var e,t=this.options.column,n=this.options.range,i=n.sheet(),r=h.filter(t,i);r?(e=h.filterType(n,t),this.viewModel.set("active",r.type),this.viewModel.set(r.type+"Filter",r.options),"custom"==r.type&&(this.viewModel.set("operator",e+"_"+r.operator),this.viewModel.set("operatorType",e))):this.viewModel.reset()},_popup:function(){this.popup=this.element.kendoPopup({copyAnchorStyles:!1}).data("kendoPopup")},_sort:function(){var t=e.template(f.templates.menuItem),n=d,i=[{command:"sort",dir:"asc",text:n.sortAscending,iconClass:"sort-asc"},{command:"sort",dir:"desc",text:n.sortDescending,iconClass:"sort-desc"}],r=o("<ul />",{html:e.render(t,i)}).appendTo(this.element);this.menu=r.kendoMenu({orientation:"vertical",select:function(e){var t=o(e.item).data("dir"),n=this.options.range.resize({top:1}),i={value:t,sheet:!1,operatingRange:n,column:this.options.column};n.isSortable()?this.action({command:"SortCommand",options:i}):this.close()}.bind(this)}).data("kendoMenu")},_appendTemplate:function(t,n,i,r){var a=e.template(t),s=o("<div class='"+n+"'/>").html(a({messages:d,guid:e.guid(),ns:e.ns}));return this.element.append(s),i&&(i=new l(s,{expanded:r,toggle:this._detailToggle.bind(this)})),e.bind(s,this.viewModel),s},_detailToggle:function(e){this.element.find("[data-role=details]").not(e.sender.element).data("kendoDetails").toggle(!e.show)},_filterByCondition:function(){var e="custom"===this.viewModel.active;this._appendTemplate(f.templates.filterByCondition,f.classNames.filterByCondition,!0,e)},_filterByValue:function(){var t,n="value"===this.viewModel.active,i=this._appendTemplate(f.templates.filterByValue,f.classNames.filterByValue,!0,n);this.valuesTreeView=i.find("[data-role=treeview]").data("kendoTreeView"),t=h.valuesTree(this.options.range,this.options.column),this.viewModel.set("valuesDataSource",new e.data.HierarchicalDataSource({data:t}))},_actionButtons:function(){this._appendTemplate(f.templates.actionButtons,f.classNames.actionButtons,!1)},_active:function(){var e=this.element.find("[data-role=details]").filter(function(e,t){return o(t).data("kendoDetails").visible()});e.hasClass(f.classNames.filterByValue)?this.viewModel.set("active","value"):e.hasClass(f.classNames.filterByCondition)&&this.viewModel.set("active","custom")}}),e.spreadsheet.FilterMenu=f,o.extend(!0,f,{classNames:s,templates:c}))}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/editor.min",["kendo.core.min"],e)}(function(){!function(e){function t(e,t){return e&&(e.top!==t.top||e.left!==t.left)}if(!(e.support.browser.msie&&e.support.browser.version<9)){var n=e.Observable.extend({init:function(t){e.Observable.fn.init.call(this),this.view=t,this.formulaBar=t.formulaBar,this._active=!1,this.barInput=t.formulaBar.formulaInput,this.cellInput=t.formulaInput,this.barInput.syncWith(this.cellInput),this.cellInput.syncWith(this.barInput),this.barInput.bind("keyup",this._triggerUpdate.bind(this)),this.cellInput.bind("keyup",this._triggerUpdate.bind(this)),this.barInput.bind("focus",this._focus.bind(this)),this.cellInput.bind("focus",this._focus.bind(this)),this.barInput.bind("blur",this._blur.bind(this)),this.cellInput.bind("blur",this._blur.bind(this))},events:["activate","deactivate","change","update"],_focus:function(e){this.lastActive=e.sender==this.barInput?"bar":"cell"},_blur:function(){},_triggerUpdate:function(){this.trigger("update",{value:this.value()})},activeEditor:function(){var t=null,n=e._activeElement();return this.barElement()[0]===n?t=this.barInput:this.cellElement()[0]===n&&(t=this.cellInput),t},activate:function(e){return this._active=!0,this._rect=e.rect,this.cellInput.position(e.rect),this.cellInput.resize(e.rect),this.cellInput.tooltip(e.tooltip),this.cellInput.activeCell=this.barInput.activeCell=e.range.topLeft,this.trigger("activate"),this},deactivate:function(){var e=this.cellInput;this._active&&(e.value()!=this._value&&this.trigger("change",{value:e.value()})||(this._active=!1,this._rect=null,e.hide(),this.trigger("deactivate")))},enable:function(e){this.barInput.enable(e),this.cellInput.enable(e)},enableEditing:function(e){this.barInput.enableEditing(e),this.cellInput.enableEditing(e)},barElement:function(){return this.barInput.element},cellElement:function(){return this.cellInput.element},focusLastActive:function(){this.focus(this.lastActive)},focus:function(e){e=e||"cell","cell"===e?(this.cellInput.element.focus(),this.cellInput.end()):this.barInput.element.focus()},isActive:function(){return this._active},isFiltered:function(){return this.barInput.popup.visible()||this.cellInput.popup.visible()},canInsertRef:function(e){var t=this.activeEditor();return t&&t.canInsertRef(e)},highlightedRefs:function(){var e=this.activeEditor(),t=[];return e&&(t=e.highlightedRefs()),t},scale:function(){this.cellInput.scale()},toggleTooltip:function(e){this.cellInput.toggleTooltip(t(this._rect,e))},value:function(e){return void 0===e?this.barInput.value():(null===e&&(e=""),this._value=e,this.barInput.value(e),void this.cellInput.value(e))},insertNewline:function(){this.activeEditor().insertNewline(),this.scale()}});e.spreadsheet.SheetEditor=n}}(kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/autofill.min",["spreadsheet/runtime.min","spreadsheet/range.min"],e)}(function(){"use strict";function e(e){var t,n,i,r,o,a=e.length,s=(a+1)/2,l=e.reduce(function(e,t){return e+t},0)/a,d=0,c=0;for(t=0;t<a;t++)n=t+1-s,i=e[t]-l,d+=n*i,c+=n*n;return c?(r=d/c,o=l-r*s,function(e){return o+r*(e+1)}):function(t){return e[t%e.length]}}function t(t){function o(e){var t,n=e[1]-e[0];for(t=2;t<e.length;++t)if(e[t]-e[t-1]!=n)return null;return n}function a(e){return e.map(function(e){return e.number})}var s=[],l=t.map(function(e){return e.formula||e.value});return r(l,function(i,r,d,c){var u,h,f,p,m;for("number"==d?(h=a(c),1==h.length&&(i>0||r<l.length||"date"==n(h[0],t[i].format))&&h.push(h[0]+1),u=e(h)):"string"==d||"formula"==d||"boolean"==d?u=function(e,t){return l[t]}:Array.isArray(d)?1==c.length?u=function(e){return d[(c[0].number+e)%d.length]}:(f=o(a(c)),u=null==f?function(e){return c[e%c.length].value}:function(e){var t=c[0].number+f*e;return d[t%d.length]}):"null"!=d?(h=a(c),1==h.length&&h.push(h[0]+1),h=e(h),u=function(e,t){return l[t].replace(/^(.*\D)\d+/,"$1"+h(e,t))}):u=function(){return null},p={f:u,begin:i,end:r,len:r-i},m=i;m<r;++m)s[m]=p}),function(e,n){var r=s[n],o=e/l.length|0,a=e%l.length,d=o*r.len+a-r.begin,c=r.f(d,n),u=i(t[n]);return delete u.enable,c instanceof h?u.formula=c:u.value=c,u}}function n(e,t){if(null!=t)return d.formatting.type(e,t)}function i(e){var t={};return Object.keys(e||{}).forEach(function(n){t[n]=e[n]}),t}function r(e,t){var n,i,r=null,a=0,s=[];for(i=0;i<e.length;++i)n=o(e[i]),s.push(n),null!=r&&n.type!==r.type&&(t(a,i,r.type,s.slice(a,i)),a=i),r=n;t(a,i,r.type,s.slice(a,i))}function o(e){var t,n;if("number"==typeof e)return{type:"number",number:e};if("string"==typeof e)return(t=s(e))?t:(n=/^(.*\D)(\d+)/.exec(e),n?(e=e.replace(/^(.*\D)\d+/,"$1-######"),{type:e,match:n,number:parseFloat(n[2])}):{type:"string"});if("boolean"==typeof e)return{type:"boolean"};if(null==e)return{type:"null"};if(e instanceof h)return{type:"formula"};throw window.console.error(e),Error("Cannot fill data")}function a(){var e=kendo.culture();return[e.calendars.standard.days.namesAbbr,e.calendars.standard.days.names,e.calendars.standard.months.namesAbbr,e.calendars.standard.months.names]}function s(e){var t,n,i,r,o=e.toLowerCase(),s=a();for(t=0;t<s.length;++t)for(n=s[t],i=n.length;--i>=0;)if(r=n[i].toLowerCase(),r==o)return{type:n,number:i,value:e}}function l(e){var t,n,i=e.length,r=e[0].length,o=[];for(t=0;t<r;++t)for(o[t]=[],n=0;n<i;++n)o[t][n]=e[n][t];return o}var d,c,u,h,f,p,m;kendo.support.browser.msie&&kendo.support.browser.version<9||(d=kendo.spreadsheet,c=d.Range,u=d.calc.runtime,h=u.Formula,f="incompatibleRanges",p="noFillDirection",m=c.FillError=function(e){this.code=e},c.prototype._previewFillFrom=function(e,n){var i,r,o,a,s,d,c,u,h,g,v,_,b,k,w=this,y=w._sheet;if("string"==typeof e&&(e=y.range(e)),i=e._ref.toRangeRef(),r=w._ref.toRangeRef(),i.intersects(r)){if(i.eq(r))return null;if(r=r.clone(),i.topLeft.eq(r.topLeft))if(i.width()==r.width())r.topLeft.row+=i.height(),n=0;else{if(i.height()!=r.height())throw new m(f);r.topLeft.col+=i.width(),n=1}else{if(!i.bottomRight.eq(r.bottomRight))throw new m(f);if(i.width()==r.width())r.bottomRight.row-=i.height(),n=2;else{if(i.height()!=r.height())throw new m(f);r.bottomRight.col-=i.width(),n=3}}return y.range(r)._previewFillFrom(e,n)}if(null==n)if(i.topLeft.col==r.topLeft.col)n=i.topLeft.row<r.topLeft.row?0:2;else{if(i.topLeft.row!=r.topLeft.row)throw new m(p);n=i.topLeft.col<r.topLeft.col?1:3}if(o=1&n,a=2&n,o&&i.height()!=r.height()||!o&&i.width()!=r.width())throw new m(f);for(s=e._properties(),o?d=r.width():(s=l(s),d=r.height()),c=Array(s.length),u=0;u<s.length;++u)for(h=s[u],g=t(h),v=c[u]=Array(d),_=0;_<d;++_)b=a?-_-1:h.length+_,k=a?h.length-_%h.length-1:_%h.length,v[a?d-_-1:_]=g(b,k);return o||(c=l(c)),{props:c,direction:n,dest:w}},c.prototype.fillFrom=function(e,t){var n=this._previewFillFrom(e,t);return n.dest._properties(n.props),n.dest})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/nameeditor.min",["kendo.core.min"],e)}(function(){!function(e){var t,n,i;e.support.browser.msie&&e.support.browser.version<9||(t=e.jQuery,n={input:"k-spreadsheet-name-editor",list:"k-spreadsheet-name-list"},i=e.ui.Widget.extend({init:function(i,r){e.ui.Widget.call(this,i,r),i.addClass(n.input);var o=new e.data.DataSource({transport:{read:function(t){var n=[];this._workbook.forEachName(function(t){!t.hidden&&t.value instanceof e.spreadsheet.Ref&&n.push({name:t.name})}),t.success(n)}.bind(this),cache:!1}});this.combo=t("<input />").appendTo(i).kendoComboBox({clearButton:!1,dataTextField:"name",dataValueField:"name",template:"#:data.name#<a class='k-button-delete' href='\\#'><span class='k-icon k-i-close'></span></a>",dataSource:o,autoBind:!1,ignoreCase:!0,change:this._on_listChange.bind(this),noDataTemplate:"<div></div>",open:function(){o.read()}}).getKendoComboBox(),this.combo.input.on("keydown",this._on_keyDown.bind(this)).on("focus",this._on_focus.bind(this)),this.combo.popup.element.addClass("k-spreadsheet-names-popup").on("mousemove",function(e){e.stopPropagation()}).on("click",".k-button-delete",function(e){e.preventDefault(),e.stopPropagation();var n=t(e.target).closest(".k-item");n=this.combo.dataItem(n),this._deleteItem(n.name)}.bind(this))},value:function(e){return void 0===e?this.combo.value():void this.combo.value(e)},_deleteItem:function(e){this.trigger("delete",{name:e})},_on_keyDown:function(e){switch(e.keyCode){case 27:this.combo.value(this._prevValue),this.trigger("cancel");break;case 13:this.trigger("enter")}},_on_focus:function(){this._prevValue=this.combo.value()},_on_listChange:function(){var e=this.combo.value();e&&this.trigger("select",{name:e})}}),e.spreadsheet.NameEditor=i)}(window.kendo)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("spreadsheet/print.min",["kendo.pdf.min","spreadsheet/sheet.min","spreadsheet/range.min","spreadsheet/references.min","spreadsheet/numformat.min","util/text-metrics.min"],e)}(function(){"use strict";function e(e,t){var n=0,i=[],r=.2*t,o=t;return e.forEach(function(e){t&&n+e>o&&(o-n<r&&(n=t*Math.ceil(n/t)),o+=t*Math.ceil(e/t)),i.push(n),n+=e}),i.push(n),i}function t(e,t){var n=e._grid,i={},r={};return e.forEachMergedCell(t,function(e){var o=e.topLeft;n.forEach(e,function(n){o.eq(n)?i[n.print()]=e:t.contains(n)&&(r[n.print()]=o)})}),{primary:i,secondary:r}}function n(n,s,l){var d,c,u,h,f,p,g,v,_=[],b=[],k=[],w=t(n,s),y=-1,x=-1;return n.forEach(s,function(e,t,i){var r,a,d,c=e-s.topLeft.row,u=t-s.topLeft.col,h=n.rowHeight(e),f=n.columnWidth(t);u||b.push(h),c||k.push(f),!n.isHiddenColumn(t)&&!n.isHiddenRow(e)&&h&&f&&(r=l.forScreen||o(i),(l.emptyCells||r)&&(a=new m(e,t).print(),w.secondary[a]||(r?(y=Math.max(y,c),x=Math.max(x,u)):i.empty=!0,d=w.primary[a],d?(delete w.primary[a],i.merged=!0,i.rowspan=d.height(),i.colspan=d.width(),l.forScreen&&(i.width=n._columns.sum(d.topLeft.col,d.bottomRight.col),i.height=n._rows.sum(d.topLeft.row,d.bottomRight.row))):(i.rowspan=1,i.colspan=1),i.row=c,i.col=u,_.push(i))))}),b=b.slice(0,y+1),k=k.slice(0,x+1),d=l.pageWidth,c=l.pageHeight,u=1,l.fitWidth&&(h=k.reduce(i,0),h>d&&(u=d/h,d/=u,c/=u)),f=e(b,c||0),p=e(k,d||0),g=0,v=0,_=_.filter(function(e){return(!e.empty||!(e.row>y||e.col>x))&&(e.left=p[e.col],e.top=f[e.row],e.merged?l.forScreen?(e.right=e.left+e.width,e.bottom=e.top+e.height):(e.right=r(p,e.col+e.colspan),e.bottom=r(f,e.row+e.rowspan),e.width=e.right-e.left,e.height=e.bottom-e.top):(e.width=k[e.col],e.height=b[e.row],e.bottom=e.top+e.height,e.right=e.left+e.width),g=Math.max(g,e.right),v=Math.max(v,e.bottom),!0)}),Object.keys(w.primary).forEach(function(e){var t=w.primary[e];n.forEach(t.topLeft.toRangeRef(),function(e,i,r){var o=e-s.topLeft.row,a=i-s.topLeft.col;r.merged=!0,r.colspan=t.height(),r.rowspan=t.width(),r.top=o<0?-n._rows.sum(e,e-o-1):f[o],r.left=a<0?-n._columns.sum(i,i-a-1):p[a],r.height=n._rows.sum(t.topLeft.row,t.bottomRight.row),r.width=n._columns.sum(t.topLeft.col,t.bottomRight.col),r.height>0&&r.width>0&&(r.right=r.left+r.width,r.bottom=r.top+r.height,_.push(r))})}),{width:g,height:v,cells:_.sort(a),scale:u,xCoords:p,yCoords:f}}function i(e,t){return e+t}function r(e,t){return t<e.length?e[t]:e[e.length-1]}function o(e){return null!=e.value||e.merged||null!=e.background||null!=e.borderTop||null!=e.borderRight||null!=e.borderBottom||null!=e.borderLeft||null!=e.validation&&!e.validation.value}function a(e,t){return e.top<t.top?-1:e.top==t.top?e.left<t.left?-1:e.left==t.left?0:1:1}function s(e,t,n){function i(i,r){var o,a,s,u,h,f=r*d,p=f+d,m=i*c,v=m+c,k=0,w=0,y=e.cells.filter(function(e){return!(e.right<=f||e.left>=p||e.bottom<=m||e.top>=v)&&(k=Math.max(e.bottom,k),w=Math.max(e.right,w),!0)});y.length>0&&(o=new g.Group,t.append(o),o.clip(g.Path.fromRect(new _.Rect([0,0],[n.pageWidth,n.pageHeight]))),a=new g.Group,o.append(a),s=_.Matrix.scale(e.scale,e.scale).multiplyCopy(_.Matrix.translate(-f,-m)),(n.hCenter||n.vCenter)&&(s=s.multiplyCopy(_.Matrix.translate(n.hCenter?(p-w)/2:0,n.vCenter?(v-k)/2:0))),a.transform(s),n.guidelines&&(u=null,e.xCoords.forEach(function(e){e=Math.min(e,w),e!==u&&e>=f&&e<=p&&(u=e,a.append((new g.Path).moveTo(e,m).lineTo(e,k).close().stroke("#999",b)))}),u=null,e.yCoords.forEach(function(e){e=Math.min(e,k),e!==u&&e>=m&&e<=v&&(u=e,a.append((new g.Path).moveTo(f,e).lineTo(w,e).close().stroke("#999",b)))})),h=new g.Group,y.forEach(function(e){l(e,a,h,n)}),a.append(h))}var r,o,a=Math.ceil(e.width/n.pageWidth),s=Math.ceil(e.height/n.pageHeight),d=n.pageWidth/e.scale,c=n.pageHeight/e.scale;for(r=0;r<a;++r)for(o=0;o<s;++o)i(o,r)}function l(e,t,n,i){var r,o,a,s,l,c,u=new g.Group;if(t.append(u),r=new _.Rect([e.left,e.top],[e.width,e.height]),(e.background||e.merged)&&(o=r,i.guidelines&&(o=r.clone(),o.origin.x+=b/2,o.origin.y+=b/2,o.size.width-=b,o.size.height-=b),u.append(new g.Rect(o).fill(e.background||"#fff").stroke(null))),e.borderLeft&&n.append((new g.Path).moveTo(e.left,e.top).lineTo(e.left,e.bottom).close().stroke(e.borderLeft.color,e.borderLeft.size)),e.borderTop&&n.append((new g.Path).moveTo(e.left,e.top).lineTo(e.right,e.top).close().stroke(e.borderTop.color,e.borderTop.size)),e.borderRight&&n.append((new g.Path).moveTo(e.right,e.top).lineTo(e.right,e.bottom).close().stroke(e.borderRight.color,e.borderRight.size)),e.borderBottom&&n.append((new g.Path).moveTo(e.left,e.bottom).lineTo(e.right,e.bottom).close().stroke(e.borderBottom.color,e.borderBottom.size)),a=e.value,null!=a){if(s="number"==typeof a?"number":null,l=new g.Group,l.clip(g.Path.fromRect(r)),u.append(l),e.format?(c=v.textAndColor(a,e.format),a=c.text,c.type&&(s=c.type)):a+="",!e.textAlign)switch(s){case"number":case"date":case"percent":e.textAlign="right";break;case"boolean":e.textAlign="center"}d(a,c&&c.color||e.color||"#000",e,l)}}function d(e,t,n,i){var r,o,a,s,l=n.left+2,d=n.top+2,c=n.width-4,f=n.height-4,p=h(n),m={font:p,whiteSpace:"pre"},v={font:p,fill:{color:t}},b=[],k=0,w=d;switch(n.wrap?(u(e,m,c).forEach(function(e){var t=new g.Text(e.text,[l,w],v);w+=e.box.height,b.push({el:t,box:e.box})}),k=w-d):(r=new g.Text(e,[l,w],v),o=kendo.util.measureText(e,m),b.push({el:r,box:o}),k=o.height),a=new g.Group,i.append(a),s=0,n.verticalAlign){case"center":s=f-k>>1;break;case void 0:case null:case"bottom":s=f-k}s<0&&(s=0),b.forEach(function(e){var i,r,o,l,d,u,h;switch(a.append(e.el),i=0,r=e.box.width,n.textAlign){case"center":i=(c-r)/2;break;case"right":i=c-r}i<0&&(i=0),(i||s)&&e.el.transform(_.Matrix.translate(i,s)),n.underline&&(o=n.fontSize||12,l=o/12,d=new g.Path({stroke:{width:l,color:t}}),u=e.el.position(),h=u.y+o+s+2*l,d.moveTo(u.x+i,h).lineTo(u.x+i+r,h),a.append(d))})}function c(e,t,n,i){function r(o,s,l){var d=e.substring(a,s).trim(),c=kendo.util.measureText(d,t);c.width<=n?s<l-1?r(s,s+l>>1,l):(i.push({text:d,box:c}),a=s):o<s&&r(o,o+s>>1,s)}for(var o=e.length,a=0;a<o;)r(a,o,o)}function u(e,t,n){var i=e.split(/\r?\n/),r=[];return i.forEach(function(e){c(e,t,n,r)}),r}function h(e){var t=[];return e.italic&&t.push("italic"),e.bold&&t.push("bold"),t.push((e.fontSize||12)+"px"),t.push(e.fontFamily||"Arial"),t.join(" ")}function f(e,t,i,r){var o,a,l,d,c;null==i&&null==r&&(r=t,i={},t=p.SHEETREF),null==r&&(r=i,t instanceof p.Range||t instanceof p.Ref||"string"==typeof t?i={}:(i=t,t=p.SHEETREF)),i=kendo.jQuery.extend({paperSize:"A4",landscape:!0,margin:"1cm",guidelines:!0,emptyCells:!0,fitWidth:!1,center:!1},i),o=new g.Group,a=kendo.pdf.getPaperOptions(i),o.options.set("pdf",{author:i.author,creator:i.creator,date:i.date,keywords:i.keywords,margin:a.margin,multiPage:!0,paperSize:a.paperSize,subject:i.subject,title:i.title}),l=a.paperSize[0],d=a.paperSize[1],a.margin&&(l-=a.margin.left+a.margin.right,d-=a.margin.top+a.margin.bottom),i.pageWidth=l,i.pageHeight=d,c=n(e,e._ref(t),i),s(c,o,i),r(o)}var p,m,g,v,_,b;kendo.support.browser.msie&&kendo.support.browser.version<9||(p=kendo.spreadsheet,m=p.CellRef,g=kendo.drawing,v=p.formatting,_=kendo.geometry,b=.8,p.Sheet.prototype.draw=function(e,t,n){var i=this;i._workbook?i.recalc(i._workbook._context,function(){f(i,e,t,n)}):f(i,e,t,n)},p.draw={doLayout:n,drawLayout:s,shouldDrawCell:o})},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.spreadsheet.min",["util/undoredostack.min","util/text-metrics.min","util/parse-xml.min","kendo.excel.min","kendo.progressbar.min","kendo.pdf.min","spreadsheet/commands.min","spreadsheet/formulabar.min","spreadsheet/formulainput.min","spreadsheet/eventlistener.min","spreadsheet/rangelist.min","spreadsheet/propertybag.min","spreadsheet/references.min","spreadsheet/navigator.min","spreadsheet/axismanager.min","spreadsheet/clipboard.min","spreadsheet/range.min","spreadsheet/sheet.min","spreadsheet/sheetsbar.min","spreadsheet/excel-reader.min","spreadsheet/workbook.min","spreadsheet/formulacontext.min","spreadsheet/controller.min","spreadsheet/view.min","spreadsheet/customeditors.min","spreadsheet/grid.min","spreadsheet/axis.min","spreadsheet/filter.min","spreadsheet/sorter.min","spreadsheet/runtime.min","spreadsheet/calc.min","spreadsheet/numformat.min","spreadsheet/runtime.functions.min","spreadsheet/runtime.functions.2.min","spreadsheet/toolbar.min","spreadsheet/dialogs.min","spreadsheet/sheetbinder.min","spreadsheet/filtermenu.min","spreadsheet/editor.min","spreadsheet/autofill.min","spreadsheet/nameeditor.min","spreadsheet/print.min"],e)}(function(){return function(e,t){var n,i,r,o,a,s,l,d,c;e.support.browser.msie&&e.support.browser.version<9||(n=e.jQuery,i=e.ui.Widget,r=e.spreadsheet.Workbook,o=e.spreadsheet.Controller,a=e.spreadsheet.View,s=".kendoSpreadsheet",l={recalc:!0,selection:!0,activeCell:!0,layout:!0,sheetSelection:!0,resize:!0,editorChange:!1,editorClose:!1},d={wrapper:"k-widget k-spreadsheet"},c=e.ui.Widget.extend({init:function(e,t){i.fn.init.call(this,e,t),this.element.addClass(c.classNames.wrapper),this._view=new a(this.element,{messages:this.options.messages.view,toolbar:this.options.toolbar,sheetsbar:this.options.sheetsbar}),this._workbook=new r(this.options,this._view),this._controller=new o(this._view,this._workbook),this._autoRefresh=!0,this._bindWorkbookEvents(),this._view.workbook(this._workbook),this.refresh(),this._resizeHandler=function(){this.resize()}.bind(this),n(window).on("resize"+s,this._resizeHandler)},_resize:function(){this.refresh({layout:!0})},_workbookChange:function(t){if(this._autoRefresh&&this.refresh(t),t.recalc&&t.ref){var n=new e.spreadsheet.Range(t.ref,this.activeSheet());this.trigger("change",{range:n})}},activeSheet:function(e){return this._workbook.activeSheet(e)},moveSheetToIndex:function(e,t){return this._workbook.moveSheetToIndex(e,t)},insertSheet:function(e){return this._workbook.insertSheet(e)},sheets:function(){return this._workbook.sheets()},removeSheet:function(e){return this._workbook.removeSheet(e)},sheetByName:function(e){return this._workbook.sheetByName(e)},sheetIndex:function(e){return this._workbook.sheetIndex(e)},sheetByIndex:function(e){return this._workbook.sheetByIndex(e)},renameSheet:function(e,t){return this._workbook.renameSheet(e,t)},refresh:function(e){return e||(e=l),e.editorClose||(this._view.sheet(this._workbook.activeSheet()),this._controller.sheet(this._workbook.activeSheet()),this._workbook.refresh(e)),e.editorChange||(this._view.refresh(e),this._controller.refresh(),this._view.render(),this.trigger("render")),this},openDialog:function(e,t){return this._view.openDialog(e,t)},autoRefresh:function(e){return e!==t?(this._autoRefresh=e,e===!0&&this.refresh(),this):this._autoRefresh},toJSON:function(){return this._workbook.toJSON()},fromJSON:function(e){e.sheets?(this._workbook.destroy(),this._workbook=new r(n.extend({},this.options,e)),this._bindWorkbookEvents(),this._view.workbook(this._workbook),this._controller.workbook(this._workbook),this.activeSheet(this.activeSheet())):this.refresh()},fromFile:function(e,t){return this._workbook.fromFile(e,t)},saveAsPDF:function(e){this._workbook.saveAsPDF(n.extend({},this.options.pdf,e,{workbook:this._workbook}))},saveAsExcel:function(e){this._workbook.saveAsExcel(e)},draw:function(e,t){this._workbook.draw(e,t)},_workbookExcelExport:function(e){this.trigger("excelExport",e)&&e.preventDefault()},_workbookExcelImport:function(e){this.trigger("excelImport",e)?e.preventDefault():this._initProgress(e.promise)},_initProgress:function(t){var i=n("<div class='k-loading-mask' style='width: 100%; height: 100%; top: 0;'><div class='k-loading-color'/></div>").appendTo(this.element),r=n("<div class='k-loading-progress'>").appendTo(i).kendoProgressBar({type:"chunk",chunkCount:10,min:0,max:1,value:0}).data("kendoProgressBar");t.progress(function(e){r.value(e.progress)}).always(function(){e.destroy(i),i.remove()})},_workbookPdfExport:function(e){this.trigger("pdfExport",e)&&e.preventDefault()},_bindWorkbookEvents:function(){this._workbook.bind("change",this._workbookChange.bind(this)),this._workbook.bind("excelExport",this._workbookExcelExport.bind(this)),this._workbook.bind("excelImport",this._workbookExcelImport.bind(this)),this._workbook.bind("pdfExport",this._workbookPdfExport.bind(this))},destroy:function(){e.ui.Widget.fn.destroy.call(this),this._workbook.destroy(),this._controller.destroy(),this._view.destroy(),this._resizeHandler&&n(window).off("resize"+s,this._resizeHandler)},options:{name:"Spreadsheet",toolbar:!0,sheetsbar:!0,rows:200,columns:50,rowHeight:20,columnWidth:64,headerHeight:20,headerWidth:32,excel:{proxyURL:"",fileName:"Workbook.xlsx"},messages:{},pdf:{area:"workbook",fileName:"Workbook.pdf",proxyURL:"",paperSize:"a4",landscape:!0,margin:null,title:null,author:null,subject:null,keywords:null,creator:"Kendo UI PDF Generator v."+e.version,date:null}},defineName:function(e,t,n){return this._workbook.defineName(e,t,n)},undefineName:function(e){return this._workbook.undefineName(e)},nameValue:function(e){return this._workbook.nameValue(e)},forEachName:function(e){return this._workbook.forEachName(e)},events:["pdfExport","excelExport","excelImport","change","render"]}),e.spreadsheet.ALL_REASONS=l,e.ui.plugin(c),n.extend(!0,c,{classNames:d}))}(window.kendo),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.pivot.configurator.min",["kendo.dom.min"],e)}(function(){return function(e,t){function n(e){for(var t,n=0,i=e.length;n<i;n++)if(2==e[n].type){t=!0;break}t&&e.splice(n+1,0,{caption:"KPIs",defaultHierarchy:"[KPIs]",name:"KPIs",uniqueName:"[KPIs]"})}function i(e){return{name:e.uniqueName,type:e.type}}function r(e){for(var t=0,n=e.length;t<n;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e}function o(t){var n=e(t).closest(".k-pivot-setting");return n.length?n.data("kendoPivotSettingTarget"):null}function a(e,t,n){return{hierarchyUniqueName:e,uniqueName:t,caption:t,measure:t,name:t,type:n,kpi:!0}}function s(e){var t=e.name;return[a(t,e.value,"value"),a(t,e.goal,"goal"),a(t,e.status,"status"),a(t,e.trend,"trend")]}var l=window.kendo,d=l.ui,c=d.Widget,u=".kendoPivotConfigurator",h="mouseenter"+u+" mouseleave"+u,f=l.template('<p class="k-reset"><span class="k-icon #=icon#"></span>${name}</p><div class="k-list-container k-reset"/>'),p=c.extend({init:function(e,t){c.fn.init.call(this,e,t),this.element.addClass("k-widget k-fieldselector k-alt k-edit-form-container"),this._dataSource(),this._layout(),this.refresh(),l.notify(this)},events:[],options:{name:"PivotConfigurator",filterable:!1,sortable:!1,messages:{measures:"Drop Data Fields Here",columns:"Drop Column Fields Here",rows:"Drop Rows Fields Here",measuresLabel:"Measures",columnsLabel:"Columns",rowsLabel:"Rows",fieldsLabel:"Fields"}},_dataSource:function(){var t=this;t.dataSource&&t._refreshHandler?t.dataSource.unbind("change",t._refreshHandler).unbind("error",t._errorHandler).unbind("progress",t._progressHandler):(t._errorHandler=e.proxy(t._error,t),t._refreshHandler=e.proxy(t.refresh,t),t._progressHandler=e.proxy(t._requestStart,t)),t.dataSource=l.data.PivotDataSource.create(t.options.dataSource),t.dataSource.bind("change",t._refreshHandler).bind("error",t._errorHandler).bind("progress",t._progressHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.measures&&this.measures.setDataSource(e),this.rows&&this.rows.setDataSource(e),this.columns&&this.columns.setDataSource(e),this.refresh()},_treeViewDataSource:function(){var t=this;return l.data.HierarchicalDataSource.create({schema:{model:{id:"uniqueName",hasChildren:function(e){return!("hierarchyUniqueName"in e||"aggregator"in e)}}},transport:{read:function(i){var o,a,l;e.isEmptyObject(i.data)?(o=t.dataSource.schemaDimensions(),o.done(function(e){t.dataSource.cubeBuilder||n(e),i.success(e)}).fail(i.error)):(a=t.treeView.dataSource.get(i.data.uniqueName),"[KPIs]"===a.uniqueName?(l=!0,o=t.dataSource.schemaKPIs(),o.done(function(e){i.success(r(e))}).fail(i.error)):"kpi"==a.type&&(l=!0,i.success(s(a))),l||(o=2==a.type?t.dataSource.schemaMeasures():a.dimensionUniqueName?t.dataSource.schemaLevels(i.data.uniqueName):t.dataSource.schemaHierarchies(i.data.uniqueName),o.done(i.success).fail(i.error)))}}})},_progress:function(e){l.ui.progress(this.element,e)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_layout:function(){this.form=e('<div class="k-columns k-state-default k-floatwrap"/>').appendTo(this.element),this._fields(),this._targets()},_fields:function(){
var t=e('<div class="k-state-default"><p class="k-reset"><span class="k-icon k-i-group"></span>'+this.options.messages.fieldsLabel+"</p></div>").appendTo(this.form),n='# if (item.type == 2 || item.uniqueName == "[KPIs]") { #<span class="k-icon k-i-#= (item.type == 2 ? "sum" : "kpi") #"></span># } else if (item.type && item.type !== "kpi") { #<span class="k-icon k-i-dimension"></span># } ##: item.caption || item.name #';this.treeView=e("<div/>").appendTo(t).kendoTreeView({template:n,dataTextField:"caption",dragAndDrop:!0,autoBind:!1,dataSource:this._treeViewDataSource(),dragstart:function(e){var t=this.dataItem(e.sourceNode);(t.hasChildren||t.aggregator||t.measure)&&2!=t.type&&"[KPIs]"!==t.uniqueName||e.preventDefault()},drag:function(e){var t="k-i-denied",n=o(e.dropTarget);n&&n.validate(this.dataItem(e.sourceNode))&&(t="k-i-add"),e.setStatusClass(t)},drop:function(e){var t,n,r,a,l,d;if(e.preventDefault(),t=o(e.dropTarget),n=this.dataItem(e.sourceNode),t&&t.validate(n)){if(d=n.defaultHierarchy||n.uniqueName,"kpi"===n.type)for(l=s(n),a=l.length,d=[],r=0;r<a;r++)d.push(i(l[r]));else n.kpi&&(d=[i(n)]);t.add(d)}}}).data("kendoTreeView")},_createTarget:function(t,n){var i='<li class="k-item k-header" data-'+l.ns+'name="${data.name}">${data.name}',r=n.sortable,o="";return r&&(o+="#if (data.sortIcon) {#",o+='<span class="k-icon ${data.sortIcon} k-setting-sort"></span>',o+="#}#"),(n.filterable||r)&&(o+='<span class="k-icon k-i-arrowhead-s k-setting-fieldmenu"></span>'),o+='<span class="k-icon k-si-close k-setting-delete"></span>',i+='<span class="k-field-actions">'+o+"</span></li>",new l.ui.PivotSettingTarget(t,e.extend({dataSource:this.dataSource,hint:function(t){var n=e('<div class="k-fieldselector"><ul class="k-list k-reset"></ul></div>');return n.find(".k-list").append(t.clone()),n},template:i,emptyTemplate:'<li class="k-item k-empty">${data}</li>'},n))},_targets:function(){var t=e('<div class="k-state-default"/>').appendTo(this.form),n=e(f({name:this.options.messages.columnsLabel,icon:"k-i-vbars"})).appendTo(t),i=e('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(n.last()),r=e(f({name:this.options.messages.rowsLabel,icon:"k-i-hbars"})).appendTo(t),o=e('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(r.last()),a=e(f({name:this.options.messages.measuresLabel,icon:"k-i-sum"})).appendTo(t),s=e('<ul class="k-pivot-configurator-settings k-list k-reset" />').appendTo(a.last()),l=this.options;this.columns=this._createTarget(i,{filterable:l.filterable,sortable:l.sortable,connectWith:o,messages:{empty:l.messages.columns,fieldMenu:l.messages.fieldMenu}}),this.rows=this._createTarget(o,{filterable:l.filterable,setting:"rows",connectWith:i,messages:{empty:this.options.messages.rows,fieldMenu:this.options.messages.fieldMenu}}),this.measures=this._createTarget(s,{setting:"measures",messages:{empty:l.messages.measures}}),i.add(o).add(s).on(h,".k-item:not(.k-empty)",this._toggleHover)},_toggleHover:function(t){e(t.currentTarget).toggleClass("k-state-hover","mouseenter"===t.type)},_resize:function(){var e,t,n=this.element,i=this.options.height,r=l._outerHeight;i&&(n.height(i),n.is(":visible")&&(t=n.children(".k-columns").children("div.k-state-default"),i=n.innerHeight(),e=(r(n)-i)/2,i=i-(r(t,!0)-t.height())-e,t.height(i)))},refresh:function(){var e=this.dataSource;(e.cubeBuilder||this._cube!==e.cube()||this._catalog!==e.catalog())&&this.treeView.dataSource.fetch(),this._catalog=this.dataSource.catalog(),this._cube=this.dataSource.cube(),this._resize(),this._progress(!1)},destroy:function(){c.fn.destroy.call(this),this.dataSource.unbind("change",this._refreshHandler),this.form.find(".k-list").off(u),this.rows.destroy(),this.columns.destroy(),this.measures.destroy(),this.treeView.destroy(),this.element=null,this._refreshHandler=null}});d.plugin(p)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.angular.min",["kendo.core.min"],e)}(function(){return function(e,t,n){"use strict";function i(e){var t=S;try{return S=function(e){return e()},e()}finally{S=t}}function r(t,i,r,d,c,g){function v(){var n,g,v,_,b,x,T;return r.kRebind&&(n=e(e(i)[0].cloneNode(!0))),C=o(t,i,r,d,y).options,i.is("select")&&!function(t){if(t.length>0){var n=e(t[0]);!/\S/.test(n.text())&&/^\?/.test(n.val())&&n.remove()}}(i[0].options),g=y.call(i,F=C).data(d),l(g,t,r,d,c),t.$emit("kendoWidgetCreated",g),v=f(t,g),r.kRebind&&m(g,t,i,n,r.kRebind,v,r),r.kNgDisabled&&(_=r.kNgDisabled,b=t.$eval(_),b&&g.enable(!b),a(g,t,i,_)),r.kNgReadonly&&(x=r.kNgReadonly,T=t.$eval(x),T&&g.readonly(T),s(g,t,i,x)),r.kNgModel&&h(g,t,r.kNgModel),k&&u(g,t,i,k,w),g&&p(g,i),g}var _,b,k,w,y,x,C,T,D,E,R,I,A,M;if(!(i instanceof jQuery))throw Error("The Kendo UI directives require jQuery to be available before AngularJS. Please include jquery before angular in the document.");if(_=r.kNgDelay,b=t.$eval(_),g=g||[],k=g[0],w=g[1],y=e(i)[d],!y)return window.console.error("Could not find: "+d),null;if(x=o(t,i,r,d,y),C=x.options,x.unresolved.length){for(T=[],D=0,E=x.unresolved.length;D<E;D++)R=x.unresolved[D],I=e.Deferred(function(e){var i=t.$watch(R.path,function(t){t!==n&&(i(),e.resolve())})}).promise(),T.push(I);return e.when.apply(null,T).then(v),n}return _&&!b?(A=t.$root||t,M=function(){var e=t.$watch(_,function(t){t!==n&&(e(),i.removeAttr(r.$attr.kNgDelay),_=null,S(v))})},/^\$(digest|apply)$/.test(A.$$phase)?M():t.$apply(M),n):v()}function o(i,r,o,a,s){function l(e,r){var o=t.copy(i.$eval(r));o===n?p.push({option:e,path:r}):d[e]=o}var d,c,u,h,f=a.replace(/^kendo/,""),p=[],m=o.kOptions||o.options,g=i.$eval(m);return m&&g===n&&p.push({option:"options",path:m}),d=t.extend({},o.defaultOptions,g),c=s.widget.prototype.options,u=s.widget.prototype.events,e.each(o,function(e,t){var n,i,r,o;"source"!==e&&"kDataSource"!==e&&"kScopeField"!==e&&"scopeField"!==e&&(n="data"+e.charAt(0).toUpperCase()+e.slice(1),0===e.indexOf("on")&&(i=e.replace(/^on./,function(e){return e.charAt(2).toLowerCase()}),u.indexOf(i)>-1&&(d[i]=t)),c.hasOwnProperty(n)?l(n,t):c.hasOwnProperty(e)&&!A[e]?l(e,t):I[e]||(r=e.match(/^k(On)?([A-Z].*)/),r&&(o=r[2].charAt(0).toLowerCase()+r[2].slice(1),r[1]&&"kOnLabel"!=e?d[o]=t:("kOnLabel"==e&&(o="onLabel"),l(o,t)))))}),h=o.kDataSource||o.source,h&&(d.dataSource=R(i,r,f,h)),d.$angular=[i],{options:d,unresolved:p}}function a(e,t,i,r){return kendo.ui.PanelBar&&e instanceof kendo.ui.PanelBar||kendo.ui.Menu&&e instanceof kendo.ui.Menu?(E.warn("k-ng-disabled specified on a widget that does not have the enable() method: "+e.options.name),n):(t.$watch(r,function(t,n){t!=n&&e.enable(!t)}),n)}function s(e,t,i,r){return"function"!=typeof e.readonly?(E.warn("k-ng-readonly specified on a widget that does not have the readonly() method: "+e.options.name),n):(t.$watch(r,function(t,n){t!=n&&e.readonly(t)}),n)}function l(e,t,n,i,r){if(n[r]){var o=T(n[r]).assign;if(!o)throw Error(r+" attribute used but expression in it is not assignable: "+n[i]);o(t,e)}}function d(e){return/checkbox|radio/i.test(e.attr("type"))?e.prop("checked"):e.val()}function c(e){return M.test(e[0].tagName)}function u(e,t,i,r,o){var a,s,l,u,h;e.value&&(s=!1,a=c(i)?function(){return d(i)}:function(){return e.value()},l=function(){var i=r.$viewValue;i===n&&(i=r.$modelValue),i===n&&(i=null),s=!0,setTimeout(function(){if(s=!1,e){var n=t[e.element.attr("k-ng-model")];n&&(i=n),e.options.autoBind!==!1||e.listView.bound()?e.value(i):i&&e.value(i)}},0)},r.$render=l,setTimeout(function(){r.$render!==l&&(r.$render=l)()}),c(i)&&i.on("change",function(){s=!0}),u=function(e){return function(){var n;s||(e&&o&&(n=o.$pristine),r.$setViewValue(a()),e&&(r.$setPristine(),n&&o.$setPristine()),k(t))}},e.first("change",u(!1)),e.first("spin",u(!1)),kendo.ui.AutoComplete&&e instanceof kendo.ui.AutoComplete||e.first("dataBound",u(!0)),h=a(),isNaN(r.$viewValue)||h==r.$viewValue||(r.$isEmpty(r.$viewValue)?null!=h&&""!==h&&h!=r.$viewValue&&r.$setViewValue(h):e.value(r.$viewValue)),r.$setPristine())}function h(t,i,r){var o,a,s,l,d,c,u,h,f,p;return"function"!=typeof t.value?(E.warn("k-ng-model specified on a widget that does not have the value() method: "+t.options.name),n):(o=e(t.element).parents("form"),a=kendo.getter(o.attr("name"),!0)(i),s=T(r),l=s.assign,d=!1,c=kendo.ui.MultiSelect&&t instanceof kendo.ui.MultiSelect,u=function(e){return e&&c?e.length:0},h=u(s(i)),t.$angular_setLogicValue(s(i)),f=function(e,i){e===n&&(e=null),d||e==i&&u(e)==h||(h=u(e),t.$angular_setLogicValue(e))},c?i.$watchCollection(r,f):i.$watch(r,f),p=function(){d=!0,a&&a.$pristine&&a.$setDirty(),k(i,function(){l(i,t.$angular_getLogicValue()),h=u(s(i))}),d=!1},t.first("change",p),t.first("spin",p),n)}function f(e,t){var n=e.$on("$destroy",function(){n(),t&&(kendo.destroy(t.element),t=null)});return n}function p(t,n){function i(){a.disconnect()}function r(){a.observe(e(n)[0],{attributes:!0})}var o,a;window.MutationObserver&&t.wrapper&&(o=[].slice.call(e(n)[0].classList),a=new MutationObserver(function(n){i(),t&&(n.forEach(function(n){var i,r=e(t.wrapper)[0];switch(n.attributeName){case"class":i=[].slice.call(n.target.classList),i.forEach(function(e){o.indexOf(e)<0&&(r.classList.add(e),kendo.ui.ComboBox&&t instanceof kendo.ui.ComboBox&&t.input[0].classList.add(e))}),o.forEach(function(e){i.indexOf(e)<0&&(r.classList.remove(e),kendo.ui.ComboBox&&t instanceof kendo.ui.ComboBox&&t.input[0].classList.remove(e))}),o=i;break;case"disabled":"function"!=typeof t.enable||t.element.attr("readonly")||t.enable(!e(n.target).attr("disabled"));break;case"readonly":"function"!=typeof t.readonly||t.element.attr("disabled")||t.readonly(!!e(n.target).attr("readonly"))}}),r())}),r(),t.first("destroy",i))}function m(t,n,i,r,o,a,s){var l=n.$watch(o,function(o,d){var c,u,h,f,p;t._muteRebind||o===d||(l(),s._cleanUp&&s._cleanUp(),c=L[t.options.name],c&&c.forEach(function(t){var i=n.$eval(s["k"+t]);i&&r.append(e(i).attr(kendo.toHyphens("k"+t),""))}),u=e(t.wrapper)[0],h=e(t.element)[0],f="Upload"===t.options.name,f&&(i=e(h)),p=i.injector().get("$compile"),t._destroy(),a&&a(),t=null,h&&(u&&u.parentNode.replaceChild(h,u),e(i).replaceWith(r)),p(r)(n))},!0);k(n)}function g(e,t){return function(n,i){return e.call(t,n,i)}}function v(e,t){this[e]=kendo.stringify(t)}function _(e,n){function i(e,t){x.directive(e,["directiveFactory",function(n){return n.create(t,e)}])}var r,o,a,s,l=n?"Mobile":"";l+=e.fn.options.name,r=l,o="kendo"+l.charAt(0)+l.substr(1).toLowerCase(),l="kendo"+l,a=l.replace(/([A-Z])/g,"-$1"),H.indexOf(l.replace("kendo",""))==-1&&(s=l===o?[l]:[l,o],t.forEach(s,function(e){x.directive(e,function(){return{restrict:"E",replace:!0,template:function(e,t){var n=z[r]||"div",i=t.kScopeField||t.scopeField;return"<"+n+" "+a+(i?'="'+i+'"':"")+">"+e.html()+"</"+n+">"}}})})),N.indexOf(l.replace("kendo",""))>-1||(i(l,l),o!=l&&i(o,l))}function b(t){return t=e(t),kendo.widgetInstance(t,kendo.ui)||kendo.widgetInstance(t,kendo.mobile.ui)||kendo.widgetInstance(t,kendo.dataviz.ui)}function k(e,t){var n=e.$root||e,i=/^\$(digest|apply)$/.test(n.$$phase);t?i?t():n.$apply(t):i||n.$digest()}function w(t,n){t.$destroy(),n&&e(n).removeData("$scope").removeData("$$kendoScope").removeData("$isolateScope").removeData("$isolateScopeNoTemplate").removeClass("ng-scope")}function y(n,i,r){var o,a,s;if(e.isArray(n))return t.forEach(n,function(e){y(e,i,r)});if("string"==typeof n){for(o=n.split("."),a=kendo;a&&o.length>0;)a=a[o.shift()];if(!a)return P.push([n,i,r]),!1;n=a.prototype}return s=n[i],n[i]=function(){var e=this,t=arguments;return r.apply({self:e,next:function(){return s.apply(e,arguments.length>0?arguments:t)}},t)},!0}var x,C,T,S,D,E,F,R,I,A,M,z,H,N,P,L;t&&t.injector&&(x=t.module("kendo.directives",[]),C=t.injector(["ng"]),T=C.get("$parse"),S=C.get("$timeout"),E=C.get("$log"),R=function(){var e={TreeList:"TreeListDataSource",TreeView:"HierarchicalDataSource",Scheduler:"SchedulerDataSource",PivotGrid:"PivotDataSource",PivotConfigurator:"PivotDataSource",PanelBar:"$PLAIN",Menu:"$PLAIN",ContextMenu:"$PLAIN"},t=function(e,t){return"$PLAIN"==t?e:kendo.data[t].create(e)};return function(n,i,r,o){var a=e[r]||"DataSource",s=n.$eval(o),l=t(s,a);return n.$watch(o,function(e){var n,r=b(i);r&&"function"==typeof r.setDataSource&&e!==s&&(n=t(e,a),r.setDataSource(n),s=e)}),l}}(),I={kDataSource:!0,kOptions:!0,kRebind:!0,kNgModel:!0,kNgDelay:!0},A={name:!0,title:!0,style:!0},M=/^(input|select|textarea)$/i,x.factory("directiveFactory",["$compile",function(t){var n,i,o=!1;return D=t,i=function(t,i){return{restrict:"AC",require:["?ngModel","^?form"],scope:!1,controller:["$scope","$attrs","$element",function(e,t){this.template=g(v,t),t._cleanUp=g(function(){this.template=null,t._cleanUp=null},this)}],link:function(a,s,l,d){var c,u=e(s),h=t.replace(/([A-Z])/g,"-$1");u.attr(h,u.attr("data-"+h)),u[0].removeAttribute("data-"+h),c=r(a,s,l,t,i,d),c&&(n&&clearTimeout(n),n=setTimeout(function(){a.$emit("kendoRendered"),o||(o=!0,e("form").each(function(){var t=e(this).controller("form");t&&t.$setPristine()}))}))}}},{create:i}}]),z={Editor:"textarea",NumericTextBox:"input",DatePicker:"input",DateTimePicker:"input",TimePicker:"input",AutoComplete:"input",ColorPicker:"input",MaskedTextBox:"input",MultiSelect:"input",Upload:"input",Validator:"form",Button:"button",MobileButton:"a",MobileBackButton:"a",MobileDetailButton:"a",ListView:"ul",MobileListView:"ul",TreeView:"ul",Menu:"ul",ContextMenu:"ul",ActionSheet:"ul"},H=["MobileView","MobileDrawer","MobileLayout","MobileSplitView","MobilePane","MobileModalView"],N=["MobileApplication","MobileView","MobileModalView","MobileLayout","MobileActionSheet","MobileDrawer","MobileSplitView","MobilePane","MobileScrollView","MobilePopOver"],t.forEach(["MobileNavBar","MobileButton","MobileBackButton","MobileDetailButton","MobileTabStrip","MobileScrollView","MobileScroller"],function(e){N.push(e),e="kendo"+e,x.directive(e,function(){return{restrict:"A",link:function(t,n,i){r(t,n,i,e,e)}}})}),P=[],kendo.onWidgetRegistered(function(t){P=e.grep(P,function(e){return!y.apply(null,e)}),_(t.widget,"Mobile"==t.prefix)}),y(["ui.Widget","mobile.ui.Widget"],"angular",function(r,o){var a,s=this.self;return"init"==r?(!o&&F&&(o=F),F=null,o&&o.$angular&&(s.$angular_scope=o.$angular[0],s.$angular_init(s.element,o)),n):(a=s.$angular_scope,a&&i(function(){var i,l,d=o(),c=d.elements,u=d.data;if(c.length>0)switch(r){case"cleanup":t.forEach(c,function(t){var n=e(t).data("$$kendoScope");n&&n!==a&&n.$$kendoScope&&w(n,t)});break;case"compile":i=s.element.injector(),l=i?i.get("$compile"):D,t.forEach(c,function(t,i){var r,o;d.scopeFrom?r=d.scopeFrom:(o=u&&u[i],o!==n?(r=e.extend(a.$new(),o),r.$$kendoScope=!0):r=a),e(t).data("$$kendoScope",r),l(t)(r)}),k(a)}}),n)}),y("ui.Widget","$angular_getLogicValue",function(){return this.self.value()}),y("ui.Widget","$angular_setLogicValue",function(e){this.self.value(e)}),y("ui.Select","$angular_getLogicValue",function(){var e=this.self.dataItem(),t=this.self.options.dataValueField;return e?this.self.options.valuePrimitive?t?e[t]:e:e.toJSON():null}),y("ui.Select","$angular_setLogicValue",function(e){var t=this.self,i=t.options,r=i.dataValueField,o=i.text||"";e===n&&(e=""),r&&!i.valuePrimitive&&e&&(o=e[i.dataTextField]||"",e=e[r||i.dataTextField]),t.options.autoBind!==!1||t.listView.bound()?t.value(e):!o&&e&&i.valuePrimitive?t.value(e):t._preselect(e,o)}),y("ui.MultiSelect","$angular_getLogicValue",function(){var t=this.self.dataItems().slice(0),n=this.self.options.dataValueField;return n&&this.self.options.valuePrimitive&&(t=e.map(t,function(e){return e[n]})),t}),y("ui.MultiSelect","$angular_setLogicValue",function(t){var n,i,r,o;null==t&&(t=[]),n=this.self,i=n.options,r=i.dataValueField,o=t,r&&!i.valuePrimitive&&(t=e.map(t,function(e){return e[r]})),i.autoBind!==!1||i.valuePrimitive||n.listView.bound()?n.value(t):n._preselect(o,t)}),y("ui.AutoComplete","$angular_getLogicValue",function(){var e,t,n,i,r,o=this.self.options,a=this.self.value().split(o.separator),s=o.valuePrimitive,l=this.self.listView.selectedDataItems(),d=[];for(e=0,t=l.length;e<t;e++)for(n=l[e],i=o.dataTextField?n[o.dataTextField]:n,r=0;r<a.length;r++)if(i===a[r]){d.push(s?i:n.toJSON());break}return d}),y("ui.AutoComplete","$angular_setLogicValue",function(t){null==t&&(t=[]);var i=this.self,r=i.options.dataTextField;r&&!i.options.valuePrimitive&&(t=t.length!==n?e.map(t,function(e){return e[r]}):t[r]),i.value(t)}),y("ui.Widget","$angular_init",function(t,n){var i,r,o,a,s=this.self;if(n&&!e.isArray(n))for(i=s.$angular_scope,r=s.events.length;--r>=0;)o=s.events[r],a=n[o],a&&"string"==typeof a&&(n[o]=s.$angular_makeEventHandler(o,i,a))}),y("ui.Widget","$angular_makeEventHandler",function(e,t,n){return n=T(n),function(e){k(t,function(){n(t,{kendoEvent:e})})}}),y(["ui.Grid","ui.ListView","ui.TreeView"],"$angular_makeEventHandler",function(e,n,i){return"change"!=e?this.next():(i=T(i),function(e){var r,o,a,s,l,d,c,u,h,f=e.sender,p=f.options,m={kendoEvent:e};for(t.isString(p.selectable)&&(r=p.selectable.indexOf("cell")!==-1,o=p.selectable.indexOf("multiple")!==-1),a=m.selected=this.select(),s=m.data=[],l=m.columns=[],c=0;c<a.length;c++)u=r?a[c].parentNode:a[c],h=f.dataItem(u),r?(t.element.inArray(h,s)<0&&s.push(h),d=t.element(a[c]).index(),t.element.inArray(d,l)<0&&l.push(d)):s.push(h);o||(m.dataItem=m.data=s[0],m.angularDataItem=kendo.proxyModelSetters(m.dataItem),m.selected=a[0]),k(n,function(){i(n,m)})})}),y("ui.Grid","$angular_init",function(i,r){if(this.next(),r.columns){var o=e.extend({},kendo.Template,r.templateSettings);t.forEach(r.columns,function(e){!e.field||e.template||e.format||e.values||e.encoded!==n&&!e.encoded||(e.template="<span ng-bind='"+kendo.expr(e.field,"dataItem")+"'>#: "+kendo.expr(e.field,o.paramName)+"#</span>")})}}),y("mobile.ui.ButtonGroup","value",function(e){var t=this.self;return null!=e&&(t.select(t.element.children("li.km-button").eq(e)),t.trigger("change"),t.trigger("select",{index:t.selectedIndex})),t.selectedIndex}),y("mobile.ui.ButtonGroup","_select",function(){this.next(),this.self.trigger("change")}),x.directive("kendoMobileApplication",function(){return{terminal:!0,link:function(e,t,n){r(e,t,n,"kendoMobileApplication","kendoMobileApplication")}}}).directive("kendoMobileView",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=r(e,t,n,"kendoMobileView","kendoMobileView")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileDrawer",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=r(e,t,n,"kendoMobileDrawer","kendoMobileDrawer")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileModalView",function(){return{scope:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=r(e,t,n,"kendoMobileModalView","kendoMobileModalView")},post:function(e,t,n){n._instance._layout(),n._instance._scroller()}}}}).directive("kendoMobileSplitView",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,n._instance=r(e,t,n,"kendoMobileSplitView","kendoMobileSplitView")},post:function(e,t,n){n._instance._layout()}}}}).directive("kendoMobilePane",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,r(e,t,n,"kendoMobilePane","kendoMobilePane")}}}}).directive("kendoMobileLayout",function(){return{link:{pre:function(e,t,n){r(e,t,n,"kendoMobileLayout","kendoMobileLayout")}}}}).directive("kendoMobileActionSheet",function(){return{restrict:"A",link:function(t,n,i){n.find("a[k-action]").each(function(){e(this).attr("data-"+kendo.ns+"action",e(this).attr("k-action"))}),r(t,n,i,"kendoMobileActionSheet","kendoMobileActionSheet")}}}).directive("kendoMobilePopOver",function(){return{terminal:!0,link:{pre:function(e,t,n){n.defaultOptions=e.viewOptions,r(e,t,n,"kendoMobilePopOver","kendoMobilePopOver")}}}}).directive("kendoViewTitle",function(){return{restrict:"E",replace:!0,template:function(e){return"<span data-"+kendo.ns+"role='view-title'>"+e.html()+"</span>"}}}).directive("kendoMobileHeader",function(){return{restrict:"E",link:function(e,t){t.addClass("km-header").attr("data-role","header")}}}).directive("kendoMobileFooter",function(){return{restrict:"E",link:function(e,t){t.addClass("km-footer").attr("data-role","footer")}}}).directive("kendoMobileScrollViewPage",function(){return{restrict:"E",replace:!0,template:function(e){return"<div data-"+kendo.ns+"role='page'>"+e.html()+"</div>"}}}),t.forEach(["align","icon","rel","transition","actionsheetContext"],function(e){var t="k"+e.slice(0,1).toUpperCase()+e.slice(1);x.directive(t,function(){return{restrict:"A",priority:2,link:function(n,i,r){i.attr(kendo.attr(kendo.toHyphens(e)),n.$eval(r[t]))}}})}),L={TreeMap:["Template"],MobileListView:["HeaderTemplate","Template"],MobileScrollView:["EmptyTemplate","Template"],Grid:["AltRowTemplate","DetailTemplate","RowTemplate"],ListView:["EditTemplate","Template","AltTemplate"],Pager:["SelectTemplate","LinkTemplate"],PivotGrid:["ColumnHeaderTemplate","DataCellTemplate","RowHeaderTemplate"],Scheduler:["AllDayEventTemplate","DateHeaderTemplate","EventTemplate","MajorTimeHeaderTemplate","MinorTimeHeaderTemplate"],TreeView:["Template"],Validator:["ErrorTemplate"]},function(){var e={};t.forEach(L,function(n,i){t.forEach(n,function(t){e[t]||(e[t]=[]),e[t].push("?^^kendo"+i)})}),t.forEach(e,function(e,t){var n="k"+t,i=kendo.toHyphens(n);x.directive(n,function(){return{restrict:"A",require:e,terminal:!0,compile:function(t,r){if(""===r[n]){t.removeAttr(i);var o=t[0].outerHTML;return function(t,r,a,s){for(var l;!l&&s.length;)l=s.shift();l?(l.template(n,o),r.remove()):E.warn(i+" without a matching parent widget found. It can be one of the following: "+e.join(", "))}}}}})})}())}(window.kendo.jQuery,window.angular),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.webcomponents.min",["kendo.core.min"],e)}(function(){return function(e,t,n){function i(e,t){var i=e.getAttribute(t);return null===i?i=n:"null"===i?i=null:"true"===i?i=!0:"false"===i?i=!1:p.test(i)?i=parseFloat(i):h.test(i)&&!f.test(i)&&(i=Function("return ("+i+")")()),i}function r(e,t){var n={};return Object.keys(t).concat("dataSource").forEach(function(t){e.hasAttribute(kendo.toHyphens(t))&&(n[t]=i(e,kendo.toHyphens(t)))}),n}function o(e){var t={};return Object.keys(e).forEach(function(n){"_"!=n[0]&&(t[n]=e[n])}),t}function a(e,t){var n=document.createEvent("CustomEvent");n.initCustomEvent(e,!1,!0,o(t)),this.dispatchEvent(n),n.defaultPrevented&&t.preventDefault()}function s(e,t){var n,i=Object.keys(t);for(n=0;n<=i.length;n++)if("function"==typeof t[i[n]])e[i[n]]||(e[i[n]]=t[i[n]].bind(e.widget));else{if("options"===i[n])continue;e[i[n]]=e[i[n]]||t[i[n]]}}function l(t,n){var i=n.prototype.options,o=Object.create(HTMLElement.prototype);Object.defineProperty(o,"options",{get:function(){return this.widget.options},set:function(n){var i,r,o,a=this.widget;n=e.extend(!0,{},a.options,n),i=e(a.wrapper)[0],r=e(a.element)[0],a._destroy(),o=document.createElement(d[t]||"div"),i&&r&&(i.parentNode.replaceChild(r,i),e(r).replaceWith(o)),a.value&&(n.value=a.value()),a.init(o,n),this.bindEvents()}}),o.bindEvents=function(){n.prototype.events.indexOf("init")<0&&n.prototype.events.push("init"),n.prototype.events.forEach(function(e){this.widget.bind(e,a.bind(this,e)),this.hasAttribute(c+e)&&this.bind(e,function(t){window[this.getAttribute(c+e)].call(this,t)}.bind(this))}.bind(this))},o.attachedCallback=function(){var o,a=this,l=document.createElement(d[t]||"div");e(l).append(a.childNodes),e(l).attr("class",e(a).attr("class")),e(l).attr("style",e(a).attr("style")),a.appendChild(l),a.widget=new n(l,r(a,i)),o=a.widget;do s(a,o);while(o=Object.getPrototypeOf(o));this.bindEvents(),a.widget.trigger("init")},o.detachedCallback=function(){kendo.destroy(this.element)},kendo.webComponents.push("kendo-"+t),document.registerElement("kendo-"+t,{prototype:o})}var d,c,u,h,f,p;kendo.support.customElements&&!kendo.webComponents.length&&(t&&(1==t.version.major||t.injector)||(d={editor:"textarea",numerictextbox:"input",datepicker:"input",datetimepicker:"input",timepicker:"input",autocomplete:"input",colorpicker:"input",maskedtextbox:"input",dropdownlist:"select",multiselect:"select",upload:"input",validator:"form",button:"button",mobilebutton:"a",mobilebackbutton:"a",mobiledetailbutton:"a",listview:"ul",mobilelistview:"ul",treeview:"ul",menu:"ul",contextmenu:"ul",actionsheet:"ul"},c="on-",u=[],kendo.onWidgetRegistered(function(e){var t=e.prefix+e.widget.prototype.options.name.toLowerCase();u.indexOf(t)===-1&&(u.push(t),l(t,e.widget))}),h=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,f=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,p=/^(\+|-?)\d+(\.?)\d*$/))}(window.kendo.jQuery,window.angular),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.angular2.min",["kendo.core.min","kendo.webcomponents.min"],e)}(function(){!function(e,t){var n,i;t&&t.register&&(n=this&&this.__decorate||function(e,t,n,i){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(e,t,n,i);switch(arguments.length){case 2:return e.reduceRight(function(e,t){return t&&t(e)||e},t);case 3:return e.reduceRight(function(e,i){return void(i&&i(t,n))},void 0);case 4:return e.reduceRight(function(e,i){return i&&i(t,n,e)||e},i)}},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},t.register("kendo/angular2",["angular2/angular2"],function(t){var r,o;return{setters:[function(e){r=e}],execute:function(){o=function(){function t(e,t){var n=this;this.elementRef=t,this.onChange=function(e){},this.onTouched=function(){},this.element=t.nativeElement,this.element.addEventListener("change",function(){n.onChange(n.element.value())}),this.element.addEventListener("spin",function(){n.onChange(n.element.value())}),e.valueAccessor=this,this.cd=e,e.valueAccessor=this}return t.prototype.writeValue=function(e){this.element.value(e)},t.prototype.registerOnChange=function(e){this.onChange=e},t.prototype.registerOnTouched=function(e){this.onTouched=e},t=n([r.Directive({selector:e.webComponents.join(",")}),i("design:paramtypes",[r.NgControl,r.ElementRef])],t)}(),t("KendoValueAccessor",o)}}}))}(window.kendo,window.System)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.web.min",["kendo.core.min","kendo.router.min","kendo.view.min","kendo.fx.min","kendo.dom.min","kendo.data.odata.min","kendo.data.xml.min","kendo.data.min","kendo.ooxml.min","kendo.excel.min","kendo.data.signalr.min","kendo.binder.min","kendo.drawing.min","kendo.validator.min","kendo.userevents.min","kendo.draganddrop.min","kendo.mobile.scroller.min","kendo.groupable.min","kendo.reorderable.min","kendo.resizable.min","kendo.sortable.min","kendo.selectable.min","kendo.button.min","kendo.pager.min","kendo.popup.min","kendo.notification.min","kendo.tooltip.min","kendo.list.min","kendo.calendar.min","kendo.datepicker.min","kendo.autocomplete.min","kendo.dropdownlist.min","kendo.combobox.min","kendo.multiselect.min","kendo.colorpicker.min","kendo.columnmenu.min","kendo.columnsorter.min","kendo.grid.min","kendo.listview.min","kendo.filebrowser.min","kendo.imagebrowser.min","kendo.editor.min","kendo.numerictextbox.min","kendo.maskedtextbox.min","kendo.mediaplayer.min","kendo.menu.min","kendo.editable.min","kendo.pivot.fieldmenu.min","kendo.filtercell.min","kendo.panelbar.min","kendo.progressbar.min","kendo.responsivepanel.min","kendo.tabstrip.min","kendo.timepicker.min","kendo.toolbar.min","kendo.datetimepicker.min","kendo.treeview.draganddrop.min","kendo.treeview.min","kendo.slider.min","kendo.splitter.min","kendo.upload.min","kendo.dialog.min","kendo.window.min","kendo.virtuallist.min","kendo.scheduler.view.min","kendo.scheduler.dayview.min","kendo.scheduler.agendaview.min","kendo.scheduler.monthview.min","kendo.scheduler.recurrence.min","kendo.scheduler.min","kendo.gantt.list.min","kendo.gantt.timeline.min","kendo.gantt.min","kendo.treelist.min","kendo.pivotgrid.min","kendo.spreadsheet.min","kendo.pivot.configurator.min","kendo.angular.min","kendo.webcomponents.min","kendo.angular2.min"],e)}(function(){"bundle all";return window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.web.min.js.map
;
/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("aspnetmvc/kendo.data.aspnetmvc.min",["kendo.data.min","kendo.combobox.min","kendo.multiselect.min","kendo.validator.min"],e)}(function(){!function(e,t){function n(t,n,r){var i,o={};return t.sort?(o[this.options.prefix+"sort"]=e.map(t.sort,function(e){return e.field+"-"+e.dir}).join("~"),delete t.sort):o[this.options.prefix+"sort"]="",t.page&&(o[this.options.prefix+"page"]=t.page,delete t.page),t.pageSize&&(o[this.options.prefix+"pageSize"]=t.pageSize,delete t.pageSize),t.group?(o[this.options.prefix+"group"]=e.map(t.group,function(e){return e.field+"-"+e.dir}).join("~"),delete t.group):o[this.options.prefix+"group"]="",t.aggregate&&(o[this.options.prefix+"aggregate"]=e.map(t.aggregate,function(e){return e.field+"-"+e.aggregate}).join("~"),delete t.aggregate),t.filter?(o[this.options.prefix+"filter"]=a(t.filter,r.encode),delete t.filter):(o[this.options.prefix+"filter"]="",delete t.filter),delete t.take,delete t.skip,i=new g(r),i.serialize(o,t,""),o}function a(n,i){return n.filters?e.map(n.filters,function(e){var t=e.filters&&e.filters.length>1,n=a(e,i);return n&&t&&(n="("+n+")"),n}).join("~"+n.logic+"~"):n.field?n.field+"~"+n.operator+"~"+r(n.value,i):t}function r(e,t){if("string"==typeof e){if(!(e.indexOf("Date(")>-1))return e=e.replace(l,"''"),t&&(e=encodeURIComponent(e)),"'"+e+"'";e=new Date(parseInt(e.replace(/^\/Date\((.*?)\)\/$/,"$1"),10))}return e&&e.getTime?"datetime'"+c.format("{0:yyyy-MM-ddTHH-mm-ss}",e)+"'":e}function i(e,n){return t!==e?e:n}function o(t){var n=t.HasSubgroups||t.hasSubgroups||!1,a=t.Items||t.items;return{value:i(t.Key,i(t.key,t.value)),field:t.Member||t.member||t.field,hasSubgroups:n,aggregates:d(t.Aggregates||t.aggregates),items:n?e.map(a,o):a}}function s(e){var t={};return t[e.AggregateMethodName.toLowerCase()]=e.Value,t}function d(e){var t,n,a,r={};for(t in e){r={},a=e[t];for(n in a)r[n.toLowerCase()]=a[n];e[t]=r}return e}function u(e){var t,n,a,r={};for(t=0,n=e.length;t<n;t++)a=e[t],r[a.Member]=f(!0,r[a.Member],s(a));return r}var c=window.kendo,l=/'/gi,f=e.extend,p=e.isArray,m=e.isPlainObject,v=".",g=function(e){e=e||{},this.culture=e.culture||c.culture(),this.stringifyDates=e.stringifyDates,this.decimalSeparator=this.culture.numberFormat[v]};g.prototype=g.fn={serialize:function(e,t,n){var a,r;for(r in t)a=n?n+"."+r:r,this.serializeField(e,t[r],t,r,a)},serializeField:function(e,n,a,r,i){p(n)?this.serializeArray(e,n,i):m(n)?this.serialize(e,n,i):e[i]===t&&(e[i]=a[r]=this.serializeValue(n))},serializeArray:function(e,t,n){var a,r,i,o,s;for(o=0,s=0;o<t.length;o++)a=t[o],r="["+s+"]",i=n+r,this.serializeField(e,a,t,r,i),s++},serializeValue:function(e){return e instanceof Date?e=this.stringifyDates?c.stringify(e).replace(/"/g,""):c.toString(e,"G",this.culture.name):"number"==typeof e&&(e=(""+e).replace(v,this.decimalSeparator)),e}},f(!0,c.data,{schemas:{"aspnetmvc-ajax":{groups:function(t){return e.map(this._dataAccessFunction(t),o)},aggregates:function(t){var n,a;if(t=t.d||t,n=t.AggregateResults||[],!e.isArray(n)){for(a in n)n[a]=u(n[a]);return n}return u(n)}}}}),f(!0,c.data,{transports:{"aspnetmvc-ajax":c.data.RemoteTransport.extend({init:function(e){var t=this,a=(e||{}).stringifyDates;c.data.RemoteTransport.fn.init.call(this,f(!0,{},this.options,e,{parameterMap:function(e,r){return n.call(t,e,r,{encode:!1,stringifyDates:a})}}))},read:function(e){var t=this.options.data,n=this.options.read.url;m(t)?(n&&(this.options.data=null),!t.Data.length&&n?c.data.RemoteTransport.fn.read.call(this,e):e.success(t)):c.data.RemoteTransport.fn.read.call(this,e)},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"},parameterMap:n,prefix:""}})}}),f(!0,c.data,{schemas:{webapi:c.data.schemas["aspnetmvc-ajax"]}}),f(!0,c.data,{transports:{webapi:c.data.RemoteTransport.extend({init:function(e){var t,a,r=this,i=(e||{}).stringifyDates;e.update&&(t="string"==typeof e.update?e.update:e.update.url,e.update=f(e.update,{url:function(n){return c.format(t,n[e.idField])}})),e.destroy&&(a="string"==typeof e.destroy?e.destroy:e.destroy.url,e.destroy=f(e.destroy,{url:function(t){return c.format(a,t[e.idField])}})),e.create&&"string"==typeof e.create&&(e.create={url:e.create}),c.data.RemoteTransport.fn.init.call(this,f(!0,{},this.options,e,{parameterMap:function(e,t){return n.call(r,e,t,{encode:!1,stringifyDates:i,culture:c.cultures["en-US"]})}}))},read:function(e){var t=this.options.data,n=this.options.read.url;m(t)?(n&&(this.options.data=null),!t.Data.length&&n?c.data.RemoteTransport.fn.read.call(this,e):e.success(t)):c.data.RemoteTransport.fn.read.call(this,e)},options:{read:{type:"GET"},update:{type:"PUT"},create:{type:"POST"},destroy:{type:"DELETE"},parameterMap:n,prefix:""}})}}),f(!0,c.data,{transports:{"aspnetmvc-server":c.data.RemoteTransport.extend({init:function(e){var t=this;c.data.RemoteTransport.fn.init.call(this,f(e,{parameterMap:function(e,a){return n.call(t,e,a,{encode:!0})}}))},read:function(t){var n,a,r=this.options.prefix,i=[r+"sort",r+"page",r+"pageSize",r+"group",r+"aggregate",r+"filter"],o=RegExp("("+i.join("|")+")=[^&]*&?","g");a=location.search.replace(o,"").replace("?",""),a.length&&!/&$/.test(a)&&(a+="&"),t=this.setup(t,"read"),n=t.url,n.indexOf("?")>=0?(a=a.replace(/(.*?=.*?)&/g,function(e){return n.indexOf(e.substr(0,e.indexOf("=")))>=0?"":e}),n+="&"+a):n+="?"+a,n+=e.map(t.data,function(e,t){return t+"="+e}).join("&"),location.href=n}})}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.combobox.aspnetmvc.min",["aspnetmvc/kendo.data.aspnetmvc.min"],e)}(function(){!function(e,t){var n=window.kendo,a=n.ui;a&&a.ComboBox&&(a.ComboBox.requestData=function(t){var n,a,r=e(t).data("kendoComboBox");if(r)return n=r.dataSource.filter(),a=r.input.val(),n&&n.filters.length||(a=""),{text:a}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.dropdownlist.aspnetmvc.min",["aspnetmvc/kendo.data.aspnetmvc.min"],e)}(function(){!function(e,t){var n=window.kendo,a=n.ui;a&&a.DropDownList&&(a.DropDownList.requestData=function(t){var n,a,r,i=e(t).data("kendoDropDownList");if(i)return n=i.dataSource.filter(),a=i.filterInput,r=a?a.val():"",n&&n.filters.length||(r=""),{text:r}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.multiselect.aspnetmvc.min",["aspnetmvc/kendo.combobox.aspnetmvc.min"],e)}(function(){!function(e,t){var n=window.kendo,a=n.ui;a&&a.MultiSelect&&(a.MultiSelect.requestData=function(t){var n,a=e(t).data("kendoMultiSelect");if(a)return n=a.input.val(),{text:n!==a.options.placeholder?n:""}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.imagebrowser.aspnetmvc.min",["aspnetmvc/kendo.multiselect.aspnetmvc.min"],e)}(function(){!function(e,t){var n=window.kendo,a=e.extend,r=e.isFunction;a(!0,n.data,{schemas:{"imagebrowser-aspnetmvc":{data:function(e){return e||[]},model:{id:"name",fields:{name:{field:"Name"},size:{field:"Size"},type:{field:"EntryType",parse:function(e){return 0==e?"f":"d"}}}}}}}),a(!0,n.data,{schemas:{"filebrowser-aspnetmvc":n.data.schemas["imagebrowser-aspnetmvc"]}}),a(!0,n.data,{transports:{"imagebrowser-aspnetmvc":n.data.RemoteTransport.extend({init:function(t){n.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,a){a.data=e.extend({},a.data,{path:this.options.path()}),r(this.options[t])?this.options[t].call(this,a):n.data.RemoteTransport.fn[t].call(this,a)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"},parameterMap:function(e,t){return"read"!=t&&(e.EntryType="f"===e.EntryType?0:1),e}}})}}),a(!0,n.data,{transports:{"filebrowser-aspnetmvc":n.data.transports["imagebrowser-aspnetmvc"]}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("aspnetmvc/kendo.validator.aspnetmvc.min",["aspnetmvc/kendo.imagebrowser.aspnetmvc.min"],e)}(function(){!function(e,t){function n(){var e,t={};for(e in p)t["mvc"+e]=s(e);return t}function a(){var e,t={};for(e in p)t["mvc"+e]=d(e);return t}function r(e,t){var n,a,r,i={},o=e.data(),s=t.length;for(r in o)a=r.toLowerCase(),n=a.indexOf(t),n>-1&&(a=a.substring(n+s,r.length),a&&(i[a]=o[r]));return i}function i(t){var n,a,r=t.Fields||[],i={};for(n=0,a=r.length;n<a;n++)e.extend(!0,i,o(r[n]));return i}function o(e){var t,n,a,r,i={},o={},s=e.FieldName,d=e.ValidationRules;for(a=0,r=d.length;a<r;a++)t=d[a].ValidationType,n=d[a].ValidationParameters,i[s+t]=c(s,t,n),o[s+t]=u(d[a].ErrorMessage);return{rules:i,messages:o}}function s(e){return function(t){return t.attr("data-val-"+e)}}function d(e){return function(t){return!t.filter("[data-val-"+e+"]").length||p[e](t,r(t,e))}}function u(e){return function(){return e}}function c(e,t,n){return function(a){return!a.filter("[name="+e+"]").length||p[t](a,n)}}function l(e,t){return"string"==typeof t&&(t=RegExp("^(?:"+t+")$")),t.test(e)}var f=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,p={required:function(e){var t,n,a,r=e.val(),i=e.filter("[type=checkbox]");return i.length&&(t=i[0].name.replace(f,"\\$1"),n="input:hidden[name='"+t+"']",a=i.next(n),a.length||(a=i.next("label.k-checkbox-label").next(n)),r=a.length?a.val():"checked"===e.attr("checked")),!(""===r||!r||0===r.length)},number:function(e){return""===e.val()||null==e.val()||null!==kendo.parseFloat(e.val())},regex:function(e,t){return""===e.val()||l(e.val(),t.pattern)},range:function(e,t){return""===e.val()||this.min(e,t)&&this.max(e,t)},min:function(e,t){var n=parseFloat(t.min)||0,a=kendo.parseFloat(e.val());return n<=a},max:function(e,t){var n=parseFloat(t.max)||0,a=kendo.parseFloat(e.val());return a<=n},date:function(e){return""===e.val()||null!==kendo.parseDate(e.val())},length:function(t,n){if(""!==t.val()){var a=e.trim(t.val()).length;return(!n.min||a>=(n.min||0))&&(!n.max||a<=(n.max||0))}return!0}};e.extend(!0,kendo.ui.validator,{rules:a(),messages:n(),messageLocators:{mvcLocator:{locate:function(e,t){return t=t.replace(f,"\\$1"),e.find(".field-validation-valid[data-valmsg-for='"+t+"'], .field-validation-error[data-valmsg-for='"+t+"']")},decorate:function(e,t){e.addClass("field-validation-error").attr("data-valmsg-for",t||"")}},mvcMetadataLocator:{locate:function(e,t){return t=t.replace(f,"\\$1"),e.find("#"+t+"_validationMessage.field-validation-valid")},decorate:function(e,t){e.addClass("field-validation-error").attr("id",t+"_validationMessage")}}},ruleResolvers:{mvcMetaDataResolver:{resolve:function(t){var n,a=window.mvcClientValidationMetadata||[];if(a.length)for(t=e(t),n=0;n<a.length;n++)if(a[n].FormId==t.attr("id"))return i(a[n]);return{}}}}})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("kendo.aspnetmvc.min",["kendo.data.min","kendo.combobox.min","kendo.dropdownlist.min","kendo.multiselect.min","kendo.validator.min","aspnetmvc/kendo.data.aspnetmvc.min","aspnetmvc/kendo.combobox.aspnetmvc.min","aspnetmvc/kendo.dropdownlist.aspnetmvc.min","aspnetmvc/kendo.multiselect.aspnetmvc.min","aspnetmvc/kendo.imagebrowser.aspnetmvc.min","aspnetmvc/kendo.validator.aspnetmvc.min"],e)}(function(){},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.aspnetmvc.min.js.map
;
/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(y){"function"==typeof define&&define.amd?define(["kendo.core.min"],y):y()}(function(){!function(y,M){kendo.cultures["ru-RU"]={name:"ru-RU",numberFormat:{pattern:["-n"],decimals:2,",":" ",".":",",groupSize:[3],percent:{pattern:["-n%","n%"],decimals:2,",":" ",".":",",groupSize:[3],symbol:"%"},currency:{name:"Russian Ruble",abbr:"RUB",pattern:["-n $","n $"],decimals:2,",":" ",".":",",groupSize:[3],symbol:"₽"}},calendars:{standard:{days:{names:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],namesAbbr:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],namesShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"]},months:{names:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],namesAbbr:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"]},AM:[""],PM:[""],patterns:{d:"dd.MM.yyyy",D:"d MMMM yyyy 'г.'",F:"d MMMM yyyy 'г.' H:mm:ss",g:"dd.MM.yyyy H:mm",G:"dd.MM.yyyy H:mm:ss",m:"d MMMM",M:"d MMMM",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"H:mm",T:"H:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM yyyy",Y:"MMMM yyyy"},"/":".",":":":",firstDay:1}}}}(this)});
//# sourceMappingURL=kendo.culture.ru-RU.min.js.map
;
/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e){"function"==typeof define&&define.amd?define(["kendo.core.min"],e):e()}(function(){!function(e,t){kendo.ui.FilterCell&&(kendo.ui.FilterCell.prototype.options.operators=e.extend(!0,kendo.ui.FilterCell.prototype.options.operators,{date:{eq:"равна",gte:"после или равна",gt:"после",lte:"до или равна",lt:"до",neq:"не равна"},number:{eq:"равно",gte:"больше или равно",gt:"больше",lte:"меньше или равно",lt:"меньше",neq:"не равно"},string:{endswith:"оканчивается на",eq:"равно",neq:"не равно",startswith:"начинающимися на",contains:"содержащими",doesnotcontain:"не содержит"},enums:{eq:"равно",neq:"не равно"}})),kendo.ui.FilterMenu&&(kendo.ui.FilterMenu.prototype.options.operators=e.extend(!0,kendo.ui.FilterMenu.prototype.options.operators,{date:{eq:"равна",gte:"после или равна",gt:"после",lte:"до или равна",lt:"до",neq:"не равна"},number:{eq:"равно",gte:"больше или равно",gt:"больше",lte:"меньше или равно",lt:"меньше",neq:"не равно"},string:{endswith:"оканчивается на",eq:"равно",neq:"не равно",startswith:"начинающимися на",contains:"содержащими",doesnotcontain:"не содержит"},enums:{eq:"равно",neq:"не равно"}})),kendo.ui.ColumnMenu&&(kendo.ui.ColumnMenu.prototype.options.messages=e.extend(!0,kendo.ui.ColumnMenu.prototype.options.messages,{columns:"Колонны",sortAscending:"Сортировка по возрастанию",sortDescending:"Сортировка по убыванию",settings:"Параметры столбцов",done:"Cделанный",lock:"Запирать",unlock:"Отпереть",filter:"Фильтровать"})),kendo.ui.RecurrenceEditor&&(kendo.ui.RecurrenceEditor.prototype.options.messages=e.extend(!0,kendo.ui.RecurrenceEditor.prototype.options.messages,{daily:{interval:"days(s)",repeatEvery:"Repeat every:"},end:{after:"After",occurrence:"occurrence(s)",label:"End:",never:"Never",on:"On",mobileLabel:"Ends"},frequencies:{daily:"Daily",monthly:"Monthly",never:"Never",weekly:"Weekly",yearly:"Yearly"},monthly:{day:"Day",interval:"month(s)",repeatEvery:"Repeat every:",repeatOn:"Repeat on:"},offsetPositions:{first:"first",fourth:"fourth",last:"last",second:"second",third:"third"},weekly:{repeatEvery:"Repeat every:",repeatOn:"Repeat on:",interval:"week(s)"},yearly:{of:"of",repeatEvery:"Repeat every:",repeatOn:"Repeat on:",interval:"year(s)"},weekdays:{day:"day",weekday:"weekday",weekend:"weekend day"}})),kendo.ui.Grid&&(kendo.ui.Grid.prototype.options.messages=e.extend(!0,kendo.ui.Grid.prototype.options.messages,{commands:{create:"Добавить",destroy:"Удалить",canceledit:"Отмена",update:"Обновить",edit:"Изменить",excel:"Export to Excel",pdf:"Export to PDF",select:"Выбрать",cancel:"Отменить изменения",save:"Сохранить изменения"},editable:{confirmation:"Вы уверены, что хотите удалить эту запись?",cancelDelete:"Отмена",confirmDelete:"Удалить"},noRecords:"Нет записей доступны."})),kendo.ui.Pager&&(kendo.ui.Pager.prototype.options.messages=e.extend(!0,kendo.ui.Pager.prototype.options.messages,{allPages:"All",page:"Страница",display:"Отображены записи {0} - {1} из {2}",of:"из {0}",empty:"Нет записей для отображения",refresh:"Обновить",first:"Вернуться на первую страницу",itemsPerPage:"элементов на странице",last:"К последней странице",next:"Перейдите на следующую страницу",previous:"Перейти на предыдущую страницу",morePages:"Больше страниц"})),kendo.ui.FilterCell&&(kendo.ui.FilterCell.prototype.options.messages=e.extend(!0,kendo.ui.FilterCell.prototype.options.messages,{filter:"фильтровать",clear:"очистить",isFalse:"ложь",isTrue:"истина",operator:"Оператор"})),kendo.ui.FilterMenu&&(kendo.ui.FilterMenu.prototype.options.messages=e.extend(!0,kendo.ui.FilterMenu.prototype.options.messages,{filter:"фильтровать",and:"И",clear:"очистить",info:"Строки со значениями",selectValue:"-выберите-",isFalse:"ложь",isTrue:"истина",or:"или",cancel:"Отмена",operator:"Оператор",value:"Значение"})),kendo.ui.FilterMultiCheck&&(kendo.ui.FilterMultiCheck.prototype.options.messages=e.extend(!0,kendo.ui.FilterMultiCheck.prototype.options.messages,{search:"Поиск"})),kendo.ui.Groupable&&(kendo.ui.Groupable.prototype.options.messages=e.extend(!0,kendo.ui.Groupable.prototype.options.messages,{empty:"Переместите сюда заголовок колонки, чтобы сгрупировать записи из этой колонки"})),kendo.ui.Editor&&(kendo.ui.Editor.prototype.options.messages=e.extend(!0,kendo.ui.Editor.prototype.options.messages,{bold:"Полужирный",createLink:"Вставить гиперссылку",fontName:"Шрифт",fontNameInherit:"(шрифт как в документе)",fontSize:"Выбрать размер шрифта",fontSizeInherit:"(размер как в документе)",formatBlock:"Текст изображения",indent:"Увеличить отступ",insertHtml:"Вставить HTML",insertImage:"Изображение",insertOrderedList:"Нумерованный список",insertUnorderedList:"Маркированныйсписок",italic:"Курсив",justifyCenter:"По центру",justifyFull:"По ширине",justifyLeft:"Влево",justifyRight:"Вправо",outdent:"Уменьшить отступ",strikethrough:"Зачеркнутый",styles:"Стиль",subscript:"Под строкой",superscript:"Над строкой",underline:"Подчеркнутый",unlink:"Удалить гиперссылку",dialogButtonSeparator:"или",dialogCancel:"Отмена",dialogInsert:"Вставить",imageAltText:"Alternate text",imageWebAddress:"Веб адрес",linkOpenInNewWindow:"Открыть в новом окне",linkText:"Текст",linkToolTip:"Всплывающая подсказка",linkWebAddress:"Веб адрес",search:"Поиск",createTable:"Вставить таблицу",addColumnLeft:"Add column on the left",addColumnRight:"Add column on the right",addRowAbove:"Add row above",addRowBelow:"Add row below",deleteColumn:"Delete column",deleteRow:"Delete row",backColor:"Background color",deleteFile:'Are you sure you want to delete "{0}"?',directoryNotFound:"A directory with this name was not found.",dropFilesHere:"drop files here to upload",emptyFolder:"Empty Folder",foreColor:"Color",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',orderBy:"Arrange by:",orderByName:"Name",orderBySize:"Size",overwriteFile:'\'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',uploadFile:"Upload",formatting:"Format",viewHtml:"View HTML",dialogUpdate:"Update",insertFile:"Insert file"})),kendo.ui.Upload&&(kendo.ui.Upload.prototype.options.localization=e.extend(!0,kendo.ui.Upload.prototype.options.localization,{cancel:"Отменить загрузку",dropFilesHere:"перетащите сюда файлы для загрузки",remove:"Удалить",retry:"Повторить",select:"Выбрать...",statusFailed:"загрузка прервана",statusUploaded:"загружено",statusUploading:"загружается",uploadSelectedFiles:"Загрузить выбранные файлы",headerStatusUploaded:"Готово",headerStatusUploading:"Загружается..."})),kendo.ui.Scheduler&&(kendo.ui.Scheduler.prototype.options.messages=e.extend(!0,kendo.ui.Scheduler.prototype.options.messages,{allDay:"all day",cancel:"Отмена",editable:{confirmation:"Are you sure you want to delete this event?"},date:"Date",destroy:"Delete",editor:{allDayEvent:"All day event",description:"Description",editorTitle:"Event",end:"End",endTimezone:"End timezone",repeat:"Repeat",separateTimezones:"Use separate start and end time zones",start:"Start",startTimezone:"Start timezone",timezone:" ",timezoneEditorButton:"Time zone",timezoneEditorTitle:"Timezones",title:"Title",noTimezone:"No timezone"},event:"Event",recurrenceMessages:{deleteRecurring:"Do you want to delete only this event occurrence or the whole series?",deleteWindowOccurrence:"Delete current occurrence",deleteWindowSeries:"Delete the series",deleteWindowTitle:"Delete Recurring Item",editRecurring:"Do you want to edit only this event occurrence or the whole series?",editWindowOccurrence:"Edit current occurrence",editWindowSeries:"Edit the series",editWindowTitle:"Edit Recurring Item"},save:"Save",time:"Time",today:"Today",views:{agenda:"Agenda",day:"Day",month:"Month",week:"Week",workWeek:"Work Week"},deleteWindowTitle:"Delete event",showFullDay:"Show full day",showWorkDay:"Show business hours"})),kendo.ui.Validator&&(kendo.ui.Validator.prototype.options.messages=e.extend(!0,kendo.ui.Validator.prototype.options.messages,{required:"{0} обязателен",pattern:"{0} не верен",min:"{0} должен быть больше или равен {1}",max:"{0} должен быть меньше или равен {1}",step:"{0} не верен",email:"{0} не корректный email",url:"{0} не корректный URL",date:"{0} не корректная дата"})),kendo.ui.Dialog&&(kendo.ui.Dialog.prototype.options.messages=e.extend(!0,kendo.ui.Dialog.prototype.options.localization,{close:"Закрыть"})),kendo.ui.Alert&&(kendo.ui.Alert.prototype.options.messages=e.extend(!0,kendo.ui.Alert.prototype.options.localization,{okText:"ОК"})),kendo.ui.Confirm&&(kendo.ui.Confirm.prototype.options.messages=e.extend(!0,kendo.ui.Confirm.prototype.options.localization,{okText:"ОК",cancel:"Отмена"})),kendo.ui.Prompt&&(kendo.ui.Prompt.prototype.options.messages=e.extend(!0,kendo.ui.Prompt.prototype.options.localization,{okText:"ОК",cancel:"Отмена"}))}(window.kendo.jQuery)});
//# sourceMappingURL=kendo.messages.ru-RU.min.js.map
;
(function () {
    var refresh = kendo.ui.ColumnSorter.prototype.refresh;
    kendo.ui.ColumnSorter.prototype.refresh = function () {
        refresh.apply(this, arguments);
        // Move sort icon to the beginning of the column's link
        this.link.find(".k-icon.k-i-arrow-n, .k-icon.k-i-arrow-s").detach().prependTo(this.link);
    };
})();;
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Ot(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function p(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function v(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function S(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function D(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=D(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&k(e[s])!==k(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function b(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function H(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function R(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function C(e){var t,n,s={};for(n in e)m(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var F={};function L(e,t){F[e]=t}function U(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return U(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=x(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=x(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(de(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function de(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),d(n)&&(s=function(e,t){t[n]=k(e)}),t=0;t<e.length;t++)he[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,pe=4,ve=5,we=6,Me=7,Se=8;function De(e){return ke(e)?366:365}function ke(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),H("year","y"),L("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):k(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(be(this,t,e),c.updateOffset(this,n),this):xe(this,t)}}function xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function be(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&ke(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?ke(e)?29:28:31-s%7%2}Ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),H("month","M"),L("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=k(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,He="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!d(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ce(this,e),c.updateOffset(this,!0),this):xe(this,"Month")}var Le=ae;var Ue=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=de(s[t]),i[t]=de(i[t]);for(t=0;t<24;t++)r[t]=de(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),L("week",5),L("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=k(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),H("hour","h"),L("hour",13),ue("a",Ke),ue("A",Ke),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d 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"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\.?m?\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(e){var t=null;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,require("./locale/"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),et._abbr}function ut(e,t){if(null!==t){var n,s=nt;if(t.abbr=e,null!=st[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}return delete st[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=rt(e[r]).split("-")).length,n=(n=rt(e[r+1]))?n.split("-"):null;0<t;){if(s=at(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[pe]||0!==n[ve]||0!==n[we])?ge:n[pe]<0||59<n[pe]?pe:n[ve]<0||59<n[ve]?ve:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=Se),g(e).overflow=t),e}function ht(e,t,n){return null!=e?e:null!=t?t:n}function ct(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ht(t.GG,e._a[me],Ie(Tt(),1,4).year),s=ht(t.W,1),((i=ht(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(Tt(),r,a);n=ht(t.gg,e._a[me],l.year),s=ht(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],gt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||" ")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),kt(e)}else e._isValid=!1}var wt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=wt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=Mt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&Ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function kt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,d=l.length,h=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),h+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(he,a)&&he[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=d-h,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ct(e),dt(e)}else Dt(e);else vt(e)}function Yt(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||lt(e._l),null===r||void 0===a&&""===r?v({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),S(r)?new M(dt(r)):(h(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],kt(t),p(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?kt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):h(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(vt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ct(t)):u(n)?function(e){if(!e._d){var t=C(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ct(e)}}(t):d(n)?t._d=new Date(n):c.createFromInputFallback(t),p(e)||(e._d=null),e))}function Ot(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Yt(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Tt(e,t,n,s){return Ot(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),bt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:v()});function Pt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=C(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Wt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Wt.length;++s)if(e[Wt[s]]){if(n)return!1;parseFloat(e[Wt[s]])!==k(e[Wt[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=lt(),this._bubble()}function Rt(e){return e instanceof Ht}function Ct(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+U(~~(e/60),2)+n+U(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ut(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Ut(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+k(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Nt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(S(e)||h(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):Tt(e).local()}function Gt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Vt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var Et=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,It=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function At(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=Et.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:k(a[ye])*n,h:k(a[ge])*n,m:k(a[pe])*n,s:k(a[ve])*n,ms:k(Ct(1e3*a[we]))*n}):(a=It.exec(e))?(n="-"===a[1]?-1:(a[1],1),r={y:jt(a[2],n),M:jt(a[3],n),w:jt(a[4],n),d:jt(a[5],n),h:jt(a[6],n),m:jt(a[7],n),s:jt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Nt(t,e),e.isBefore(t)?n=Zt(e,t):((n=Zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function zt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,At(e="string"==typeof e?+e:e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ct(t._days),a=Ct(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,xe(e,"Month")+a*n),r&&be(e,"Date",xe(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}At.fn=Ht.prototype,At.invalid=function(){return At(NaN)};var qt=zt(1,"add"),Jt=zt(-1,"subtract");function Bt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xt=n("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)});function Kt(){return this._locale}function en(e,t){I(0,[e,e.length],0,t)}function tn(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),en("gggg","weekYear"),en("ggggg","weekYear"),en("GGGG","isoWeekYear"),en("GGGGG","isoWeekYear"),H("weekYear","gg"),H("isoWeekYear","GG"),L("weekYear",1),L("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=k(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),H("quarter","Q"),L("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(k(e)-1)}),I("D",["DD",2],"Do","date"),H("date","D"),L("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=k(e.match(B)[0])});var nn=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),H("dayOfYear","DDD"),L("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=k(e)}),I("m",["mm",2],0,"minute"),H("minute","m"),L("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],pe);var sn=Te("Minutes",!1);I("s",["ss",2],0,"second"),H("second","s"),L("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],ve);var rn,an=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),H("millisecond","ms"),L("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),rn="SSSS";rn.length<=9;rn+="S")ue(rn,ne);function on(e,t){t[we]=k(1e3*("0."+e))}for(rn="S";rn.length<=9;rn+="S")ce(rn,on);var un=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var ln=M.prototype;function dn(e){return e}ln.add=qt,ln.calendar=function(e,t){var n=e||Tt(),s=Nt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(x(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},ln.clone=function(){return new M(this)},ln.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Nt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=R(t)){case"year":r=Bt(this,s)/12;break;case"month":r=Bt(this,s);break;case"quarter":r=Bt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:D(r)},ln.endOf=function(e){return void 0===(e=R(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},ln.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},ln.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.fromNow=function(e){return this.from(Tt(),e)},ln.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.toNow=function(e){return this.to(Tt(),e)},ln.get=function(e){return x(this[e=R(e)])?this[e]():this},ln.invalidAt=function(){return g(this).overflow},ln.isAfter=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(l(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},ln.isBefore=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(l(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},ln.isSame=function(e,t){var n,s=S(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=R(t||"millisecond"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},ln.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},ln.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},ln.isValid=function(){return p(this)},ln.lang=Xt,ln.locale=Qt,ln.localeData=Kt,ln.max=bt,ln.min=xt,ln.parsingFlags=function(){return _({},g(this))},ln.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:F[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=C(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},ln.startOf=function(e){switch(e=R(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":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},ln.subtract=Jt,ln.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},ln.toObject=function(){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()}},ln.toDate=function(){return new Date(this.valueOf())},ln.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},ln.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},ln.toJSON=function(){return this.isValid()?this.toISOString():null},ln.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},ln.unix=function(){return Math.floor(this.valueOf()/1e3)},ln.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ln.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ln.year=Oe,ln.isLeapYear=function(){return ke(this.year())},ln.weekYear=function(e){return tn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ln.isoWeekYear=function(e){return tn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},ln.quarter=ln.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},ln.month=Fe,ln.daysInMonth=function(){return Pe(this.year(),this.month())},ln.week=ln.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},ln.isoWeek=ln.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},ln.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},ln.isoWeeksInYear=function(){return Ae(this.year(),1,4)},ln.date=nn,ln.day=ln.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},ln.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},ln.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=(n=e,s=this.localeData(),"string"==typeof n?s.weekdaysParse(n)%7||7:isNaN(n)?null:n);return this.day(this.day()%7?t:t-7)}return this.day()||7;var n,s},ln.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},ln.hour=ln.hours=tt,ln.minute=ln.minutes=sn,ln.second=ln.seconds=an,ln.millisecond=ln.milliseconds=un,ln.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Ut(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Gt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,At(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Gt(this)},ln.utc=function(e){return this.utcOffset(0,e)},ln.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),"m")),this},ln.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Ut(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},ln.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},ln.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Fe),ln.years=n("years accessor is deprecated. Use year instead",Oe),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var hn=P.prototype;function cn(e,t,n,s){var i=lt(),r=y().set(s,t);return i[n](r,e)}function fn(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=cn(e,s,n,"month");return i}function mn(e,t,n,s){"boolean"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t=t||"";var i,r=lt(),a=e?r._week.dow:0;if(null!=n)return cn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}hn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return x(s)?s.call(t,n):s},hn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(e){return this._ordinal.replace("%d",e)},hn.preparse=dn,hn.postformat=dn,hn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},hn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return x(n)?n(t):n.replace(/%s/i,t)},hn.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},hn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},hn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},hn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},hn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},hn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},hn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},hn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ot("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ot),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",lt);var _n=Math.abs;function yn(e,t,n,s){var i=At(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function pn(e){return 4800*e/146097}function vn(e){return 146097*e/4800}function wn(e){return function(){return this.as(e)}}var Mn=wn("ms"),Sn=wn("s"),Dn=wn("m"),kn=wn("h"),Yn=wn("d"),On=wn("w"),Tn=wn("M"),xn=wn("y");function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Pn=bn("milliseconds"),Wn=bn("seconds"),Hn=bn("minutes"),Rn=bn("hours"),Cn=bn("days"),Fn=bn("months"),Ln=bn("years");var Un=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var Gn=Math.abs;function Vn(e){return(0<e)-(e<0)||+e}function En(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Gn(this._milliseconds)/1e3,s=Gn(this._days),i=Gn(this._months);t=D((e=D(n/60))/60),n%=60,e%=60;var r=D(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Vn(this._months)!==Vn(h)?"-":"",m=Vn(this._days)!==Vn(h)?"-":"",_=Vn(this._milliseconds)!==Vn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||d?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(d?_+d+"S":"")}var In=Ht.prototype;return In.isValid=function(){return this._isValid},In.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},In.add=function(e,t){return yn(this,e,t,1)},In.subtract=function(e,t){return yn(this,e,t,-1)},In.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=R(e))||"year"===e)return t=this._days+s/864e5,n=this._months+pn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(vn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},In.asMilliseconds=Mn,In.asSeconds=Sn,In.asMinutes=Dn,In.asHours=kn,In.asDays=Yn,In.asWeeks=On,In.asMonths=Tn,In.asYears=xn,In.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},In._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*gn(vn(o)+a),o=a=0),u.milliseconds=r%1e3,e=D(r/1e3),u.seconds=e%60,t=D(e/60),u.minutes=t%60,n=D(t/60),u.hours=n%24,o+=i=D(pn(a+=D(n/24))),a-=gn(vn(i)),s=D(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},In.clone=function(){return At(this)},In.get=function(e){return e=R(e),this.isValid()?this[e+"s"]():NaN},In.milliseconds=Pn,In.seconds=Wn,In.minutes=Hn,In.hours=Rn,In.days=Cn,In.weeks=function(){return D(this.days()/7)},In.months=Fn,In.years=Ln,In.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,d,h,c=this.localeData(),f=(n=!e,s=c,i=At(t=this).abs(),r=Un(i.as("s")),a=Un(i.as("m")),o=Un(i.as("h")),u=Un(i.as("d")),l=Un(i.as("M")),d=Un(i.as("y")),(h=r<=Nn.ss&&["s",r]||r<Nn.s&&["ss",r]||a<=1&&["m"]||a<Nn.m&&["mm",a]||o<=1&&["h"]||o<Nn.h&&["hh",o]||u<=1&&["d"]||u<Nn.d&&["dd",u]||l<=1&&["M"]||l<Nn.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=n,h[3]=0<+t,h[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,h));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},In.toISOString=En,In.toString=En,In.toJSON=En,In.locale=Qt,In.localeData=Kt,In.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",En),In.lang=Xt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(k(e))}),c.version="2.22.2",e=Tt,c.fn=ln,c.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return Tt(1e3*e)},c.months=function(e,t){return fn(e,t,"months")},c.isDate=h,c.locale=ot,c.invalid=v,c.duration=At,c.isMoment=S,c.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},c.parseZone=function(){return Tt.apply(null,arguments).parseZone()},c.localeData=lt,c.isDuration=Rt,c.monthsShort=function(e,t){return fn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},c.defineLocale=ut,c.updateLocale=function(e,t){if(null!=t){var n,s,i=nt;null!=(s=at(e))&&(i=s._config),(n=new P(t=b(i,t))).parentLocale=st[e],st[e]=n,ot(e)}else null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]);return st[e]},c.locales=function(){return s(st)},c.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},c.normalizeUnits=R,c.relativeTimeRounding=function(e){return void 0===e?Un:"function"==typeof e&&(Un=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==Nn[e]&&(void 0===t?Nn[e]:(Nn[e]=t,"s"===e&&(Nn.ss=t-1),!0))},c.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=ln,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},c});;
/*!
 * jQuery Cookie Plugin v1.4.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */
(function (factory) {
	if (typeof define === 'function' && define.amd) {
		// AMD
		define(['jquery'], factory);
	} else if (typeof exports === 'object') {
		// CommonJS
		factory(require('jquery'));
	} else {
		// Browser globals
		factory(jQuery);
	}
}(function ($) {

	var pluses = /\+/g;

	function encode(s) {
		return config.raw ? s : encodeURIComponent(s);
	}

	function decode(s) {
		return config.raw ? s : decodeURIComponent(s);
	}

	function stringifyCookieValue(value) {
		return encode(config.json ? JSON.stringify(value) : String(value));
	}

	function parseCookieValue(s) {
		if (s.indexOf('"') === 0) {
			// This is a quoted cookie as according to RFC2068, unescape...
			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
		}

		try {
			// Replace server-side written pluses with spaces.
			// If we can't decode the cookie, ignore it, it's unusable.
			// If we can't parse the cookie, ignore it, it's unusable.
			s = decodeURIComponent(s.replace(pluses, ' '));
			return config.json ? JSON.parse(s) : s;
		} catch(e) {}
	}

	function read(s, converter) {
		var value = config.raw ? s : parseCookieValue(s);
		return $.isFunction(converter) ? converter(value) : value;
	}

	var config = $.cookie = function (key, value, options) {

		// Write

		if (value !== undefined && !$.isFunction(value)) {
			options = $.extend({}, config.defaults, options);

			if (typeof options.expires === 'number') {
				var days = options.expires, t = options.expires = new Date();
				t.setTime(+t + days * 864e+5);
			}

			return (document.cookie = [
				encode(key), '=', stringifyCookieValue(value),
				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
				options.path    ? '; path=' + options.path : '',
				options.domain  ? '; domain=' + options.domain : '',
				options.secure  ? '; secure' : ''
			].join(''));
		}

		// Read

		var result = key ? undefined : {};

		// To prevent the for loop in the first place assign an empty array
		// in case there are no cookies at all. Also prevents odd result when
		// calling $.cookie().
		var cookies = document.cookie ? document.cookie.split('; ') : [];

		for (var i = 0, l = cookies.length; i < l; i++) {
			var parts = cookies[i].split('=');
			var name = decode(parts.shift());
			var cookie = parts.join('=');

			if (key && key === name) {
				// If second argument (value) is a function it's a converter...
				result = read(cookie, value);
				break;
			}

			// Prevent storing a cookie that we couldn't decode.
			if (!key && (cookie = read(cookie)) !== undefined) {
				result[name] = cookie;
			}
		}

		return result;
	};

	config.defaults = {};

	$.removeCookie = function (key, options) {
		if ($.cookie(key) === undefined) {
			return false;
		}

		// Must not alter options, thus extending a fresh object...
		$.cookie(key, '', $.extend({}, options, { expires: -1 }));
		return !$.cookie(key);
	};

}));
;
!function(){function t(t){this.message=t}var r="undefined"!=typeof exports?exports:self,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d="";a.charAt(0|i)||(c="=",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return d}),r.atob||(r.atob=function(r){var o=String(r).replace(/=+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,d="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}();
;
/*
 * jQuery File Upload AngularJS Plugin 2.2.0
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2013, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

/* jshint nomen:false */
/* global define, angular */

(function (factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        // Register as an anonymous AMD module:
        define([
            'jquery',
            'angular',
            './jquery.fileupload-image',
            './jquery.fileupload-audio',
            './jquery.fileupload-video',
            './jquery.fileupload-validate'
        ], factory);
    } else {
        factory();
    }
}(function () {
    'use strict';

    angular.module('blueimp.fileupload', [])

        // The fileUpload service provides configuration options
        // for the fileUpload directive and default handlers for
        // File Upload events:
        .provider('fileUpload', function () {
            var scopeEvalAsync = function (expression) {
                    var scope = angular.element(this)
                            .fileupload('option', 'scope');
                    // Schedule a new $digest cycle if not already inside of one
                    // and evaluate the given expression:
                    scope.$evalAsync(expression);
                },
                addFileMethods = function (scope, data) {
                    var files = data.files,
                        file = files[0];
                    angular.forEach(files, function (file, index) {
                        file._index = index;
                        file.$state = function () {
                            return data.state();
                        };
                        file.$processing = function () {
                            return data.processing();
                        };
                        file.$progress = function () {
                            return data.progress();
                        };
                        file.$response = function () {
                            return data.response();
                        };
                    });
                    file.$submit = function () {
                        if (!file.error) {
                            return data.submit();
                        }
                    };
                    file.$cancel = function () {
                        return data.abort();
                    };
                },
                $config;
            $config = this.defaults = {
                handleResponse: function (e, data) {
                    var files = data.result && data.result.files;
                    if (files) {
                        data.scope.replace(data.files, files);
                    } else if (data.errorThrown ||
                            data.textStatus === 'error') {
                        data.files[0].error = data.errorThrown ||
                            data.textStatus;
                    }
                },
                add: function (e, data) {
                    if (e.isDefaultPrevented()) {
                        return false;
                    }
                    var scope = data.scope,
                        filesCopy = [];
                    angular.forEach(data.files, function (file) {
                        filesCopy.push(file);
                    });
                    scope.$parent.$applyAsync(function () {
                        addFileMethods(scope, data);
                        var method = scope.option('prependFiles') ?
                                'unshift' : 'push';
                        Array.prototype[method].apply(scope.queue, data.files);
                    });
                    data.process(function () {
                        return scope.process(data);
                    }).always(function () {
                        scope.$parent.$applyAsync(function () {
                            addFileMethods(scope, data);
                            scope.replace(filesCopy, data.files);
                        });
                    }).then(function () {
                        if ((scope.option('autoUpload') ||
                                data.autoUpload) &&
                                data.autoUpload !== false) {
                            data.submit();
                        }
                    });
                },
                done: function (e, data) {
                    if (e.isDefaultPrevented()) {
                        return false;
                    }
                    var that = this;
                    data.scope.$apply(function () {
                        data.handleResponse.call(that, e, data);
                    });
                },
                fail: function (e, data) {
                    if (e.isDefaultPrevented()) {
                        return false;
                    }
                    var that = this,
                        scope = data.scope;
                    if (data.errorThrown === 'abort') {
                        scope.clear(data.files);
                        return;
                    }
                    scope.$apply(function () {
                        data.handleResponse.call(that, e, data);
                    });
                },
                stop: scopeEvalAsync,
                processstart: scopeEvalAsync,
                processstop: scopeEvalAsync,
                getNumberOfFiles: function () {
                    var scope = this.scope;
                    return scope.queue.length - scope.processing();
                },
                dataType: 'json',
                autoUpload: false
            };
            this.$get = [
                function () {
                    return {
                        defaults: $config
                    };
                }
            ];
        })

        // Format byte numbers to readable presentations:
        .provider('formatFileSizeFilter', function () {
            var $config = {
                // Byte units following the IEC format
                // http://en.wikipedia.org/wiki/Kilobyte
                units: [
                    {size: 1000000000, suffix: ' GB'},
                    {size: 1000000, suffix: ' MB'},
                    {size: 1000, suffix: ' KB'}
                ]
            };
            this.defaults = $config;
            this.$get = function () {
                return function (bytes) {
                    if (!angular.isNumber(bytes)) {
                        return '';
                    }
                    var unit = true,
                        i = 0,
                        prefix,
                        suffix;
                    while (unit) {
                        unit = $config.units[i];
                        prefix = unit.prefix || '';
                        suffix = unit.suffix || '';
                        if (i === $config.units.length - 1 || bytes >= unit.size) {
                            return prefix + (bytes / unit.size).toFixed(2) + suffix;
                        }
                        i += 1;
                    }
                };
            };
        })

        // The FileUploadController initializes the fileupload widget and
        // provides scope methods to control the File Upload functionality:
        .controller('FileUploadController', [
            '$scope', '$element', '$attrs', '$window', 'fileUpload',
            function ($scope, $element, $attrs, $window, fileUpload) {
                var uploadMethods = {
                    progress: function () {
                        return $element.fileupload('progress');
                    },
                    active: function () {
                        return $element.fileupload('active');
                    },
                    option: function (option, data) {
                        if (arguments.length === 1) {
                            return $element.fileupload('option', option);
                        }
                        $element.fileupload('option', option, data);
                    },
                    add: function (data) {
                        return $element.fileupload('add', data);
                    },
                    send: function (data) {
                        return $element.fileupload('send', data);
                    },
                    process: function (data) {
                        return $element.fileupload('process', data);
                    },
                    processing: function (data) {
                        return $element.fileupload('processing', data);
                    }
                };
                $scope.disabled = !$window.jQuery.support.fileInput;
                $scope.queue = $scope.queue || [];
                $scope.clear = function (files) {
                    var queue = this.queue,
                        i = queue.length,
                        file = files,
                        length = 1;
                    if (angular.isArray(files)) {
                        file = files[0];
                        length = files.length;
                    }
                    while (i) {
                        i -= 1;
                        if (queue[i] === file) {
                            return queue.splice(i, length);
                        }
                    }
                };
                $scope.replace = function (oldFiles, newFiles) {
                    var queue = this.queue,
                        file = oldFiles[0],
                        i,
                        j;
                    for (i = 0; i < queue.length; i += 1) {
                        if (queue[i] === file) {
                            for (j = 0; j < newFiles.length; j += 1) {
                                queue[i + j] = newFiles[j];
                            }
                            return;
                        }
                    }
                };
                $scope.applyOnQueue = function (method) {
                    var list = this.queue.slice(0),
                        i,
                        file;
                    for (i = 0; i < list.length; i += 1) {
                        file = list[i];
                        if (file[method]) {
                            file[method]();
                        }
                    }
                };
                $scope.submit = function () {
                    this.applyOnQueue('$submit');
                };
                $scope.cancel = function () {
                    this.applyOnQueue('$cancel');
                };
                // Add upload methods to the scope:
                angular.extend($scope, uploadMethods);
                // The fileupload widget will initialize with
                // the options provided via "data-"-parameters,
                // as well as those given via options object:
                $element.fileupload(angular.extend(
                    {scope: $scope},
                    fileUpload.defaults
                )).on('fileuploadadd', function (e, data) {
                    data.scope = $scope;
                }).on('fileuploadfail', function (e, data) {
                    if (data.errorThrown === 'abort') {
                        return;
                    }
                    if (data.dataType &&
                            data.dataType.indexOf('json') === data.dataType.length - 4) {
                        try {
                            data.result = angular.fromJson(data.jqXHR.responseText);
                        } catch (ignore) {}
                    }
                }).on([
                    'fileuploadadd',
                    'fileuploadsubmit',
                    'fileuploadsend',
                    'fileuploaddone',
                    'fileuploadfail',
                    'fileuploadalways',
                    'fileuploadprogress',
                    'fileuploadprogressall',
                    'fileuploadstart',
                    'fileuploadstop',
                    'fileuploadchange',
                    'fileuploadpaste',
                    'fileuploaddrop',
                    'fileuploaddragover',
                    'fileuploadchunksend',
                    'fileuploadchunkdone',
                    'fileuploadchunkfail',
                    'fileuploadchunkalways',
                    'fileuploadprocessstart',
                    'fileuploadprocess',
                    'fileuploadprocessdone',
                    'fileuploadprocessfail',
                    'fileuploadprocessalways',
                    'fileuploadprocessstop'
                ].join(' '), function (e, data) {
                    $scope.$parent.$applyAsync(function () {
                        if ($scope.$emit(e.type, data).defaultPrevented) {
                            e.preventDefault();
                        }
                    });
                }).on('remove', function () {
                    // Remove upload methods from the scope,
                    // when the widget is removed:
                    var method;
                    for (method in uploadMethods) {
                        if (uploadMethods.hasOwnProperty(method)) {
                            delete $scope[method];
                        }
                    }
                });
                // Observe option changes:
                $scope.$watch(
                    $attrs.fileUpload,
                    function (newOptions) {
                        if (newOptions) {
                            $element.fileupload('option', newOptions);
                        }
                    }
                );
            }
        ])

        // Provide File Upload progress feedback:
        .controller('FileUploadProgressController', [
            '$scope', '$attrs', '$parse',
            function ($scope, $attrs, $parse) {
                var fn = $parse($attrs.fileUploadProgress),
                    update = function () {
                        var progress = fn($scope);
                        if (!progress || !progress.total) {
                            return;
                        }
                        $scope.num = Math.floor(
                            progress.loaded / progress.total * 100
                        );
                    };
                update();
                $scope.$watch(
                    $attrs.fileUploadProgress + '.loaded',
                    function (newValue, oldValue) {
                        if (newValue !== oldValue) {
                            update();
                        }
                    }
                );
            }
        ])

        // Display File Upload previews:
        .controller('FileUploadPreviewController', [
            '$scope', '$element', '$attrs',
            function ($scope, $element, $attrs) {
                $scope.$watch(
                    $attrs.fileUploadPreview + '.preview',
                    function (preview) {
                        $element.empty();
                        if (preview) {
                            $element.append(preview);
                        }
                    }
                );
            }
        ])

        .directive('fileUpload', function () {
            return {
                controller: 'FileUploadController',
                scope: true
            };
        })

        .directive('fileUploadProgress', function () {
            return {
                controller: 'FileUploadProgressController',
                scope: true
            };
        })

        .directive('fileUploadPreview', function () {
            return {
                controller: 'FileUploadPreviewController'
            };
        })

        // Enhance the HTML5 download attribute to
        // allow drag&drop of files to the desktop:
        .directive('download', function () {
            return function (scope, elm) {
                elm.on('dragstart', function (e) {
                    try {
                        e.originalEvent.dataTransfer.setData(
                            'DownloadURL',
                            [
                                'application/octet-stream',
                                elm.prop('download'),
                                elm.prop('href')
                            ].join(':')
                        );
                    } catch (ignore) {}
                });
            };
        });

}));
;
