Advertisement
Guest User

Untitled

a guest
Sep 15th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 288.54 KB | None | 0 0
  1. function _taggedTemplateLiteral(e, t) {
  2. return Object.freeze(Object.defineProperties(e, {
  3. raw: {
  4. value: Object.freeze(t)
  5. }
  6. }))
  7. }
  8.  
  9. function gup(e) {
  10. e = e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  11. var t = "[\\?&]" + e + "=([^&#]*)",
  12. n = new RegExp(t),
  13. o = n.exec(window.location.href);
  14. return null === o ? "" : o[1]
  15. }! function(e, t) {
  16. "use strict";
  17. "object" == typeof module && "object" == typeof module.exports ? module.exports = e.document ? t(e, !0) : function(e) {
  18. if (!e.document) throw new Error("jQuery requires a window with a document");
  19. return t(e)
  20. } : t(e)
  21. }("undefined" != typeof window ? window : this, function(e, t) {
  22. "use strict";
  23.  
  24. function n(e, t, n) {
  25. var o, i = (t = t || re).createElement("script");
  26. if (i.text = e, n)
  27. for (o in we) n[o] && (i[o] = n[o]);
  28. t.head.appendChild(i).parentNode.removeChild(i)
  29. }
  30.  
  31. function o(e) {
  32. return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? pe[he.call(e)] || "object" : typeof e
  33. }
  34.  
  35. function i(e) {
  36. var t = !!e && "length" in e && e.length,
  37. n = o(e);
  38. return !ve(e) && !ye(e) && ("array" === n || 0 === t || "number" == typeof t && t > 0 && t - 1 in e)
  39. }
  40.  
  41. function a(e, t) {
  42. return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase()
  43. }
  44.  
  45. function r(e, t, n) {
  46. return ve(t) ? xe.grep(e, function(e, o) {
  47. return !!t.call(e, o, e) !== n
  48. }) : t.nodeType ? xe.grep(e, function(e) {
  49. return e === t !== n
  50. }) : "string" != typeof t ? xe.grep(e, function(e) {
  51. return de.call(t, e) > -1 !== n
  52. }) : xe.filter(t, e, n)
  53. }
  54.  
  55. function l(e, t) {
  56. for (;
  57. (e = e[t]) && 1 !== e.nodeType;);
  58. return e
  59. }
  60.  
  61. function s(e) {
  62. var t = {};
  63. return xe.each(e.match(Se) || [], function(e, n) {
  64. t[n] = !0
  65. }), t
  66. }
  67.  
  68. function c(e) {
  69. return e
  70. }
  71.  
  72. function u(e) {
  73. throw e
  74. }
  75.  
  76. function d(e, t, n, o) {
  77. var i;
  78. try {
  79. e && ve(i = e.promise) ? i.call(e).done(t).fail(n) : e && ve(i = e.then) ? i.call(e, t, n) : t.apply(void 0, [e].slice(o))
  80. } catch (e) {
  81. n.apply(void 0, [e])
  82. }
  83. }
  84.  
  85. function p() {
  86. re.removeEventListener("DOMContentLoaded", p), e.removeEventListener("load", p), xe.ready()
  87. }
  88.  
  89. function h(e, t) {
  90. return t.toUpperCase()
  91. }
  92.  
  93. function f(e) {
  94. return e.replace(Oe, "ms-").replace(Ne, h)
  95. }
  96.  
  97. function b() {
  98. this.expando = xe.expando + b.uid++
  99. }
  100.  
  101. function m(e) {
  102. return "true" === e || "false" !== e && ("null" === e ? null : e === +e + "" ? +e : Ue.test(e) ? JSON.parse(e) : e)
  103. }
  104.  
  105. function g(e, t, n) {
  106. var o;
  107. if (void 0 === n && 1 === e.nodeType)
  108. if (o = "data-" + t.replace(Be, "-$&").toLowerCase(), "string" == typeof(n = e.getAttribute(o))) {
  109. try {
  110. n = m(n)
  111. } catch (e) {}
  112. He.set(e, t, n)
  113. } else n = void 0;
  114. return n
  115. }
  116.  
  117. function v(e, t, n, o) {
  118. var i, a, r = 20,
  119. l = o ? function() {
  120. return o.cur()
  121. } : function() {
  122. return xe.css(e, t, "")
  123. },
  124. s = l(),
  125. c = n && n[3] || (xe.cssNumber[t] ? "" : "px"),
  126. u = (xe.cssNumber[t] || "px" !== c && +s) && We.exec(xe.css(e, t));
  127. if (u && u[3] !== c) {
  128. for (s /= 2, c = c || u[3], u = +s || 1; r--;) xe.style(e, t, u + c), (1 - a) * (1 - (a = l() / s || .5)) <= 0 && (r = 0), u /= a;
  129. u *= 2, xe.style(e, t, u + c), n = n || []
  130. }
  131. return n && (u = +u || +s || 0, i = n[1] ? u + (n[1] + 1) * n[2] : +n[2], o && (o.unit = c, o.start = u, o.end = i)), i
  132. }
  133.  
  134. function y(e) {
  135. var t, n = e.ownerDocument,
  136. o = e.nodeName,
  137. i = Ke[o];
  138. return i || (t = n.body.appendChild(n.createElement(o)), i = xe.css(t, "display"), t.parentNode.removeChild(t), "none" === i && (i = "block"), Ke[o] = i, i)
  139. }
  140.  
  141. function w(e, t) {
  142. for (var n, o, i = [], a = 0, r = e.length; a < r; a++)(o = e[a]).style && (n = o.style.display, t ? ("none" === n && (i[a] = Re.get(o, "display") || null, i[a] || (o.style.display = "")), "" === o.style.display && ze(o) && (i[a] = y(o))) : "none" !== n && (i[a] = "none", Re.set(o, "display", n)));
  143. for (a = 0; a < r; a++) null != i[a] && (e[a].style.display = i[a]);
  144. return e
  145. }
  146.  
  147. function x(e, t) {
  148. var n;
  149. return n = void 0 !== e.getElementsByTagName ? e.getElementsByTagName(t || "*") : void 0 !== e.querySelectorAll ? e.querySelectorAll(t || "*") : [], void 0 === t || t && a(e, t) ? xe.merge([e], n) : n
  150. }
  151.  
  152. function _(e, t) {
  153. for (var n = 0, o = e.length; n < o; n++) Re.set(e[n], "globalEval", !t || Re.get(t[n], "globalEval"))
  154. }
  155.  
  156. function j(e, t, n, i, a) {
  157. for (var r, l, s, c, u, d, p = t.createDocumentFragment(), h = [], f = 0, b = e.length; f < b; f++)
  158. if ((r = e[f]) || 0 === r)
  159. if ("object" === o(r)) xe.merge(h, r.nodeType ? [r] : r);
  160. else if (Je.test(r)) {
  161. for (l = l || p.appendChild(t.createElement("div")), s = (Ge.exec(r) || ["", ""])[1].toLowerCase(), c = Ze[s] || Ze._default, l.innerHTML = c[1] + xe.htmlPrefilter(r) + c[2], d = c[0]; d--;) l = l.lastChild;
  162. xe.merge(h, l.childNodes), (l = p.firstChild).textContent = ""
  163. } else h.push(t.createTextNode(r));
  164. for (p.textContent = "", f = 0; r = h[f++];)
  165. if (i && xe.inArray(r, i) > -1) a && a.push(r);
  166. else if (u = xe.contains(r.ownerDocument, r), l = x(p.appendChild(r), "script"), u && _(l), n)
  167. for (d = 0; r = l[d++];) Qe.test(r.type || "") && n.push(r);
  168. return p
  169. }
  170.  
  171. function T() {
  172. return !0
  173. }
  174.  
  175. function M() {
  176. return !1
  177. }
  178.  
  179. function k() {
  180. try {
  181. return re.activeElement
  182. } catch (e) {}
  183. }
  184.  
  185. function C(e, t, n, o, i, a) {
  186. var r, l;
  187. if ("object" == typeof t) {
  188. "string" != typeof n && (o = o || n, n = void 0);
  189. for (l in t) C(e, l, n, o, t[l], a);
  190. return e
  191. }
  192. if (null == o && null == i ? (i = n, o = n = void 0) : null == i && ("string" == typeof n ? (i = o, o = void 0) : (i = o, o = n, n = void 0)), !1 === i) i = M;
  193. else if (!i) return e;
  194. return 1 === a && (r = i, (i = function(e) {
  195. return xe().off(e), r.apply(this, arguments)
  196. }).guid = r.guid || (r.guid = xe.guid++)), e.each(function() {
  197. xe.event.add(this, t, i, o, n)
  198. })
  199. }
  200.  
  201. function D(e, t) {
  202. return a(e, "table") && a(11 !== t.nodeType ? t : t.firstChild, "tr") ? xe(e).children("tbody")[0] || e : e
  203. }
  204.  
  205. function $(e) {
  206. return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e
  207. }
  208.  
  209. function A(e) {
  210. return "true/" === (e.type || "").slice(0, 5) ? e.type = e.type.slice(5) : e.removeAttribute("type"), e
  211. }
  212.  
  213. function E(e, t) {
  214. var n, o, i, a, r, l, s, c;
  215. if (1 === t.nodeType) {
  216. if (Re.hasData(e) && (a = Re.access(e), r = Re.set(t, a), c = a.events)) {
  217. delete r.handle, r.events = {};
  218. for (i in c)
  219. for (n = 0, o = c[i].length; n < o; n++) xe.event.add(t, i, c[i][n])
  220. }
  221. He.hasData(e) && (l = He.access(e), s = xe.extend({}, l), He.set(t, s))
  222. }
  223. }
  224.  
  225. function S(e, t) {
  226. var n = t.nodeName.toLowerCase();
  227. "input" === n && Ve.test(e.type) ? t.checked = e.checked : "input" !== n && "textarea" !== n || (t.defaultValue = e.defaultValue)
  228. }
  229.  
  230. function L(e, t, o, i) {
  231. t = ce.apply([], t);
  232. var a, r, l, s, c, u, d = 0,
  233. p = e.length,
  234. h = p - 1,
  235. f = t[0],
  236. b = ve(f);
  237. if (b || p > 1 && "string" == typeof f && !ge.checkClone && rt.test(f)) return e.each(function(n) {
  238. var a = e.eq(n);
  239. b && (t[0] = f.call(this, n, a.html())), L(a, t, o, i)
  240. });
  241. if (p && (a = j(t, e[0].ownerDocument, !1, e, i), r = a.firstChild, 1 === a.childNodes.length && (a = r), r || i)) {
  242. for (s = (l = xe.map(x(a, "script"), $)).length; d < p; d++) c = a, d !== h && (c = xe.clone(c, !0, !0), s && xe.merge(l, x(c, "script"))), o.call(e[d], c, d);
  243. if (s)
  244. for (u = l[l.length - 1].ownerDocument, xe.map(l, A), d = 0; d < s; d++) c = l[d], Qe.test(c.type || "") && !Re.access(c, "globalEval") && xe.contains(u, c) && (c.src && "module" !== (c.type || "").toLowerCase() ? xe._evalUrl && xe._evalUrl(c.src) : n(c.textContent.replace(lt, ""), u, c))
  245. }
  246. return e
  247. }
  248.  
  249. function P(e, t, n) {
  250. for (var o, i = t ? xe.filter(t, e) : e, a = 0; null != (o = i[a]); a++) n || 1 !== o.nodeType || xe.cleanData(x(o)), o.parentNode && (n && xe.contains(o.ownerDocument, o) && _(x(o, "script")), o.parentNode.removeChild(o));
  251. return e
  252. }
  253.  
  254. function I(e, t, n) {
  255. var o, i, a, r, l = e.style;
  256. return (n = n || ct(e)) && ("" !== (r = n.getPropertyValue(t) || n[t]) || xe.contains(e.ownerDocument, e) || (r = xe.style(e, t)), !ge.pixelBoxStyles() && st.test(r) && ut.test(t) && (o = l.width, i = l.minWidth, a = l.maxWidth, l.minWidth = l.maxWidth = l.width = r, r = n.width, l.width = o, l.minWidth = i, l.maxWidth = a)), void 0 !== r ? r + "" : r
  257. }
  258.  
  259. function O(e, t) {
  260. return {
  261. get: function() {
  262. if (!e()) return (this.get = t).apply(this, arguments);
  263. delete this.get
  264. }
  265. }
  266. }
  267.  
  268. function N(e) {
  269. if (e in mt) return e;
  270. for (var t = e[0].toUpperCase() + e.slice(1), n = bt.length; n--;)
  271. if ((e = bt[n] + t) in mt) return e
  272. }
  273.  
  274. function q(e) {
  275. var t = xe.cssProps[e];
  276. return t || (t = xe.cssProps[e] = N(e) || e), t
  277. }
  278.  
  279. function R(e, t, n) {
  280. var o = We.exec(t);
  281. return o ? Math.max(0, o[2] - (n || 0)) + (o[3] || "px") : t
  282. }
  283.  
  284. function H(e, t, n, o, i, a) {
  285. var r = "width" === t ? 1 : 0,
  286. l = 0,
  287. s = 0;
  288. if (n === (o ? "border" : "content")) return 0;
  289. for (; r < 4; r += 2) "margin" === n && (s += xe.css(e, n + Xe[r], !0, i)), o ? ("content" === n && (s -= xe.css(e, "padding" + Xe[r], !0, i)), "margin" !== n && (s -= xe.css(e, "border" + Xe[r] + "Width", !0, i))) : (s += xe.css(e, "padding" + Xe[r], !0, i), "padding" !== n ? s += xe.css(e, "border" + Xe[r] + "Width", !0, i) : l += xe.css(e, "border" + Xe[r] + "Width", !0, i));
  290. return !o && a >= 0 && (s += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - a - s - l - .5))), s
  291. }
  292.  
  293. function U(e, t, n) {
  294. var o = ct(e),
  295. i = I(e, t, o),
  296. a = "border-box" === xe.css(e, "boxSizing", !1, o),
  297. r = a;
  298. if (st.test(i)) {
  299. if (!n) return i;
  300. i = "auto"
  301. }
  302. return r = r && (ge.boxSizingReliable() || i === e.style[t]), ("auto" === i || !parseFloat(i) && "inline" === xe.css(e, "display", !1, o)) && (i = e["offset" + t[0].toUpperCase() + t.slice(1)], r = !0), (i = parseFloat(i) || 0) + H(e, t, n || (a ? "border" : "content"), r, o, i) + "px"
  303. }
  304.  
  305. function B(e, t, n, o, i) {
  306. return new B.prototype.init(e, t, n, o, i)
  307. }
  308.  
  309. function F() {
  310. vt && (!1 === re.hidden && e.requestAnimationFrame ? e.requestAnimationFrame(F) : e.setTimeout(F, xe.fx.interval), xe.fx.tick())
  311. }
  312.  
  313. function W() {
  314. return e.setTimeout(function() {
  315. gt = void 0
  316. }), gt = Date.now()
  317. }
  318.  
  319. function X(e, t) {
  320. var n, o = 0,
  321. i = {
  322. height: e
  323. };
  324. for (t = t ? 1 : 0; o < 4; o += 2 - t) i["margin" + (n = Xe[o])] = i["padding" + n] = e;
  325. return t && (i.opacity = i.width = e), i
  326. }
  327.  
  328. function z(e, t, n) {
  329. for (var o, i = (V.tweeners[t] || []).concat(V.tweeners["*"]), a = 0, r = i.length; a < r; a++)
  330. if (o = i[a].call(n, t, e)) return o
  331. }
  332.  
  333. function Y(e, t, n) {
  334. var o, i, a, r, l, s, c, u, d = "width" in t || "height" in t,
  335. p = this,
  336. h = {},
  337. f = e.style,
  338. b = e.nodeType && ze(e),
  339. m = Re.get(e, "fxshow");
  340. n.queue || (null == (r = xe._queueHooks(e, "fx")).unqueued && (r.unqueued = 0, l = r.empty.fire, r.empty.fire = function() {
  341. r.unqueued || l()
  342. }), r.unqueued++, p.always(function() {
  343. p.always(function() {
  344. r.unqueued--, xe.queue(e, "fx").length || r.empty.fire()
  345. })
  346. }));
  347. for (o in t)
  348. if (i = t[o], yt.test(i)) {
  349. if (delete t[o], a = a || "toggle" === i, i === (b ? "hide" : "show")) {
  350. if ("show" !== i || !m || void 0 === m[o]) continue;
  351. b = !0
  352. }
  353. h[o] = m && m[o] || xe.style(e, o)
  354. }
  355. if ((s = !xe.isEmptyObject(t)) || !xe.isEmptyObject(h)) {
  356. d && 1 === e.nodeType && (n.overflow = [f.overflow, f.overflowX, f.overflowY], null == (c = m && m.display) && (c = Re.get(e, "display")), "none" === (u = xe.css(e, "display")) && (c ? u = c : (w([e], !0), c = e.style.display || c, u = xe.css(e, "display"), w([e]))), ("inline" === u || "inline-block" === u && null != c) && "none" === xe.css(e, "float") && (s || (p.done(function() {
  357. f.display = c
  358. }), null == c && (u = f.display, c = "none" === u ? "" : u)), f.display = "inline-block")), n.overflow && (f.overflow = "hidden", p.always(function() {
  359. f.overflow = n.overflow[0], f.overflowX = n.overflow[1], f.overflowY = n.overflow[2]
  360. })), s = !1;
  361. for (o in h) s || (m ? "hidden" in m && (b = m.hidden) : m = Re.access(e, "fxshow", {
  362. display: c
  363. }), a && (m.hidden = !b), b && w([e], !0), p.done(function() {
  364. b || w([e]), Re.remove(e, "fxshow");
  365. for (o in h) xe.style(e, o, h[o])
  366. })), s = z(b ? m[o] : 0, o, p), o in m || (m[o] = s.start, b && (s.end = s.start, s.start = 0))
  367. }
  368. }
  369.  
  370. function K(e, t) {
  371. var n, o, i, a, r;
  372. for (n in e)
  373. if (o = f(n), i = t[o], a = e[n], Array.isArray(a) && (i = a[1], a = e[n] = a[0]), n !== o && (e[o] = a, delete e[n]), (r = xe.cssHooks[o]) && "expand" in r) {
  374. a = r.expand(a), delete e[o];
  375. for (n in a) n in e || (e[n] = a[n], t[n] = i)
  376. } else t[o] = i
  377. }
  378.  
  379. function V(e, t, n) {
  380. var o, i, a = 0,
  381. r = V.prefilters.length,
  382. l = xe.Deferred().always(function() {
  383. delete s.elem
  384. }),
  385. s = function() {
  386. if (i) return !1;
  387. for (var t = gt || W(), n = Math.max(0, c.startTime + c.duration - t), o = 1 - (n / c.duration || 0), a = 0, r = c.tweens.length; a < r; a++) c.tweens[a].run(o);
  388. return l.notifyWith(e, [c, o, n]), o < 1 && r ? n : (r || l.notifyWith(e, [c, 1, 0]), l.resolveWith(e, [c]), !1)
  389. },
  390. c = l.promise({
  391. elem: e,
  392. props: xe.extend({}, t),
  393. opts: xe.extend(!0, {
  394. specialEasing: {},
  395. easing: xe.easing._default
  396. }, n),
  397. originalProperties: t,
  398. originalOptions: n,
  399. startTime: gt || W(),
  400. duration: n.duration,
  401. tweens: [],
  402. createTween: function(t, n) {
  403. var o = xe.Tween(e, c.opts, t, n, c.opts.specialEasing[t] || c.opts.easing);
  404. return c.tweens.push(o), o
  405. },
  406. stop: function(t) {
  407. var n = 0,
  408. o = t ? c.tweens.length : 0;
  409. if (i) return this;
  410. for (i = !0; n < o; n++) c.tweens[n].run(1);
  411. return t ? (l.notifyWith(e, [c, 1, 0]), l.resolveWith(e, [c, t])) : l.rejectWith(e, [c, t]), this
  412. }
  413. }),
  414. u = c.props;
  415. for (K(u, c.opts.specialEasing); a < r; a++)
  416. if (o = V.prefilters[a].call(c, e, u, c.opts)) return ve(o.stop) && (xe._queueHooks(c.elem, c.opts.queue).stop = o.stop.bind(o)), o;
  417. return xe.map(u, z, c), ve(c.opts.start) && c.opts.start.call(e, c), c.progress(c.opts.progress).done(c.opts.done, c.opts.complete).fail(c.opts.fail).always(c.opts.always), xe.fx.timer(xe.extend(s, {
  418. elem: e,
  419. anim: c,
  420. queue: c.opts.queue
  421. })), c
  422. }
  423.  
  424. function G(e) {
  425. return (e.match(Se) || []).join(" ")
  426. }
  427.  
  428. function Q(e) {
  429. return e.getAttribute && e.getAttribute("class") || ""
  430. }
  431.  
  432. function Z(e) {
  433. return Array.isArray(e) ? e : "string" == typeof e ? e.match(Se) || [] : []
  434. }
  435.  
  436. function J(e, t, n, i) {
  437. var a;
  438. if (Array.isArray(t)) xe.each(t, function(t, o) {
  439. n || Et.test(e) ? i(e, o) : J(e + "[" + ("object" == typeof o && null != o ? t : "") + "]", o, n, i)
  440. });
  441. else if (n || "object" !== o(t)) i(e, t);
  442. else
  443. for (a in t) J(e + "[" + a + "]", t[a], n, i)
  444. }
  445.  
  446. function ee(e) {
  447. return function(t, n) {
  448. "string" != typeof t && (n = t, t = "*");
  449. var o, i = 0,
  450. a = t.toLowerCase().match(Se) || [];
  451. if (ve(n))
  452. for (; o = a[i++];) "+" === o[0] ? (o = o.slice(1) || "*", (e[o] = e[o] || []).unshift(n)) : (e[o] = e[o] || []).push(n)
  453. }
  454. }
  455.  
  456. function te(e, t, n, o) {
  457. function i(l) {
  458. var s;
  459. return a[l] = !0, xe.each(e[l] || [], function(e, l) {
  460. var c = l(t, n, o);
  461. return "string" != typeof c || r || a[c] ? r ? !(s = c) : void 0 : (t.dataTypes.unshift(c), i(c), !1)
  462. }), s
  463. }
  464. var a = {},
  465. r = e === Ft;
  466. return i(t.dataTypes[0]) || !a["*"] && i("*")
  467. }
  468.  
  469. function ne(e, t) {
  470. var n, o, i = xe.ajaxSettings.flatOptions || {};
  471. for (n in t) void 0 !== t[n] && ((i[n] ? e : o || (o = {}))[n] = t[n]);
  472. return o && xe.extend(!0, e, o), e
  473. }
  474.  
  475. function oe(e, t, n) {
  476. for (var o, i, a, r, l = e.contents, s = e.dataTypes;
  477. "*" === s[0];) s.shift(), void 0 === o && (o = e.mimeType || t.getResponseHeader("Content-Type"));
  478. if (o)
  479. for (i in l)
  480. if (l[i] && l[i].test(o)) {
  481. s.unshift(i);
  482. break
  483. }
  484. if (s[0] in n) a = s[0];
  485. else {
  486. for (i in n) {
  487. if (!s[0] || e.converters[i + " " + s[0]]) {
  488. a = i;
  489. break
  490. }
  491. r || (r = i)
  492. }
  493. a = a || r
  494. }
  495. if (a) return a !== s[0] && s.unshift(a), n[a]
  496. }
  497.  
  498. function ie(e, t, n, o) {
  499. var i, a, r, l, s, c = {},
  500. u = e.dataTypes.slice();
  501. if (u[1])
  502. for (r in e.converters) c[r.toLowerCase()] = e.converters[r];
  503. for (a = u.shift(); a;)
  504. if (e.responseFields[a] && (n[e.responseFields[a]] = t), !s && o && e.dataFilter && (t = e.dataFilter(t, e.dataType)), s = a, a = u.shift())
  505. if ("*" === a) a = s;
  506. else if ("*" !== s && s !== a) {
  507. if (!(r = c[s + " " + a] || c["* " + a]))
  508. for (i in c)
  509. if ((l = i.split(" "))[1] === a && (r = c[s + " " + l[0]] || c["* " + l[0]])) {
  510. !0 === r ? r = c[i] : !0 !== c[i] && (a = l[0], u.unshift(l[1]));
  511. break
  512. }
  513. if (!0 !== r)
  514. if (r && e.throws) t = r(t);
  515. else try {
  516. t = r(t)
  517. } catch (e) {
  518. return {
  519. state: "parsererror",
  520. error: r ? e : "No conversion from " + s + " to " + a
  521. }
  522. }
  523. }
  524. return {
  525. state: "success",
  526. data: t
  527. }
  528. }
  529. var ae = [],
  530. re = e.document,
  531. le = Object.getPrototypeOf,
  532. se = ae.slice,
  533. ce = ae.concat,
  534. ue = ae.push,
  535. de = ae.indexOf,
  536. pe = {},
  537. he = pe.toString,
  538. fe = pe.hasOwnProperty,
  539. be = fe.toString,
  540. me = be.call(Object),
  541. ge = {},
  542. ve = function(e) {
  543. return "function" == typeof e && "number" != typeof e.nodeType
  544. },
  545. ye = function(e) {
  546. return null != e && e === e.window
  547. },
  548. we = {
  549. type: !0,
  550. src: !0,
  551. noModule: !0
  552. },
  553. xe = function(e, t) {
  554. return new xe.fn.init(e, t)
  555. },
  556. _e = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  557. xe.fn = xe.prototype = {
  558. jquery: "3.3.1",
  559. constructor: xe,
  560. length: 0,
  561. toArray: function() {
  562. return se.call(this)
  563. },
  564. get: function(e) {
  565. return null == e ? se.call(this) : e < 0 ? this[e + this.length] : this[e]
  566. },
  567. pushStack: function(e) {
  568. var t = xe.merge(this.constructor(), e);
  569. return t.prevObject = this, t
  570. },
  571. each: function(e) {
  572. return xe.each(this, e)
  573. },
  574. map: function(e) {
  575. return this.pushStack(xe.map(this, function(t, n) {
  576. return e.call(t, n, t)
  577. }))
  578. },
  579. slice: function() {
  580. return this.pushStack(se.apply(this, arguments))
  581. },
  582. first: function() {
  583. return this.eq(0)
  584. },
  585. last: function() {
  586. return this.eq(-1)
  587. },
  588. eq: function(e) {
  589. var t = this.length,
  590. n = +e + (e < 0 ? t : 0);
  591. return this.pushStack(n >= 0 && n < t ? [this[n]] : [])
  592. },
  593. end: function() {
  594. return this.prevObject || this.constructor()
  595. },
  596. push: ue,
  597. sort: ae.sort,
  598. splice: ae.splice
  599. }, xe.extend = xe.fn.extend = function() {
  600. var e, t, n, o, i, a, r = arguments[0] || {},
  601. l = 1,
  602. s = arguments.length,
  603. c = !1;
  604. for ("boolean" == typeof r && (c = r, r = arguments[l] || {}, l++), "object" == typeof r || ve(r) || (r = {}), l === s && (r = this, l--); l < s; l++)
  605. if (null != (e = arguments[l]))
  606. for (t in e) n = r[t], r !== (o = e[t]) && (c && o && (xe.isPlainObject(o) || (i = Array.isArray(o))) ? (i ? (i = !1, a = n && Array.isArray(n) ? n : []) : a = n && xe.isPlainObject(n) ? n : {}, r[t] = xe.extend(c, a, o)) : void 0 !== o && (r[t] = o));
  607. return r
  608. }, xe.extend({
  609. expando: "jQuery" + ("3.3.1" + Math.random()).replace(/\D/g, ""),
  610. isReady: !0,
  611. error: function(e) {
  612. throw new Error(e)
  613. },
  614. noop: function() {},
  615. isPlainObject: function(e) {
  616. var t, n;
  617. return !(!e || "[object Object]" !== he.call(e) || (t = le(e)) && ("function" != typeof(n = fe.call(t, "constructor") && t.constructor) || be.call(n) !== me))
  618. },
  619. isEmptyObject: function(e) {
  620. var t;
  621. for (t in e) return !1;
  622. return !0
  623. },
  624. globalEval: function(e) {
  625. n(e)
  626. },
  627. each: function(e, t) {
  628. var n, o = 0;
  629. if (i(e))
  630. for (n = e.length; o < n && !1 !== t.call(e[o], o, e[o]); o++);
  631. else
  632. for (o in e)
  633. if (!1 === t.call(e[o], o, e[o])) break; return e
  634. },
  635. trim: function(e) {
  636. return null == e ? "" : (e + "").replace(_e, "")
  637. },
  638. makeArray: function(e, t) {
  639. var n = t || [];
  640. return null != e && (i(Object(e)) ? xe.merge(n, "string" == typeof e ? [e] : e) : ue.call(n, e)), n
  641. },
  642. inArray: function(e, t, n) {
  643. return null == t ? -1 : de.call(t, e, n)
  644. },
  645. merge: function(e, t) {
  646. for (var n = +t.length, o = 0, i = e.length; o < n; o++) e[i++] = t[o];
  647. return e.length = i, e
  648. },
  649. grep: function(e, t, n) {
  650. for (var o = [], i = 0, a = e.length, r = !n; i < a; i++) !t(e[i], i) !== r && o.push(e[i]);
  651. return o
  652. },
  653. map: function(e, t, n) {
  654. var o, a, r = 0,
  655. l = [];
  656. if (i(e))
  657. for (o = e.length; r < o; r++) null != (a = t(e[r], r, n)) && l.push(a);
  658. else
  659. for (r in e) null != (a = t(e[r], r, n)) && l.push(a);
  660. return ce.apply([], l)
  661. },
  662. guid: 1,
  663. support: ge
  664. }), "function" == typeof Symbol && (xe.fn[Symbol.iterator] = ae[Symbol.iterator]), xe.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(e, t) {
  665. pe["[object " + t + "]"] = t.toLowerCase()
  666. });
  667. var je = function(e) {
  668. function t(e, t, n, o) {
  669. var i, a, r, l, s, u, p, h = t && t.ownerDocument,
  670. f = t ? t.nodeType : 9;
  671. if (n = n || [], "string" != typeof e || !e || 1 !== f && 9 !== f && 11 !== f) return n;
  672. if (!o && ((t ? t.ownerDocument || t : R) !== E && A(t), t = t || E, L)) {
  673. if (11 !== f && (s = be.exec(e)))
  674. if (i = s[1]) {
  675. if (9 === f) {
  676. if (!(r = t.getElementById(i))) return n;
  677. if (r.id === i) return n.push(r), n
  678. } else if (h && (r = h.getElementById(i)) && N(t, r) && r.id === i) return n.push(r), n
  679. } else {
  680. if (s[2]) return G.apply(n, t.getElementsByTagName(e)), n;
  681. if ((i = s[3]) && w.getElementsByClassName && t.getElementsByClassName) return G.apply(n, t.getElementsByClassName(i)), n
  682. }
  683. if (w.qsa && !W[e + " "] && (!P || !P.test(e))) {
  684. if (1 !== f) h = t, p = e;
  685. else if ("object" !== t.nodeName.toLowerCase()) {
  686. for ((l = t.getAttribute("id")) ? l = l.replace(ye, we) : t.setAttribute("id", l = q), a = (u = T(e)).length; a--;) u[a] = "#" + l + " " + d(u[a]);
  687. p = u.join(","), h = me.test(e) && c(t.parentNode) || t
  688. }
  689. if (p) try {
  690. return G.apply(n, h.querySelectorAll(p)), n
  691. } catch (e) {} finally {
  692. l === q && t.removeAttribute("id")
  693. }
  694. }
  695. }
  696. return k(e.replace(ae, "$1"), t, n, o)
  697. }
  698.  
  699. function n() {
  700. function e(n, o) {
  701. return t.push(n + " ") > x.cacheLength && delete e[t.shift()], e[n + " "] = o
  702. }
  703. var t = [];
  704. return e
  705. }
  706.  
  707. function o(e) {
  708. return e[q] = !0, e
  709. }
  710.  
  711. function i(e) {
  712. var t = E.createElement("fieldset");
  713. try {
  714. return !!e(t)
  715. } catch (e) {
  716. return !1
  717. } finally {
  718. t.parentNode && t.parentNode.removeChild(t), t = null
  719. }
  720. }
  721.  
  722. function a(e, t) {
  723. for (var n = e.split("|"), o = n.length; o--;) x.attrHandle[n[o]] = t
  724. }
  725.  
  726. function r(e, t) {
  727. var n = t && e,
  728. o = n && 1 === e.nodeType && 1 === t.nodeType && e.sourceIndex - t.sourceIndex;
  729. if (o) return o;
  730. if (n)
  731. for (; n = n.nextSibling;)
  732. if (n === t) return -1;
  733. return e ? 1 : -1
  734. }
  735.  
  736. function l(e) {
  737. return function(t) {
  738. return "form" in t ? t.parentNode && !1 === t.disabled ? "label" in t ? "label" in t.parentNode ? t.parentNode.disabled === e : t.disabled === e : t.isDisabled === e || t.isDisabled !== !e && _e(t) === e : t.disabled === e : "label" in t && t.disabled === e
  739. }
  740. }
  741.  
  742. function s(e) {
  743. return o(function(t) {
  744. return t = +t, o(function(n, o) {
  745. for (var i, a = e([], n.length, t), r = a.length; r--;) n[i = a[r]] && (n[i] = !(o[i] = n[i]))
  746. })
  747. })
  748. }
  749.  
  750. function c(e) {
  751. return e && void 0 !== e.getElementsByTagName && e
  752. }
  753.  
  754. function u() {}
  755.  
  756. function d(e) {
  757. for (var t = 0, n = e.length, o = ""; t < n; t++) o += e[t].value;
  758. return o
  759. }
  760.  
  761. function p(e, t, n) {
  762. var o = t.dir,
  763. i = t.next,
  764. a = i || o,
  765. r = n && "parentNode" === a,
  766. l = U++;
  767. return t.first ? function(t, n, i) {
  768. for (; t = t[o];)
  769. if (1 === t.nodeType || r) return e(t, n, i);
  770. return !1
  771. } : function(t, n, s) {
  772. var c, u, d, p = [H, l];
  773. if (s) {
  774. for (; t = t[o];)
  775. if ((1 === t.nodeType || r) && e(t, n, s)) return !0
  776. } else
  777. for (; t = t[o];)
  778. if (1 === t.nodeType || r)
  779. if (d = t[q] || (t[q] = {}), u = d[t.uniqueID] || (d[t.uniqueID] = {}), i && i === t.nodeName.toLowerCase()) t = t[o] || t;
  780. else {
  781. if ((c = u[a]) && c[0] === H && c[1] === l) return p[2] = c[2];
  782. if (u[a] = p, p[2] = e(t, n, s)) return !0
  783. } return !1
  784. }
  785. }
  786.  
  787. function h(e) {
  788. return e.length > 1 ? function(t, n, o) {
  789. for (var i = e.length; i--;)
  790. if (!e[i](t, n, o)) return !1;
  791. return !0
  792. } : e[0]
  793. }
  794.  
  795. function f(e, n, o) {
  796. for (var i = 0, a = n.length; i < a; i++) t(e, n[i], o);
  797. return o
  798. }
  799.  
  800. function b(e, t, n, o, i) {
  801. for (var a, r = [], l = 0, s = e.length, c = null != t; l < s; l++)(a = e[l]) && (n && !n(a, o, i) || (r.push(a), c && t.push(l)));
  802. return r
  803. }
  804.  
  805. function m(e, t, n, i, a, r) {
  806. return i && !i[q] && (i = m(i)), a && !a[q] && (a = m(a, r)), o(function(o, r, l, s) {
  807. var c, u, d, p = [],
  808. h = [],
  809. m = r.length,
  810. g = o || f(t || "*", l.nodeType ? [l] : l, []),
  811. v = !e || !o && t ? g : b(g, p, e, l, s),
  812. y = n ? a || (o ? e : m || i) ? [] : r : v;
  813. if (n && n(v, y, l, s), i)
  814. for (c = b(y, h), i(c, [], l, s), u = c.length; u--;)(d = c[u]) && (y[h[u]] = !(v[h[u]] = d));
  815. if (o) {
  816. if (a || e) {
  817. if (a) {
  818. for (c = [], u = y.length; u--;)(d = y[u]) && c.push(v[u] = d);
  819. a(null, y = [], c, s)
  820. }
  821. for (u = y.length; u--;)(d = y[u]) && (c = a ? Z(o, d) : p[u]) > -1 && (o[c] = !(r[c] = d))
  822. }
  823. } else y = b(y === r ? y.splice(m, y.length) : y), a ? a(null, r, y, s) : G.apply(r, y)
  824. })
  825. }
  826.  
  827. function g(e) {
  828. for (var t, n, o, i = e.length, a = x.relative[e[0].type], r = a || x.relative[" "], l = a ? 1 : 0, s = p(function(e) {
  829. return e === t
  830. }, r, !0), c = p(function(e) {
  831. return Z(t, e) > -1
  832. }, r, !0), u = [function(e, n, o) {
  833. var i = !a && (o || n !== C) || ((t = n).nodeType ? s(e, n, o) : c(e, n, o));
  834. return t = null, i
  835. }]; l < i; l++)
  836. if (n = x.relative[e[l].type]) u = [p(h(u), n)];
  837. else {
  838. if ((n = x.filter[e[l].type].apply(null, e[l].matches))[q]) {
  839. for (o = ++l; o < i && !x.relative[e[o].type]; o++);
  840. return m(l > 1 && h(u), l > 1 && d(e.slice(0, l - 1).concat({
  841. value: " " === e[l - 2].type ? "*" : ""
  842. })).replace(ae, "$1"), n, l < o && g(e.slice(l, o)), o < i && g(e = e.slice(o)), o < i && d(e))
  843. }
  844. u.push(n)
  845. }
  846. return h(u)
  847. }
  848.  
  849. function v(e, n) {
  850. var i = n.length > 0,
  851. a = e.length > 0,
  852. r = function(o, r, l, s, c) {
  853. var u, d, p, h = 0,
  854. f = "0",
  855. m = o && [],
  856. g = [],
  857. v = C,
  858. y = o || a && x.find.TAG("*", c),
  859. w = H += null == v ? 1 : Math.random() || .1,
  860. _ = y.length;
  861. for (c && (C = r === E || r || c); f !== _ && null != (u = y[f]); f++) {
  862. if (a && u) {
  863. for (d = 0, r || u.ownerDocument === E || (A(u), l = !L); p = e[d++];)
  864. if (p(u, r || E, l)) {
  865. s.push(u);
  866. break
  867. }
  868. c && (H = w)
  869. }
  870. i && ((u = !p && u) && h--, o && m.push(u))
  871. }
  872. if (h += f, i && f !== h) {
  873. for (d = 0; p = n[d++];) p(m, g, r, l);
  874. if (o) {
  875. if (h > 0)
  876. for (; f--;) m[f] || g[f] || (g[f] = K.call(s));
  877. g = b(g)
  878. }
  879. G.apply(s, g), c && !o && g.length > 0 && h + n.length > 1 && t.uniqueSort(s)
  880. }
  881. return c && (H = w, C = v), m
  882. };
  883. return i ? o(r) : r
  884. }
  885. var y, w, x, _, j, T, M, k, C, D, $, A, E, S, L, P, I, O, N, q = "sizzle" + 1 * new Date,
  886. R = e.document,
  887. H = 0,
  888. U = 0,
  889. B = n(),
  890. F = n(),
  891. W = n(),
  892. X = function(e, t) {
  893. return e === t && ($ = !0), 0
  894. },
  895. z = {}.hasOwnProperty,
  896. Y = [],
  897. K = Y.pop,
  898. V = Y.push,
  899. G = Y.push,
  900. Q = Y.slice,
  901. Z = function(e, t) {
  902. for (var n = 0, o = e.length; n < o; n++)
  903. if (e[n] === t) return n;
  904. return -1
  905. },
  906. J = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  907. ee = "[\\x20\\t\\r\\n\\f]",
  908. te = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  909. ne = "\\[" + ee + "*(" + te + ")(?:" + ee + "*([*^$|!~]?=)" + ee + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + te + "))|)" + ee + "*\\]",
  910. oe = ":(" + te + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + ne + ")*)|.*)\\)|)",
  911. ie = new RegExp(ee + "+", "g"),
  912. ae = new RegExp("^" + ee + "+|((?:^|[^\\\\])(?:\\\\.)*)" + ee + "+$", "g"),
  913. re = new RegExp("^" + ee + "*," + ee + "*"),
  914. le = new RegExp("^" + ee + "*([>+~]|" + ee + ")" + ee + "*"),
  915. se = new RegExp("=" + ee + "*([^\\]'\"]*?)" + ee + "*\\]", "g"),
  916. ce = new RegExp(oe),
  917. ue = new RegExp("^" + te + "$"),
  918. de = {
  919. ID: new RegExp("^#(" + te + ")"),
  920. CLASS: new RegExp("^\\.(" + te + ")"),
  921. TAG: new RegExp("^(" + te + "|[*])"),
  922. ATTR: new RegExp("^" + ne),
  923. PSEUDO: new RegExp("^" + oe),
  924. CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + ee + "*(even|odd|(([+-]|)(\\d*)n|)" + ee + "*(?:([+-]|)" + ee + "*(\\d+)|))" + ee + "*\\)|)", "i"),
  925. bool: new RegExp("^(?:" + J + ")$", "i"),
  926. needsContext: new RegExp("^" + ee + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + ee + "*((?:-\\d)?\\d*)" + ee + "*\\)|)(?=[^-]|$)", "i")
  927. },
  928. pe = /^(?:input|select|textarea|button)$/i,
  929. he = /^h\d$/i,
  930. fe = /^[^{]+\{\s*\[native \w/,
  931. be = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  932. me = /[+~]/,
  933. ge = new RegExp("\\\\([\\da-f]{1,6}" + ee + "?|(" + ee + ")|.)", "ig"),
  934. ve = function(e, t, n) {
  935. var o = "0x" + t - 65536;
  936. return o !== o || n ? t : o < 0 ? String.fromCharCode(o + 65536) : String.fromCharCode(o >> 10 | 55296, 1023 & o | 56320)
  937. },
  938. ye = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  939. we = function(e, t) {
  940. return t ? "\0" === e ? "�" : e.slice(0, -1) + "\\" + e.charCodeAt(e.length - 1).toString(16) + " " : "\\" + e
  941. },
  942. xe = function() {
  943. A()
  944. },
  945. _e = p(function(e) {
  946. return !0 === e.disabled && ("form" in e || "label" in e)
  947. }, {
  948. dir: "parentNode",
  949. next: "legend"
  950. });
  951. try {
  952. G.apply(Y = Q.call(R.childNodes), R.childNodes), Y[R.childNodes.length].nodeType
  953. } catch (e) {
  954. G = {
  955. apply: Y.length ? function(e, t) {
  956. V.apply(e, Q.call(t))
  957. } : function(e, t) {
  958. for (var n = e.length, o = 0; e[n++] = t[o++];);
  959. e.length = n - 1
  960. }
  961. }
  962. }
  963. w = t.support = {}, j = t.isXML = function(e) {
  964. var t = e && (e.ownerDocument || e).documentElement;
  965. return !!t && "HTML" !== t.nodeName
  966. }, A = t.setDocument = function(e) {
  967. var t, n, o = e ? e.ownerDocument || e : R;
  968. return o !== E && 9 === o.nodeType && o.documentElement ? (E = o, S = E.documentElement, L = !j(E), R !== E && (n = E.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", xe, !1) : n.attachEvent && n.attachEvent("onunload", xe)), w.attributes = i(function(e) {
  969. return e.className = "i", !e.getAttribute("className")
  970. }), w.getElementsByTagName = i(function(e) {
  971. return e.appendChild(E.createComment("")), !e.getElementsByTagName("*").length
  972. }), w.getElementsByClassName = fe.test(E.getElementsByClassName), w.getById = i(function(e) {
  973. return S.appendChild(e).id = q, !E.getElementsByName || !E.getElementsByName(q).length
  974. }), w.getById ? (x.filter.ID = function(e) {
  975. var t = e.replace(ge, ve);
  976. return function(e) {
  977. return e.getAttribute("id") === t
  978. }
  979. }, x.find.ID = function(e, t) {
  980. if (void 0 !== t.getElementById && L) {
  981. var n = t.getElementById(e);
  982. return n ? [n] : []
  983. }
  984. }) : (x.filter.ID = function(e) {
  985. var t = e.replace(ge, ve);
  986. return function(e) {
  987. var n = void 0 !== e.getAttributeNode && e.getAttributeNode("id");
  988. return n && n.value === t
  989. }
  990. }, x.find.ID = function(e, t) {
  991. if (void 0 !== t.getElementById && L) {
  992. var n, o, i, a = t.getElementById(e);
  993. if (a) {
  994. if ((n = a.getAttributeNode("id")) && n.value === e) return [a];
  995. for (i = t.getElementsByName(e), o = 0; a = i[o++];)
  996. if ((n = a.getAttributeNode("id")) && n.value === e) return [a]
  997. }
  998. return []
  999. }
  1000. }), x.find.TAG = w.getElementsByTagName ? function(e, t) {
  1001. return void 0 !== t.getElementsByTagName ? t.getElementsByTagName(e) : w.qsa ? t.querySelectorAll(e) : void 0
  1002. } : function(e, t) {
  1003. var n, o = [],
  1004. i = 0,
  1005. a = t.getElementsByTagName(e);
  1006. if ("*" === e) {
  1007. for (; n = a[i++];) 1 === n.nodeType && o.push(n);
  1008. return o
  1009. }
  1010. return a
  1011. }, x.find.CLASS = w.getElementsByClassName && function(e, t) {
  1012. if (void 0 !== t.getElementsByClassName && L) return t.getElementsByClassName(e)
  1013. }, I = [], P = [], (w.qsa = fe.test(E.querySelectorAll)) && (i(function(e) {
  1014. S.appendChild(e).innerHTML = "<a id='" + q + "'></a><select id='" + q + "-\r\\' msallowcapture=''><option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && P.push("[*^$]=" + ee + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || P.push("\\[" + ee + "*(?:value|" + J + ")"), e.querySelectorAll("[id~=" + q + "-]").length || P.push("~="), e.querySelectorAll(":checked").length || P.push(":checked"), e.querySelectorAll("a#" + q + "+*").length || P.push(".#.+[+~]")
  1015. }), i(function(e) {
  1016. e.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";
  1017. var t = E.createElement("input");
  1018. t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && P.push("name" + ee + "*[*^$|!~]?="), 2 !== e.querySelectorAll(":enabled").length && P.push(":enabled", ":disabled"), S.appendChild(e).disabled = !0, 2 !== e.querySelectorAll(":disabled").length && P.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), P.push(",.*:")
  1019. })), (w.matchesSelector = fe.test(O = S.matches || S.webkitMatchesSelector || S.mozMatchesSelector || S.oMatchesSelector || S.msMatchesSelector)) && i(function(e) {
  1020. w.disconnectedMatch = O.call(e, "*"), O.call(e, "[s!='']:x"), I.push("!=", oe)
  1021. }), P = P.length && new RegExp(P.join("|")), I = I.length && new RegExp(I.join("|")), t = fe.test(S.compareDocumentPosition), N = t || fe.test(S.contains) ? function(e, t) {
  1022. var n = 9 === e.nodeType ? e.documentElement : e,
  1023. o = t && t.parentNode;
  1024. return e === o || !(!o || 1 !== o.nodeType || !(n.contains ? n.contains(o) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(o)))
  1025. } : function(e, t) {
  1026. if (t)
  1027. for (; t = t.parentNode;)
  1028. if (t === e) return !0;
  1029. return !1
  1030. }, X = t ? function(e, t) {
  1031. if (e === t) return $ = !0, 0;
  1032. var n = !e.compareDocumentPosition - !t.compareDocumentPosition;
  1033. return n || (1 & (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !w.sortDetached && t.compareDocumentPosition(e) === n ? e === E || e.ownerDocument === R && N(R, e) ? -1 : t === E || t.ownerDocument === R && N(R, t) ? 1 : D ? Z(D, e) - Z(D, t) : 0 : 4 & n ? -1 : 1)
  1034. } : function(e, t) {
  1035. if (e === t) return $ = !0, 0;
  1036. var n, o = 0,
  1037. i = e.parentNode,
  1038. a = t.parentNode,
  1039. l = [e],
  1040. s = [t];
  1041. if (!i || !a) return e === E ? -1 : t === E ? 1 : i ? -1 : a ? 1 : D ? Z(D, e) - Z(D, t) : 0;
  1042. if (i === a) return r(e, t);
  1043. for (n = e; n = n.parentNode;) l.unshift(n);
  1044. for (n = t; n = n.parentNode;) s.unshift(n);
  1045. for (; l[o] === s[o];) o++;
  1046. return o ? r(l[o], s[o]) : l[o] === R ? -1 : s[o] === R ? 1 : 0
  1047. }, E) : E
  1048. }, t.matches = function(e, n) {
  1049. return t(e, null, null, n)
  1050. }, t.matchesSelector = function(e, n) {
  1051. if ((e.ownerDocument || e) !== E && A(e), n = n.replace(se, "='$1']"), w.matchesSelector && L && !W[n + " "] && (!I || !I.test(n)) && (!P || !P.test(n))) try {
  1052. var o = O.call(e, n);
  1053. if (o || w.disconnectedMatch || e.document && 11 !== e.document.nodeType) return o
  1054. } catch (e) {}
  1055. return t(n, E, null, [e]).length > 0
  1056. }, t.contains = function(e, t) {
  1057. return (e.ownerDocument || e) !== E && A(e), N(e, t)
  1058. }, t.attr = function(e, t) {
  1059. (e.ownerDocument || e) !== E && A(e);
  1060. var n = x.attrHandle[t.toLowerCase()],
  1061. o = n && z.call(x.attrHandle, t.toLowerCase()) ? n(e, t, !L) : void 0;
  1062. return void 0 !== o ? o : w.attributes || !L ? e.getAttribute(t) : (o = e.getAttributeNode(t)) && o.specified ? o.value : null
  1063. }, t.escape = function(e) {
  1064. return (e + "").replace(ye, we)
  1065. }, t.error = function(e) {
  1066. throw new Error("Syntax error, unrecognized expression: " + e)
  1067. }, t.uniqueSort = function(e) {
  1068. var t, n = [],
  1069. o = 0,
  1070. i = 0;
  1071. if ($ = !w.detectDuplicates, D = !w.sortStable && e.slice(0), e.sort(X), $) {
  1072. for (; t = e[i++];) t === e[i] && (o = n.push(i));
  1073. for (; o--;) e.splice(n[o], 1)
  1074. }
  1075. return D = null, e
  1076. }, _ = t.getText = function(e) {
  1077. var t, n = "",
  1078. o = 0,
  1079. i = e.nodeType;
  1080. if (i) {
  1081. if (1 === i || 9 === i || 11 === i) {
  1082. if ("string" == typeof e.textContent) return e.textContent;
  1083. for (e = e.firstChild; e; e = e.nextSibling) n += _(e)
  1084. } else if (3 === i || 4 === i) return e.nodeValue
  1085. } else
  1086. for (; t = e[o++];) n += _(t);
  1087. return n
  1088. }, (x = t.selectors = {
  1089. cacheLength: 50,
  1090. createPseudo: o,
  1091. match: de,
  1092. attrHandle: {},
  1093. find: {},
  1094. relative: {
  1095. ">": {
  1096. dir: "parentNode",
  1097. first: !0
  1098. },
  1099. " ": {
  1100. dir: "parentNode"
  1101. },
  1102. "+": {
  1103. dir: "previousSibling",
  1104. first: !0
  1105. },
  1106. "~": {
  1107. dir: "previousSibling"
  1108. }
  1109. },
  1110. preFilter: {
  1111. ATTR: function(e) {
  1112. return e[1] = e[1].replace(ge, ve), e[3] = (e[3] || e[4] || e[5] || "").replace(ge, ve), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4)
  1113. },
  1114. CHILD: function(e) {
  1115. return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || t.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] && t.error(e[0]), e
  1116. },
  1117. PSEUDO: function(e) {
  1118. var t, n = !e[6] && e[2];
  1119. return de.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && ce.test(n) && (t = T(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3))
  1120. }
  1121. },
  1122. filter: {
  1123. TAG: function(e) {
  1124. var t = e.replace(ge, ve).toLowerCase();
  1125. return "*" === e ? function() {
  1126. return !0
  1127. } : function(e) {
  1128. return e.nodeName && e.nodeName.toLowerCase() === t
  1129. }
  1130. },
  1131. CLASS: function(e) {
  1132. var t = B[e + " "];
  1133. return t || (t = new RegExp("(^|" + ee + ")" + e + "(" + ee + "|$)")) && B(e, function(e) {
  1134. return t.test("string" == typeof e.className && e.className || void 0 !== e.getAttribute && e.getAttribute("class") || "")
  1135. })
  1136. },
  1137. ATTR: function(e, n, o) {
  1138. return function(i) {
  1139. var a = t.attr(i, e);
  1140. return null == a ? "!=" === n : !n || (a += "", "=" === n ? a === o : "!=" === n ? a !== o : "^=" === n ? o && 0 === a.indexOf(o) : "*=" === n ? o && a.indexOf(o) > -1 : "$=" === n ? o && a.slice(-o.length) === o : "~=" === n ? (" " + a.replace(ie, " ") + " ").indexOf(o) > -1 : "|=" === n && (a === o || a.slice(0, o.length + 1) === o + "-"))
  1141. }
  1142. },
  1143. CHILD: function(e, t, n, o, i) {
  1144. var a = "nth" !== e.slice(0, 3),
  1145. r = "last" !== e.slice(-4),
  1146. l = "of-type" === t;
  1147. return 1 === o && 0 === i ? function(e) {
  1148. return !!e.parentNode
  1149. } : function(t, n, s) {
  1150. var c, u, d, p, h, f, b = a !== r ? "nextSibling" : "previousSibling",
  1151. m = t.parentNode,
  1152. g = l && t.nodeName.toLowerCase(),
  1153. v = !s && !l,
  1154. y = !1;
  1155. if (m) {
  1156. if (a) {
  1157. for (; b;) {
  1158. for (p = t; p = p[b];)
  1159. if (l ? p.nodeName.toLowerCase() === g : 1 === p.nodeType) return !1;
  1160. f = b = "only" === e && !f && "nextSibling"
  1161. }
  1162. return !0
  1163. }
  1164. if (f = [r ? m.firstChild : m.lastChild], r && v) {
  1165. for (y = (h = (c = (u = (d = (p = m)[q] || (p[q] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] || [])[0] === H && c[1]) && c[2], p = h && m.childNodes[h]; p = ++h && p && p[b] || (y = h = 0) || f.pop();)
  1166. if (1 === p.nodeType && ++y && p === t) {
  1167. u[e] = [H, h, y];
  1168. break
  1169. }
  1170. } else if (v && (y = h = (c = (u = (d = (p = t)[q] || (p[q] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] || [])[0] === H && c[1]), !1 === y)
  1171. for (;
  1172. (p = ++h && p && p[b] || (y = h = 0) || f.pop()) && ((l ? p.nodeName.toLowerCase() !== g : 1 !== p.nodeType) || !++y || (v && ((u = (d = p[q] || (p[q] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] = [H, y]), p !== t)););
  1173. return (y -= i) === o || y % o == 0 && y / o >= 0
  1174. }
  1175. }
  1176. },
  1177. PSEUDO: function(e, n) {
  1178. var i, a = x.pseudos[e] || x.setFilters[e.toLowerCase()] || t.error("unsupported pseudo: " + e);
  1179. return a[q] ? a(n) : a.length > 1 ? (i = [e, e, "", n], x.setFilters.hasOwnProperty(e.toLowerCase()) ? o(function(e, t) {
  1180. for (var o, i = a(e, n), r = i.length; r--;) e[o = Z(e, i[r])] = !(t[o] = i[r])
  1181. }) : function(e) {
  1182. return a(e, 0, i)
  1183. }) : a
  1184. }
  1185. },
  1186. pseudos: {
  1187. not: o(function(e) {
  1188. var t = [],
  1189. n = [],
  1190. i = M(e.replace(ae, "$1"));
  1191. return i[q] ? o(function(e, t, n, o) {
  1192. for (var a, r = i(e, null, o, []), l = e.length; l--;)(a = r[l]) && (e[l] = !(t[l] = a))
  1193. }) : function(e, o, a) {
  1194. return t[0] = e, i(t, null, a, n), t[0] = null, !n.pop()
  1195. }
  1196. }),
  1197. has: o(function(e) {
  1198. return function(n) {
  1199. return t(e, n).length > 0
  1200. }
  1201. }),
  1202. contains: o(function(e) {
  1203. return e = e.replace(ge, ve),
  1204. function(t) {
  1205. return (t.textContent || t.innerText || _(t)).indexOf(e) > -1
  1206. }
  1207. }),
  1208. lang: o(function(e) {
  1209. return ue.test(e || "") || t.error("unsupported lang: " + e), e = e.replace(ge, ve).toLowerCase(),
  1210. function(t) {
  1211. var n;
  1212. do {
  1213. if (n = L ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (n = n.toLowerCase()) === e || 0 === n.indexOf(e + "-")
  1214. } while ((t = t.parentNode) && 1 === t.nodeType);
  1215. return !1
  1216. }
  1217. }),
  1218. target: function(t) {
  1219. var n = e.location && e.location.hash;
  1220. return n && n.slice(1) === t.id
  1221. },
  1222. root: function(e) {
  1223. return e === S
  1224. },
  1225. focus: function(e) {
  1226. return e === E.activeElement && (!E.hasFocus || E.hasFocus()) && !!(e.type || e.href || ~e.tabIndex)
  1227. },
  1228. enabled: l(!1),
  1229. disabled: l(!0),
  1230. checked: function(e) {
  1231. var t = e.nodeName.toLowerCase();
  1232. return "input" === t && !!e.checked || "option" === t && !!e.selected
  1233. },
  1234. selected: function(e) {
  1235. return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected
  1236. },
  1237. empty: function(e) {
  1238. for (e = e.firstChild; e; e = e.nextSibling)
  1239. if (e.nodeType < 6) return !1;
  1240. return !0
  1241. },
  1242. parent: function(e) {
  1243. return !x.pseudos.empty(e)
  1244. },
  1245. header: function(e) {
  1246. return he.test(e.nodeName)
  1247. },
  1248. input: function(e) {
  1249. return pe.test(e.nodeName)
  1250. },
  1251. button: function(e) {
  1252. var t = e.nodeName.toLowerCase();
  1253. return "input" === t && "button" === e.type || "button" === t
  1254. },
  1255. text: function(e) {
  1256. var t;
  1257. return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase())
  1258. },
  1259. first: s(function() {
  1260. return [0]
  1261. }),
  1262. last: s(function(e, t) {
  1263. return [t - 1]
  1264. }),
  1265. eq: s(function(e, t, n) {
  1266. return [n < 0 ? n + t : n]
  1267. }),
  1268. even: s(function(e, t) {
  1269. for (var n = 0; n < t; n += 2) e.push(n);
  1270. return e
  1271. }),
  1272. odd: s(function(e, t) {
  1273. for (var n = 1; n < t; n += 2) e.push(n);
  1274. return e
  1275. }),
  1276. lt: s(function(e, t, n) {
  1277. for (var o = n < 0 ? n + t : n; --o >= 0;) e.push(o);
  1278. return e
  1279. }),
  1280. gt: s(function(e, t, n) {
  1281. for (var o = n < 0 ? n + t : n; ++o < t;) e.push(o);
  1282. return e
  1283. })
  1284. }
  1285. }).pseudos.nth = x.pseudos.eq;
  1286. for (y in {
  1287. radio: !0,
  1288. checkbox: !0,
  1289. file: !0,
  1290. password: !0,
  1291. image: !0
  1292. }) x.pseudos[y] = function(e) {
  1293. return function(t) {
  1294. return "input" === t.nodeName.toLowerCase() && t.type === e
  1295. }
  1296. }(y);
  1297. for (y in {
  1298. submit: !0,
  1299. reset: !0
  1300. }) x.pseudos[y] = function(e) {
  1301. return function(t) {
  1302. var n = t.nodeName.toLowerCase();
  1303. return ("input" === n || "button" === n) && t.type === e
  1304. }
  1305. }(y);
  1306. return u.prototype = x.filters = x.pseudos, x.setFilters = new u, T = t.tokenize = function(e, n) {
  1307. var o, i, a, r, l, s, c, u = F[e + " "];
  1308. if (u) return n ? 0 : u.slice(0);
  1309. for (l = e, s = [], c = x.preFilter; l;) {
  1310. o && !(i = re.exec(l)) || (i && (l = l.slice(i[0].length) || l), s.push(a = [])), o = !1, (i = le.exec(l)) && (o = i.shift(), a.push({
  1311. value: o,
  1312. type: i[0].replace(ae, " ")
  1313. }), l = l.slice(o.length));
  1314. for (r in x.filter) !(i = de[r].exec(l)) || c[r] && !(i = c[r](i)) || (o = i.shift(), a.push({
  1315. value: o,
  1316. type: r,
  1317. matches: i
  1318. }), l = l.slice(o.length));
  1319. if (!o) break
  1320. }
  1321. return n ? l.length : l ? t.error(e) : F(e, s).slice(0)
  1322. }, M = t.compile = function(e, t) {
  1323. var n, o = [],
  1324. i = [],
  1325. a = W[e + " "];
  1326. if (!a) {
  1327. for (t || (t = T(e)), n = t.length; n--;)(a = g(t[n]))[q] ? o.push(a) : i.push(a);
  1328. (a = W(e, v(i, o))).selector = e
  1329. }
  1330. return a
  1331. }, k = t.select = function(e, t, n, o) {
  1332. var i, a, r, l, s, u = "function" == typeof e && e,
  1333. p = !o && T(e = u.selector || e);
  1334. if (n = n || [], 1 === p.length) {
  1335. if ((a = p[0] = p[0].slice(0)).length > 2 && "ID" === (r = a[0]).type && 9 === t.nodeType && L && x.relative[a[1].type]) {
  1336. if (!(t = (x.find.ID(r.matches[0].replace(ge, ve), t) || [])[0])) return n;
  1337. u && (t = t.parentNode), e = e.slice(a.shift().value.length)
  1338. }
  1339. for (i = de.needsContext.test(e) ? 0 : a.length; i-- && (r = a[i], !x.relative[l = r.type]);)
  1340. if ((s = x.find[l]) && (o = s(r.matches[0].replace(ge, ve), me.test(a[0].type) && c(t.parentNode) || t))) {
  1341. if (a.splice(i, 1), !(e = o.length && d(a))) return G.apply(n, o), n;
  1342. break
  1343. }
  1344. }
  1345. return (u || M(e, p))(o, t, !L, n, !t || me.test(e) && c(t.parentNode) || t), n
  1346. }, w.sortStable = q.split("").sort(X).join("") === q, w.detectDuplicates = !!$, A(), w.sortDetached = i(function(e) {
  1347. return 1 & e.compareDocumentPosition(E.createElement("fieldset"))
  1348. }), i(function(e) {
  1349. return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href")
  1350. }) || a("type|href|height|width", function(e, t, n) {
  1351. if (!n) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2)
  1352. }), w.attributes && i(function(e) {
  1353. return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value")
  1354. }) || a("value", function(e, t, n) {
  1355. if (!n && "input" === e.nodeName.toLowerCase()) return e.defaultValue
  1356. }), i(function(e) {
  1357. return null == e.getAttribute("disabled")
  1358. }) || a(J, function(e, t, n) {
  1359. var o;
  1360. if (!n) return !0 === e[t] ? t.toLowerCase() : (o = e.getAttributeNode(t)) && o.specified ? o.value : null
  1361. }), t
  1362. }(e);
  1363. xe.find = je, xe.expr = je.selectors, xe.expr[":"] = xe.expr.pseudos, xe.uniqueSort = xe.unique = je.uniqueSort, xe.text = je.getText, xe.isXMLDoc = je.isXML, xe.contains = je.contains, xe.escapeSelector = je.escape;
  1364. var Te = function(e, t, n) {
  1365. for (var o = [], i = void 0 !== n;
  1366. (e = e[t]) && 9 !== e.nodeType;)
  1367. if (1 === e.nodeType) {
  1368. if (i && xe(e).is(n)) break;
  1369. o.push(e)
  1370. }
  1371. return o
  1372. },
  1373. Me = function(e, t) {
  1374. for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
  1375. return n
  1376. },
  1377. ke = xe.expr.match.needsContext,
  1378. Ce = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
  1379. xe.filter = function(e, t, n) {
  1380. var o = t[0];
  1381. return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === o.nodeType ? xe.find.matchesSelector(o, e) ? [o] : [] : xe.find.matches(e, xe.grep(t, function(e) {
  1382. return 1 === e.nodeType
  1383. }))
  1384. }, xe.fn.extend({
  1385. find: function(e) {
  1386. var t, n, o = this.length,
  1387. i = this;
  1388. if ("string" != typeof e) return this.pushStack(xe(e).filter(function() {
  1389. for (t = 0; t < o; t++)
  1390. if (xe.contains(i[t], this)) return !0
  1391. }));
  1392. for (n = this.pushStack([]), t = 0; t < o; t++) xe.find(e, i[t], n);
  1393. return o > 1 ? xe.uniqueSort(n) : n
  1394. },
  1395. filter: function(e) {
  1396. return this.pushStack(r(this, e || [], !1))
  1397. },
  1398. not: function(e) {
  1399. return this.pushStack(r(this, e || [], !0))
  1400. },
  1401. is: function(e) {
  1402. return !!r(this, "string" == typeof e && ke.test(e) ? xe(e) : e || [], !1).length
  1403. }
  1404. });
  1405. var De, $e = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;
  1406. (xe.fn.init = function(e, t, n) {
  1407. var o, i;
  1408. if (!e) return this;
  1409. if (n = n || De, "string" == typeof e) {
  1410. if (!(o = "<" === e[0] && ">" === e[e.length - 1] && e.length >= 3 ? [null, e, null] : $e.exec(e)) || !o[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e);
  1411. if (o[1]) {
  1412. if (t = t instanceof xe ? t[0] : t, xe.merge(this, xe.parseHTML(o[1], t && t.nodeType ? t.ownerDocument || t : re, !0)), Ce.test(o[1]) && xe.isPlainObject(t))
  1413. for (o in t) ve(this[o]) ? this[o](t[o]) : this.attr(o, t[o]);
  1414. return this
  1415. }
  1416. return (i = re.getElementById(o[2])) && (this[0] = i, this.length = 1), this
  1417. }
  1418. return e.nodeType ? (this[0] = e, this.length = 1, this) : ve(e) ? void 0 !== n.ready ? n.ready(e) : e(xe) : xe.makeArray(e, this)
  1419. }).prototype = xe.fn, De = xe(re);
  1420. var Ae = /^(?:parents|prev(?:Until|All))/,
  1421. Ee = {
  1422. children: !0,
  1423. contents: !0,
  1424. next: !0,
  1425. prev: !0
  1426. };
  1427. xe.fn.extend({
  1428. has: function(e) {
  1429. var t = xe(e, this),
  1430. n = t.length;
  1431. return this.filter(function() {
  1432. for (var e = 0; e < n; e++)
  1433. if (xe.contains(this, t[e])) return !0
  1434. })
  1435. },
  1436. closest: function(e, t) {
  1437. var n, o = 0,
  1438. i = this.length,
  1439. a = [],
  1440. r = "string" != typeof e && xe(e);
  1441. if (!ke.test(e))
  1442. for (; o < i; o++)
  1443. for (n = this[o]; n && n !== t; n = n.parentNode)
  1444. if (n.nodeType < 11 && (r ? r.index(n) > -1 : 1 === n.nodeType && xe.find.matchesSelector(n, e))) {
  1445. a.push(n);
  1446. break
  1447. }
  1448. return this.pushStack(a.length > 1 ? xe.uniqueSort(a) : a)
  1449. },
  1450. index: function(e) {
  1451. return e ? "string" == typeof e ? de.call(xe(e), this[0]) : de.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
  1452. },
  1453. add: function(e, t) {
  1454. return this.pushStack(xe.uniqueSort(xe.merge(this.get(), xe(e, t))))
  1455. },
  1456. addBack: function(e) {
  1457. return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
  1458. }
  1459. }), xe.each({
  1460. parent: function(e) {
  1461. var t = e.parentNode;
  1462. return t && 11 !== t.nodeType ? t : null
  1463. },
  1464. parents: function(e) {
  1465. return Te(e, "parentNode")
  1466. },
  1467. parentsUntil: function(e, t, n) {
  1468. return Te(e, "parentNode", n)
  1469. },
  1470. next: function(e) {
  1471. return l(e, "nextSibling")
  1472. },
  1473. prev: function(e) {
  1474. return l(e, "previousSibling")
  1475. },
  1476. nextAll: function(e) {
  1477. return Te(e, "nextSibling")
  1478. },
  1479. prevAll: function(e) {
  1480. return Te(e, "previousSibling")
  1481. },
  1482. nextUntil: function(e, t, n) {
  1483. return Te(e, "nextSibling", n)
  1484. },
  1485. prevUntil: function(e, t, n) {
  1486. return Te(e, "previousSibling", n)
  1487. },
  1488. siblings: function(e) {
  1489. return Me((e.parentNode || {}).firstChild, e)
  1490. },
  1491. children: function(e) {
  1492. return Me(e.firstChild)
  1493. },
  1494. contents: function(e) {
  1495. return a(e, "iframe") ? e.contentDocument : (a(e, "template") && (e = e.content || e), xe.merge([], e.childNodes))
  1496. }
  1497. }, function(e, t) {
  1498. xe.fn[e] = function(n, o) {
  1499. var i = xe.map(this, t, n);
  1500. return "Until" !== e.slice(-5) && (o = n), o && "string" == typeof o && (i = xe.filter(o, i)), this.length > 1 && (Ee[e] || xe.uniqueSort(i), Ae.test(e) && i.reverse()), this.pushStack(i)
  1501. }
  1502. });
  1503. var Se = /[^\x20\t\r\n\f]+/g;
  1504. xe.Callbacks = function(e) {
  1505. e = "string" == typeof e ? s(e) : xe.extend({}, e);
  1506. var t, n, i, a, r = [],
  1507. l = [],
  1508. c = -1,
  1509. u = function() {
  1510. for (a = a || e.once, i = t = !0; l.length; c = -1)
  1511. for (n = l.shift(); ++c < r.length;) !1 === r[c].apply(n[0], n[1]) && e.stopOnFalse && (c = r.length, n = !1);
  1512. e.memory || (n = !1), t = !1, a && (r = n ? [] : "")
  1513. },
  1514. d = {
  1515. add: function() {
  1516. return r && (n && !t && (c = r.length - 1, l.push(n)), function t(n) {
  1517. xe.each(n, function(n, i) {
  1518. ve(i) ? e.unique && d.has(i) || r.push(i) : i && i.length && "string" !== o(i) && t(i)
  1519. })
  1520. }(arguments), n && !t && u()), this
  1521. },
  1522. remove: function() {
  1523. return xe.each(arguments, function(e, t) {
  1524. for (var n;
  1525. (n = xe.inArray(t, r, n)) > -1;) r.splice(n, 1), n <= c && c--
  1526. }), this
  1527. },
  1528. has: function(e) {
  1529. return e ? xe.inArray(e, r) > -1 : r.length > 0
  1530. },
  1531. empty: function() {
  1532. return r && (r = []), this
  1533. },
  1534. disable: function() {
  1535. return a = l = [], r = n = "", this
  1536. },
  1537. disabled: function() {
  1538. return !r
  1539. },
  1540. lock: function() {
  1541. return a = l = [], n || t || (r = n = ""), this
  1542. },
  1543. locked: function() {
  1544. return !!a
  1545. },
  1546. fireWith: function(e, n) {
  1547. return a || (n = [e, (n = n || []).slice ? n.slice() : n], l.push(n), t || u()), this
  1548. },
  1549. fire: function() {
  1550. return d.fireWith(this, arguments), this
  1551. },
  1552. fired: function() {
  1553. return !!i
  1554. }
  1555. };
  1556. return d
  1557. }, xe.extend({
  1558. Deferred: function(t) {
  1559. var n = [
  1560. ["notify", "progress", xe.Callbacks("memory"), xe.Callbacks("memory"), 2],
  1561. ["resolve", "done", xe.Callbacks("once memory"), xe.Callbacks("once memory"), 0, "resolved"],
  1562. ["reject", "fail", xe.Callbacks("once memory"), xe.Callbacks("once memory"), 1, "rejected"]
  1563. ],
  1564. o = "pending",
  1565. i = {
  1566. state: function() {
  1567. return o
  1568. },
  1569. always: function() {
  1570. return a.done(arguments).fail(arguments), this
  1571. },
  1572. catch: function(e) {
  1573. return i.then(null, e)
  1574. },
  1575. pipe: function() {
  1576. var e = arguments;
  1577. return xe.Deferred(function(t) {
  1578. xe.each(n, function(n, o) {
  1579. var i = ve(e[o[4]]) && e[o[4]];
  1580. a[o[1]](function() {
  1581. var e = i && i.apply(this, arguments);
  1582. e && ve(e.promise) ? e.promise().progress(t.notify).done(t.resolve).fail(t.reject) : t[o[0] + "With"](this, i ? [e] : arguments)
  1583. })
  1584. }), e = null
  1585. }).promise()
  1586. },
  1587. then: function(t, o, i) {
  1588. function a(t, n, o, i) {
  1589. return function() {
  1590. var l = this,
  1591. s = arguments,
  1592. d = function() {
  1593. var e, d;
  1594. if (!(t < r)) {
  1595. if ((e = o.apply(l, s)) === n.promise()) throw new TypeError("Thenable self-resolution");
  1596. d = e && ("object" == typeof e || "function" == typeof e) && e.then, ve(d) ? i ? d.call(e, a(r, n, c, i), a(r, n, u, i)) : (r++, d.call(e, a(r, n, c, i), a(r, n, u, i), a(r, n, c, n.notifyWith))) : (o !== c && (l = void 0, s = [e]), (i || n.resolveWith)(l, s))
  1597. }
  1598. },
  1599. p = i ? d : function() {
  1600. try {
  1601. d()
  1602. } catch (e) {
  1603. xe.Deferred.exceptionHook && xe.Deferred.exceptionHook(e, p.stackTrace), t + 1 >= r && (o !== u && (l = void 0, s = [e]), n.rejectWith(l, s))
  1604. }
  1605. };
  1606. t ? p() : (xe.Deferred.getStackHook && (p.stackTrace = xe.Deferred.getStackHook()), e.setTimeout(p))
  1607. }
  1608. }
  1609. var r = 0;
  1610. return xe.Deferred(function(e) {
  1611. n[0][3].add(a(0, e, ve(i) ? i : c, e.notifyWith)), n[1][3].add(a(0, e, ve(t) ? t : c)), n[2][3].add(a(0, e, ve(o) ? o : u))
  1612. }).promise()
  1613. },
  1614. promise: function(e) {
  1615. return null != e ? xe.extend(e, i) : i
  1616. }
  1617. },
  1618. a = {};
  1619. return xe.each(n, function(e, t) {
  1620. var r = t[2],
  1621. l = t[5];
  1622. i[t[1]] = r.add, l && r.add(function() {
  1623. o = l
  1624. }, n[3 - e][2].disable, n[3 - e][3].disable, n[0][2].lock, n[0][3].lock), r.add(t[3].fire), a[t[0]] = function() {
  1625. return a[t[0] + "With"](this === a ? void 0 : this, arguments), this
  1626. }, a[t[0] + "With"] = r.fireWith
  1627. }), i.promise(a), t && t.call(a, a), a
  1628. },
  1629. when: function(e) {
  1630. var t = arguments.length,
  1631. n = t,
  1632. o = Array(n),
  1633. i = se.call(arguments),
  1634. a = xe.Deferred(),
  1635. r = function(e) {
  1636. return function(n) {
  1637. o[e] = this, i[e] = arguments.length > 1 ? se.call(arguments) : n, --t || a.resolveWith(o, i)
  1638. }
  1639. };
  1640. if (t <= 1 && (d(e, a.done(r(n)).resolve, a.reject, !t), "pending" === a.state() || ve(i[n] && i[n].then))) return a.then();
  1641. for (; n--;) d(i[n], r(n), a.reject);
  1642. return a.promise()
  1643. }
  1644. });
  1645. var Le = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  1646. xe.Deferred.exceptionHook = function(t, n) {
  1647. e.console && e.console.warn && t && Le.test(t.name) && e.console.warn("jQuery.Deferred exception: " + t.message, t.stack, n)
  1648. }, xe.readyException = function(t) {
  1649. e.setTimeout(function() {
  1650. throw t
  1651. })
  1652. };
  1653. var Pe = xe.Deferred();
  1654. xe.fn.ready = function(e) {
  1655. return Pe.then(e).catch(function(e) {
  1656. xe.readyException(e)
  1657. }), this
  1658. }, xe.extend({
  1659. isReady: !1,
  1660. readyWait: 1,
  1661. ready: function(e) {
  1662. (!0 === e ? --xe.readyWait : xe.isReady) || (xe.isReady = !0, !0 !== e && --xe.readyWait > 0 || Pe.resolveWith(re, [xe]))
  1663. }
  1664. }), xe.ready.then = Pe.then, "complete" === re.readyState || "loading" !== re.readyState && !re.documentElement.doScroll ? e.setTimeout(xe.ready) : (re.addEventListener("DOMContentLoaded", p), e.addEventListener("load", p));
  1665. var Ie = function(e, t, n, i, a, r, l) {
  1666. var s = 0,
  1667. c = e.length,
  1668. u = null == n;
  1669. if ("object" === o(n)) {
  1670. a = !0;
  1671. for (s in n) Ie(e, t, s, n[s], !0, r, l)
  1672. } else if (void 0 !== i && (a = !0, ve(i) || (l = !0), u && (l ? (t.call(e, i), t = null) : (u = t, t = function(e, t, n) {
  1673. return u.call(xe(e), n)
  1674. })), t))
  1675. for (; s < c; s++) t(e[s], n, l ? i : i.call(e[s], s, t(e[s], n)));
  1676. return a ? e : u ? t.call(e) : c ? t(e[0], n) : r
  1677. },
  1678. Oe = /^-ms-/,
  1679. Ne = /-([a-z])/g,
  1680. qe = function(e) {
  1681. return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType
  1682. };
  1683. b.uid = 1, b.prototype = {
  1684. cache: function(e) {
  1685. var t = e[this.expando];
  1686. return t || (t = {}, qe(e) && (e.nodeType ? e[this.expando] = t : Object.defineProperty(e, this.expando, {
  1687. value: t,
  1688. configurable: !0
  1689. }))), t
  1690. },
  1691. set: function(e, t, n) {
  1692. var o, i = this.cache(e);
  1693. if ("string" == typeof t) i[f(t)] = n;
  1694. else
  1695. for (o in t) i[f(o)] = t[o];
  1696. return i
  1697. },
  1698. get: function(e, t) {
  1699. return void 0 === t ? this.cache(e) : e[this.expando] && e[this.expando][f(t)]
  1700. },
  1701. access: function(e, t, n) {
  1702. return void 0 === t || t && "string" == typeof t && void 0 === n ? this.get(e, t) : (this.set(e, t, n), void 0 !== n ? n : t)
  1703. },
  1704. remove: function(e, t) {
  1705. var n, o = e[this.expando];
  1706. if (void 0 !== o) {
  1707. if (void 0 !== t) {
  1708. n = (t = Array.isArray(t) ? t.map(f) : (t = f(t)) in o ? [t] : t.match(Se) || []).length;
  1709. for (; n--;) delete o[t[n]]
  1710. }(void 0 === t || xe.isEmptyObject(o)) && (e.nodeType ? e[this.expando] = void 0 : delete e[this.expando])
  1711. }
  1712. },
  1713. hasData: function(e) {
  1714. var t = e[this.expando];
  1715. return void 0 !== t && !xe.isEmptyObject(t)
  1716. }
  1717. };
  1718. var Re = new b,
  1719. He = new b,
  1720. Ue = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  1721. Be = /[A-Z]/g;
  1722. xe.extend({
  1723. hasData: function(e) {
  1724. return He.hasData(e) || Re.hasData(e)
  1725. },
  1726. data: function(e, t, n) {
  1727. return He.access(e, t, n)
  1728. },
  1729. removeData: function(e, t) {
  1730. He.remove(e, t)
  1731. },
  1732. _data: function(e, t, n) {
  1733. return Re.access(e, t, n)
  1734. },
  1735. _removeData: function(e, t) {
  1736. Re.remove(e, t)
  1737. }
  1738. }), xe.fn.extend({
  1739. data: function(e, t) {
  1740. var n, o, i, a = this[0],
  1741. r = a && a.attributes;
  1742. if (void 0 === e) {
  1743. if (this.length && (i = He.get(a), 1 === a.nodeType && !Re.get(a, "hasDataAttrs"))) {
  1744. for (n = r.length; n--;) r[n] && 0 === (o = r[n].name).indexOf("data-") && (o = f(o.slice(5)), g(a, o, i[o]));
  1745. Re.set(a, "hasDataAttrs", !0)
  1746. }
  1747. return i
  1748. }
  1749. return "object" == typeof e ? this.each(function() {
  1750. He.set(this, e)
  1751. }) : Ie(this, function(t) {
  1752. var n;
  1753. if (a && void 0 === t) {
  1754. if (void 0 !== (n = He.get(a, e))) return n;
  1755. if (void 0 !== (n = g(a, e))) return n
  1756. } else this.each(function() {
  1757. He.set(this, e, t)
  1758. })
  1759. }, null, t, arguments.length > 1, null, !0)
  1760. },
  1761. removeData: function(e) {
  1762. return this.each(function() {
  1763. He.remove(this, e)
  1764. })
  1765. }
  1766. }), xe.extend({
  1767. queue: function(e, t, n) {
  1768. var o;
  1769. if (e) return t = (t || "fx") + "queue", o = Re.get(e, t), n && (!o || Array.isArray(n) ? o = Re.access(e, t, xe.makeArray(n)) : o.push(n)), o || []
  1770. },
  1771. dequeue: function(e, t) {
  1772. t = t || "fx";
  1773. var n = xe.queue(e, t),
  1774. o = n.length,
  1775. i = n.shift(),
  1776. a = xe._queueHooks(e, t),
  1777. r = function() {
  1778. xe.dequeue(e, t)
  1779. };
  1780. "inprogress" === i && (i = n.shift(), o--), i && ("fx" === t && n.unshift("inprogress"), delete a.stop, i.call(e, r, a)), !o && a && a.empty.fire()
  1781. },
  1782. _queueHooks: function(e, t) {
  1783. var n = t + "queueHooks";
  1784. return Re.get(e, n) || Re.access(e, n, {
  1785. empty: xe.Callbacks("once memory").add(function() {
  1786. Re.remove(e, [t + "queue", n])
  1787. })
  1788. })
  1789. }
  1790. }), xe.fn.extend({
  1791. queue: function(e, t) {
  1792. var n = 2;
  1793. return "string" != typeof e && (t = e, e = "fx", n--), arguments.length < n ? xe.queue(this[0], e) : void 0 === t ? this : this.each(function() {
  1794. var n = xe.queue(this, e, t);
  1795. xe._queueHooks(this, e), "fx" === e && "inprogress" !== n[0] && xe.dequeue(this, e)
  1796. })
  1797. },
  1798. dequeue: function(e) {
  1799. return this.each(function() {
  1800. xe.dequeue(this, e)
  1801. })
  1802. },
  1803. clearQueue: function(e) {
  1804. return this.queue(e || "fx", [])
  1805. },
  1806. promise: function(e, t) {
  1807. var n, o = 1,
  1808. i = xe.Deferred(),
  1809. a = this,
  1810. r = this.length,
  1811. l = function() {
  1812. --o || i.resolveWith(a, [a])
  1813. };
  1814. for ("string" != typeof e && (t = e, e = void 0), e = e || "fx"; r--;)(n = Re.get(a[r], e + "queueHooks")) && n.empty && (o++, n.empty.add(l));
  1815. return l(), i.promise(t)
  1816. }
  1817. });
  1818. var Fe = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
  1819. We = new RegExp("^(?:([+-])=|)(" + Fe + ")([a-z%]*)$", "i"),
  1820. Xe = ["Top", "Right", "Bottom", "Left"],
  1821. ze = function(e, t) {
  1822. return "none" === (e = t || e).style.display || "" === e.style.display && xe.contains(e.ownerDocument, e) && "none" === xe.css(e, "display")
  1823. },
  1824. Ye = function(e, t, n, o) {
  1825. var i, a, r = {};
  1826. for (a in t) r[a] = e.style[a], e.style[a] = t[a];
  1827. i = n.apply(e, o || []);
  1828. for (a in t) e.style[a] = r[a];
  1829. return i
  1830. },
  1831. Ke = {};
  1832. xe.fn.extend({
  1833. show: function() {
  1834. return w(this, !0)
  1835. },
  1836. hide: function() {
  1837. return w(this)
  1838. },
  1839. toggle: function(e) {
  1840. return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function() {
  1841. ze(this) ? xe(this).show() : xe(this).hide()
  1842. })
  1843. }
  1844. });
  1845. var Ve = /^(?:checkbox|radio)$/i,
  1846. Ge = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i,
  1847. Qe = /^$|^module$|\/(?:java|ecma)script/i,
  1848. Ze = {
  1849. option: [1, "<select multiple='multiple'>", "</select>"],
  1850. thead: [1, "<table>", "</table>"],
  1851. col: [2, "<table><colgroup>", "</colgroup></table>"],
  1852. tr: [2, "<table><tbody>", "</tbody></table>"],
  1853. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  1854. _default: [0, "", ""]
  1855. };
  1856. Ze.optgroup = Ze.option, Ze.tbody = Ze.tfoot = Ze.colgroup = Ze.caption = Ze.thead, Ze.th = Ze.td;
  1857. var Je = /<|&#?\w+;/;
  1858. ! function() {
  1859. var e = re.createDocumentFragment().appendChild(re.createElement("div")),
  1860. t = re.createElement("input");
  1861. t.setAttribute("type", "radio"), t.setAttribute("checked", "checked"), t.setAttribute("name", "t"), e.appendChild(t), ge.checkClone = e.cloneNode(!0).cloneNode(!0).lastChild.checked, e.innerHTML = "<textarea>x</textarea>", ge.noCloneChecked = !!e.cloneNode(!0).lastChild.defaultValue
  1862. }();
  1863. var et = re.documentElement,
  1864. tt = /^key/,
  1865. nt = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  1866. ot = /^([^.]*)(?:\.(.+)|)/;
  1867. xe.event = {
  1868. global: {},
  1869. add: function(e, t, n, o, i) {
  1870. var a, r, l, s, c, u, d, p, h, f, b, m = Re.get(e);
  1871. if (m)
  1872. for (n.handler && (n = (a = n).handler, i = a.selector), i && xe.find.matchesSelector(et, i), n.guid || (n.guid = xe.guid++), (s = m.events) || (s = m.events = {}), (r = m.handle) || (r = m.handle = function(t) {
  1873. return void 0 !== xe && xe.event.triggered !== t.type ? xe.event.dispatch.apply(e, arguments) : void 0
  1874. }), c = (t = (t || "").match(Se) || [""]).length; c--;) h = b = (l = ot.exec(t[c]) || [])[1], f = (l[2] || "").split(".").sort(), h && (d = xe.event.special[h] || {}, h = (i ? d.delegateType : d.bindType) || h, d = xe.event.special[h] || {}, u = xe.extend({
  1875. type: h,
  1876. origType: b,
  1877. data: o,
  1878. handler: n,
  1879. guid: n.guid,
  1880. selector: i,
  1881. needsContext: i && xe.expr.match.needsContext.test(i),
  1882. namespace: f.join(".")
  1883. }, a), (p = s[h]) || ((p = s[h] = []).delegateCount = 0, d.setup && !1 !== d.setup.call(e, o, f, r) || e.addEventListener && e.addEventListener(h, r)), d.add && (d.add.call(e, u), u.handler.guid || (u.handler.guid = n.guid)), i ? p.splice(p.delegateCount++, 0, u) : p.push(u), xe.event.global[h] = !0)
  1884. },
  1885. remove: function(e, t, n, o, i) {
  1886. var a, r, l, s, c, u, d, p, h, f, b, m = Re.hasData(e) && Re.get(e);
  1887. if (m && (s = m.events)) {
  1888. for (c = (t = (t || "").match(Se) || [""]).length; c--;)
  1889. if (l = ot.exec(t[c]) || [], h = b = l[1], f = (l[2] || "").split(".").sort(), h) {
  1890. for (d = xe.event.special[h] || {}, p = s[h = (o ? d.delegateType : d.bindType) || h] || [], l = l[2] && new RegExp("(^|\\.)" + f.join("\\.(?:.*\\.|)") + "(\\.|$)"), r = a = p.length; a--;) u = p[a], !i && b !== u.origType || n && n.guid !== u.guid || l && !l.test(u.namespace) || o && o !== u.selector && ("**" !== o || !u.selector) || (p.splice(a, 1), u.selector && p.delegateCount--, d.remove && d.remove.call(e, u));
  1891. r && !p.length && (d.teardown && !1 !== d.teardown.call(e, f, m.handle) || xe.removeEvent(e, h, m.handle), delete s[h])
  1892. } else
  1893. for (h in s) xe.event.remove(e, h + t[c], n, o, !0);
  1894. xe.isEmptyObject(s) && Re.remove(e, "handle events")
  1895. }
  1896. },
  1897. dispatch: function(e) {
  1898. var t, n, o, i, a, r, l = xe.event.fix(e),
  1899. s = new Array(arguments.length),
  1900. c = (Re.get(this, "events") || {})[l.type] || [],
  1901. u = xe.event.special[l.type] || {};
  1902. for (s[0] = l, t = 1; t < arguments.length; t++) s[t] = arguments[t];
  1903. if (l.delegateTarget = this, !u.preDispatch || !1 !== u.preDispatch.call(this, l)) {
  1904. for (r = xe.event.handlers.call(this, l, c), t = 0;
  1905. (i = r[t++]) && !l.isPropagationStopped();)
  1906. for (l.currentTarget = i.elem, n = 0;
  1907. (a = i.handlers[n++]) && !l.isImmediatePropagationStopped();) l.rnamespace && !l.rnamespace.test(a.namespace) || (l.handleObj = a, l.data = a.data, void 0 !== (o = ((xe.event.special[a.origType] || {}).handle || a.handler).apply(i.elem, s)) && !1 === (l.result = o) && (l.preventDefault(), l.stopPropagation()));
  1908. return u.postDispatch && u.postDispatch.call(this, l), l.result
  1909. }
  1910. },
  1911. handlers: function(e, t) {
  1912. var n, o, i, a, r, l = [],
  1913. s = t.delegateCount,
  1914. c = e.target;
  1915. if (s && c.nodeType && !("click" === e.type && e.button >= 1))
  1916. for (; c !== this; c = c.parentNode || this)
  1917. if (1 === c.nodeType && ("click" !== e.type || !0 !== c.disabled)) {
  1918. for (a = [], r = {}, n = 0; n < s; n++) void 0 === r[i = (o = t[n]).selector + " "] && (r[i] = o.needsContext ? xe(i, this).index(c) > -1 : xe.find(i, this, null, [c]).length), r[i] && a.push(o);
  1919. a.length && l.push({
  1920. elem: c,
  1921. handlers: a
  1922. })
  1923. }
  1924. return c = this, s < t.length && l.push({
  1925. elem: c,
  1926. handlers: t.slice(s)
  1927. }), l
  1928. },
  1929. addProp: function(e, t) {
  1930. Object.defineProperty(xe.Event.prototype, e, {
  1931. enumerable: !0,
  1932. configurable: !0,
  1933. get: ve(t) ? function() {
  1934. if (this.originalEvent) return t(this.originalEvent)
  1935. } : function() {
  1936. if (this.originalEvent) return this.originalEvent[e]
  1937. },
  1938. set: function(t) {
  1939. Object.defineProperty(this, e, {
  1940. enumerable: !0,
  1941. configurable: !0,
  1942. writable: !0,
  1943. value: t
  1944. })
  1945. }
  1946. })
  1947. },
  1948. fix: function(e) {
  1949. return e[xe.expando] ? e : new xe.Event(e)
  1950. },
  1951. special: {
  1952. load: {
  1953. noBubble: !0
  1954. },
  1955. focus: {
  1956. trigger: function() {
  1957. if (this !== k() && this.focus) return this.focus(), !1
  1958. },
  1959. delegateType: "focusin"
  1960. },
  1961. blur: {
  1962. trigger: function() {
  1963. if (this === k() && this.blur) return this.blur(), !1
  1964. },
  1965. delegateType: "focusout"
  1966. },
  1967. click: {
  1968. trigger: function() {
  1969. if ("checkbox" === this.type && this.click && a(this, "input")) return this.click(), !1
  1970. },
  1971. _default: function(e) {
  1972. return a(e.target, "a")
  1973. }
  1974. },
  1975. beforeunload: {
  1976. postDispatch: function(e) {
  1977. void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result)
  1978. }
  1979. }
  1980. }
  1981. }, xe.removeEvent = function(e, t, n) {
  1982. e.removeEventListener && e.removeEventListener(t, n)
  1983. }, xe.Event = function(e, t) {
  1984. if (!(this instanceof xe.Event)) return new xe.Event(e, t);
  1985. e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? T : M, this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget) : this.type = e, t && xe.extend(this, t), this.timeStamp = e && e.timeStamp || Date.now(), this[xe.expando] = !0
  1986. }, xe.Event.prototype = {
  1987. constructor: xe.Event,
  1988. isDefaultPrevented: M,
  1989. isPropagationStopped: M,
  1990. isImmediatePropagationStopped: M,
  1991. isSimulated: !1,
  1992. preventDefault: function() {
  1993. var e = this.originalEvent;
  1994. this.isDefaultPrevented = T, e && !this.isSimulated && e.preventDefault()
  1995. },
  1996. stopPropagation: function() {
  1997. var e = this.originalEvent;
  1998. this.isPropagationStopped = T, e && !this.isSimulated && e.stopPropagation()
  1999. },
  2000. stopImmediatePropagation: function() {
  2001. var e = this.originalEvent;
  2002. this.isImmediatePropagationStopped = T, e && !this.isSimulated && e.stopImmediatePropagation(), this.stopPropagation()
  2003. }
  2004. }, xe.each({
  2005. altKey: !0,
  2006. bubbles: !0,
  2007. cancelable: !0,
  2008. changedTouches: !0,
  2009. ctrlKey: !0,
  2010. detail: !0,
  2011. eventPhase: !0,
  2012. metaKey: !0,
  2013. pageX: !0,
  2014. pageY: !0,
  2015. shiftKey: !0,
  2016. view: !0,
  2017. char: !0,
  2018. charCode: !0,
  2019. key: !0,
  2020. keyCode: !0,
  2021. button: !0,
  2022. buttons: !0,
  2023. clientX: !0,
  2024. clientY: !0,
  2025. offsetX: !0,
  2026. offsetY: !0,
  2027. pointerId: !0,
  2028. pointerType: !0,
  2029. screenX: !0,
  2030. screenY: !0,
  2031. targetTouches: !0,
  2032. toElement: !0,
  2033. touches: !0,
  2034. which: function(e) {
  2035. var t = e.button;
  2036. return null == e.which && tt.test(e.type) ? null != e.charCode ? e.charCode : e.keyCode : !e.which && void 0 !== t && nt.test(e.type) ? 1 & t ? 1 : 2 & t ? 3 : 4 & t ? 2 : 0 : e.which
  2037. }
  2038. }, xe.event.addProp), xe.each({
  2039. mouseenter: "mouseover",
  2040. mouseleave: "mouseout",
  2041. pointerenter: "pointerover",
  2042. pointerleave: "pointerout"
  2043. }, function(e, t) {
  2044. xe.event.special[e] = {
  2045. delegateType: t,
  2046. bindType: t,
  2047. handle: function(e) {
  2048. var n, o = this,
  2049. i = e.relatedTarget,
  2050. a = e.handleObj;
  2051. return i && (i === o || xe.contains(o, i)) || (e.type = a.origType, n = a.handler.apply(this, arguments), e.type = t), n
  2052. }
  2053. }
  2054. }), xe.fn.extend({
  2055. on: function(e, t, n, o) {
  2056. return C(this, e, t, n, o)
  2057. },
  2058. one: function(e, t, n, o) {
  2059. return C(this, e, t, n, o, 1)
  2060. },
  2061. off: function(e, t, n) {
  2062. var o, i;
  2063. if (e && e.preventDefault && e.handleObj) return o = e.handleObj, xe(e.delegateTarget).off(o.namespace ? o.origType + "." + o.namespace : o.origType, o.selector, o.handler), this;
  2064. if ("object" == typeof e) {
  2065. for (i in e) this.off(i, t, e[i]);
  2066. return this
  2067. }
  2068. return !1 !== t && "function" != typeof t || (n = t, t = void 0), !1 === n && (n = M), this.each(function() {
  2069. xe.event.remove(this, e, n, t)
  2070. })
  2071. }
  2072. });
  2073. var it = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
  2074. at = /<script|<style|<link/i,
  2075. rt = /checked\s*(?:[^=]|=\s*.checked.)/i,
  2076. lt = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  2077. xe.extend({
  2078. htmlPrefilter: function(e) {
  2079. return e.replace(it, "<$1></$2>")
  2080. },
  2081. clone: function(e, t, n) {
  2082. var o, i, a, r, l = e.cloneNode(!0),
  2083. s = xe.contains(e.ownerDocument, e);
  2084. if (!(ge.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || xe.isXMLDoc(e)))
  2085. for (r = x(l), o = 0, i = (a = x(e)).length; o < i; o++) S(a[o], r[o]);
  2086. if (t)
  2087. if (n)
  2088. for (a = a || x(e), r = r || x(l), o = 0, i = a.length; o < i; o++) E(a[o], r[o]);
  2089. else E(e, l);
  2090. return (r = x(l, "script")).length > 0 && _(r, !s && x(e, "script")), l
  2091. },
  2092. cleanData: function(e) {
  2093. for (var t, n, o, i = xe.event.special, a = 0; void 0 !== (n = e[a]); a++)
  2094. if (qe(n)) {
  2095. if (t = n[Re.expando]) {
  2096. if (t.events)
  2097. for (o in t.events) i[o] ? xe.event.remove(n, o) : xe.removeEvent(n, o, t.handle);
  2098. n[Re.expando] = void 0
  2099. }
  2100. n[He.expando] && (n[He.expando] = void 0)
  2101. }
  2102. }
  2103. }), xe.fn.extend({
  2104. detach: function(e) {
  2105. return P(this, e, !0)
  2106. },
  2107. remove: function(e) {
  2108. return P(this, e)
  2109. },
  2110. text: function(e) {
  2111. return Ie(this, function(e) {
  2112. return void 0 === e ? xe.text(this) : this.empty().each(function() {
  2113. 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = e)
  2114. })
  2115. }, null, e, arguments.length)
  2116. },
  2117. append: function() {
  2118. return L(this, arguments, function(e) {
  2119. 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || D(this, e).appendChild(e)
  2120. })
  2121. },
  2122. prepend: function() {
  2123. return L(this, arguments, function(e) {
  2124. if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
  2125. var t = D(this, e);
  2126. t.insertBefore(e, t.firstChild)
  2127. }
  2128. })
  2129. },
  2130. before: function() {
  2131. return L(this, arguments, function(e) {
  2132. this.parentNode && this.parentNode.insertBefore(e, this)
  2133. })
  2134. },
  2135. after: function() {
  2136. return L(this, arguments, function(e) {
  2137. this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
  2138. })
  2139. },
  2140. empty: function() {
  2141. for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (xe.cleanData(x(e, !1)), e.textContent = "");
  2142. return this
  2143. },
  2144. clone: function(e, t) {
  2145. return e = null != e && e, t = null == t ? e : t, this.map(function() {
  2146. return xe.clone(this, e, t)
  2147. })
  2148. },
  2149. html: function(e) {
  2150. return Ie(this, function(e) {
  2151. var t = this[0] || {},
  2152. n = 0,
  2153. o = this.length;
  2154. if (void 0 === e && 1 === t.nodeType) return t.innerHTML;
  2155. if ("string" == typeof e && !at.test(e) && !Ze[(Ge.exec(e) || ["", ""])[1].toLowerCase()]) {
  2156. e = xe.htmlPrefilter(e);
  2157. try {
  2158. for (; n < o; n++) 1 === (t = this[n] || {}).nodeType && (xe.cleanData(x(t, !1)), t.innerHTML = e);
  2159. t = 0
  2160. } catch (e) {}
  2161. }
  2162. t && this.empty().append(e)
  2163. }, null, e, arguments.length)
  2164. },
  2165. replaceWith: function() {
  2166. var e = [];
  2167. return L(this, arguments, function(t) {
  2168. var n = this.parentNode;
  2169. xe.inArray(this, e) < 0 && (xe.cleanData(x(this)), n && n.replaceChild(t, this))
  2170. }, e)
  2171. }
  2172. }), xe.each({
  2173. appendTo: "append",
  2174. prependTo: "prepend",
  2175. insertBefore: "before",
  2176. insertAfter: "after",
  2177. replaceAll: "replaceWith"
  2178. }, function(e, t) {
  2179. xe.fn[e] = function(e) {
  2180. for (var n, o = [], i = xe(e), a = i.length - 1, r = 0; r <= a; r++) n = r === a ? this : this.clone(!0), xe(i[r])[t](n), ue.apply(o, n.get());
  2181. return this.pushStack(o)
  2182. }
  2183. });
  2184. var st = new RegExp("^(" + Fe + ")(?!px)[a-z%]+$", "i"),
  2185. ct = function(t) {
  2186. var n = t.ownerDocument.defaultView;
  2187. return n && n.opener || (n = e), n.getComputedStyle(t)
  2188. },
  2189. ut = new RegExp(Xe.join("|"), "i");
  2190. ! function() {
  2191. function t() {
  2192. if (c) {
  2193. s.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", c.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", et.appendChild(s).appendChild(c);
  2194. var t = e.getComputedStyle(c);
  2195. o = "1%" !== t.top, l = 12 === n(t.marginLeft), c.style.right = "60%", r = 36 === n(t.right), i = 36 === n(t.width), c.style.position = "absolute", a = 36 === c.offsetWidth || "absolute", et.removeChild(s), c = null
  2196. }
  2197. }
  2198.  
  2199. function n(e) {
  2200. return Math.round(parseFloat(e))
  2201. }
  2202. var o, i, a, r, l, s = re.createElement("div"),
  2203. c = re.createElement("div");
  2204. c.style && (c.style.backgroundClip = "content-box", c.cloneNode(!0).style.backgroundClip = "", ge.clearCloneStyle = "content-box" === c.style.backgroundClip, xe.extend(ge, {
  2205. boxSizingReliable: function() {
  2206. return t(), i
  2207. },
  2208. pixelBoxStyles: function() {
  2209. return t(), r
  2210. },
  2211. pixelPosition: function() {
  2212. return t(), o
  2213. },
  2214. reliableMarginLeft: function() {
  2215. return t(), l
  2216. },
  2217. scrollboxSize: function() {
  2218. return t(), a
  2219. }
  2220. }))
  2221. }();
  2222. var dt = /^(none|table(?!-c[ea]).+)/,
  2223. pt = /^--/,
  2224. ht = {
  2225. position: "absolute",
  2226. visibility: "hidden",
  2227. display: "block"
  2228. },
  2229. ft = {
  2230. letterSpacing: "0",
  2231. fontWeight: "400"
  2232. },
  2233. bt = ["Webkit", "Moz", "ms"],
  2234. mt = re.createElement("div").style;
  2235. xe.extend({
  2236. cssHooks: {
  2237. opacity: {
  2238. get: function(e, t) {
  2239. if (t) {
  2240. var n = I(e, "opacity");
  2241. return "" === n ? "1" : n
  2242. }
  2243. }
  2244. }
  2245. },
  2246. cssNumber: {
  2247. animationIterationCount: !0,
  2248. columnCount: !0,
  2249. fillOpacity: !0,
  2250. flexGrow: !0,
  2251. flexShrink: !0,
  2252. fontWeight: !0,
  2253. lineHeight: !0,
  2254. opacity: !0,
  2255. order: !0,
  2256. orphans: !0,
  2257. widows: !0,
  2258. zIndex: !0,
  2259. zoom: !0
  2260. },
  2261. cssProps: {},
  2262. style: function(e, t, n, o) {
  2263. if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
  2264. var i, a, r, l = f(t),
  2265. s = pt.test(t),
  2266. c = e.style;
  2267. if (s || (t = q(l)), r = xe.cssHooks[t] || xe.cssHooks[l], void 0 === n) return r && "get" in r && void 0 !== (i = r.get(e, !1, o)) ? i : c[t];
  2268. "string" == (a = typeof n) && (i = We.exec(n)) && i[1] && (n = v(e, t, i), a = "number"), null != n && n === n && ("number" === a && (n += i && i[3] || (xe.cssNumber[l] ? "" : "px")), ge.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (c[t] = "inherit"), r && "set" in r && void 0 === (n = r.set(e, n, o)) || (s ? c.setProperty(t, n) : c[t] = n))
  2269. }
  2270. },
  2271. css: function(e, t, n, o) {
  2272. var i, a, r, l = f(t);
  2273. return pt.test(t) || (t = q(l)), (r = xe.cssHooks[t] || xe.cssHooks[l]) && "get" in r && (i = r.get(e, !0, n)), void 0 === i && (i = I(e, t, o)), "normal" === i && t in ft && (i = ft[t]), "" === n || n ? (a = parseFloat(i), !0 === n || isFinite(a) ? a || 0 : i) : i
  2274. }
  2275. }), xe.each(["height", "width"], function(e, t) {
  2276. xe.cssHooks[t] = {
  2277. get: function(e, n, o) {
  2278. if (n) return !dt.test(xe.css(e, "display")) || e.getClientRects().length && e.getBoundingClientRect().width ? U(e, t, o) : Ye(e, ht, function() {
  2279. return U(e, t, o)
  2280. })
  2281. },
  2282. set: function(e, n, o) {
  2283. var i, a = ct(e),
  2284. r = "border-box" === xe.css(e, "boxSizing", !1, a),
  2285. l = o && H(e, t, o, r, a);
  2286. return r && ge.scrollboxSize() === a.position && (l -= Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - parseFloat(a[t]) - H(e, t, "border", !1, a) - .5)), l && (i = We.exec(n)) && "px" !== (i[3] || "px") && (e.style[t] = n, n = xe.css(e, t)), R(e, n, l)
  2287. }
  2288. }
  2289. }), xe.cssHooks.marginLeft = O(ge.reliableMarginLeft, function(e, t) {
  2290. if (t) return (parseFloat(I(e, "marginLeft")) || e.getBoundingClientRect().left - Ye(e, {
  2291. marginLeft: 0
  2292. }, function() {
  2293. return e.getBoundingClientRect().left
  2294. })) + "px"
  2295. }), xe.each({
  2296. margin: "",
  2297. padding: "",
  2298. border: "Width"
  2299. }, function(e, t) {
  2300. xe.cssHooks[e + t] = {
  2301. expand: function(n) {
  2302. for (var o = 0, i = {}, a = "string" == typeof n ? n.split(" ") : [n]; o < 4; o++) i[e + Xe[o] + t] = a[o] || a[o - 2] || a[0];
  2303. return i
  2304. }
  2305. }, "margin" !== e && (xe.cssHooks[e + t].set = R)
  2306. }), xe.fn.extend({
  2307. css: function(e, t) {
  2308. return Ie(this, function(e, t, n) {
  2309. var o, i, a = {},
  2310. r = 0;
  2311. if (Array.isArray(t)) {
  2312. for (o = ct(e), i = t.length; r < i; r++) a[t[r]] = xe.css(e, t[r], !1, o);
  2313. return a
  2314. }
  2315. return void 0 !== n ? xe.style(e, t, n) : xe.css(e, t)
  2316. }, e, t, arguments.length > 1)
  2317. }
  2318. }), xe.Tween = B, B.prototype = {
  2319. constructor: B,
  2320. init: function(e, t, n, o, i, a) {
  2321. this.elem = e, this.prop = n, this.easing = i || xe.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = o, this.unit = a || (xe.cssNumber[n] ? "" : "px")
  2322. },
  2323. cur: function() {
  2324. var e = B.propHooks[this.prop];
  2325. return e && e.get ? e.get(this) : B.propHooks._default.get(this)
  2326. },
  2327. run: function(e) {
  2328. var t, n = B.propHooks[this.prop];
  2329. return this.options.duration ? this.pos = t = xe.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = 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) : B.propHooks._default.set(this), this
  2330. }
  2331. }, B.prototype.init.prototype = B.prototype, B.propHooks = {
  2332. _default: {
  2333. get: function(e) {
  2334. var t;
  2335. return 1 !== e.elem.nodeType || null != e.elem[e.prop] && null == e.elem.style[e.prop] ? e.elem[e.prop] : (t = xe.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0
  2336. },
  2337. set: function(e) {
  2338. xe.fx.step[e.prop] ? xe.fx.step[e.prop](e) : 1 !== e.elem.nodeType || null == e.elem.style[xe.cssProps[e.prop]] && !xe.cssHooks[e.prop] ? e.elem[e.prop] = e.now : xe.style(e.elem, e.prop, e.now + e.unit)
  2339. }
  2340. }
  2341. }, B.propHooks.scrollTop = B.propHooks.scrollLeft = {
  2342. set: function(e) {
  2343. e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
  2344. }
  2345. }, xe.easing = {
  2346. linear: function(e) {
  2347. return e
  2348. },
  2349. swing: function(e) {
  2350. return .5 - Math.cos(e * Math.PI) / 2
  2351. },
  2352. _default: "swing"
  2353. }, xe.fx = B.prototype.init, xe.fx.step = {};
  2354. var gt, vt, yt = /^(?:toggle|show|hide)$/,
  2355. wt = /queueHooks$/;
  2356. xe.Animation = xe.extend(V, {
  2357. tweeners: {
  2358. "*": [function(e, t) {
  2359. var n = this.createTween(e, t);
  2360. return v(n.elem, e, We.exec(t), n), n
  2361. }]
  2362. },
  2363. tweener: function(e, t) {
  2364. ve(e) ? (t = e, e = ["*"]) : e = e.match(Se);
  2365. for (var n, o = 0, i = e.length; o < i; o++) n = e[o], V.tweeners[n] = V.tweeners[n] || [], V.tweeners[n].unshift(t)
  2366. },
  2367. prefilters: [Y],
  2368. prefilter: function(e, t) {
  2369. t ? V.prefilters.unshift(e) : V.prefilters.push(e)
  2370. }
  2371. }), xe.speed = function(e, t, n) {
  2372. var o = e && "object" == typeof e ? xe.extend({}, e) : {
  2373. complete: n || !n && t || ve(e) && e,
  2374. duration: e,
  2375. easing: n && t || t && !ve(t) && t
  2376. };
  2377. return xe.fx.off ? o.duration = 0 : "number" != typeof o.duration && (o.duration in xe.fx.speeds ? o.duration = xe.fx.speeds[o.duration] : o.duration = xe.fx.speeds._default), null != o.queue && !0 !== o.queue || (o.queue = "fx"), o.old = o.complete, o.complete = function() {
  2378. ve(o.old) && o.old.call(this), o.queue && xe.dequeue(this, o.queue)
  2379. }, o
  2380. }, xe.fn.extend({
  2381. fadeTo: function(e, t, n, o) {
  2382. return this.filter(ze).css("opacity", 0).show().end().animate({
  2383. opacity: t
  2384. }, e, n, o)
  2385. },
  2386. animate: function(e, t, n, o) {
  2387. var i = xe.isEmptyObject(e),
  2388. a = xe.speed(t, n, o),
  2389. r = function() {
  2390. var t = V(this, xe.extend({}, e), a);
  2391. (i || Re.get(this, "finish")) && t.stop(!0)
  2392. };
  2393. return r.finish = r, i || !1 === a.queue ? this.each(r) : this.queue(a.queue, r)
  2394. },
  2395. stop: function(e, t, n) {
  2396. var o = function(e) {
  2397. var t = e.stop;
  2398. delete e.stop, t(n)
  2399. };
  2400. return "string" != typeof e && (n = t, t = e, e = void 0), t && !1 !== e && this.queue(e || "fx", []), this.each(function() {
  2401. var t = !0,
  2402. i = null != e && e + "queueHooks",
  2403. a = xe.timers,
  2404. r = Re.get(this);
  2405. if (i) r[i] && r[i].stop && o(r[i]);
  2406. else
  2407. for (i in r) r[i] && r[i].stop && wt.test(i) && o(r[i]);
  2408. for (i = a.length; i--;) a[i].elem !== this || null != e && a[i].queue !== e || (a[i].anim.stop(n), t = !1, a.splice(i, 1));
  2409. !t && n || xe.dequeue(this, e)
  2410. })
  2411. },
  2412. finish: function(e) {
  2413. return !1 !== e && (e = e || "fx"), this.each(function() {
  2414. var t, n = Re.get(this),
  2415. o = n[e + "queue"],
  2416. i = n[e + "queueHooks"],
  2417. a = xe.timers,
  2418. r = o ? o.length : 0;
  2419. for (n.finish = !0, xe.queue(this, e, []), i && i.stop && i.stop.call(this, !0), t = a.length; t--;) a[t].elem === this && a[t].queue === e && (a[t].anim.stop(!0), a.splice(t, 1));
  2420. for (t = 0; t < r; t++) o[t] && o[t].finish && o[t].finish.call(this);
  2421. delete n.finish
  2422. })
  2423. }
  2424. }), xe.each(["toggle", "show", "hide"], function(e, t) {
  2425. var n = xe.fn[t];
  2426. xe.fn[t] = function(e, o, i) {
  2427. return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(X(t, !0), e, o, i)
  2428. }
  2429. }), xe.each({
  2430. slideDown: X("show"),
  2431. slideUp: X("hide"),
  2432. slideToggle: X("toggle"),
  2433. fadeIn: {
  2434. opacity: "show"
  2435. },
  2436. fadeOut: {
  2437. opacity: "hide"
  2438. },
  2439. fadeToggle: {
  2440. opacity: "toggle"
  2441. }
  2442. }, function(e, t) {
  2443. xe.fn[e] = function(e, n, o) {
  2444. return this.animate(t, e, n, o)
  2445. }
  2446. }), xe.timers = [], xe.fx.tick = function() {
  2447. var e, t = 0,
  2448. n = xe.timers;
  2449. for (gt = Date.now(); t < n.length; t++)(e = n[t])() || n[t] !== e || n.splice(t--, 1);
  2450. n.length || xe.fx.stop(), gt = void 0
  2451. }, xe.fx.timer = function(e) {
  2452. xe.timers.push(e), xe.fx.start()
  2453. }, xe.fx.interval = 13, xe.fx.start = function() {
  2454. vt || (vt = !0, F())
  2455. }, xe.fx.stop = function() {
  2456. vt = null
  2457. }, xe.fx.speeds = {
  2458. slow: 600,
  2459. fast: 200,
  2460. _default: 400
  2461. }, xe.fn.delay = function(t, n) {
  2462. return t = xe.fx ? xe.fx.speeds[t] || t : t, n = n || "fx", this.queue(n, function(n, o) {
  2463. var i = e.setTimeout(n, t);
  2464. o.stop = function() {
  2465. e.clearTimeout(i)
  2466. }
  2467. })
  2468. },
  2469. function() {
  2470. var e = re.createElement("input"),
  2471. t = re.createElement("select").appendChild(re.createElement("option"));
  2472. e.type = "checkbox", ge.checkOn = "" !== e.value, ge.optSelected = t.selected, (e = re.createElement("input")).value = "t", e.type = "radio", ge.radioValue = "t" === e.value
  2473. }();
  2474. var xt, _t = xe.expr.attrHandle;
  2475. xe.fn.extend({
  2476. attr: function(e, t) {
  2477. return Ie(this, xe.attr, e, t, arguments.length > 1)
  2478. },
  2479. removeAttr: function(e) {
  2480. return this.each(function() {
  2481. xe.removeAttr(this, e)
  2482. })
  2483. }
  2484. }), xe.extend({
  2485. attr: function(e, t, n) {
  2486. var o, i, a = e.nodeType;
  2487. if (3 !== a && 8 !== a && 2 !== a) return void 0 === e.getAttribute ? xe.prop(e, t, n) : (1 === a && xe.isXMLDoc(e) || (i = xe.attrHooks[t.toLowerCase()] || (xe.expr.match.bool.test(t) ? xt : void 0)), void 0 !== n ? null === n ? void xe.removeAttr(e, t) : i && "set" in i && void 0 !== (o = i.set(e, n, t)) ? o : (e.setAttribute(t, n + ""), n) : i && "get" in i && null !== (o = i.get(e, t)) ? o : null == (o = xe.find.attr(e, t)) ? void 0 : o)
  2488. },
  2489. attrHooks: {
  2490. type: {
  2491. set: function(e, t) {
  2492. if (!ge.radioValue && "radio" === t && a(e, "input")) {
  2493. var n = e.value;
  2494. return e.setAttribute("type", t), n && (e.value = n), t
  2495. }
  2496. }
  2497. }
  2498. },
  2499. removeAttr: function(e, t) {
  2500. var n, o = 0,
  2501. i = t && t.match(Se);
  2502. if (i && 1 === e.nodeType)
  2503. for (; n = i[o++];) e.removeAttribute(n)
  2504. }
  2505. }), xt = {
  2506. set: function(e, t, n) {
  2507. return !1 === t ? xe.removeAttr(e, n) : e.setAttribute(n, n), n
  2508. }
  2509. }, xe.each(xe.expr.match.bool.source.match(/\w+/g), function(e, t) {
  2510. var n = _t[t] || xe.find.attr;
  2511. _t[t] = function(e, t, o) {
  2512. var i, a, r = t.toLowerCase();
  2513. return o || (a = _t[r], _t[r] = i, i = null != n(e, t, o) ? r : null, _t[r] = a), i
  2514. }
  2515. });
  2516. var jt = /^(?:input|select|textarea|button)$/i,
  2517. Tt = /^(?:a|area)$/i;
  2518. xe.fn.extend({
  2519. prop: function(e, t) {
  2520. return Ie(this, xe.prop, e, t, arguments.length > 1)
  2521. },
  2522. removeProp: function(e) {
  2523. return this.each(function() {
  2524. delete this[xe.propFix[e] || e]
  2525. })
  2526. }
  2527. }), xe.extend({
  2528. prop: function(e, t, n) {
  2529. var o, i, a = e.nodeType;
  2530. if (3 !== a && 8 !== a && 2 !== a) return 1 === a && xe.isXMLDoc(e) || (t = xe.propFix[t] || t, i = xe.propHooks[t]), void 0 !== n ? i && "set" in i && void 0 !== (o = i.set(e, n, t)) ? o : e[t] = n : i && "get" in i && null !== (o = i.get(e, t)) ? o : e[t]
  2531. },
  2532. propHooks: {
  2533. tabIndex: {
  2534. get: function(e) {
  2535. var t = xe.find.attr(e, "tabindex");
  2536. return t ? parseInt(t, 10) : jt.test(e.nodeName) || Tt.test(e.nodeName) && e.href ? 0 : -1
  2537. }
  2538. }
  2539. },
  2540. propFix: {
  2541. for: "htmlFor",
  2542. class: "className"
  2543. }
  2544. }), ge.optSelected || (xe.propHooks.selected = {
  2545. get: function(e) {
  2546. var t = e.parentNode;
  2547. return t && t.parentNode && t.parentNode.selectedIndex, null
  2548. },
  2549. set: function(e) {
  2550. var t = e.parentNode;
  2551. t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex)
  2552. }
  2553. }), xe.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
  2554. xe.propFix[this.toLowerCase()] = this
  2555. }), xe.fn.extend({
  2556. addClass: function(e) {
  2557. var t, n, o, i, a, r, l, s = 0;
  2558. if (ve(e)) return this.each(function(t) {
  2559. xe(this).addClass(e.call(this, t, Q(this)))
  2560. });
  2561. if ((t = Z(e)).length)
  2562. for (; n = this[s++];)
  2563. if (i = Q(n), o = 1 === n.nodeType && " " + G(i) + " ") {
  2564. for (r = 0; a = t[r++];) o.indexOf(" " + a + " ") < 0 && (o += a + " ");
  2565. i !== (l = G(o)) && n.setAttribute("class", l)
  2566. }
  2567. return this
  2568. },
  2569. removeClass: function(e) {
  2570. var t, n, o, i, a, r, l, s = 0;
  2571. if (ve(e)) return this.each(function(t) {
  2572. xe(this).removeClass(e.call(this, t, Q(this)))
  2573. });
  2574. if (!arguments.length) return this.attr("class", "");
  2575. if ((t = Z(e)).length)
  2576. for (; n = this[s++];)
  2577. if (i = Q(n), o = 1 === n.nodeType && " " + G(i) + " ") {
  2578. for (r = 0; a = t[r++];)
  2579. for (; o.indexOf(" " + a + " ") > -1;) o = o.replace(" " + a + " ", " ");
  2580. i !== (l = G(o)) && n.setAttribute("class", l)
  2581. }
  2582. return this
  2583. },
  2584. toggleClass: function(e, t) {
  2585. var n = typeof e,
  2586. o = "string" === n || Array.isArray(e);
  2587. return "boolean" == typeof t && o ? t ? this.addClass(e) : this.removeClass(e) : ve(e) ? this.each(function(n) {
  2588. xe(this).toggleClass(e.call(this, n, Q(this), t), t)
  2589. }) : this.each(function() {
  2590. var t, i, a, r;
  2591. if (o)
  2592. for (i = 0, a = xe(this), r = Z(e); t = r[i++];) a.hasClass(t) ? a.removeClass(t) : a.addClass(t);
  2593. else void 0 !== e && "boolean" !== n || ((t = Q(this)) && Re.set(this, "__className__", t), this.setAttribute && this.setAttribute("class", t || !1 === e ? "" : Re.get(this, "__className__") || ""))
  2594. })
  2595. },
  2596. hasClass: function(e) {
  2597. var t, n, o = 0;
  2598. for (t = " " + e + " "; n = this[o++];)
  2599. if (1 === n.nodeType && (" " + G(Q(n)) + " ").indexOf(t) > -1) return !0;
  2600. return !1
  2601. }
  2602. });
  2603. var Mt = /\r/g;
  2604. xe.fn.extend({
  2605. val: function(e) {
  2606. var t, n, o, i = this[0];
  2607. return arguments.length ? (o = ve(e), this.each(function(n) {
  2608. var i;
  2609. 1 === this.nodeType && (null == (i = o ? e.call(this, n, xe(this).val()) : e) ? i = "" : "number" == typeof i ? i += "" : Array.isArray(i) && (i = xe.map(i, function(e) {
  2610. return null == e ? "" : e + ""
  2611. })), (t = xe.valHooks[this.type] || xe.valHooks[this.nodeName.toLowerCase()]) && "set" in t && void 0 !== t.set(this, i, "value") || (this.value = i))
  2612. })) : i ? (t = xe.valHooks[i.type] || xe.valHooks[i.nodeName.toLowerCase()]) && "get" in t && void 0 !== (n = t.get(i, "value")) ? n : "string" == typeof(n = i.value) ? n.replace(Mt, "") : null == n ? "" : n : void 0
  2613. }
  2614. }), xe.extend({
  2615. valHooks: {
  2616. option: {
  2617. get: function(e) {
  2618. var t = xe.find.attr(e, "value");
  2619. return null != t ? t : G(xe.text(e))
  2620. }
  2621. },
  2622. select: {
  2623. get: function(e) {
  2624. var t, n, o, i = e.options,
  2625. r = e.selectedIndex,
  2626. l = "select-one" === e.type,
  2627. s = l ? null : [],
  2628. c = l ? r + 1 : i.length;
  2629. for (o = r < 0 ? c : l ? r : 0; o < c; o++)
  2630. if (((n = i[o]).selected || o === r) && !n.disabled && (!n.parentNode.disabled || !a(n.parentNode, "optgroup"))) {
  2631. if (t = xe(n).val(), l) return t;
  2632. s.push(t)
  2633. }
  2634. return s
  2635. },
  2636. set: function(e, t) {
  2637. for (var n, o, i = e.options, a = xe.makeArray(t), r = i.length; r--;)((o = i[r]).selected = xe.inArray(xe.valHooks.option.get(o), a) > -1) && (n = !0);
  2638. return n || (e.selectedIndex = -1), a
  2639. }
  2640. }
  2641. }
  2642. }), xe.each(["radio", "checkbox"], function() {
  2643. xe.valHooks[this] = {
  2644. set: function(e, t) {
  2645. if (Array.isArray(t)) return e.checked = xe.inArray(xe(e).val(), t) > -1
  2646. }
  2647. }, ge.checkOn || (xe.valHooks[this].get = function(e) {
  2648. return null === e.getAttribute("value") ? "on" : e.value
  2649. })
  2650. }), ge.focusin = "onfocusin" in e;
  2651. var kt = /^(?:focusinfocus|focusoutblur)$/,
  2652. Ct = function(e) {
  2653. e.stopPropagation()
  2654. };
  2655. xe.extend(xe.event, {
  2656. trigger: function(t, n, o, i) {
  2657. var a, r, l, s, c, u, d, p, h = [o || re],
  2658. f = fe.call(t, "type") ? t.type : t,
  2659. b = fe.call(t, "namespace") ? t.namespace.split(".") : [];
  2660. if (r = p = l = o = o || re, 3 !== o.nodeType && 8 !== o.nodeType && !kt.test(f + xe.event.triggered) && (f.indexOf(".") > -1 && (f = (b = f.split(".")).shift(), b.sort()), c = f.indexOf(":") < 0 && "on" + f, t = t[xe.expando] ? t : new xe.Event(f, "object" == typeof t && t), t.isTrigger = i ? 2 : 3, t.namespace = b.join("."), t.rnamespace = t.namespace ? new RegExp("(^|\\.)" + b.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = o), n = null == n ? [t] : xe.makeArray(n, [t]), d = xe.event.special[f] || {}, i || !d.trigger || !1 !== d.trigger.apply(o, n))) {
  2661. if (!i && !d.noBubble && !ye(o)) {
  2662. for (s = d.delegateType || f, kt.test(s + f) || (r = r.parentNode); r; r = r.parentNode) h.push(r), l = r;
  2663. l === (o.ownerDocument || re) && h.push(l.defaultView || l.parentWindow || e)
  2664. }
  2665. for (a = 0;
  2666. (r = h[a++]) && !t.isPropagationStopped();) p = r, t.type = a > 1 ? s : d.bindType || f, (u = (Re.get(r, "events") || {})[t.type] && Re.get(r, "handle")) && u.apply(r, n), (u = c && r[c]) && u.apply && qe(r) && (t.result = u.apply(r, n), !1 === t.result && t.preventDefault());
  2667. return t.type = f, i || t.isDefaultPrevented() || d._default && !1 !== d._default.apply(h.pop(), n) || !qe(o) || c && ve(o[f]) && !ye(o) && ((l = o[c]) && (o[c] = null), xe.event.triggered = f, t.isPropagationStopped() && p.addEventListener(f, Ct), o[f](), t.isPropagationStopped() && p.removeEventListener(f, Ct), xe.event.triggered = void 0, l && (o[c] = l)), t.result
  2668. }
  2669. },
  2670. simulate: function(e, t, n) {
  2671. var o = xe.extend(new xe.Event, n, {
  2672. type: e,
  2673. isSimulated: !0
  2674. });
  2675. xe.event.trigger(o, null, t)
  2676. }
  2677. }), xe.fn.extend({
  2678. trigger: function(e, t) {
  2679. return this.each(function() {
  2680. xe.event.trigger(e, t, this)
  2681. })
  2682. },
  2683. triggerHandler: function(e, t) {
  2684. var n = this[0];
  2685. if (n) return xe.event.trigger(e, t, n, !0)
  2686. }
  2687. }), ge.focusin || xe.each({
  2688. focus: "focusin",
  2689. blur: "focusout"
  2690. }, function(e, t) {
  2691. var n = function(e) {
  2692. xe.event.simulate(t, e.target, xe.event.fix(e))
  2693. };
  2694. xe.event.special[t] = {
  2695. setup: function() {
  2696. var o = this.ownerDocument || this,
  2697. i = Re.access(o, t);
  2698. i || o.addEventListener(e, n, !0), Re.access(o, t, (i || 0) + 1)
  2699. },
  2700. teardown: function() {
  2701. var o = this.ownerDocument || this,
  2702. i = Re.access(o, t) - 1;
  2703. i ? Re.access(o, t, i) : (o.removeEventListener(e, n, !0), Re.remove(o, t))
  2704. }
  2705. }
  2706. });
  2707. var Dt = e.location,
  2708. $t = Date.now(),
  2709. At = /\?/;
  2710. xe.parseXML = function(t) {
  2711. var n;
  2712. if (!t || "string" != typeof t) return null;
  2713. try {
  2714. n = (new e.DOMParser).parseFromString(t, "text/xml")
  2715. } catch (e) {
  2716. n = void 0
  2717. }
  2718. return n && !n.getElementsByTagName("parsererror").length || xe.error("Invalid XML: " + t), n
  2719. };
  2720. var Et = /\[\]$/,
  2721. St = /\r?\n/g,
  2722. Lt = /^(?:submit|button|image|reset|file)$/i,
  2723. Pt = /^(?:input|select|textarea|keygen)/i;
  2724. xe.param = function(e, t) {
  2725. var n, o = [],
  2726. i = function(e, t) {
  2727. var n = ve(t) ? t() : t;
  2728. o[o.length] = encodeURIComponent(e) + "=" + encodeURIComponent(null == n ? "" : n)
  2729. };
  2730. if (Array.isArray(e) || e.jquery && !xe.isPlainObject(e)) xe.each(e, function() {
  2731. i(this.name, this.value)
  2732. });
  2733. else
  2734. for (n in e) J(n, e[n], t, i);
  2735. return o.join("&")
  2736. }, xe.fn.extend({
  2737. serialize: function() {
  2738. return xe.param(this.serializeArray())
  2739. },
  2740. serializeArray: function() {
  2741. return this.map(function() {
  2742. var e = xe.prop(this, "elements");
  2743. return e ? xe.makeArray(e) : this
  2744. }).filter(function() {
  2745. var e = this.type;
  2746. return this.name && !xe(this).is(":disabled") && Pt.test(this.nodeName) && !Lt.test(e) && (this.checked || !Ve.test(e))
  2747. }).map(function(e, t) {
  2748. var n = xe(this).val();
  2749. return null == n ? null : Array.isArray(n) ? xe.map(n, function(e) {
  2750. return {
  2751. name: t.name,
  2752. value: e.replace(St, "\r\n")
  2753. }
  2754. }) : {
  2755. name: t.name,
  2756. value: n.replace(St, "\r\n")
  2757. }
  2758. }).get()
  2759. }
  2760. });
  2761. var It = /%20/g,
  2762. Ot = /#.*$/,
  2763. Nt = /([?&])_=[^&]*/,
  2764. qt = /^(.*?):[ \t]*([^\r\n]*)$/gm,
  2765. Rt = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  2766. Ht = /^(?:GET|HEAD)$/,
  2767. Ut = /^\/\//,
  2768. Bt = {},
  2769. Ft = {},
  2770. Wt = "*/".concat("*"),
  2771. Xt = re.createElement("a");
  2772. Xt.href = Dt.href, xe.extend({
  2773. active: 0,
  2774. lastModified: {},
  2775. etag: {},
  2776. ajaxSettings: {
  2777. url: Dt.href,
  2778. type: "GET",
  2779. isLocal: Rt.test(Dt.protocol),
  2780. global: !0,
  2781. processData: !0,
  2782. async: !0,
  2783. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  2784. accepts: {
  2785. "*": Wt,
  2786. text: "text/plain",
  2787. html: "text/html",
  2788. xml: "application/xml, text/xml",
  2789. json: "application/json, text/javascript"
  2790. },
  2791. contents: {
  2792. xml: /\bxml\b/,
  2793. html: /\bhtml/,
  2794. json: /\bjson\b/
  2795. },
  2796. responseFields: {
  2797. xml: "responseXML",
  2798. text: "responseText",
  2799. json: "responseJSON"
  2800. },
  2801. converters: {
  2802. "* text": String,
  2803. "text html": !0,
  2804. "text json": JSON.parse,
  2805. "text xml": xe.parseXML
  2806. },
  2807. flatOptions: {
  2808. url: !0,
  2809. context: !0
  2810. }
  2811. },
  2812. ajaxSetup: function(e, t) {
  2813. return t ? ne(ne(e, xe.ajaxSettings), t) : ne(xe.ajaxSettings, e)
  2814. },
  2815. ajaxPrefilter: ee(Bt),
  2816. ajaxTransport: ee(Ft),
  2817. ajax: function(t, n) {
  2818. function o(t, n, o, l) {
  2819. var c, p, h, w, x, _ = n;
  2820. u || (u = !0, s && e.clearTimeout(s), i = void 0, r = l || "", j.readyState = t > 0 ? 4 : 0, c = t >= 200 && t < 300 || 304 === t, o && (w = oe(f, j, o)), w = ie(f, w, j, c), c ? (f.ifModified && ((x = j.getResponseHeader("Last-Modified")) && (xe.lastModified[a] = x), (x = j.getResponseHeader("etag")) && (xe.etag[a] = x)), 204 === t || "HEAD" === f.type ? _ = "nocontent" : 304 === t ? _ = "notmodified" : (_ = w.state, p = w.data, c = !(h = w.error))) : (h = _, !t && _ || (_ = "error", t < 0 && (t = 0))), j.status = t, j.statusText = (n || _) + "", c ? g.resolveWith(b, [p, _, j]) : g.rejectWith(b, [j, _, h]), j.statusCode(y), y = void 0, d && m.trigger(c ? "ajaxSuccess" : "ajaxError", [j, f, c ? p : h]), v.fireWith(b, [j, _]), d && (m.trigger("ajaxComplete", [j, f]), --xe.active || xe.event.trigger("ajaxStop")))
  2821. }
  2822. "object" == typeof t && (n = t, t = void 0), n = n || {};
  2823. var i, a, r, l, s, c, u, d, p, h, f = xe.ajaxSetup({}, n),
  2824. b = f.context || f,
  2825. m = f.context && (b.nodeType || b.jquery) ? xe(b) : xe.event,
  2826. g = xe.Deferred(),
  2827. v = xe.Callbacks("once memory"),
  2828. y = f.statusCode || {},
  2829. w = {},
  2830. x = {},
  2831. _ = "canceled",
  2832. j = {
  2833. readyState: 0,
  2834. getResponseHeader: function(e) {
  2835. var t;
  2836. if (u) {
  2837. if (!l)
  2838. for (l = {}; t = qt.exec(r);) l[t[1].toLowerCase()] = t[2];
  2839. t = l[e.toLowerCase()]
  2840. }
  2841. return null == t ? null : t
  2842. },
  2843. getAllResponseHeaders: function() {
  2844. return u ? r : null
  2845. },
  2846. setRequestHeader: function(e, t) {
  2847. return null == u && (e = x[e.toLowerCase()] = x[e.toLowerCase()] || e, w[e] = t), this
  2848. },
  2849. overrideMimeType: function(e) {
  2850. return null == u && (f.mimeType = e), this
  2851. },
  2852. statusCode: function(e) {
  2853. var t;
  2854. if (e)
  2855. if (u) j.always(e[j.status]);
  2856. else
  2857. for (t in e) y[t] = [y[t], e[t]];
  2858. return this
  2859. },
  2860. abort: function(e) {
  2861. var t = e || _;
  2862. return i && i.abort(t), o(0, t), this
  2863. }
  2864. };
  2865. if (g.promise(j), f.url = ((t || f.url || Dt.href) + "").replace(Ut, Dt.protocol + "//"), f.type = n.method || n.type || f.method || f.type, f.dataTypes = (f.dataType || "*").toLowerCase().match(Se) || [""], null == f.crossDomain) {
  2866. c = re.createElement("a");
  2867. try {
  2868. c.href = f.url, c.href = c.href, f.crossDomain = Xt.protocol + "//" + Xt.host != c.protocol + "//" + c.host
  2869. } catch (e) {
  2870. f.crossDomain = !0
  2871. }
  2872. }
  2873. if (f.data && f.processData && "string" != typeof f.data && (f.data = xe.param(f.data, f.traditional)), te(Bt, f, n, j), u) return j;
  2874. (d = xe.event && f.global) && 0 == xe.active++ && xe.event.trigger("ajaxStart"), f.type = f.type.toUpperCase(), f.hasContent = !Ht.test(f.type), a = f.url.replace(Ot, ""), f.hasContent ? f.data && f.processData && 0 === (f.contentType || "").indexOf("application/x-www-form-urlencoded") && (f.data = f.data.replace(It, "+")) : (h = f.url.slice(a.length), f.data && (f.processData || "string" == typeof f.data) && (a += (At.test(a) ? "&" : "?") + f.data, delete f.data), !1 === f.cache && (a = a.replace(Nt, "$1"), h = (At.test(a) ? "&" : "?") + "_=" + $t++ + h), f.url = a + h), f.ifModified && (xe.lastModified[a] && j.setRequestHeader("If-Modified-Since", xe.lastModified[a]), xe.etag[a] && j.setRequestHeader("If-None-Match", xe.etag[a])), (f.data && f.hasContent && !1 !== f.contentType || n.contentType) && j.setRequestHeader("Content-Type", f.contentType), j.setRequestHeader("Accept", f.dataTypes[0] && f.accepts[f.dataTypes[0]] ? f.accepts[f.dataTypes[0]] + ("*" !== f.dataTypes[0] ? ", " + Wt + "; q=0.01" : "") : f.accepts["*"]);
  2875. for (p in f.headers) j.setRequestHeader(p, f.headers[p]);
  2876. if (f.beforeSend && (!1 === f.beforeSend.call(b, j, f) || u)) return j.abort();
  2877. if (_ = "abort", v.add(f.complete), j.done(f.success), j.fail(f.error), i = te(Ft, f, n, j)) {
  2878. if (j.readyState = 1, d && m.trigger("ajaxSend", [j, f]), u) return j;
  2879. f.async && f.timeout > 0 && (s = e.setTimeout(function() {
  2880. j.abort("timeout")
  2881. }, f.timeout));
  2882. try {
  2883. u = !1, i.send(w, o)
  2884. } catch (e) {
  2885. if (u) throw e;
  2886. o(-1, e)
  2887. }
  2888. } else o(-1, "No Transport");
  2889. return j
  2890. },
  2891. getJSON: function(e, t, n) {
  2892. return xe.get(e, t, n, "json")
  2893. },
  2894. getScript: function(e, t) {
  2895. return xe.get(e, void 0, t, "script")
  2896. }
  2897. }), xe.each(["get", "post"], function(e, t) {
  2898. xe[t] = function(e, n, o, i) {
  2899. return ve(n) && (i = i || o, o = n, n = void 0), xe.ajax(xe.extend({
  2900. url: e,
  2901. type: t,
  2902. dataType: i,
  2903. data: n,
  2904. success: o
  2905. }, xe.isPlainObject(e) && e))
  2906. }
  2907. }), xe._evalUrl = function(e) {
  2908. return xe.ajax({
  2909. url: e,
  2910. type: "GET",
  2911. dataType: "script",
  2912. cache: !0,
  2913. async: !1,
  2914. global: !1,
  2915. throws: !0
  2916. })
  2917. }, xe.fn.extend({
  2918. wrapAll: function(e) {
  2919. var t;
  2920. return this[0] && (ve(e) && (e = e.call(this[0])), t = xe(e, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function() {
  2921. for (var e = this; e.firstElementChild;) e = e.firstElementChild;
  2922. return e
  2923. }).append(this)), this
  2924. },
  2925. wrapInner: function(e) {
  2926. return ve(e) ? this.each(function(t) {
  2927. xe(this).wrapInner(e.call(this, t))
  2928. }) : this.each(function() {
  2929. var t = xe(this),
  2930. n = t.contents();
  2931. n.length ? n.wrapAll(e) : t.append(e)
  2932. })
  2933. },
  2934. wrap: function(e) {
  2935. var t = ve(e);
  2936. return this.each(function(n) {
  2937. xe(this).wrapAll(t ? e.call(this, n) : e)
  2938. })
  2939. },
  2940. unwrap: function(e) {
  2941. return this.parent(e).not("body").each(function() {
  2942. xe(this).replaceWith(this.childNodes)
  2943. }), this
  2944. }
  2945. }), xe.expr.pseudos.hidden = function(e) {
  2946. return !xe.expr.pseudos.visible(e)
  2947. }, xe.expr.pseudos.visible = function(e) {
  2948. return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length)
  2949. }, xe.ajaxSettings.xhr = function() {
  2950. try {
  2951. return new e.XMLHttpRequest
  2952. } catch (e) {}
  2953. };
  2954. var zt = {
  2955. 0: 200,
  2956. 1223: 204
  2957. },
  2958. Yt = xe.ajaxSettings.xhr();
  2959. ge.cors = !!Yt && "withCredentials" in Yt, ge.ajax = Yt = !!Yt, xe.ajaxTransport(function(t) {
  2960. var n, o;
  2961. if (ge.cors || Yt && !t.crossDomain) return {
  2962. send: function(i, a) {
  2963. var r, l = t.xhr();
  2964. if (l.open(t.type, t.url, t.async, t.username, t.password), t.xhrFields)
  2965. for (r in t.xhrFields) l[r] = t.xhrFields[r];
  2966. t.mimeType && l.overrideMimeType && l.overrideMimeType(t.mimeType), t.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");
  2967. for (r in i) l.setRequestHeader(r, i[r]);
  2968. n = function(e) {
  2969. return function() {
  2970. n && (n = o = l.onload = l.onerror = l.onabort = l.ontimeout = l.onreadystatechange = null, "abort" === e ? l.abort() : "error" === e ? "number" != typeof l.status ? a(0, "error") : a(l.status, l.statusText) : a(zt[l.status] || l.status, l.statusText, "text" !== (l.responseType || "text") || "string" != typeof l.responseText ? {
  2971. binary: l.response
  2972. } : {
  2973. text: l.responseText
  2974. }, l.getAllResponseHeaders()))
  2975. }
  2976. }, l.onload = n(), o = l.onerror = l.ontimeout = n("error"), void 0 !== l.onabort ? l.onabort = o : l.onreadystatechange = function() {
  2977. 4 === l.readyState && e.setTimeout(function() {
  2978. n && o()
  2979. })
  2980. }, n = n("abort");
  2981. try {
  2982. l.send(t.hasContent && t.data || null)
  2983. } catch (e) {
  2984. if (n) throw e
  2985. }
  2986. },
  2987. abort: function() {
  2988. n && n()
  2989. }
  2990. }
  2991. }), xe.ajaxPrefilter(function(e) {
  2992. e.crossDomain && (e.contents.script = !1)
  2993. }), xe.ajaxSetup({
  2994. accepts: {
  2995. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  2996. },
  2997. contents: {
  2998. script: /\b(?:java|ecma)script\b/
  2999. },
  3000. converters: {
  3001. "text script": function(e) {
  3002. return xe.globalEval(e), e
  3003. }
  3004. }
  3005. }), xe.ajaxPrefilter("script", function(e) {
  3006. void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET")
  3007. }), xe.ajaxTransport("script", function(e) {
  3008. if (e.crossDomain) {
  3009. var t, n;
  3010. return {
  3011. send: function(o, i) {
  3012. t = xe("<script>").prop({
  3013. charset: e.scriptCharset,
  3014. src: e.url
  3015. }).on("load error", n = function(e) {
  3016. t.remove(), n = null, e && i("error" === e.type ? 404 : 200, e.type)
  3017. }), re.head.appendChild(t[0])
  3018. },
  3019. abort: function() {
  3020. n && n()
  3021. }
  3022. }
  3023. }
  3024. });
  3025. var Kt = [],
  3026. Vt = /(=)\?(?=&|$)|\?\?/;
  3027. xe.ajaxSetup({
  3028. jsonp: "callback",
  3029. jsonpCallback: function() {
  3030. var e = Kt.pop() || xe.expando + "_" + $t++;
  3031. return this[e] = !0, e
  3032. }
  3033. }), xe.ajaxPrefilter("json jsonp", function(t, n, o) {
  3034. var i, a, r, l = !1 !== t.jsonp && (Vt.test(t.url) ? "url" : "string" == typeof t.data && 0 === (t.contentType || "").indexOf("application/x-www-form-urlencoded") && Vt.test(t.data) && "data");
  3035. if (l || "jsonp" === t.dataTypes[0]) return i = t.jsonpCallback = ve(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, l ? t[l] = t[l].replace(Vt, "$1" + i) : !1 !== t.jsonp && (t.url += (At.test(t.url) ? "&" : "?") + t.jsonp + "=" + i), t.converters["script json"] = function() {
  3036. return r || xe.error(i + " was not called"), r[0]
  3037. }, t.dataTypes[0] = "json", a = e[i], e[i] = function() {
  3038. r = arguments
  3039. }, o.always(function() {
  3040. void 0 === a ? xe(e).removeProp(i) : e[i] = a, t[i] && (t.jsonpCallback = n.jsonpCallback, Kt.push(i)), r && ve(a) && a(r[0]), r = a = void 0
  3041. }), "script"
  3042. }), ge.createHTMLDocument = function() {
  3043. var e = re.implementation.createHTMLDocument("").body;
  3044. return e.innerHTML = "<form></form><form></form>", 2 === e.childNodes.length
  3045. }(), xe.parseHTML = function(e, t, n) {
  3046. if ("string" != typeof e) return [];
  3047. "boolean" == typeof t && (n = t, t = !1);
  3048. var o, i, a;
  3049. return t || (ge.createHTMLDocument ? ((o = (t = re.implementation.createHTMLDocument("")).createElement("base")).href = re.location.href, t.head.appendChild(o)) : t = re), i = Ce.exec(e), a = !n && [], i ? [t.createElement(i[1])] : (i = j([e], t, a), a && a.length && xe(a).remove(), xe.merge([], i.childNodes))
  3050. }, xe.fn.load = function(e, t, n) {
  3051. var o, i, a, r = this,
  3052. l = e.indexOf(" ");
  3053. return l > -1 && (o = G(e.slice(l)), e = e.slice(0, l)), ve(t) ? (n = t, t = void 0) : t && "object" == typeof t && (i = "POST"), r.length > 0 && xe.ajax({
  3054. url: e,
  3055. type: i || "GET",
  3056. dataType: "html",
  3057. data: t
  3058. }).done(function(e) {
  3059. a = arguments, r.html(o ? xe("<div>").append(xe.parseHTML(e)).find(o) : e)
  3060. }).always(n && function(e, t) {
  3061. r.each(function() {
  3062. n.apply(this, a || [e.responseText, t, e])
  3063. })
  3064. }), this
  3065. }, xe.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(e, t) {
  3066. xe.fn[t] = function(e) {
  3067. return this.on(t, e)
  3068. }
  3069. }), xe.expr.pseudos.animated = function(e) {
  3070. return xe.grep(xe.timers, function(t) {
  3071. return e === t.elem
  3072. }).length
  3073. }, xe.offset = {
  3074. setOffset: function(e, t, n) {
  3075. var o, i, a, r, l, s, c = xe.css(e, "position"),
  3076. u = xe(e),
  3077. d = {};
  3078. "static" === c && (e.style.position = "relative"), l = u.offset(), a = xe.css(e, "top"), s = xe.css(e, "left"), ("absolute" === c || "fixed" === c) && (a + s).indexOf("auto") > -1 ? (r = (o = u.position()).top, i = o.left) : (r = parseFloat(a) || 0, i = parseFloat(s) || 0), ve(t) && (t = t.call(e, n, xe.extend({}, l))), null != t.top && (d.top = t.top - l.top + r), null != t.left && (d.left = t.left - l.left + i), "using" in t ? t.using.call(e, d) : u.css(d)
  3079. }
  3080. }, xe.fn.extend({
  3081. offset: function(e) {
  3082. if (arguments.length) return void 0 === e ? this : this.each(function(t) {
  3083. xe.offset.setOffset(this, e, t)
  3084. });
  3085. var t, n, o = this[0];
  3086. return o ? o.getClientRects().length ? (t = o.getBoundingClientRect(), n = o.ownerDocument.defaultView, {
  3087. top: t.top + n.pageYOffset,
  3088. left: t.left + n.pageXOffset
  3089. }) : {
  3090. top: 0,
  3091. left: 0
  3092. } : void 0
  3093. },
  3094. position: function() {
  3095. if (this[0]) {
  3096. var e, t, n, o = this[0],
  3097. i = {
  3098. top: 0,
  3099. left: 0
  3100. };
  3101. if ("fixed" === xe.css(o, "position")) t = o.getBoundingClientRect();
  3102. else {
  3103. for (t = this.offset(), n = o.ownerDocument, e = o.offsetParent || n.documentElement; e && (e === n.body || e === n.documentElement) && "static" === xe.css(e, "position");) e = e.parentNode;
  3104. e && e !== o && 1 === e.nodeType && ((i = xe(e).offset()).top += xe.css(e, "borderTopWidth", !0), i.left += xe.css(e, "borderLeftWidth", !0))
  3105. }
  3106. return {
  3107. top: t.top - i.top - xe.css(o, "marginTop", !0),
  3108. left: t.left - i.left - xe.css(o, "marginLeft", !0)
  3109. }
  3110. }
  3111. },
  3112. offsetParent: function() {
  3113. return this.map(function() {
  3114. for (var e = this.offsetParent; e && "static" === xe.css(e, "position");) e = e.offsetParent;
  3115. return e || et
  3116. })
  3117. }
  3118. }), xe.each({
  3119. scrollLeft: "pageXOffset",
  3120. scrollTop: "pageYOffset"
  3121. }, function(e, t) {
  3122. var n = "pageYOffset" === t;
  3123. xe.fn[e] = function(o) {
  3124. return Ie(this, function(e, o, i) {
  3125. var a;
  3126. if (ye(e) ? a = e : 9 === e.nodeType && (a = e.defaultView), void 0 === i) return a ? a[t] : e[o];
  3127. a ? a.scrollTo(n ? a.pageXOffset : i, n ? i : a.pageYOffset) : e[o] = i
  3128. }, e, o, arguments.length)
  3129. }
  3130. }), xe.each(["top", "left"], function(e, t) {
  3131. xe.cssHooks[t] = O(ge.pixelPosition, function(e, n) {
  3132. if (n) return n = I(e, t), st.test(n) ? xe(e).position()[t] + "px" : n
  3133. })
  3134. }), xe.each({
  3135. Height: "height",
  3136. Width: "width"
  3137. }, function(e, t) {
  3138. xe.each({
  3139. padding: "inner" + e,
  3140. content: t,
  3141. "": "outer" + e
  3142. }, function(n, o) {
  3143. xe.fn[o] = function(i, a) {
  3144. var r = arguments.length && (n || "boolean" != typeof i),
  3145. l = n || (!0 === i || !0 === a ? "margin" : "border");
  3146. return Ie(this, function(t, n, i) {
  3147. var a;
  3148. return ye(t) ? 0 === o.indexOf("outer") ? t["inner" + e] : t.document.documentElement["client" + e] : 9 === t.nodeType ? (a = t.documentElement, Math.max(t.body["scroll" + e], a["scroll" + e], t.body["offset" + e], a["offset" + e], a["client" + e])) : void 0 === i ? xe.css(t, n, l) : xe.style(t, n, i, l)
  3149. }, t, r ? i : void 0, r)
  3150. }
  3151. })
  3152. }), xe.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function(e, t) {
  3153. xe.fn[t] = function(e, n) {
  3154. return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
  3155. }
  3156. }), xe.fn.extend({
  3157. hover: function(e, t) {
  3158. return this.mouseenter(e).mouseleave(t || e)
  3159. }
  3160. }), xe.fn.extend({
  3161. bind: function(e, t, n) {
  3162. return this.on(e, null, t, n)
  3163. },
  3164. unbind: function(e, t) {
  3165. return this.off(e, null, t)
  3166. },
  3167. delegate: function(e, t, n, o) {
  3168. return this.on(t, e, n, o)
  3169. },
  3170. undelegate: function(e, t, n) {
  3171. return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n)
  3172. }
  3173. }), xe.proxy = function(e, t) {
  3174. var n, o, i;
  3175. if ("string" == typeof t && (n = e[t], t = e, e = n), ve(e)) return o = se.call(arguments, 2), i = function() {
  3176. return e.apply(t || this, o.concat(se.call(arguments)))
  3177. }, i.guid = e.guid = e.guid || xe.guid++, i
  3178. }, xe.holdReady = function(e) {
  3179. e ? xe.readyWait++ : xe.ready(!0)
  3180. }, xe.isArray = Array.isArray, xe.parseJSON = JSON.parse, xe.nodeName = a, xe.isFunction = ve, xe.isWindow = ye, xe.camelCase = f, xe.type = o, xe.now = Date.now, xe.isNumeric = function(e) {
  3181. var t = xe.type(e);
  3182. return ("number" === t || "string" === t) && !isNaN(e - parseFloat(e))
  3183. }, "function" == typeof define && define.amd && define("jquery", [], function() {
  3184. return xe
  3185. });
  3186. var Gt = e.jQuery,
  3187. Qt = e.$;
  3188. return xe.noConflict = function(t) {
  3189. return e.$ === xe && (e.$ = Qt), t && e.jQuery === xe && (e.jQuery = Gt), xe
  3190. }, t || (e.jQuery = e.$ = xe), xe
  3191. }),
  3192. function(e, t, n) {
  3193. function o(e, t, n) {
  3194. e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent("on" + t, n)
  3195. }
  3196.  
  3197. function i(e) {
  3198. if ("keypress" == e.type) {
  3199. var t = String.fromCharCode(e.which);
  3200. return e.shiftKey || (t = t.toLowerCase()), t
  3201. }
  3202. return d[e.which] ? d[e.which] : p[e.which] ? p[e.which] : String.fromCharCode(e.which).toLowerCase()
  3203. }
  3204.  
  3205. function a(e) {
  3206. var t = [];
  3207. return e.shiftKey && t.push("shift"), e.altKey && t.push("alt"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), t
  3208. }
  3209.  
  3210. function r(e) {
  3211. return "shift" == e || "ctrl" == e || "alt" == e || "meta" == e
  3212. }
  3213.  
  3214. function l(e, t) {
  3215. var n, o = [],
  3216. i = e;
  3217. for ("+" === i ? i = ["+"] : (i = i.replace(/\+{2}/g, "+plus"), i = i.split("+")), n = 0; n < i.length; ++n) {
  3218. var a = i[n];
  3219. f[a] && (a = f[a]), t && "keypress" != t && h[a] && (a = h[a], o.push("shift")), r(a) && o.push(a)
  3220. }
  3221. if (i = a, !(n = t)) {
  3222. if (!u) {
  3223. u = {};
  3224. for (var l in d) 95 < l && 112 > l || d.hasOwnProperty(l) && (u[d[l]] = l)
  3225. }
  3226. n = u[i] ? "keydown" : "keypress"
  3227. }
  3228. return "keypress" == n && o.length && (n = "keydown"), {
  3229. key: a,
  3230. modifiers: o,
  3231. action: n
  3232. }
  3233. }
  3234.  
  3235. function s(e, n) {
  3236. return null !== e && e !== t && (e === n || s(e.parentNode, n))
  3237. }
  3238.  
  3239. function c(e) {
  3240. function n(e) {
  3241. e = e || {};
  3242. var t, n = !1;
  3243. for (t in m) e[t] ? n = !0 : m[t] = 0;
  3244. n || (y = !1)
  3245. }
  3246.  
  3247. function s(e, t, n, o, i, a) {
  3248. var l, s = [],
  3249. c = n.type;
  3250. if (!f._callbacks[e]) return [];
  3251. for ("keyup" == c && r(e) && (t = [e]), l = 0; l < f._callbacks[e].length; ++l) {
  3252. var u = f._callbacks[e][l];
  3253. if ((o || !u.seq || m[u.seq] == u.level) && c == u.action) {
  3254. var d;
  3255. (d = "keypress" == c && !n.metaKey && !n.ctrlKey) || (d = u.modifiers, d = t.sort().join(",") === d.sort().join(",")), d && (d = o && u.seq == o && u.level == a, (!o && u.combo == i || d) && f._callbacks[e].splice(l, 1), s.push(u))
  3256. }
  3257. }
  3258. return s
  3259. }
  3260.  
  3261. function u(e, t, n, o) {
  3262. f.stopCallback(t, t.target || t.srcElement, n, o) || !1 !== e(t, n) || (t.preventDefault ? t.preventDefault() : t.returnValue = !1, t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0)
  3263. }
  3264.  
  3265. function d(e) {
  3266. "number" != typeof e.which && (e.which = e.keyCode);
  3267. var t = i(e);
  3268. t && ("keyup" == e.type && g === t ? g = !1 : f.handleKey(t, a(e), e))
  3269. }
  3270.  
  3271. function p(e, t, o, a) {
  3272. function r(t) {
  3273. u(o, t, e), "keyup" !== a && (g = i(t)), setTimeout(n, 10)
  3274. }
  3275. for (var s = m[e] = 0; s < t.length; ++s) {
  3276. var c = s + 1 === t.length ? r : function(t) {
  3277. return function() {
  3278. y = t, ++m[e], clearTimeout(b), b = setTimeout(n, 1e3)
  3279. }
  3280. }(a || l(t[s + 1]).action);
  3281. h(t[s], c, a, e, s)
  3282. }
  3283. }
  3284.  
  3285. function h(e, t, n, o, i) {
  3286. f._directMap[e + ":" + n] = t, e = e.replace(/\s+/g, " ");
  3287. var a = e.split(" ");
  3288. 1 < a.length ? p(e, a, t, n) : (n = l(e, n), f._callbacks[n.key] = f._callbacks[n.key] || [], s(n.key, n.modifiers, {
  3289. type: n.action
  3290. }, o, e, i), f._callbacks[n.key][o ? "unshift" : "push"]({
  3291. callback: t,
  3292. modifiers: n.modifiers,
  3293. action: n.action,
  3294. seq: o,
  3295. level: i,
  3296. combo: e
  3297. }))
  3298. }
  3299. var f = this;
  3300. if (e = e || t, !(f instanceof c)) return new c(e);
  3301. f.target = e, f._callbacks = {}, f._directMap = {};
  3302. var b, m = {},
  3303. g = !1,
  3304. v = !1,
  3305. y = !1;
  3306. f._handleKey = function(e, t, o) {
  3307. var i, a = s(e, t, o);
  3308. t = {};
  3309. var l = 0,
  3310. c = !1;
  3311. for (i = 0; i < a.length; ++i) a[i].seq && (l = Math.max(l, a[i].level));
  3312. for (i = 0; i < a.length; ++i) a[i].seq ? a[i].level == l && (c = !0, t[a[i].seq] = 1, u(a[i].callback, o, a[i].combo, a[i].seq)) : c || u(a[i].callback, o, a[i].combo);
  3313. a = "keypress" == o.type && v, o.type != y || r(e) || a || n(t), v = c && "keydown" == o.type
  3314. }, f._bindMultiple = function(e, t, n) {
  3315. for (var o = 0; o < e.length; ++o) h(e[o], t, n)
  3316. }, o(e, "keypress", d), o(e, "keydown", d), o(e, "keyup", d)
  3317. }
  3318. if (e) {
  3319. var u, d = {
  3320. 8: "backspace",
  3321. 9: "tab",
  3322. 13: "enter",
  3323. 16: "shift",
  3324. 17: "ctrl",
  3325. 18: "alt",
  3326. 20: "capslock",
  3327. 27: "esc",
  3328. 32: "space",
  3329. 33: "pageup",
  3330. 34: "pagedown",
  3331. 35: "end",
  3332. 36: "home",
  3333. 37: "left",
  3334. 38: "up",
  3335. 39: "right",
  3336. 40: "down",
  3337. 45: "ins",
  3338. 46: "del",
  3339. 91: "meta",
  3340. 93: "meta",
  3341. 224: "meta"
  3342. },
  3343. p = {
  3344. 106: "*",
  3345. 107: "+",
  3346. 109: "-",
  3347. 110: ".",
  3348. 111: "/",
  3349. 186: ";",
  3350. 187: "=",
  3351. 188: ",",
  3352. 189: "-",
  3353. 190: ".",
  3354. 191: "/",
  3355. 192: "`",
  3356. 219: "[",
  3357. 220: "\\",
  3358. 221: "]",
  3359. 222: "'"
  3360. },
  3361. h = {
  3362. "~": "`",
  3363. "!": "1",
  3364. "@": "2",
  3365. "#": "3",
  3366. $: "4",
  3367. "%": "5",
  3368. "^": "6",
  3369. "&": "7",
  3370. "*": "8",
  3371. "(": "9",
  3372. ")": "0",
  3373. _: "-",
  3374. "+": "=",
  3375. ":": ";",
  3376. '"': "'",
  3377. "<": ",",
  3378. ">": ".",
  3379. "?": "/",
  3380. "|": "\\"
  3381. },
  3382. f = {
  3383. option: "alt",
  3384. command: "meta",
  3385. return: "enter",
  3386. escape: "esc",
  3387. plus: "+",
  3388. mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
  3389. };
  3390. for (n = 1; 20 > n; ++n) d[111 + n] = "f" + n;
  3391. for (n = 0; 9 >= n; ++n) d[n + 96] = n.toString();
  3392. c.prototype.bind = function(e, t, n) {
  3393. return e = e instanceof Array ? e : [e], this._bindMultiple.call(this, e, t, n), this
  3394. }, c.prototype.unbind = function(e, t) {
  3395. return this.bind.call(this, e, function() {}, t)
  3396. }, c.prototype.trigger = function(e, t) {
  3397. return this._directMap[e + ":" + t] && this._directMap[e + ":" + t]({}, e), this
  3398. }, c.prototype.reset = function() {
  3399. return this._callbacks = {}, this._directMap = {}, this
  3400. }, c.prototype.stopCallback = function(e, t) {
  3401. return !(-1 < (" " + t.className + " ").indexOf(" mousetrap ") || s(t, this.target)) && ("INPUT" == t.tagName || "SELECT" == t.tagName || "TEXTAREA" == t.tagName || t.isContentEditable)
  3402. }, c.prototype.handleKey = function() {
  3403. return this._handleKey.apply(this, arguments)
  3404. }, c.addKeycodes = function(e) {
  3405. for (var t in e) e.hasOwnProperty(t) && (d[t] = e[t]);
  3406. u = null
  3407. }, c.init = function() {
  3408. var e, n = c(t);
  3409. for (e in n) "_" !== e.charAt(0) && (c[e] = function(e) {
  3410. return function() {
  3411. return n[e].apply(n, arguments)
  3412. }
  3413. }(e))
  3414. }, c.init(), e.Mousetrap = c, "undefined" != typeof module && module.exports && (module.exports = c), "function" == typeof define && define.amd && define(function() {
  3415. return c
  3416. })
  3417. }
  3418. }("undefined" != typeof window ? window : null, "undefined" != typeof window ? document : null),
  3419. function(e) {
  3420. var t = {},
  3421. n = e.prototype.stopCallback;
  3422. e.prototype.stopCallback = function(e, o, i, a) {
  3423. return !!this.paused || !t[i] && !t[a] && n.call(this, e, o, i)
  3424. }, e.prototype.bindGlobal = function(e, n, o) {
  3425. if (this.bind(e, n, o), e instanceof Array)
  3426. for (n = 0; n < e.length; n++) t[e[n]] = !0;
  3427. else t[e] = !0
  3428. }, e.init()
  3429. }(Mousetrap),
  3430. function(e, t) {
  3431. "undefined" != typeof module && module.exports ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : window.basicContext = t()
  3432. }(0, function() {
  3433. var e = null,
  3434. t = "item",
  3435. n = "separator",
  3436. o = function() {
  3437. var e = arguments.length <= 0 || void 0 === arguments[0] ? "" : arguments[0];
  3438. return document.querySelector(".basicContext " + e)
  3439. },
  3440. i = function() {
  3441. var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0];
  3442. return !0 == (0 === Object.keys(e).length) && (e.type = n), null == e.type && (e.type = t), null == e.class && (e.class = ""), !1 !== e.visible && (e.visible = !0), null == e.icon && (e.icon = null), null == e.title && (e.title = "Undefined"), !0 !== e.disabled && (e.disabled = !1), !0 === e.disabled && (e.class += " basicContext__item--disabled"), null != e.fn || e.type === n || !1 !== e.disabled || (console.warn("Missing fn for item '" + e.title + "'"), !1)
  3443. },
  3444. a = function(e, o) {
  3445. var a = "",
  3446. r = "";
  3447. return !1 === i(e) ? "" : !1 === e.visible ? "" : (e.num = o, null !== e.icon && (r = "<span class='basicContext__icon " + e.icon + "'></span>"), e.type === t ? a = "\n\t\t <tr class='basicContext__item " + e.class + "'>\n\t\t <td class='basicContext__data' data-num='" + e.num + "'>" + r + e.title + "</td>\n\t\t </tr>\n\t\t " : e.type === n && (a = "\n\t\t <tr class='basicContext__item basicContext__item--separator'></tr>\n\t\t "), a)
  3448. },
  3449. r = function(e) {
  3450. var t = "";
  3451. return t += "\n\t <div class='basicContextContainer'>\n\t <div class='basicContext'>\n\t <table>\n\t <tbody>\n\t ", e.forEach(function(e, n) {
  3452. return t += a(e, n)
  3453. }), t += "\n\t </tbody>\n\t </table>\n\t </div>\n\t </div>\n\t "
  3454. },
  3455. l = function() {
  3456. var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0],
  3457. t = {
  3458. x: e.clientX,
  3459. y: e.clientY
  3460. };
  3461. if ("touchend" === e.type && (null == t.x || null == t.y)) {
  3462. var n = e.changedTouches;
  3463. null != n && n.length > 0 && (t.x = n[0].clientX, t.y = n[0].clientY)
  3464. }
  3465. return (null == t.x || t.x < 0) && (t.x = 0), (null == t.y || t.y < 0) && (t.y = 0), t
  3466. },
  3467. s = function(e, t) {
  3468. var n = l(e),
  3469. o = n.x,
  3470. i = n.y,
  3471. a = {
  3472. width: window.innerWidth,
  3473. height: window.innerHeight
  3474. },
  3475. r = {
  3476. width: t.offsetWidth,
  3477. height: t.offsetHeight
  3478. };
  3479. return o + r.width > a.width && (o -= o + r.width - a.width), i + r.height > a.height && (i -= i + r.height - a.height), r.height > a.height && (i = 0, t.classList.add("basicContext--scrollable")), {
  3480. x: o,
  3481. y: i,
  3482. rx: n.x - o,
  3483. ry: n.y - i
  3484. }
  3485. },
  3486. c = function() {
  3487. var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0];
  3488. return null != e.fn && (!1 !== e.visible && (!0 !== e.disabled && (o("td[data-num='" + e.num + "']").onclick = e.fn, o("td[data-num='" + e.num + "']").oncontextmenu = e.fn, !0)))
  3489. },
  3490. u = function(t, n, i, a) {
  3491. var l = r(t);
  3492. document.body.insertAdjacentHTML("beforeend", l), null == e && (e = document.body.style.overflow, document.body.style.overflow = "hidden");
  3493. var u = o(),
  3494. d = s(n, u);
  3495. return u.style.left = d.x + "px", u.style.top = d.y + "px", u.style.transformOrigin = d.rx + "px " + d.ry + "px", u.style.opacity = 1, null == i && (i = p), u.parentElement.onclick = i, u.parentElement.oncontextmenu = i, t.forEach(c), "function" == typeof n.preventDefault && n.preventDefault(), "function" == typeof n.stopPropagation && n.stopPropagation(), "function" == typeof a && a(), !0
  3496. },
  3497. d = function() {
  3498. var e = o();
  3499. return null != e && 0 !== e.length
  3500. },
  3501. p = function() {
  3502. if (!1 === d()) return !1;
  3503. var t = document.querySelector(".basicContextContainer");
  3504. return t.parentElement.removeChild(t), null != e && (document.body.style.overflow = e, e = null), !0
  3505. };
  3506. return {
  3507. ITEM: t,
  3508. SEPARATOR: n,
  3509. show: u,
  3510. visible: d,
  3511. close: p
  3512. }
  3513. }),
  3514. function(e) {
  3515. if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
  3516. else if ("function" == typeof define && define.amd) define([], e);
  3517. else {
  3518. var t;
  3519. t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.basicModal = e()
  3520. }
  3521. }(function() {
  3522. return function e(t, n, o) {
  3523. function i(r, l) {
  3524. if (!n[r]) {
  3525. if (!t[r]) {
  3526. var s = "function" == typeof require && require;
  3527. if (!l && s) return s(r, !0);
  3528. if (a) return a(r, !0);
  3529. var c = new Error("Cannot find module '" + r + "'");
  3530. throw c.code = "MODULE_NOT_FOUND", c
  3531. }
  3532. var u = n[r] = {
  3533. exports: {}
  3534. };
  3535. t[r][0].call(u.exports, function(e) {
  3536. return i(t[r][1][e] || e)
  3537. }, u, u.exports, e, t, n, o)
  3538. }
  3539. return n[r].exports
  3540. }
  3541. for (var a = "function" == typeof require && require, r = 0; r < o.length; r++) i(o[r]);
  3542. return i
  3543. }({
  3544. 1: [function(e, t, n) {
  3545. "use strict";
  3546. Object.defineProperty(n, "__esModule", {
  3547. value: !0
  3548. });
  3549. var o = null,
  3550. i = (n.THEME = {
  3551. small: "basicModal__small",
  3552. xclose: "basicModal__xclose"
  3553. }, function() {
  3554. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
  3555. return !0 === (arguments.length > 1 && void 0 !== arguments[1] && arguments[1]) ? document.querySelectorAll(".basicModal " + e) : document.querySelector(".basicModal " + e)
  3556. }),
  3557. a = function(e, t) {
  3558. return null != e && (e.constructor === Object ? Array.prototype.forEach.call(Object.keys(e), function(n) {
  3559. return t(e[n], n, e)
  3560. }) : Array.prototype.forEach.call(e, function(n, o) {
  3561. return t(n, o, e)
  3562. }))
  3563. },
  3564. r = function(e) {
  3565. return null == e || 0 === Object.keys(e).length ? (console.error("Missing or empty modal configuration object"), !1) : (null == e.body && (e.body = ""), null == e.class && (e.class = ""), !1 !== e.closable && (e.closable = !0), null == e.buttons ? (console.error("basicModal requires at least one button"), !1) : null != e.buttons.action && (null == e.buttons.action.class && (e.buttons.action.class = ""), null == e.buttons.action.title && (e.buttons.action.title = "OK"), null == e.buttons.action.fn) ? (console.error("Missing fn for action-button"), !1) : null == e.buttons.cancel || (null == e.buttons.cancel.class && (e.buttons.cancel.class = ""), null == e.buttons.cancel.title && (e.buttons.cancel.title = "Cancel"), null != e.buttons.cancel.fn) || (console.error("Missing fn for cancel-button"), !1))
  3566. },
  3567. l = function(e) {
  3568. var t = "";
  3569. return t += "\n\t <div class='basicModalContainer basicModalContainer--fadeIn' data-closable='" + e.closable + "'>\n\t <div class='basicModal basicModal--fadeIn " + e.class + "' role=\"dialog\">\n\t <div class='basicModal__content'>\n\t " + e.body + "\n\t </div>\n\t <div class='basicModal__buttons'>\n\t ", null != e.buttons.cancel && (-1 === e.buttons.cancel.class.indexOf("basicModal__xclose") ? t += "<a id='basicModal__cancel' class='basicModal__button " + e.buttons.cancel.class + "'>" + e.buttons.cancel.title + "</a>" : t += "<div id='basicModal__cancel' class='basicModal__button " + e.buttons.cancel.class + '\' aria-label=\'close\'><svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M405 136.798l-29.798-29.798-119.202 119.202-119.202-119.202-29.798 29.798 119.202 119.202-119.202 119.202 29.798 29.798 119.202-119.202 119.202 119.202 29.798-29.798-119.202-119.202z"/></svg></div>'), null != e.buttons.action && (t += "<a id='basicModal__action' class='basicModal__button " + e.buttons.action.class + "'>" + e.buttons.action.title + "</a>"), t += "\n\t </div>\n\t </div>\n\t </div>\n\t "
  3570. },
  3571. s = n.getValues = function() {
  3572. var e = {},
  3573. t = i("input[name]", !0),
  3574. n = i("select[name]", !0);
  3575. return a(t, function(t) {
  3576. var n = t.getAttribute("name"),
  3577. o = t.value;
  3578. e[n] = o
  3579. }), a(n, function(t) {
  3580. var n = t.getAttribute("name"),
  3581. o = t.options[t.selectedIndex].value;
  3582. e[n] = o
  3583. }), 0 === Object.keys(e).length ? null : e
  3584. },
  3585. c = function(e) {
  3586. return null != e.buttons.cancel && (i("#basicModal__cancel").onclick = function() {
  3587. if (!0 === this.classList.contains("basicModal__button--active")) return !1;
  3588. this.classList.add("basicModal__button--active"), e.buttons.cancel.fn()
  3589. }), null != e.buttons.action && (i("#basicModal__action").onclick = function() {
  3590. if (!0 === this.classList.contains("basicModal__button--active")) return !1;
  3591. this.classList.add("basicModal__button--active"), e.buttons.action.fn(s())
  3592. }), a(i("input", !0), function(e) {
  3593. e.oninput = e.onblur = function() {
  3594. this.classList.remove("error")
  3595. }
  3596. }), a(i("select", !0), function(e) {
  3597. e.onchange = e.onblur = function() {
  3598. this.classList.remove("error")
  3599. }
  3600. }), !0
  3601. },
  3602. u = (n.show = function e(t) {
  3603. if (!1 === r(t)) return !1;
  3604. if (null != i()) return p(!0), setTimeout(function() {
  3605. return e(t)
  3606. }, 301), !1;
  3607. o = document.activeElement;
  3608. var n = l(t);
  3609. document.body.insertAdjacentHTML("beforeend", n), c(t);
  3610. var a = i("input");
  3611. null != a && a.select();
  3612. var s = i("select");
  3613. return null == a && null != s && s.focus(), null != t.callback && t.callback(t), !0
  3614. }, n.error = function(e) {
  3615. d();
  3616. var t = i("input[name='" + e + "']") || i("select[name='" + e + "']");
  3617. if (null == t) return !1;
  3618. t.classList.add("error"), "function" == typeof t.select ? t.select() : t.focus(), i().classList.remove("basicModal--fadeIn", "basicModal--shake"), setTimeout(function() {
  3619. return i().classList.add("basicModal--shake")
  3620. }, 1)
  3621. }, n.visible = function() {
  3622. return null != i()
  3623. }),
  3624. d = (n.action = function() {
  3625. var e = i("#basicModal__action");
  3626. return null != e && (e.click(), !0)
  3627. }, n.cancel = function() {
  3628. var e = i("#basicModal__cancel");
  3629. return null != e && (e.click(), !0)
  3630. }, n.reset = function() {
  3631. var e = i(".basicModal__button", !0);
  3632. a(e, function(e) {
  3633. return e.classList.remove("basicModal__button--active")
  3634. });
  3635. var t = i("input", !0);
  3636. a(t, function(e) {
  3637. return e.classList.remove("error")
  3638. });
  3639. var n = i("select", !0);
  3640. return a(n, function(e) {
  3641. return e.classList.remove("error")
  3642. }), !0
  3643. }),
  3644. p = n.close = function() {
  3645. var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
  3646. if (!1 === u()) return !1;
  3647. var t = i().parentElement;
  3648. return ("false" !== t.getAttribute("data-closable") || !1 !== e) && (t.classList.remove("basicModalContainer--fadeIn"), t.classList.add("basicModalContainer--fadeOut"), setTimeout(function() {
  3649. return null != t && null != t.parentElement && void t.parentElement.removeChild(t)
  3650. }, 300), null != o && (o.focus(), o = null), !0)
  3651. }
  3652. }, {}]
  3653. }, {}, [1])(1)
  3654. });
  3655. var _templateObject = _taggedTemplateLiteral(["<p>Are you sure you want to delete the album '$", "' and all of the photos it contains? This action can't be undone!</p>"], ["<p>Are you sure you want to delete the album '$", "' and all of the photos it contains? This action can't be undone!</p>"]),
  3656. _templateObject2 = _taggedTemplateLiteral(["<p>Are you sure you want to delete all $", " selected albums and all of the photos they contain? This action can't be undone!</p>"], ["<p>Are you sure you want to delete all $", " selected albums and all of the photos they contain? This action can't be undone!</p>"]),
  3657. _templateObject3 = _taggedTemplateLiteral(["<input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='$", "'>"], ["<input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='$", "'>"]),
  3658. _templateObject4 = _taggedTemplateLiteral(["<p>Enter a new title for this album: ", "</p>"], ["<p>Enter a new title for this album: ", "</p>"]),
  3659. _templateObject5 = _taggedTemplateLiteral(["<p>Enter a title for all $", " selected albums: ", "</p>"], ["<p>Enter a title for all $", " selected albums: ", "</p>"]),
  3660. _templateObject6 = _taggedTemplateLiteral(["<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$", "'></p>"], ["<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$", "'></p>"]),
  3661. _templateObject7 = _taggedTemplateLiteral(["<p>Are you sure you want to merge the album '$", "' into the album '$", "'?</p>"], ["<p>Are you sure you want to merge the album '$", "' into the album '$", "'?</p>"]),
  3662. _templateObject8 = _taggedTemplateLiteral(["<p>Are you sure you want to merge all selected albums into the album '$", "'?</p>"], ["<p>Are you sure you want to merge all selected albums into the album '$", "'?</p>"]),
  3663. _templateObject9 = _taggedTemplateLiteral(["<svg class='iconic $", "'><use xlink:href='#$", "' /></svg>"], ["<svg class='iconic $", "'><use xlink:href='#$", "' /></svg>"]),
  3664. _templateObject10 = _taggedTemplateLiteral(["<div class='divider'><h1>$", "</h1></div>"], ["<div class='divider'><h1>$", "</h1></div>"]),
  3665. _templateObject11 = _taggedTemplateLiteral(["<div id='$", "' class='edit'>", "</div>"], ["<div id='$", "' class='edit'>", "</div>"]),
  3666. _templateObject12 = _taggedTemplateLiteral(["<div id='multiselect' style='top: $", "px; left: $", "px;'></div>"], ["<div id='multiselect' style='top: $", "px; left: $", "px;'></div>"]),
  3667. _templateObject13 = _taggedTemplateLiteral(["\n\t <div class='album' data-id='$", "'>\n\t <img src='$", "' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n\t <img src='$", "' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n\t <img src='$", "' srcset='$", " 1.5x' width='200' height='200' alt='Photo thumbnail' data-overlay='$", "' draggable='false'>\n\t <div class='overlay'>\n\t <h1 title='$", "'>$", "</h1>\n\t <a>$", "</a>\n\t </div>\n\t "], ["\n\t <div class='album' data-id='$", "'>\n\t <img src='$", "' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n\t <img src='$", "' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n\t <img src='$", "' srcset='$", " 1.5x' width='200' height='200' alt='Photo thumbnail' data-overlay='$", "' draggable='false'>\n\t <div class='overlay'>\n\t <h1 title='$", "'>$", "</h1>\n\t <a>$", "</a>\n\t </div>\n\t "]),
  3668. _templateObject14 = _taggedTemplateLiteral(["\n\t\t <div class='badges'>\n\t\t <a class='badge $", " icn-star'>", "</a>\n\t\t <a class='badge $", " icn-share'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t </div>\n\t\t "], ["\n\t\t <div class='badges'>\n\t\t <a class='badge $", " icn-star'>", "</a>\n\t\t <a class='badge $", " icn-share'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t </div>\n\t\t "]),
  3669. _templateObject15 = _taggedTemplateLiteral(["\n\t <div class='photo' data-album-id='$", "' data-id='$", "'>\n\t <img src='$", "' srcset='$", " 1.5x' width='200' height='200' alt='Photo thumbnail' draggable='false'>\n\t <div class='overlay'>\n\t <h1 title='$", "'>$", "</h1>\n\t "], ["\n\t <div class='photo' data-album-id='$", "' data-id='$", "'>\n\t <img src='$", "' srcset='$", " 1.5x' width='200' height='200' alt='Photo thumbnail' draggable='false'>\n\t <div class='overlay'>\n\t <h1 title='$", "'>$", "</h1>\n\t "]),
  3670. _templateObject16 = _taggedTemplateLiteral(["<a><span title='Camera Date'>", "</span>$", "</a>"], ["<a><span title='Camera Date'>", "</span>$", "</a>"]),
  3671. _templateObject17 = _taggedTemplateLiteral(["<a>$", "</a>"], ["<a>$", "</a>"]),
  3672. _templateObject18 = _taggedTemplateLiteral(["\n\t\t <div class='badges'>\n\t\t <a class='badge $", " icn-star'>", "</a>\n\t\t <a class='badge $", " icn-share'>", "</a>\n\t\t </div>\n\t\t "], ["\n\t\t <div class='badges'>\n\t\t <a class='badge $", " icn-star'>", "</a>\n\t\t <a class='badge $", " icn-share'>", "</a>\n\t\t </div>\n\t\t "]),
  3673. _templateObject19 = _taggedTemplateLiteral(["<img id='image' class='$", "' src='$", "' draggable='false'>"], ["<img id='image' class='$", "' src='$", "' draggable='false'>"]),
  3674. _templateObject20 = _taggedTemplateLiteral(["<img id='image' class='$", "' src='$", "' srcset='$", " 1920w, $", " $", "w' draggable='false'>"], ["<img id='image' class='$", "' src='$", "' srcset='$", " 1920w, $", " $", "w' draggable='false'>"]),
  3675. _templateObject21 = _taggedTemplateLiteral(["\n\t <h1>$", "</h1>\n\t <div class='rows'>\n\t "], ["\n\t <h1>$", "</h1>\n\t <div class='rows'>\n\t "]),
  3676. _templateObject22 = _taggedTemplateLiteral(["\n\t\t <div class='row'>\n\t\t <a class='name'>$", "</a>\n\t\t <a class='status'></a>\n\t\t <p class='notice'></p>\n\t\t </div>\n\t\t "], ["\n\t\t <div class='row'>\n\t\t <a class='name'>$", "</a>\n\t\t <a class='status'></a>\n\t\t <p class='notice'></p>\n\t\t </div>\n\t\t "]),
  3677. _templateObject23 = _taggedTemplateLiteral(["<a class='tag'>$", "<span data-index='$", "'>", "</span></a>"], ["<a class='tag'>$", "<span data-index='$", "'>", "</span></a>"]),
  3678. _templateObject24 = _taggedTemplateLiteral(["<img class='cover' width='16' height='16' src='$", "'><div class='title'>$", "</div>"], ["<img class='cover' width='16' height='16' src='$", "'><div class='title'>$", "</div>"]),
  3679. _templateObject25 = _taggedTemplateLiteral(["$", "", ""], ["$", "", ""]),
  3680. _templateObject26 = _taggedTemplateLiteral(["\n\t <p class='signIn'>\n\t <input class='text' name='username' autocomplete='username' type='text' placeholder='username' autocapitalize='off' autocorrect='off'>\n\t <input class='text' name='password' autocomplete='current-password' type='password' placeholder='password'>\n\t </p>\n\t <p class='version'>Lychee $", "<span> &#8211; <a target='_blank' href='$", "'>Update available!</a><span></p>\n\t "], ["\n\t <p class='signIn'>\n\t <input class='text' name='username' autocomplete='username' type='text' placeholder='username' autocapitalize='off' autocorrect='off'>\n\t <input class='text' name='password' autocomplete='current-password' type='password' placeholder='password'>\n\t </p>\n\t <p class='version'>Lychee $", "<span> &#8211; <a target='_blank' href='$", "'>Update available!</a><span></p>\n\t "]),
  3681. _templateObject27 = _taggedTemplateLiteral(["<p>Are you sure you want to delete the photo '$", "'? This action can't be undone!</p>"], ["<p>Are you sure you want to delete the photo '$", "'? This action can't be undone!</p>"]),
  3682. _templateObject28 = _taggedTemplateLiteral(["<p>Are you sure you want to delete all $", " selected photo? This action can't be undone!</p>"], ["<p>Are you sure you want to delete all $", " selected photo? This action can't be undone!</p>"]),
  3683. _templateObject29 = _taggedTemplateLiteral(["<p>Enter a new title for this photo: ", "</p>"], ["<p>Enter a new title for this photo: ", "</p>"]),
  3684. _templateObject30 = _taggedTemplateLiteral(["<p>Enter a title for all $", " selected photos: ", "</p>"], ["<p>Enter a title for all $", " selected photos: ", "</p>"]),
  3685. _templateObject31 = _taggedTemplateLiteral(["<p>Enter a description for this photo: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$", "'></p>"], ["<p>Enter a description for this photo: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$", "'></p>"]),
  3686. _templateObject32 = _taggedTemplateLiteral(["<input class='text' name='tags' type='text' maxlength='800' placeholder='Tags' value='$", "'>"], ["<input class='text' name='tags' type='text' maxlength='800' placeholder='Tags' value='$", "'>"]),
  3687. _templateObject33 = _taggedTemplateLiteral(["<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: ", "</p>"], ["<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: ", "</p>"]),
  3688. _templateObject34 = _taggedTemplateLiteral(["<p>Enter your tags for all $", " selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: ", "</p>"], ["<p>Enter your tags for all $", " selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: ", "</p>"]),
  3689. _templateObject35 = _taggedTemplateLiteral(["\n\t <p>\n\t In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below:\n\t <input class='text' name='key' type='text' placeholder='Dropbox API Key' value='$", "'>\n\t </p>\n\t "], ["\n\t <p>\n\t In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below:\n\t <input class='text' name='key' type='text' placeholder='Dropbox API Key' value='$", "'>\n\t </p>\n\t "]),
  3690. _templateObject36 = _taggedTemplateLiteral(["<span class='attr_$", "'>$", "</span>"], ["<span class='attr_$", "'>$", "</span>"]),
  3691. _templateObject37 = _taggedTemplateLiteral(["\n\t\t\t <tr>\n\t\t\t <td>$", "</td>\n\t\t\t <td>", "</td>\n\t\t\t </tr>\n\t\t\t "], ["\n\t\t\t <tr>\n\t\t\t <td>$", "</td>\n\t\t\t <td>", "</td>\n\t\t\t </tr>\n\t\t\t "]),
  3692. _templateObject38 = _taggedTemplateLiteral(["\n\t\t <div class='sidebar__divider'>\n\t\t <h1>$", "</h1>\n\t\t </div>\n\t\t <div id='tags'>\n\t\t <div class='attr_$", "'>", "</div>\n\t\t ", "\n\t\t </div>\n\t\t "], ["\n\t\t <div class='sidebar__divider'>\n\t\t <h1>$", "</h1>\n\t\t </div>\n\t\t <div id='tags'>\n\t\t <div class='attr_$", "'>", "</div>\n\t\t ", "\n\t\t </div>\n\t\t "]),
  3693. _templateObject39 = _taggedTemplateLiteral(["<p>Please enter the direct link to a photo to import it: <input class='text' name='link' type='text' placeholder='http://' value='$", "'></p>"], ["<p>Please enter the direct link to a photo to import it: <input class='text' name='link' type='text' placeholder='http://' value='$", "'></p>"]),
  3694. _templateObject40 = _taggedTemplateLiteral(["<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='$", "uploads/import/'></p>"], ["<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='$", "uploads/import/'></p>"]),
  3695. _templateObject41 = _taggedTemplateLiteral(['linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$', '")'], ['linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$', '")']);
  3696. ! function(e) {
  3697. var t = function(t) {
  3698. var n = this;
  3699. this.el = e(t), this.pos = {
  3700. start: {
  3701. x: 0,
  3702. y: 0
  3703. },
  3704. end: {
  3705. x: 0,
  3706. y: 0
  3707. }
  3708. }, this.startTime, t.on("touchstart", function(e) {
  3709. n.touchStart(e)
  3710. }), t.on("touchmove", function(e) {
  3711. n.touchMove(e)
  3712. }), t.on("touchend", function(e) {
  3713. n.swipeEnd()
  3714. }), t.on("mousedown", function(e) {
  3715. n.mouseDown(e)
  3716. })
  3717. };
  3718. t.prototype = {
  3719. touchStart: function(e) {
  3720. var t = e.originalEvent.touches[0];
  3721. this.swipeStart(e, t.pageX, t.pageY)
  3722. },
  3723. touchMove: function(e) {
  3724. var t = e.originalEvent.touches[0];
  3725. this.swipeMove(e, t.pageX, t.pageY)
  3726. },
  3727. mouseDown: function(e) {
  3728. var t = this;
  3729. this.swipeStart(e, e.pageX, e.pageY), this.el.on("mousemove", function(e) {
  3730. t.mouseMove(e)
  3731. }), this.el.on("mouseup", function() {
  3732. t.mouseUp()
  3733. })
  3734. },
  3735. mouseMove: function(e) {
  3736. this.swipeMove(e, e.pageX, e.pageY)
  3737. },
  3738. mouseUp: function(e) {
  3739. this.swipeEnd(e), this.el.off("mousemove"), this.el.off("mouseup")
  3740. },
  3741. swipeStart: function(e, t, n) {
  3742. this.pos.start.x = t, this.pos.start.y = n, this.pos.end.x = t, this.pos.end.y = n, this.startTime = (new Date).getTime(), this.trigger("swipeStart", e)
  3743. },
  3744. swipeMove: function(e, t, n) {
  3745. this.pos.end.x = t, this.pos.end.y = n, this.trigger("swipeMove", e)
  3746. },
  3747. swipeEnd: function(e) {
  3748. this.trigger("swipeEnd", e)
  3749. },
  3750. trigger: function(t, n) {
  3751. var o = this,
  3752. i = e.Event(t),
  3753. a = o.pos.start.x - o.pos.end.x,
  3754. r = o.pos.end.y - o.pos.start.y,
  3755. l = Math.atan2(r, a),
  3756. s = "up",
  3757. c = Math.round(Math.sqrt(Math.pow(a, 2) + Math.pow(r, 2))),
  3758. u = Math.round(180 * l / Math.PI),
  3759. d = Math.round(c / ((new Date).getTime() - o.startTime) * 1e3);
  3760. u < 0 && (u = 360 - Math.abs(u)), u <= 45 && u >= 0 || u <= 360 && u >= 315 ? s = "left" : u >= 135 && u <= 225 ? s = "right" : u > 45 && u < 135 && (s = "down"), i.originalEvent = n, i.swipe = {
  3761. x: a,
  3762. y: r,
  3763. direction: s,
  3764. distance: c,
  3765. angle: u,
  3766. speed: d
  3767. }, e(o.el).trigger(i)
  3768. }
  3769. }, e.fn.swipe = function() {
  3770. new t(this);
  3771. return this
  3772. }
  3773. }(jQuery), album = {
  3774. json: null
  3775. }, album.getID = function() {
  3776. var e = null,
  3777. t = function(e) {
  3778. return "0" === e || "f" === e || "s" === e || "r" === e || $.isNumeric(e)
  3779. };
  3780. return photo.json ? e = photo.json.album : album.json && (e = album.json.id), !1 === t(e) && (e = $(".album:hover, .album.active").attr("data-id")), !1 === t(e) && (e = $(".photo:hover, .photo.active").attr("data-album-id")), !0 === t(e) && e
  3781. }, album.load = function(e) {
  3782. var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
  3783. password.get(e, function() {
  3784. !1 === t && lychee.animate(".content", "contentZoomOut");
  3785. var n = (new Date).getTime(),
  3786. o = {
  3787. albumID: e,
  3788. password: password.value
  3789. };
  3790. api.post("Album::get", o, function(o) {
  3791. var i = 0;
  3792. if ("Warning: Album private!" === o) return void 0 != document.location.hash.replace("#", "").split("/")[1] ? lychee.setMode("view") : (lychee.content.show(), lychee.goto()), !1;
  3793. if ("Warning: Wrong password!" === o) return album.load(e, t), !1;
  3794. album.json = o;
  3795. var a = (new Date).getTime() - n;
  3796. i = a > 300 ? 0 : 300 - a, !0 === t && (i = 0), visible.albums() || visible.photo() || visible.album() || (i = 0), setTimeout(function() {
  3797. view.album.init(), !1 === t && (lychee.animate(lychee.content, "contentZoomIn"), header.setMode("album"))
  3798. }, i)
  3799. })
  3800. })
  3801. }, album.parse = function() {
  3802. album.json.title || (album.json.title = "Untitled")
  3803. }, album.add = function() {
  3804. var e = function(e) {
  3805. var t = e.title,
  3806. n = function(e) {
  3807. return !isNaN(parseFloat(e)) && isFinite(e)
  3808. };
  3809. basicModal.close();
  3810. var o = {
  3811. title: t
  3812. };
  3813. api.post("Album::add", o, function(e) {
  3814. !1 !== e && n(e) ? (albums.refresh(), lychee.goto(e)) : lychee.error(null, o, e)
  3815. })
  3816. };
  3817. basicModal.show({
  3818. body: "<p>Enter a title for the new album: <input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='Untitled'></p>",
  3819. buttons: {
  3820. action: {
  3821. title: "Create Album",
  3822. fn: e
  3823. },
  3824. cancel: {
  3825. title: "Cancel",
  3826. fn: basicModal.close
  3827. }
  3828. }
  3829. })
  3830. }, album.delete = function(e) {
  3831. var t = {},
  3832. n = {},
  3833. o = "";
  3834. if (!e) return !1;
  3835. if (e instanceof Array == !1 && (e = [e]), t.fn = function() {
  3836. basicModal.close();
  3837. var t = {
  3838. albumIDs: e.join()
  3839. };
  3840. api.post("Album::delete", t, function(n) {
  3841. visible.albums() ? e.forEach(function(e) {
  3842. albums.json.num--, view.albums.content.delete(e), albums.deleteByID(e)
  3843. }) : (albums.refresh(), lychee.goto()), !0 !== n && lychee.error(null, t, n)
  3844. })
  3845. }, "0" === e.toString()) t.title = "Clear Unsorted", n.title = "Keep Unsorted", o = "<p>Are you sure you want to delete all photos from 'Unsorted'?<br>This action can't be undone!</p>";
  3846. else if (1 === e.length) {
  3847. var i = "";
  3848. t.title = "Delete Album and Photos", n.title = "Keep Album", album.json ? i = album.json.title : albums.json && (i = albums.getByID(e).title), "" === i && (i = "Untitled"), o = lychee.html(_templateObject, i)
  3849. } else t.title = "Delete Albums and Photos", n.title = "Keep Albums", o = lychee.html(_templateObject2, e.length);
  3850. basicModal.show({
  3851. body: o,
  3852. buttons: {
  3853. action: {
  3854. title: t.title,
  3855. fn: t.fn,
  3856. class: "red"
  3857. },
  3858. cancel: {
  3859. title: n.title,
  3860. fn: basicModal.close
  3861. }
  3862. }
  3863. })
  3864. }, album.setTitle = function(e) {
  3865. var t = "",
  3866. n = "";
  3867. if (!e) return !1;
  3868. e instanceof Array == !1 && (e = [e]), 1 === e.length && (album.json ? t = album.json.title : albums.json && (t = albums.getByID(e).title));
  3869. var o = function(t) {
  3870. basicModal.close();
  3871. var n = t.title;
  3872. visible.album() ? (album.json.title = n, view.album.title(), albums.json && (albums.getByID(e[0]).title = n)) : visible.albums() && e.forEach(function(e) {
  3873. albums.getByID(e).title = n, view.albums.content.title(e)
  3874. });
  3875. var o = {
  3876. albumIDs: e.join(),
  3877. title: n
  3878. };
  3879. api.post("Album::setTitle", o, function(e) {
  3880. !0 !== e && lychee.error(null, o, e)
  3881. })
  3882. },
  3883. i = lychee.html(_templateObject3, t);
  3884. n = 1 === e.length ? lychee.html(_templateObject4, i) : lychee.html(_templateObject5, e.length, i), basicModal.show({
  3885. body: n,
  3886. buttons: {
  3887. action: {
  3888. title: "Set Title",
  3889. fn: o
  3890. },
  3891. cancel: {
  3892. title: "Cancel",
  3893. fn: basicModal.close
  3894. }
  3895. }
  3896. })
  3897. }, album.setDescription = function(e) {
  3898. var t = album.json.description,
  3899. n = function(t) {
  3900. var n = t.description;
  3901. basicModal.close(), visible.album() && (album.json.description = n, view.album.description());
  3902. var o = {
  3903. albumID: e,
  3904. description: n
  3905. };
  3906. api.post("Album::setDescription", o, function(e) {
  3907. !0 !== e && lychee.error(null, o, e)
  3908. })
  3909. };
  3910. basicModal.show({
  3911. body: lychee.html(_templateObject6, t),
  3912. buttons: {
  3913. action: {
  3914. title: "Set Description",
  3915. fn: n
  3916. },
  3917. cancel: {
  3918. title: "Cancel",
  3919. fn: basicModal.close
  3920. }
  3921. }
  3922. })
  3923. }, album.setPublic = function(e, t, n) {
  3924. var o = "";
  3925. if (albums.refresh(), !0 === t) {
  3926. var i = "",
  3927. a = {};
  3928. a.fn = function() {
  3929. album.setPublic(album.getID(), !1, n)
  3930. }, "1" === album.json.public ? (a.title = "Edit Sharing", i = "The sharing-properties of this album will be changed to the following:") : (a.title = "Share Album", i = "This album will be shared with the following properties:");
  3931. var r = "\n\t\t <p class='less'>" + i + "</p>\n\t\t <form>\n\t\t <div class='choice'>\n\t\t <label>\n\t\t <input type='checkbox' name='hidden'>\n\t\t <span class='checkbox'>" + build.iconic("check") + "</span>\n\t\t <span class='label'>Hidden</span>\n\t\t </label>\n\t\t <p>Only people with the direct link can view this album.</p>\n\t\t </div>\n\t\t <div class='choice'>\n\t\t <label>\n\t\t <input type='checkbox' name='downloadable'>\n\t\t <span class='checkbox'>" + build.iconic("check") + "</span>\n\t\t <span class='label'>Downloadable</span>\n\t\t </label>\n\t\t <p>Visitors of your Lychee can download this album.</p>\n\t\t </div>\n\t\t <div class='choice'>\n\t\t <label>\n\t\t <input type='checkbox' name='password'>\n\t\t <span class='checkbox'>" + build.iconic("check") + "</span>\n\t\t <span class='label'>Password protected</span>\n\t\t </label>\n\t\t <p>Album only accessible with a valid password.</p>\n\t\t <input class='text' name='passwordtext' type='password' placeholder='password' value=''>\n\t\t </div>\n\t\t </form>\n\t\t ";
  3932. return basicModal.show({
  3933. body: r,
  3934. buttons: {
  3935. action: {
  3936. title: a.title,
  3937. fn: a.fn
  3938. },
  3939. cancel: {
  3940. title: "Cancel",
  3941. fn: basicModal.close
  3942. }
  3943. }
  3944. }), "1" === album.json.public && "0" === album.json.visible && $('.basicModal .choice input[name="hidden"]').click(), "1" === album.json.downloadable && $('.basicModal .choice input[name="downloadable"]').click(), $('.basicModal .choice input[name="password"]').on("change", function() {
  3945. !0 === $(this).prop("checked") ? $('.basicModal .choice input[name="passwordtext"]').show().focus() : $('.basicModal .choice input[name="passwordtext"]').hide()
  3946. }), !0
  3947. }
  3948. basicModal.visible() ? (album.json.public = "1", 1 === $('.basicModal .choice input[name="hidden"]:checked').length ? album.json.visible = "0" : album.json.visible = "1", 1 === $('.basicModal .choice input[name="downloadable"]:checked').length ? album.json.downloadable = "1" : album.json.downloadable = "0", 1 === $('.basicModal .choice input[name="password"]:checked').length ? (o = $('.basicModal .choice input[name="passwordtext"]').val(), album.json.password = "1") : (o = "", album.json.password = "0"), basicModal.close()) : album.json.public = "0", visible.album() && (album.json.visible = "0" === album.json.public ? "1" : album.json.visible, album.json.downloadable = "0" === album.json.public ? "0" : album.json.downloadable, album.json.password = "0" === album.json.public ? "0" : album.json.password, view.album.public(), view.album.hidden(), view.album.downloadable(), view.album.password(), "1" === album.json.public && contextMenu.shareAlbum(e, n));
  3949. var l = {
  3950. albumID: e,
  3951. public: album.json.public,
  3952. password: o,
  3953. visible: album.json.visible,
  3954. downloadable: album.json.downloadable
  3955. };
  3956. api.post("Album::setPublic", l, function(e) {
  3957. !0 !== e && lychee.error(null, l, e)
  3958. })
  3959. }, album.share = function(e) {
  3960. var t = location.href;
  3961. switch (e) {
  3962. case "twitter":
  3963. window.open("https://twitter.com/share?url=" + encodeURI(t));
  3964. break;
  3965. case "facebook":
  3966. window.open("http://www.facebook.com/sharer.php?u=" + encodeURI(t) + "&t=" + encodeURI(album.json.title));
  3967. break;
  3968. case "mail":
  3969. location.href = "mailto:?subject=" + encodeURI(album.json.title) + "&body=" + encodeURI(t)
  3970. }
  3971. }, album.getArchive = function(e) {
  3972. var t = "",
  3973. n = api.path + "?function=Album::getArchive&albumID=" + e;
  3974. t = location.href.indexOf("index.html") > 0 ? location.href.replace(location.hash, "").replace("index.html", n) : location.href.replace(location.hash, "") + n, !0 === lychee.publicMode && (t += "&password=" + encodeURIComponent(password.value)), location.href = t
  3975. }, album.merge = function(e) {
  3976. var t = "",
  3977. n = "",
  3978. o = "";
  3979. if (!e) return !1;
  3980. e instanceof Array == !1 && (e = [e]), albums.json && (t = albums.getByID(e[0]).title), "" === t && (t = "Untitled"), 2 === e.length ? (albums.json && (n = albums.getByID(e[1]).title), "" === n && (n = "Untitled"), o = lychee.html(_templateObject7, n, t)) : o = lychee.html(_templateObject8, t);
  3981. var i = function() {
  3982. basicModal.close();
  3983. var t = {
  3984. albumIDs: e.join()
  3985. };
  3986. api.post("Album::merge", t, function(e) {
  3987. !0 !== e ? lychee.error(null, t, e) : (albums.refresh(), lychee.goto())
  3988. })
  3989. };
  3990. basicModal.show({
  3991. body: o,
  3992. buttons: {
  3993. action: {
  3994. title: "Merge Albums",
  3995. fn: i,
  3996. class: "red"
  3997. },
  3998. cancel: {
  3999. title: "Don't Merge",
  4000. fn: basicModal.close
  4001. }
  4002. }
  4003. })
  4004. }, albums = {
  4005. json: null
  4006. }, albums.load = function() {
  4007. var e = (new Date).getTime();
  4008. lychee.animate(".content", "contentZoomOut"), null === albums.json ? api.post("Albums::get", {}, function(t) {
  4009. var n = 0;
  4010. !1 === lychee.publicMode && albums._createSmartAlbums(t.smartalbums), albums.json = t;
  4011. var o = (new Date).getTime() - e;
  4012. n = o > 300 ? 0 : 300 - o, visible.albums() || visible.photo() || visible.album() || (n = 0), visible.album() && "" === lychee.content.html() && (n = 0), setTimeout(function() {
  4013. header.setMode("albums"), view.albums.init(), lychee.animate(lychee.content, "contentZoomIn")
  4014. }, n)
  4015. }) : setTimeout(function() {
  4016. header.setMode("albums"), view.albums.init(), lychee.animate(lychee.content, "contentZoomIn")
  4017. }, 300)
  4018. }, albums.parse = function(e) {
  4019. "1" === e.password && !0 === lychee.publicMode ? (e.thumbs[0] = "src/images/password.svg", e.thumbs[1] = "src/images/password.svg", e.thumbs[2] = "src/images/password.svg") : (e.thumbs[0] || (e.thumbs[0] = "src/images/no_images.svg"), e.thumbs[1] || (e.thumbs[1] = "src/images/no_images.svg"), e.thumbs[2] || (e.thumbs[2] = "src/images/no_images.svg"))
  4020. }, albums._createSmartAlbums = function(e) {
  4021. e.unsorted = {
  4022. id: 0,
  4023. title: "Unsorted",
  4024. sysdate: e.unsorted.num + " photos",
  4025. unsorted: "1",
  4026. thumbs: e.unsorted.thumbs
  4027. }, e.starred = {
  4028. id: "f",
  4029. title: "Starred",
  4030. sysdate: e.starred.num + " photos",
  4031. star: "1",
  4032. thumbs: e.starred.thumbs
  4033. }, e.public = {
  4034. id: "s",
  4035. title: "Public",
  4036. sysdate: e.public.num + " photos",
  4037. public: "1",
  4038. thumbs: e.public.thumbs
  4039. }, e.recent = {
  4040. id: "r",
  4041. title: "Recent",
  4042. sysdate: e.recent.num + " photos",
  4043. recent: "1",
  4044. thumbs: e.recent.thumbs
  4045. }
  4046. }, albums.getByID = function(e) {
  4047. if (null != e && albums.json && albums.json.albums) {
  4048. var t = void 0;
  4049. return $.each(albums.json.albums, function(n) {
  4050. var o = albums.json.albums[n];
  4051. o.id == e && (t = o)
  4052. }), t
  4053. }
  4054. }, albums.deleteByID = function(e) {
  4055. if (null == e) return !1;
  4056. if (!albums.json) return !1;
  4057. if (!albums.json.albums) return !1;
  4058. var t = !1;
  4059. return $.each(albums.json.albums, function(n) {
  4060. if (albums.json.albums[n].id == e) return albums.json.albums.splice(n, 1), t = !0, !1
  4061. }), t
  4062. }, albums.refresh = function() {
  4063. albums.json = null
  4064. }, api = {
  4065. path: "php/index.php",
  4066. onError: null
  4067. }, api.post = function(e, t, n) {
  4068. loadingBar.show(), t = $.extend({
  4069. function: e
  4070. }, t);
  4071. var o = function(e) {
  4072. if (setTimeout(loadingBar.hide, 100), "string" == typeof e && "Error: " === e.substring(0, 7)) return api.onError(e.substring(7, e.length), t, e), !1;
  4073. n(e)
  4074. },
  4075. i = function(e, n, o) {
  4076. api.onError("Server error or API not found.", t, o)
  4077. };
  4078. $.ajax({
  4079. type: "POST",
  4080. url: api.path,
  4081. data: t,
  4082. dataType: "json",
  4083. success: o,
  4084. error: i
  4085. })
  4086. }, build = {}, build.iconic = function(e) {
  4087. var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
  4088. n = "";
  4089. return n += lychee.html(_templateObject9, t, e)
  4090. }, build.divider = function(e) {
  4091. var t = "";
  4092. return t += lychee.html(_templateObject10, e)
  4093. }, build.editIcon = function(e) {
  4094. var t = "";
  4095. return t += lychee.html(_templateObject11, e, build.iconic("pencil"))
  4096. }, build.multiselect = function(e, t) {
  4097. return lychee.html(_templateObject12, e, t)
  4098. }, build.album = function(e) {
  4099. var t = "",
  4100. n = e.sysdate,
  4101. o = lychee.retinize(e.thumbs[0]),
  4102. i = o.path,
  4103. a = o.isPhoto;
  4104. return "" !== lychee.sortingAlbums && (sortingAlbums = lychee.sortingAlbums.replace("ORDER BY ", "").split(" "),
  4105. "max_takestamp" !== sortingAlbums[0] && "min_takestamp" !== sortingAlbums[0] || (n = e.min_takestamp === e.max_takestamp ? e.max_takestamp : e.min_takestamp + " - " + e.max_takestamp)), t += lychee.html(_templateObject13, e.id, e.thumbs[2], e.thumbs[1], e.thumbs[0], i, a, e.title, e.title, n), !1 === lychee.publicMode && (t += lychee.html(_templateObject14, "1" === e.star ? "badge--visible" : "", build.iconic("star"), "1" === e.public ? "badge--visible" : "", build.iconic("eye"), "1" === e.unsorted ? "badge--visible" : "", build.iconic("list"), "1" === e.recent ? "badge--visible" : "", build.iconic("clock"), "1" === e.password ? "badge--visible" : "", build.iconic("lock-locked"))), t += "</div>"
  4106. }, build.photo = function(e) {
  4107. var t = "",
  4108. n = lychee.retinize(e.thumbUrl),
  4109. o = n.path;
  4110. return t += lychee.html(_templateObject15, e.album, e.id, e.thumbUrl, o, e.title, e.title), "1" === e.cameraDate ? t += lychee.html(_templateObject16, build.iconic("camera-slr"), e.sysdate) : t += lychee.html(_templateObject17, e.sysdate), t += "</div>", !1 === lychee.publicMode && (t += lychee.html(_templateObject18, "1" === e.star ? "badge--visible" : "", build.iconic("star"), "1" === e.public && "1" !== album.json.public ? "badge--visible" : "", build.iconic("eye"))), t += "</div>"
  4111. }, build.imageview = function(e, t) {
  4112. var n = "";
  4113. return n += !1 == ("" !== e.medium) ? lychee.html(_templateObject19, !0 === t ? "" : "full", e.url) : lychee.html(_templateObject20, !0 === t ? "" : "full", e.url, e.medium, e.url, e.width), n += "\n\t <div class='arrow_wrapper arrow_wrapper--previous'><a id='previous'>" + build.iconic("caret-left") + "</a></div>\n\t <div class='arrow_wrapper arrow_wrapper--next'><a id='next'>" + build.iconic("caret-right") + "</a></div>\n\t "
  4114. }, build.no_content = function(e) {
  4115. var t = "";
  4116. switch (t += "\n\t <div class='no_content fadeIn'>\n\t " + build.iconic(e) + "\n\t ", e) {
  4117. case "magnifying-glass":
  4118. t += "<p>No results</p>";
  4119. break;
  4120. case "eye":
  4121. t += "<p>No public albums</p>";
  4122. break;
  4123. case "cog":
  4124. t += "<p>No configuration</p>";
  4125. break;
  4126. case "question-mark":
  4127. t += "<p>Photo not found</p>"
  4128. }
  4129. return t += "</div>"
  4130. }, build.uploadModal = function(e, t) {
  4131. var n = "";
  4132. n += lychee.html(_templateObject21, e);
  4133. for (var o = 0; o < t.length;) {
  4134. var i = t[o];
  4135. i.name.length > 40 && (i.name = i.name.substr(0, 17) + "..." + i.name.substr(i.name.length - 20, 20)), n += lychee.html(_templateObject22, i.name), o++
  4136. }
  4137. return n += "</div>"
  4138. }, build.tags = function(e) {
  4139. var t = "";
  4140. return "" !== e ? (e = e.split(","), e.forEach(function(e, n, o) {
  4141. t += lychee.html(_templateObject23, e, n, build.iconic("x"))
  4142. })) : t = "<div class='empty'>No Tags</div>", t
  4143. }, contextMenu = {}, contextMenu.add = function(e) {
  4144. var t = [{
  4145. title: build.iconic("image") + "Upload Photo",
  4146. fn: function() {
  4147. return $("#upload_files").click()
  4148. }
  4149. }, {}, {
  4150. title: build.iconic("link-intact") + "Import from Link",
  4151. fn: upload.start.url
  4152. }, {
  4153. title: build.iconic("dropbox", "ionicons") + "Import from Dropbox",
  4154. fn: upload.start.dropbox
  4155. }, {
  4156. title: build.iconic("terminal") + "Import from Server",
  4157. fn: upload.start.server
  4158. }, {}, {
  4159. title: build.iconic("folder") + "New Album",
  4160. fn: album.add
  4161. }];
  4162. basicContext.show(t, e.originalEvent), upload.notify()
  4163. }, contextMenu.settings = function(e) {
  4164. var t = [{
  4165. title: build.iconic("person") + "Change Login",
  4166. fn: settings.setLogin
  4167. }, {
  4168. title: build.iconic("sort-ascending") + "Change Sorting",
  4169. fn: settings.setSorting
  4170. }, {
  4171. title: build.iconic("dropbox", "ionicons") + "Set Dropbox",
  4172. fn: settings.setDropboxKey
  4173. }, {}, {
  4174. title: build.iconic("info") + "About Lychee",
  4175. fn: function() {
  4176. return window.open(lychee.website)
  4177. }
  4178. }, {
  4179. title: build.iconic("wrench") + "Diagnostics",
  4180. fn: function() {
  4181. return window.open("plugins/Diagnostics/")
  4182. }
  4183. }, {
  4184. title: build.iconic("align-left") + "Show Log",
  4185. fn: function() {
  4186. return window.open("plugins/Log/")
  4187. }
  4188. }, {}, {
  4189. title: build.iconic("account-logout") + "Sign Out",
  4190. fn: lychee.logout
  4191. }];
  4192. basicContext.show(t, e.originalEvent)
  4193. }, contextMenu.album = function(e, t) {
  4194. if ("0" === e || "f" === e || "s" === e || "r" === e) return !1;
  4195. var n = albums.json && albums.json.albums && Object.keys(albums.json.albums).length > 1,
  4196. o = [{
  4197. title: build.iconic("pencil") + "Rename",
  4198. fn: function() {
  4199. return album.setTitle([e])
  4200. }
  4201. }, {
  4202. title: build.iconic("collapse-left") + "Merge",
  4203. visible: n,
  4204. fn: function() {
  4205. basicContext.close(), contextMenu.mergeAlbum(e, t)
  4206. }
  4207. }, {
  4208. title: build.iconic("trash") + "Delete",
  4209. fn: function() {
  4210. return album.delete([e])
  4211. }
  4212. }];
  4213. $('.album[data-id="' + e + '"]').addClass("active"), basicContext.show(o, t.originalEvent, contextMenu.close)
  4214. }, contextMenu.albumMulti = function(e, t) {
  4215. multiselect.stopResize();
  4216. var n = e.length > 1,
  4217. o = albums.json && albums.json.albums && Object.keys(albums.json.albums).length > 1,
  4218. i = [{
  4219. title: build.iconic("pencil") + "Rename All",
  4220. fn: function() {
  4221. return album.setTitle(e)
  4222. }
  4223. }, {
  4224. title: build.iconic("collapse-left") + "Merge All",
  4225. visible: o && n,
  4226. fn: function() {
  4227. return album.merge(e)
  4228. }
  4229. }, {
  4230. title: build.iconic("collapse-left") + "Merge",
  4231. visible: o && !n,
  4232. fn: function() {
  4233. basicContext.close(), contextMenu.mergeAlbum(e[0], t)
  4234. }
  4235. }, {
  4236. title: build.iconic("trash") + "Delete All",
  4237. fn: function() {
  4238. return album.delete(e)
  4239. }
  4240. }];
  4241. i.push(), basicContext.show(i, t.originalEvent, contextMenu.close)
  4242. }, contextMenu.albumTitle = function(e, t) {
  4243. api.post("Albums::get", {}, function(n) {
  4244. var o = [];
  4245. n.albums && n.num > 1 && ($.each(n.albums, function() {
  4246. var t = this;
  4247. this.thumbs[0] || (this.thumbs[0] = "src/images/no_cover.svg"), "" === this.title && (this.title = "Untitled");
  4248. var n = lychee.html(_templateObject24, this.thumbs[0], this.title);
  4249. this.id != e && o.push({
  4250. title: n,
  4251. fn: function() {
  4252. return lychee.goto(t.id)
  4253. }
  4254. })
  4255. }), o.unshift({})), o.unshift({
  4256. title: build.iconic("pencil") + "Rename",
  4257. fn: function() {
  4258. return album.setTitle([e])
  4259. }
  4260. }), basicContext.show(o, t.originalEvent, contextMenu.close)
  4261. })
  4262. }, contextMenu.mergeAlbum = function(e, t) {
  4263. api.post("Albums::get", {}, function(n) {
  4264. var o = [];
  4265. if (n.albums && n.num > 1 && $.each(n.albums, function() {
  4266. var t = this;
  4267. this.thumbs[0] || (this.thumbs[0] = "src/images/no_cover.svg"), "" === this.title && (this.title = "Untitled");
  4268. var n = lychee.html(_templateObject24, this.thumbs[0], this.title);
  4269. this.id != e && o.push({
  4270. title: n,
  4271. fn: function() {
  4272. return album.merge([e, t.id])
  4273. }
  4274. })
  4275. }), 0 === o.length) return !1;
  4276. basicContext.show(o, t.originalEvent, contextMenu.close)
  4277. })
  4278. }, contextMenu.photo = function(e, t) {
  4279. var n = [{
  4280. title: build.iconic("star") + "Star",
  4281. fn: function() {
  4282. return photo.setStar([e])
  4283. }
  4284. }, {
  4285. title: build.iconic("tag") + "Tags",
  4286. fn: function() {
  4287. return photo.editTags([e])
  4288. }
  4289. }, {}, {
  4290. title: build.iconic("pencil") + "Rename",
  4291. fn: function() {
  4292. return photo.setTitle([e])
  4293. }
  4294. }, {
  4295. title: build.iconic("layers") + "Duplicate",
  4296. fn: function() {
  4297. return photo.duplicate([e])
  4298. }
  4299. }, {
  4300. title: build.iconic("folder") + "Move",
  4301. fn: function() {
  4302. basicContext.close(), contextMenu.move([e], t)
  4303. }
  4304. }, {
  4305. title: build.iconic("trash") + "Delete",
  4306. fn: function() {
  4307. return photo.delete([e])
  4308. }
  4309. }];
  4310. $('.photo[data-id="' + e + '"]').addClass("active"), basicContext.show(n, t.originalEvent, contextMenu.close)
  4311. }, contextMenu.photoMulti = function(e, t) {
  4312. multiselect.stopResize();
  4313. var n = [{
  4314. title: build.iconic("star") + "Star All",
  4315. fn: function() {
  4316. return photo.setStar(e)
  4317. }
  4318. }, {
  4319. title: build.iconic("tag") + "Tag All",
  4320. fn: function() {
  4321. return photo.editTags(e)
  4322. }
  4323. }, {}, {
  4324. title: build.iconic("pencil") + "Rename All",
  4325. fn: function() {
  4326. return photo.setTitle(e)
  4327. }
  4328. }, {
  4329. title: build.iconic("layers") + "Duplicate All",
  4330. fn: function() {
  4331. return photo.duplicate(e)
  4332. }
  4333. }, {
  4334. title: build.iconic("folder") + "Move All",
  4335. fn: function() {
  4336. basicContext.close(), contextMenu.move(e, t)
  4337. }
  4338. }, {
  4339. title: build.iconic("trash") + "Delete All",
  4340. fn: function() {
  4341. return photo.delete(e)
  4342. }
  4343. }];
  4344. basicContext.show(n, t.originalEvent, contextMenu.close)
  4345. }, contextMenu.photoTitle = function(e, t, n) {
  4346. var o = [{
  4347. title: build.iconic("pencil") + "Rename",
  4348. fn: function() {
  4349. return photo.setTitle([t])
  4350. }
  4351. }],
  4352. i = album.json;
  4353. !1 !== i.content && i.num > 1 && (o.push({}), $.each(i.content, function(n) {
  4354. var i = this;
  4355. "" === this.title && (this.title = "Untitled");
  4356. var a = lychee.html(_templateObject24, this.thumbUrl, this.title);
  4357. this.id != t && o.push({
  4358. title: a,
  4359. fn: function() {
  4360. return lychee.goto(e + "/" + i.id)
  4361. }
  4362. })
  4363. })), basicContext.show(o, n.originalEvent, contextMenu.close)
  4364. }, contextMenu.photoMore = function(e, t) {
  4365. var n = !1 === lychee.publicMode || album.json && album.json.downloadable && "1" === album.json.downloadable && !0 === lychee.publicMode,
  4366. o = [{
  4367. title: build.iconic("fullscreen-enter") + "Full Photo",
  4368. fn: function() {
  4369. return window.open(photo.getDirectLink())
  4370. }
  4371. }, {
  4372. title: build.iconic("cloud-download") + "Download",
  4373. visible: n,
  4374. fn: function() {
  4375. return photo.getArchive(e)
  4376. }
  4377. }];
  4378. basicContext.show(o, t.originalEvent)
  4379. }, contextMenu.move = function(e, t) {
  4380. var n = [];
  4381. api.post("Albums::get", {}, function(o) {
  4382. 0 === o.num ? n = [{
  4383. title: "New Album",
  4384. fn: album.add
  4385. }] : ($.each(o.albums, function() {
  4386. var t = this;
  4387. this.thumbs[0] || (this.thumbs[0] = "src/images/no_cover.svg"), "" === this.title && (this.title = "Untitled");
  4388. var o = lychee.html(_templateObject24, this.thumbs[0], this.title);
  4389. this.id != album.getID() && n.push({
  4390. title: o,
  4391. fn: function() {
  4392. return photo.setAlbum(e, t.id)
  4393. }
  4394. })
  4395. }), "0" !== album.getID() && (n.unshift({}), n.unshift({
  4396. title: "Unsorted",
  4397. fn: function() {
  4398. return photo.setAlbum(e, 0)
  4399. }
  4400. }))), basicContext.show(n, t.originalEvent, contextMenu.close)
  4401. })
  4402. }, contextMenu.sharePhoto = function(e, t) {
  4403. var n = photo.getViewLink(e),
  4404. o = [{
  4405. title: '<input readonly id="link" value="' + n + '">',
  4406. fn: function() {},
  4407. class: "basicContext__item--noHover"
  4408. }, {}, {
  4409. title: build.iconic("twitter", "ionicons") + "Twitter",
  4410. fn: function() {
  4411. return photo.share(e, "twitter")
  4412. }
  4413. }, {
  4414. title: build.iconic("facebook", "ionicons") + "Facebook",
  4415. fn: function() {
  4416. return photo.share(e, "facebook")
  4417. }
  4418. }, {
  4419. title: build.iconic("envelope-closed") + "Mail",
  4420. fn: function() {
  4421. return photo.share(e, "mail")
  4422. }
  4423. }, {
  4424. title: build.iconic("dropbox", "ionicons") + "Dropbox",
  4425. visible: !1 === lychee.publicMode,
  4426. fn: function() {
  4427. return photo.share(e, "dropbox")
  4428. }
  4429. }, {
  4430. title: build.iconic("link-intact") + "Direct Link",
  4431. fn: function() {
  4432. return window.open(photo.getDirectLink())
  4433. }
  4434. }, {}, {
  4435. title: build.iconic("ban") + "Make Private",
  4436. visible: !1 === lychee.publicMode,
  4437. fn: function() {
  4438. return photo.setPublic(e)
  4439. }
  4440. }];
  4441. !0 === lychee.publicMode && o.splice(7, 1), basicContext.show(o, t.originalEvent), $(".basicContext input#link").focus().select()
  4442. }, contextMenu.shareAlbum = function(e, t) {
  4443. var n = [{
  4444. title: '<input readonly id="link" value="' + location.href + '">',
  4445. fn: function() {},
  4446. class: "basicContext__item--noHover"
  4447. }, {}, {
  4448. title: build.iconic("twitter", "ionicons") + "Twitter",
  4449. fn: function() {
  4450. return album.share("twitter")
  4451. }
  4452. }, {
  4453. title: build.iconic("facebook", "ionicons") + "Facebook",
  4454. fn: function() {
  4455. return album.share("facebook")
  4456. }
  4457. }, {
  4458. title: build.iconic("envelope-closed") + "Mail",
  4459. fn: function() {
  4460. return album.share("mail")
  4461. }
  4462. }, {}, {
  4463. title: build.iconic("pencil") + "Edit Sharing",
  4464. visible: !1 === lychee.publicMode,
  4465. fn: function() {
  4466. return album.setPublic(e, !0, t)
  4467. }
  4468. }, {
  4469. title: build.iconic("ban") + "Make Private",
  4470. visible: !1 === lychee.publicMode,
  4471. fn: function() {
  4472. return album.setPublic(e, !1)
  4473. }
  4474. }];
  4475. !0 === lychee.publicMode && n.splice(5, 1), basicContext.show(n, t.originalEvent), $(".basicContext input#link").focus().select()
  4476. }, contextMenu.close = function() {
  4477. if (!visible.contextMenu()) return !1;
  4478. basicContext.close(), $(".photo.active, .album.active").removeClass("active"), visible.multiselect() && multiselect.close()
  4479. }, header = {
  4480. _dom: $(".header")
  4481. }, header.dom = function(e) {
  4482. return null == e || "" === e ? header._dom : header._dom.find(e)
  4483. }, header.bind = function() {
  4484. var e = lychee.getEventName();
  4485. return header.dom(".header__title").on(e, function(e) {
  4486. if (!1 === $(this).hasClass("header__title--editable")) return !1;
  4487. visible.photo() ? contextMenu.photoTitle(album.getID(), photo.getID(), e) : contextMenu.albumTitle(album.getID(), e)
  4488. }), header.dom("#button_share").on(e, function(e) {
  4489. "1" === photo.json.public || "2" === photo.json.public ? contextMenu.sharePhoto(photo.getID(), e) : photo.setPublic(photo.getID(), e)
  4490. }), header.dom("#button_share_album").on(e, function(e) {
  4491. "1" === album.json.public ? contextMenu.shareAlbum(album.getID(), e) : album.setPublic(album.getID(), !0, e)
  4492. }), header.dom("#button_signin").on(e, lychee.loginDialog), header.dom("#button_settings").on(e, contextMenu.settings), header.dom("#button_info_album").on(e, sidebar.toggle), header.dom("#button_info").on(e, sidebar.toggle), header.dom(".button_add").on(e, contextMenu.add), header.dom("#button_more").on(e, function(e) {
  4493. contextMenu.photoMore(photo.getID(), e)
  4494. }), header.dom("#button_move").on(e, function(e) {
  4495. contextMenu.move([photo.getID()], e)
  4496. }), header.dom(".header__hostedwith").on(e, function() {
  4497. window.open(lychee.website)
  4498. }), header.dom("#button_trash_album").on(e, function() {
  4499. album.delete([album.getID()])
  4500. }), header.dom("#button_trash").on(e, function() {
  4501. photo.delete([photo.getID()])
  4502. }), header.dom("#button_archive").on(e, function() {
  4503. album.getArchive(album.getID())
  4504. }), header.dom("#button_star").on(e, function() {
  4505. photo.setStar([photo.getID()])
  4506. }), header.dom("#button_back_home").on(e, function() {
  4507. lychee.goto()
  4508. }), header.dom("#button_back").on(e, function() {
  4509. lychee.goto(album.getID())
  4510. }), header.dom(".header__search").on("keyup click", function() {
  4511. search.find($(this).val())
  4512. }), header.dom(".header__clear").on(e, function() {
  4513. header.dom(".header__search").focus(), search.reset()
  4514. }), !0
  4515. }, header.show = function() {
  4516. return lychee.imageview.removeClass("full"), header.dom().removeClass("header--hidden"), !0
  4517. }, header.hide = function(e) {
  4518. return !(!visible.photo() || visible.sidebar() || visible.contextMenu() || !1 !== basicModal.visible()) && (lychee.imageview.addClass("full"), header.dom().addClass("header--hidden"), !0)
  4519. }, header.setTitle = function() {
  4520. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "Untitled",
  4521. t = header.dom(".header__title"),
  4522. n = lychee.html(_templateObject25, e, build.iconic("caret-bottom"));
  4523. return t.html(n), !0
  4524. }, header.setMode = function(e) {
  4525. switch ("albums" === e && !0 === lychee.publicMode && (e = "public"), e) {
  4526. case "public":
  4527. return header.dom().removeClass("header--view"), header.dom(".header__toolbar--albums, .header__toolbar--album, .header__toolbar--photo").removeClass("header__toolbar--visible"), header.dom(".header__toolbar--public").addClass("header__toolbar--visible"), !0;
  4528. case "albums":
  4529. return header.dom().removeClass("header--view"), header.dom(".header__toolbar--public, .header__toolbar--album, .header__toolbar--photo").removeClass("header__toolbar--visible"), header.dom(".header__toolbar--albums").addClass("header__toolbar--visible"), !0;
  4530. case "album":
  4531. var t = album.getID();
  4532. return header.dom().removeClass("header--view"), header.dom(".header__toolbar--public, .header__toolbar--albums, .header__toolbar--photo").removeClass("header__toolbar--visible"), header.dom(".header__toolbar--album").addClass("header__toolbar--visible"), !1 === album.json.content ? $("#button_archive").hide() : $("#button_archive").show(), !0 === lychee.publicMode && "0" === album.json.downloadable && $("#button_archive").hide(), "s" === t || "f" === t || "r" === t ? $("#button_info_album, #button_trash_album, #button_share_album").hide() : "0" === t ? ($("#button_info_album, #button_share_album").hide(), $("#button_trash_album").show()) : $("#button_info_album, #button_trash_album, #button_share_album").show(), !0;
  4533. case "photo":
  4534. return header.dom().addClass("header--view"), header.dom(".header__toolbar--public, .header__toolbar--albums, .header__toolbar--album").removeClass("header__toolbar--visible"), header.dom(".header__toolbar--photo").addClass("header__toolbar--visible"), !0
  4535. }
  4536. return !1
  4537. }, header.setEditable = function(e) {
  4538. var t = header.dom(".header__title");
  4539. return !0 === lychee.publicMode && (e = !1), e ? t.addClass("header__title--editable") : t.removeClass("header__title--editable"), !0
  4540. }, $(document).ready(function() {
  4541. var e = lychee.getEventName();
  4542. api.onError = lychee.error, multiselect.bind(), header.bind(), lychee.imageview.on(e, ".arrow_wrapper--previous", photo.previous).on(e, ".arrow_wrapper--next", photo.next), Mousetrap.bind(["left"], function() {
  4543. if (visible.photo()) return $("#imageview a#previous").click(), !1
  4544. }).bind(["right"], function() {
  4545. if (visible.photo()) return $("#imageview a#next").click(), !1
  4546. }).bind(["u"], function() {
  4547. if (!visible.photo()) return $("#upload_files").click(), !1
  4548. }).bind(["s", "f"], function() {
  4549. return visible.photo() ? (header.dom("#button_star").click(), !1) : visible.albums() ? (header.dom(".header__search").focus(), !1) : void 0
  4550. }).bind(["r"], function() {
  4551. return visible.album() ? (album.setTitle(album.getID()), !1) : visible.photo() ? (photo.setTitle([photo.getID()]), !1) : void 0
  4552. }).bind(["d"], function() {
  4553. return visible.photo() ? (photo.setDescription(photo.getID()), !1) : visible.album() ? (album.setDescription(album.getID()), !1) : void 0
  4554. }).bind(["t"], function() {
  4555. if (visible.photo()) return photo.editTags([photo.getID()]), !1
  4556. }).bind(["i"], function() {
  4557. if (!visible.multiselect()) return sidebar.toggle(), !1
  4558. }).bind(["command+backspace", "ctrl+backspace"], function() {
  4559. return visible.photo() && !1 === basicModal.visible() ? (photo.delete([photo.getID()]), !1) : visible.album() && !1 === basicModal.visible() ? (album.delete([album.getID()]), !1) : void 0
  4560. }).bind(["command+a", "ctrl+a"], function() {
  4561. return visible.album() && !1 === basicModal.visible() ? (multiselect.selectAll(), !1) : visible.albums() && !1 === basicModal.visible() ? (multiselect.selectAll(), !1) : void 0
  4562. }), Mousetrap.bindGlobal("enter", function() {
  4563. !0 === basicModal.visible() && basicModal.action()
  4564. }), Mousetrap.bindGlobal(["esc", "command+up"], function() {
  4565. return !0 === basicModal.visible() ? basicModal.cancel() : visible.contextMenu() ? contextMenu.close() : visible.photo() ? lychee.goto(album.getID()) : visible.album() ? lychee.goto() : visible.albums() && 0 !== header.dom(".header__search").val().length && search.reset(), !1
  4566. }), "touchend" === e && $(document).on("touchend", "#imageview #image", function(e) {
  4567. (null == swipe.obj || swipe.offset >= -5 && swipe.offset <= 5) && (visible.header() ? header.hide(e) : header.show())
  4568. }).swipe().on("swipeStart", function() {
  4569. visible.photo() && swipe.start($("#imageview #image"))
  4570. }).swipe().on("swipeMove", function(e) {
  4571. visible.photo() && swipe.move(e.swipe)
  4572. }).swipe().on("swipeEnd", function(e) {
  4573. visible.photo() && swipe.stop(e.swipe, photo.previous, photo.next)
  4574. }), $(document).on("click", ".album", function() {
  4575. lychee.goto($(this).attr("data-id"))
  4576. }).on("click", ".photo", function() {
  4577. lychee.goto(album.getID() + "/" + $(this).attr("data-id"))
  4578. }).on("contextmenu", ".photo", function(e) {
  4579. contextMenu.photo(photo.getID(), e)
  4580. }).on("contextmenu", ".album", function(e) {
  4581. contextMenu.album(album.getID(), e)
  4582. }).on("change", "#upload_files", function() {
  4583. basicModal.close(), upload.start.local(this.files)
  4584. }).on("dragover", function() {
  4585. return !1
  4586. }, !1).on("drop", function(e) {
  4587. return visible.photo() && lychee.goto(album.getID()), visible.contextMenu() && contextMenu.close(), e.originalEvent.dataTransfer.files.length > 0 ? upload.start.local(e.originalEvent.dataTransfer.files) : e.originalEvent.dataTransfer.getData("Text").length > 3 && upload.start.url(e.originalEvent.dataTransfer.getData("Text")), !1
  4588. }), lychee.init()
  4589. }), loadingBar = {
  4590. status: null,
  4591. _dom: $("#loading")
  4592. }, loadingBar.dom = function(e) {
  4593. return null == e || "" === e ? loadingBar._dom : loadingBar._dom.find(e)
  4594. }, loadingBar.show = function(e, t) {
  4595. return "error" === e ? (loadingBar.status = "error", t && (t = t.replace("<br>", "")), t || (t = "Whoops, it looks like something went wrong. Please reload the site and try again!"), visible.header() && header.dom().addClass("header--error"), loadingBar.dom().removeClass("loading uploading error").html("<h1>Error: <span>" + t + "</span></h1>").addClass(e).show(), clearTimeout(loadingBar._timeout), loadingBar._timeout = setTimeout(function() {
  4596. return loadingBar.hide(!0)
  4597. }, 3e3), !0) : null === loadingBar.status ? (loadingBar.status = "loading", clearTimeout(loadingBar._timeout), loadingBar._timeout = setTimeout(function() {
  4598. visible.header() && header.dom().addClass("header--loading"), loadingBar.dom().removeClass("loading uploading error").html("").addClass("loading").show()
  4599. }, 1e3), !0) : void 0
  4600. }, loadingBar.hide = function(e) {
  4601. ("error" !== loadingBar.status && null != loadingBar.status || e) && (loadingBar.status = null, header.dom().removeClass("header--error header--loading"), clearTimeout(loadingBar._timeout), setTimeout(function() {
  4602. return loadingBar.dom().hide()
  4603. }, 300))
  4604. }, lychee = {
  4605. title: document.title,
  4606. version: "3.1.6",
  4607. versionCode: "030106",
  4608. updatePath: "//update.electerious.com/index.json",
  4609. updateURL: "https://github.com/electerious/Lychee",
  4610. website: "http://lychee.electerious.com",
  4611. publicMode: !1,
  4612. viewMode: !1,
  4613. checkForUpdates: "1",
  4614. sortingPhotos: "",
  4615. sortingAlbums: "",
  4616. location: "",
  4617. dropbox: !1,
  4618. dropboxKey: "",
  4619. content: $(".content"),
  4620. imageview: $("#imageview")
  4621. }, lychee.init = function() {
  4622. api.post("Session::init", {}, function(e) {
  4623. if (2 === e.status) lychee.sortingPhotos = e.config.sortingPhotos || "", lychee.sortingAlbums = e.config.sortingAlbums || "", lychee.dropboxKey = e.config.dropboxKey || "", lychee.location = e.config.location || "", lychee.checkForUpdates = e.config.checkForUpdates || "1", !1 === e.config.login && settings.createLogin();
  4624. else if (1 === e.status) lychee.checkForUpdates = e.config.checkForUpdates || "1", lychee.setMode("public");
  4625. else if (0 === e.status) return lychee.setMode("public"), header.dom().hide(), lychee.content.hide(), $("body").append(build.no_content("cog")), settings.createConfig(), !0;
  4626. $(window).bind("popstate", lychee.load), lychee.load()
  4627. })
  4628. }, lychee.login = function(e) {
  4629. var t = e.username,
  4630. n = e.password,
  4631. o = {
  4632. user: t,
  4633. password: n
  4634. };
  4635. api.post("Session::login", o, function(e) {
  4636. !0 === e ? window.location.reload() : basicModal.error("password")
  4637. })
  4638. }, lychee.loginDialog = function() {
  4639. var e = lychee.html(_templateObject26, lychee.version, lychee.updateURL);
  4640. basicModal.show({
  4641. body: e,
  4642. buttons: {
  4643. action: {
  4644. title: "Sign In",
  4645. fn: lychee.login
  4646. },
  4647. cancel: {
  4648. title: "Cancel",
  4649. fn: basicModal.close
  4650. }
  4651. }
  4652. }), "1" === lychee.checkForUpdates && lychee.getUpdate()
  4653. }, lychee.logout = function() {
  4654. api.post("Session::logout", {}, function() {
  4655. window.location.reload()
  4656. })
  4657. }, lychee.goto = function() {
  4658. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
  4659. e = "#" + e, history.pushState(null, null, e), lychee.load()
  4660. }, lychee.load = function() {
  4661. var e = "",
  4662. t = "",
  4663. n = document.location.hash.replace("#", "").split("/");
  4664. $(".no_content").remove(), contextMenu.close(), multiselect.close(), null != n[0] && (e = n[0]), null != n[1] && (t = n[1]), e && t ? (photo.json = null, ("" === lychee.content.html() || header.dom(".header__search").length && 0 !== header.dom(".header__search").val().length) && (lychee.content.hide(), album.load(e, !0)), photo.load(t, e)) : e ? (photo.json = null, visible.photo() && view.photo.hide(), !visible.sidebar() || "0" !== e && "f" !== e && "s" !== e && "r" !== e || sidebar.toggle(), album.json && e == album.json.id ? view.album.title() : album.load(e)) : (null != search.hash && (albums.json = null, search.hash = null), album.json = null, photo.json = null, visible.sidebar() && sidebar.toggle(), visible.photo() && view.photo.hide(), lychee.content.show(), albums.load())
  4665. }, lychee.getUpdate = function() {
  4666. var e = function(e) {
  4667. e.lychee.version > parseInt(lychee.versionCode) && $(".version span").show()
  4668. };
  4669. $.ajax({
  4670. url: lychee.updatePath,
  4671. success: e
  4672. })
  4673. }, lychee.setTitle = function(e, t) {
  4674. document.title = lychee.title + " - " + e, header.setEditable(t), header.setTitle(e)
  4675. }, lychee.setMode = function(e) {
  4676. $("#button_settings, #button_trash_album, .button_add, .header__divider").remove(), $("#button_trash, #button_move, #button_star").remove(), $("#button_share, #button_share_album").removeClass("button--eye").addClass("button--share").find("use").attr("xlink:href", "#share"), $(document).off("click", ".header__title--editable").off("touchend", ".header__title--editable").off("contextmenu", ".photo").off("contextmenu", ".album").off("drop"), Mousetrap.unbind(["u"]).unbind(["s"]).unbind(["f"]).unbind(["r"]).unbind(["d"]).unbind(["t"]).unbind(["command+backspace", "ctrl+backspace"]).unbind(["command+a", "ctrl+a"]), "public" === e ? lychee.publicMode = !0 : "view" === e && (Mousetrap.unbind(["esc", "command+up"]), $("#button_back, a#next, a#previous").remove(), $(".no_content").remove(), lychee.publicMode = !0, lychee.viewMode = !0)
  4677. }, lychee.animate = function(e, t) {
  4678. var n = [
  4679. ["fadeIn", "fadeOut"],
  4680. ["contentZoomIn", "contentZoomOut"]
  4681. ];
  4682. e.jQuery || (e = $(e));
  4683. for (var o = 0; o < n.length; o++)
  4684. for (var i = 0; i < n[o].length; i++)
  4685. if (n[o][i] == t) return e.removeClass(n[o][0] + " " + n[o][1]).addClass(t), !0;
  4686. return !1
  4687. }, lychee.retinize = function() {
  4688. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
  4689. t = e.split(".").pop(),
  4690. n = "svg" !== t;
  4691. return !0 === n && (e = e.replace(/\.[^\/.]+$/, ""), e = e + "@2x." + t), {
  4692. path: e,
  4693. isPhoto: n
  4694. }
  4695. }, lychee.loadDropbox = function(e) {
  4696. if (!1 === lychee.dropbox && null != lychee.dropboxKey && "" !== lychee.dropboxKey) {
  4697. loadingBar.show();
  4698. var t = document.createElement("script"),
  4699. n = document.getElementsByTagName("script")[0];
  4700. t.src = "https://www.dropbox.com/static/api/1/dropins.js", t.id = "dropboxjs", t.type = "text/javascript", t.async = "true", t.setAttribute("data-app-key", lychee.dropboxKey), t.onload = t.onreadystatechange = function() {
  4701. var t = this.readyState;
  4702. t && "complete" !== t && "loaded" !== t || (lychee.dropbox = !0, loadingBar.hide(), e())
  4703. }, n.parentNode.insertBefore(t, n)
  4704. } else !0 === lychee.dropbox && null != lychee.dropboxKey && "" !== lychee.dropboxKey ? e() : settings.setDropboxKey(e)
  4705. }, lychee.getEventName = function() {
  4706. return !0 === (/Android|iPhone|iPad|iPod/i.test(navigator.userAgent || navigator.vendor || window.opera) && "ontouchend" in document.documentElement) ? "touchend" : "click"
  4707. }, lychee.escapeHTML = function() {
  4708. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
  4709. return e += "", e = e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;").replace(/`/g, "&#96;")
  4710. }, lychee.html = function(e) {
  4711. for (var t = e.raw, n = "", o = arguments.length, i = Array(o > 1 ? o - 1 : 0), a = 1; a < o; a++) i[a - 1] = arguments[a];
  4712. return i.forEach(function(e, o) {
  4713. var i = t[o];
  4714. "$" === i.slice(-1) && (e = lychee.escapeHTML(e), i = i.slice(0, -1)), n += i, n += e
  4715. }), n += t[t.length - 1]
  4716. }, lychee.error = function(e, t, n) {
  4717. console.error({
  4718. description: e,
  4719. params: t,
  4720. response: n
  4721. }), loadingBar.show("error", e)
  4722. }, multiselect = {}, multiselect.position = {
  4723. top: null,
  4724. right: null,
  4725. bottom: null,
  4726. left: null
  4727. }, multiselect.bind = function() {
  4728. return $(".content").on("mousedown", function(e) {
  4729. 1 === e.which && multiselect.show(e)
  4730. }), !0
  4731. }, multiselect.show = function(e) {
  4732. return !lychee.publicMode && (!(!visible.albums() && !visible.album()) && (0 === $(".album:hover, .photo:hover").length && (!visible.search() && (visible.multiselect() && $("#multiselect").remove(), sidebar.setSelectable(!1), multiselect.position.top = e.pageY, multiselect.position.right = -1 * (e.pageX - $(document).width()), multiselect.position.bottom = -1 * (multiselect.position.top - $(window).height()), multiselect.position.left = e.pageX, $("body").append(build.multiselect(multiselect.position.top, multiselect.position.left)), void $(document).on("mousemove", multiselect.resize).on("mouseup", function(e) {
  4733. 1 === e.which && multiselect.getSelection(e)
  4734. })))))
  4735. }, multiselect.selectAll = function() {
  4736. if (lychee.publicMode) return !1;
  4737. if (visible.search()) return !1;
  4738. if (!visible.albums() && !visible.album) return !1;
  4739. visible.multiselect() && $("#multiselect").remove(), sidebar.setSelectable(!1), multiselect.position.top = 70, multiselect.position.right = 40, multiselect.position.bottom = 90, multiselect.position.left = 20, $("body").append(build.multiselect(multiselect.position.top, multiselect.position.left));
  4740. var e = {
  4741. width: $(document).width(),
  4742. height: $(document).height()
  4743. },
  4744. t = {
  4745. width: e.width - multiselect.position.right + 2,
  4746. height: e.height - multiselect.position.bottom
  4747. },
  4748. n = {
  4749. pageX: e.width - multiselect.position.right / 2,
  4750. pageY: e.height - multiselect.position.bottom
  4751. };
  4752. $("#multiselect").css(t), multiselect.getSelection(n)
  4753. }, multiselect.resize = function(e) {
  4754. if (null === multiselect.position.top || null === multiselect.position.right || null === multiselect.position.bottom || null === multiselect.position.left) return !1;
  4755. var t = {},
  4756. n = {},
  4757. o = {
  4758. x: e.pageX,
  4759. y: e.pageY
  4760. },
  4761. i = {
  4762. top: null,
  4763. bottom: null,
  4764. height: null,
  4765. left: null,
  4766. right: null,
  4767. width: null
  4768. };
  4769. o.y >= multiselect.position.top ? (n.height = $(document).height(), t.height = o.y - multiselect.position.top, multiselect.position.top + t.height >= n.height && (t.height -= multiselect.position.top + t.height - n.height + 2), i.top = multiselect.position.top, i.bottom = "inherit", i.height = t.height) : (i.top = "inherit", i.bottom = multiselect.position.bottom, i.height = multiselect.position.top - e.pageY), o.x >= multiselect.position.left ? (n.width = $(document).width(), t.width = o.x - multiselect.position.left, multiselect.position.left + t.width >= n.width && (t.width -= multiselect.position.left + t.width - n.width + 2), i.right = "inherit", i.left = multiselect.position.left, i.width = t.width) : (i.right = multiselect.position.right, i.left = "inherit", i.width = multiselect.position.left - e.pageX), $("#multiselect").css(i)
  4770. }, multiselect.stopResize = function() {
  4771. null !== multiselect.position.top && $(document).off("mousemove mouseup")
  4772. }, multiselect.getSize = function() {
  4773. if (!visible.multiselect()) return !1;
  4774. var e = $("#multiselect"),
  4775. t = e.offset();
  4776. return {
  4777. top: t.top,
  4778. left: t.left,
  4779. width: parseInt(e.css("width").replace("px", "")),
  4780. height: parseInt(e.css("height").replace("px", ""))
  4781. }
  4782. }, multiselect.getSelection = function(e) {
  4783. var t = [],
  4784. n = multiselect.getSize();
  4785. return !visible.contextMenu() && (!!visible.multiselect() && ($(".photo, .album").each(function() {
  4786. var e = $(this).offset();
  4787. if (e.top >= n.top - 150 && e.left >= n.left - 150 && e.top + 206 <= n.top + n.height + 150 && e.left + 206 <= n.left + n.width + 150) {
  4788. var o = $(this).data("id");
  4789. "0" !== o && 0 !== o && "f" !== o && "s" !== o && "r" !== o && null != o && (t.push(o), $(this).addClass("active"))
  4790. }
  4791. }), void(0 !== t.length && visible.album() ? contextMenu.photoMulti(t, e) : 0 !== t.length && visible.albums() ? contextMenu.albumMulti(t, e) : multiselect.close())))
  4792. }, multiselect.close = function() {
  4793. sidebar.setSelectable(!0), multiselect.stopResize(), multiselect.position.top = null, multiselect.position.right = null, multiselect.position.bottom = null, multiselect.position.left = null, lychee.animate("#multiselect", "fadeOut"), setTimeout(function() {
  4794. return $("#multiselect").remove()
  4795. }, 300)
  4796. }, password = {
  4797. value: ""
  4798. }, password.get = function(e, t) {
  4799. !1 === lychee.publicMode ? t() : album.json && "0" === album.json.password ? t() : albums.json && "0" === albums.getByID(e).password ? t() : albums.json || album.json ? password.getDialog(e, t) : (album.json = {
  4800. password: !0
  4801. }, t(""))
  4802. }, password.getDialog = function(e, t) {
  4803. var n = function(n) {
  4804. var o = n.password,
  4805. i = {
  4806. albumID: e,
  4807. password: o
  4808. };
  4809. api.post("Album::getPublic", i, function(e) {
  4810. !0 === e ? (basicModal.close(), password.value = o, t()) : basicModal.error("password")
  4811. })
  4812. },
  4813. o = function() {
  4814. basicModal.close(), visible.albums() || lychee.goto()
  4815. };
  4816. basicModal.show({
  4817. body: "\n\t <p>\n\t This album is protected by a password. Enter the password below to view the photos of this album:\n\t <input name='password' class='text' type='password' placeholder='password' value=''>\n\t </p>\n\t ",
  4818. buttons: {
  4819. action: {
  4820. title: "Enter",
  4821. fn: n
  4822. },
  4823. cancel: {
  4824. title: "Cancel",
  4825. fn: o
  4826. }
  4827. }
  4828. })
  4829. }, photo = {
  4830. json: null,
  4831. cache: null
  4832. }, photo.getID = function() {
  4833. var e = null;
  4834. return e = photo.json ? photo.json.id : $(".photo:hover, .photo.active").attr("data-id"), !0 === $.isNumeric(e) && e
  4835. }, photo.load = function(e, t) {
  4836. var n = function n() {
  4837. "" !== password.value ? photo.load(e, t) : setTimeout(n, 200)
  4838. };
  4839. if (null == album.json) return function n() {
  4840. null != album.json ? photo.load(e, t) : setTimeout(n, 100)
  4841. }(), !1;
  4842. var o = {
  4843. photoID: e,
  4844. albumID: t,
  4845. password: password.value
  4846. };
  4847. api.post("Photo::get", o, function(t) {
  4848. return "Warning: Photo private!" === t ? (lychee.content.show(), lychee.goto(), !1) : "Warning: Wrong password!" === t ? (n(), !1) : (photo.json = t, visible.photo() || view.photo.show(), view.photo.init(), lychee.imageview.show(), void setTimeout(function() {
  4849. lychee.content.show(), photo.preloadNext(e)
  4850. }, 300))
  4851. })
  4852. }, photo.preloadNext = function(e) {
  4853. if (album.json && album.json.content && album.json.content[e] && "" != album.json.content[e].nextPhoto) {
  4854. var t = album.json.content[e].nextPhoto,
  4855. n = album.json.content[t].url,
  4856. o = album.json.content[t].medium,
  4857. i = null != o && "" !== o ? o : n;
  4858. $("head [data-prefetch]").remove(), $("head").append('<link data-prefetch rel="prefetch" href="' + i + '">')
  4859. }
  4860. }, photo.parse = function() {
  4861. photo.json.title || (photo.json.title = "Untitled")
  4862. }, photo.previous = function(e) {
  4863. if (!1 !== photo.getID() && album.json && album.json.content[photo.getID()] && "" !== album.json.content[photo.getID()].previousPhoto) {
  4864. var t = 0;
  4865. !0 === e && (t = 200, $("#imageview #image").css({
  4866. WebkitTransform: "translateX(100%)",
  4867. MozTransform: "translateX(100%)",
  4868. transform: "translateX(100%)",
  4869. opacity: 0
  4870. })), setTimeout(function() {
  4871. if (!1 === photo.getID()) return !1;
  4872. lychee.goto(album.getID() + "/" + album.json.content[photo.getID()].previousPhoto)
  4873. }, t)
  4874. }
  4875. }, photo.next = function(e) {
  4876. if (!1 !== photo.getID() && album.json && album.json.content[photo.getID()] && "" !== album.json.content[photo.getID()].nextPhoto) {
  4877. var t = 0;
  4878. !0 === e && (t = 200, $("#imageview #image").css({
  4879. WebkitTransform: "translateX(-100%)",
  4880. MozTransform: "translateX(-100%)",
  4881. transform: "translateX(-100%)",
  4882. opacity: 0
  4883. })), setTimeout(function() {
  4884. if (!1 === photo.getID()) return !1;
  4885. lychee.goto(album.getID() + "/" + album.json.content[photo.getID()].nextPhoto)
  4886. }, t)
  4887. }
  4888. }, photo.duplicate = function(e) {
  4889. if (!e) return !1;
  4890. e instanceof Array == !1 && (e = [e]), albums.refresh();
  4891. var t = {
  4892. photoIDs: e.join()
  4893. };
  4894. api.post("Photo::duplicate", t, function(e) {
  4895. !0 !== e ? lychee.error(null, t, e) : album.load(album.getID())
  4896. })
  4897. }, photo.delete = function(e) {
  4898. var t = {},
  4899. n = {},
  4900. o = "",
  4901. i = "";
  4902. if (!e) return !1;
  4903. e instanceof Array == !1 && (e = [e]), 1 === e.length && "" === (i = visible.photo() ? photo.json.title : album.json.content[e].title) && (i = "Untitled"), t.fn = function() {
  4904. var t = null,
  4905. n = null;
  4906. basicModal.close(), e.forEach(function(e, o, i) {
  4907. "" === album.json.content[e].nextPhoto && "" === album.json.content[e].previousPhoto || (t = album.json.content[e].nextPhoto, n = album.json.content[e].previousPhoto, album.json.content[n].nextPhoto = t, album.json.content[t].previousPhoto = n), delete album.json.content[e], view.album.content.delete(e)
  4908. }),
  4909. albums.refresh(), visible.photo() && null != t && t !== photo.getID() ? lychee.goto(album.getID() + "/" + t) : visible.albums() || lychee.goto(album.getID());
  4910. var o = {
  4911. photoIDs: e.join()
  4912. };
  4913. api.post("Photo::delete", o, function(e) {
  4914. !0 !== e && lychee.error(null, o, e)
  4915. })
  4916. }, 1 === e.length ? (t.title = "Delete Photo", n.title = "Keep Photo", o = lychee.html(_templateObject27, i)) : (t.title = "Delete Photo", n.title = "Keep Photo", o = lychee.html(_templateObject28, e.length)), basicModal.show({
  4917. body: o,
  4918. buttons: {
  4919. action: {
  4920. title: t.title,
  4921. fn: t.fn,
  4922. class: "red"
  4923. },
  4924. cancel: {
  4925. title: n.title,
  4926. fn: basicModal.close
  4927. }
  4928. }
  4929. })
  4930. }, photo.setTitle = function(e) {
  4931. var t = "",
  4932. n = "";
  4933. if (!e) return !1;
  4934. e instanceof Array == !1 && (e = [e]), 1 === e.length && (photo.json ? t = photo.json.title : album.json && (t = album.json.content[e].title));
  4935. var o = function(t) {
  4936. basicModal.close();
  4937. var n = t.title;
  4938. visible.photo() && (photo.json.title = "" === n ? "Untitled" : n, view.photo.title()), e.forEach(function(e, t, o) {
  4939. album.json.content[e].title = n, view.album.content.title(e)
  4940. });
  4941. var o = {
  4942. photoIDs: e.join(),
  4943. title: n
  4944. };
  4945. api.post("Photo::setTitle", o, function(e) {
  4946. !0 !== e && lychee.error(null, o, e)
  4947. })
  4948. },
  4949. i = lychee.html(_templateObject3, t);
  4950. n = 1 === e.length ? lychee.html(_templateObject29, i) : lychee.html(_templateObject30, e.length, i), basicModal.show({
  4951. body: n,
  4952. buttons: {
  4953. action: {
  4954. title: "Set title",
  4955. fn: o
  4956. },
  4957. cancel: {
  4958. title: "Cancel",
  4959. fn: basicModal.close
  4960. }
  4961. }
  4962. })
  4963. }, photo.setAlbum = function(e, t) {
  4964. var n = null,
  4965. o = null;
  4966. if (!e) return !1;
  4967. e instanceof Array == !1 && (e = [e]), e.forEach(function(e, t, i) {
  4968. "" === album.json.content[e].nextPhoto && "" === album.json.content[e].previousPhoto || (n = album.json.content[e].nextPhoto, o = album.json.content[e].previousPhoto, album.json.content[o].nextPhoto = n, album.json.content[n].previousPhoto = o), delete album.json.content[e], view.album.content.delete(e)
  4969. }), albums.refresh(), visible.photo() && null != n && n !== photo.getID() ? lychee.goto(album.getID() + "/" + n) : visible.albums() || lychee.goto(album.getID());
  4970. var i = {
  4971. photoIDs: e.join(),
  4972. albumID: t
  4973. };
  4974. api.post("Photo::setAlbum", i, function(e) {
  4975. !0 !== e && lychee.error(null, i, e)
  4976. })
  4977. }, photo.setStar = function(e) {
  4978. if (!e) return !1;
  4979. visible.photo() && (photo.json.star = "0" === photo.json.star ? "1" : "0", view.photo.star()), e.forEach(function(e, t, n) {
  4980. album.json.content[e].star = "0" === album.json.content[e].star ? "1" : "0", view.album.content.star(e)
  4981. }), albums.refresh();
  4982. var t = {
  4983. photoIDs: e.join()
  4984. };
  4985. api.post("Photo::setStar", t, function(e) {
  4986. !0 !== e && lychee.error(null, t, e)
  4987. })
  4988. }, photo.setPublic = function(e, t) {
  4989. if ("2" === photo.json.public) {
  4990. var n = function() {
  4991. basicModal.close(), lychee.goto(photo.json.original_album)
  4992. };
  4993. return basicModal.show({
  4994. body: "<p>This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.</p>",
  4995. buttons: {
  4996. action: {
  4997. title: "Show Album",
  4998. fn: n
  4999. },
  5000. cancel: {
  5001. title: "Cancel",
  5002. fn: basicModal.close
  5003. }
  5004. }
  5005. }), !1
  5006. }
  5007. visible.photo() && (photo.json.public = "0" === photo.json.public ? "1" : "0", view.photo.public(), "1" === photo.json.public && contextMenu.sharePhoto(e, t)), album.json.content[e].public = "0" === album.json.content[e].public ? "1" : "0", view.album.content.public(e), albums.refresh(), api.post("Photo::setPublic", {
  5008. photoID: e
  5009. }, function(e) {
  5010. !0 !== e && lychee.error(null, params, e)
  5011. })
  5012. }, photo.setDescription = function(e) {
  5013. var t = photo.json.description,
  5014. n = function(t) {
  5015. basicModal.close();
  5016. var n = t.description;
  5017. visible.photo() && (photo.json.description = n, view.photo.description());
  5018. var o = {
  5019. photoID: e,
  5020. description: n
  5021. };
  5022. api.post("Photo::setDescription", o, function(e) {
  5023. !0 !== e && lychee.error(null, o, e)
  5024. })
  5025. };
  5026. basicModal.show({
  5027. body: lychee.html(_templateObject31, t),
  5028. buttons: {
  5029. action: {
  5030. title: "Set Description",
  5031. fn: n
  5032. },
  5033. cancel: {
  5034. title: "Cancel",
  5035. fn: basicModal.close
  5036. }
  5037. }
  5038. })
  5039. }, photo.editTags = function(e) {
  5040. var t = "",
  5041. n = "";
  5042. if (!e) return !1;
  5043. if (e instanceof Array == !1 && (e = [e]), visible.photo()) t = photo.json.tags;
  5044. else if (visible.album() && 1 === e.length) t = album.json.content[e].tags;
  5045. else if (visible.search() && 1 === e.length) t = album.json.content[e].tags;
  5046. else if (visible.album() && e.length > 1) {
  5047. var o = !0;
  5048. e.forEach(function(t, n, i) {
  5049. o = album.json.content[t].tags === album.json.content[e[0]].tags && !0 === o
  5050. }), !0 === o && (t = album.json.content[e[0]].tags)
  5051. }
  5052. t = t.replace(/,/g, ", ");
  5053. var i = function(t) {
  5054. basicModal.close(), photo.setTags(e, t.tags)
  5055. },
  5056. a = lychee.html(_templateObject32, t);
  5057. n = 1 === e.length ? lychee.html(_templateObject33, a) : lychee.html(_templateObject34, e.length, a), basicModal.show({
  5058. body: n,
  5059. buttons: {
  5060. action: {
  5061. title: "Set Tags",
  5062. fn: i
  5063. },
  5064. cancel: {
  5065. title: "Cancel",
  5066. fn: basicModal.close
  5067. }
  5068. }
  5069. })
  5070. }, photo.setTags = function(e, t) {
  5071. if (!e) return !1;
  5072. e instanceof Array == !1 && (e = [e]), t = t.replace(/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/g, ","), t = t.replace(/,$|^,|(\ ){0,}$/g, ""), visible.photo() && (photo.json.tags = t, view.photo.tags()), e.forEach(function(e, n, o) {
  5073. album.json.content[e].tags = t
  5074. });
  5075. var n = {
  5076. photoIDs: e.join(),
  5077. tags: t
  5078. };
  5079. api.post("Photo::setTags", n, function(e) {
  5080. !0 !== e && lychee.error(null, n, e)
  5081. })
  5082. }, photo.deleteTag = function(e, t) {
  5083. var n = void 0;
  5084. n = photo.json.tags.split(","), n.splice(t, 1), photo.json.tags = n.toString(), photo.setTags([e], photo.json.tags)
  5085. }, photo.share = function(e, t) {
  5086. var n = photo.getViewLink(e);
  5087. switch (t) {
  5088. case "twitter":
  5089. window.open("https://twitter.com/share?url=" + encodeURI(n));
  5090. break;
  5091. case "facebook":
  5092. window.open("http://www.facebook.com/sharer.php?u=" + encodeURI(n) + "&t=" + encodeURI(photo.json.title));
  5093. break;
  5094. case "mail":
  5095. location.href = "mailto:?subject=" + encodeURI(photo.json.title) + "&body=" + encodeURI(n);
  5096. break;
  5097. case "dropbox":
  5098. lychee.loadDropbox(function() {
  5099. var e = photo.json.title + "." + photo.getDirectLink().split(".").pop();
  5100. Dropbox.save(photo.getDirectLink(), e)
  5101. })
  5102. }
  5103. }, photo.getArchive = function(e) {
  5104. var t = void 0,
  5105. n = api.path + "?function=Photo::getArchive&photoID=" + e;
  5106. t = location.href.indexOf("index.html") > 0 ? location.href.replace(location.hash, "").replace("index.html", n) : location.href.replace(location.hash, "") + n, !0 === lychee.publicMode && (t += "&password=" + encodeURIComponent(password.value)), location.href = t
  5107. }, photo.getDirectLink = function() {
  5108. var e = "";
  5109. return photo.json && photo.json.url && "" !== photo.json.url && (e = photo.json.url), e
  5110. }, photo.getViewLink = function(e) {
  5111. var t = "view.php?p=" + e;
  5112. return location.href.indexOf("index.html") > 0 ? location.href.replace("index.html" + location.hash, t) : location.href.replace(location.hash, t)
  5113. }, search = {
  5114. hash: null
  5115. }, search.find = function(e) {
  5116. clearTimeout($(window).data("timeout")), $(window).data("timeout", setTimeout(function() {
  5117. 0 !== header.dom(".header__search").val().length ? api.post("search", {
  5118. term: e
  5119. }, function(e) {
  5120. var t = "",
  5121. n = "",
  5122. o = "";
  5123. e && e.albums && (albums.json = {
  5124. albums: e.albums
  5125. }, $.each(albums.json.albums, function() {
  5126. albums.parse(this), n += build.album(this)
  5127. })), e && e.photos && (album.json = {
  5128. content: e.photos
  5129. }, $.each(album.json.content, function() {
  5130. o += build.photo(this)
  5131. })), t = "" === n && "" === o ? "error" : "" === n ? build.divider("Photos") + o : "" === o ? build.divider("Albums") + n : build.divider("Albums") + n + build.divider("Photos") + o, search.hash !== e.hash && ($(".no_content").remove(), lychee.animate(".content", "contentZoomOut"), search.hash = e.hash, setTimeout(function() {
  5132. "error" === t ? (lychee.content.html(""), $("body").append(build.no_content("magnifying-glass"))) : (lychee.content.html(t), lychee.animate(lychee.content, "contentZoomIn"))
  5133. }, 300))
  5134. }) : search.reset()
  5135. }, 250))
  5136. }, search.reset = function() {
  5137. header.dom(".header__search").val(""), $(".no_content").remove(), null != search.hash && (albums.json = null, album.json = null, photo.json = null, search.hash = null, lychee.animate(".divider", "fadeOut"), lychee.goto())
  5138. }, settings = {}, settings.createConfig = function() {
  5139. var e = function(e) {
  5140. var t = e.dbName || "",
  5141. n = e.dbUser || "",
  5142. o = e.dbPassword || "",
  5143. i = e.dbHost || "",
  5144. a = e.dbTablePrefix || "";
  5145. if (n.length < 1) return basicModal.error("dbUser"), !1;
  5146. i.length < 1 && (i = "localhost"), t.length < 1 && (t = "lychee");
  5147. var r = {
  5148. dbName: t,
  5149. dbUser: n,
  5150. dbPassword: o,
  5151. dbHost: i,
  5152. dbTablePrefix: a
  5153. };
  5154. api.post("Config::create", r, function(e) {
  5155. if (!0 !== e) return "Warning: Connection failed!" === e ? (basicModal.show({
  5156. body: "<p>Unable to connect to host database because access was denied. Double-check your host, username and password and ensure that access from your current location is permitted.</p>",
  5157. buttons: {
  5158. action: {
  5159. title: "Retry",
  5160. fn: settings.createConfig
  5161. }
  5162. }
  5163. }), !1) : "Warning: Creation failed!" === e ? (basicModal.show({
  5164. body: "<p>Unable to create the database. Double-check your host, username and password and ensure that the specified user has the rights to modify and add content to the database.</p>",
  5165. buttons: {
  5166. action: {
  5167. title: "Retry",
  5168. fn: settings.createConfig
  5169. }
  5170. }
  5171. }), !1) : "Warning: Could not create file!" === e ? (basicModal.show({
  5172. body: "<p>Unable to save this configuration. Permission denied in <b>'data/'</b>. Please set the read, write and execute rights for others in <b>'data/'</b> and <b>'uploads/'</b>. Take a look at the readme for more information.</p>",
  5173. buttons: {
  5174. action: {
  5175. title: "Retry",
  5176. fn: settings.createConfig
  5177. }
  5178. }
  5179. }), !1) : (basicModal.show({
  5180. body: "<p>Something unexpected happened. Please try again and check your installation and server. Take a look at the readme for more information.</p>",
  5181. buttons: {
  5182. action: {
  5183. title: "Retry",
  5184. fn: settings.createConfig
  5185. }
  5186. }
  5187. }), !1);
  5188. window.location.reload()
  5189. })
  5190. };
  5191. basicModal.show({
  5192. body: "\n\t <p>\n\t Enter your database connection details below:\n\t <input name='dbHost' class='text' type='text' placeholder='Database Host (optional)' value=''>\n\t <input name='dbUser' class='text' type='text' placeholder='Database Username' value=''>\n\t <input name='dbPassword' class='text' type='password' placeholder='Database Password' value=''>\n\t </p>\n\t <p>\n\t Lychee will create its own database. If required, you can enter the name of an existing database instead:\n\t <input name='dbName' class='text' type='text' placeholder='Database Name (optional)' value=''>\n\t <input name='dbTablePrefix' class='text' type='text' placeholder='Table prefix (optional)' value=''>\n\t </p>\n\t ",
  5193. buttons: {
  5194. action: {
  5195. title: "Connect",
  5196. fn: e
  5197. }
  5198. }
  5199. })
  5200. }, settings.createLogin = function() {
  5201. var e = function(e) {
  5202. var t = e.username,
  5203. n = e.password;
  5204. if (t.length < 1) return basicModal.error("username"), !1;
  5205. if (n.length < 1) return basicModal.error("password"), !1;
  5206. basicModal.close();
  5207. var o = {
  5208. username: t,
  5209. password: n
  5210. };
  5211. api.post("Settings::setLogin", o, function(e) {
  5212. !0 !== e && basicModal.show({
  5213. body: "<p>Unable to save login. Please try again with another username and password!</p>",
  5214. buttons: {
  5215. action: {
  5216. title: "Retry",
  5217. fn: settings.createLogin
  5218. }
  5219. }
  5220. })
  5221. })
  5222. };
  5223. basicModal.show({
  5224. body: "\n\t <p>\n\t Enter a username and password for your installation:\n\t <input name='username' class='text' type='text' placeholder='New Username' value=''>\n\t <input name='password' class='text' type='password' placeholder='New Password' value=''>\n\t </p>\n\t ",
  5225. buttons: {
  5226. action: {
  5227. title: "Create Login",
  5228. fn: e
  5229. }
  5230. }
  5231. })
  5232. }, settings.setLogin = function() {
  5233. var e = function(e) {
  5234. var t = e.oldPassword || "",
  5235. n = e.username || "",
  5236. o = e.password || "";
  5237. if (t.length < 1) return basicModal.error("oldPassword"), !1;
  5238. if (n.length < 1) return basicModal.error("username"), !1;
  5239. if (o.length < 1) return basicModal.error("password"), !1;
  5240. basicModal.close();
  5241. var i = {
  5242. oldPassword: t,
  5243. username: n,
  5244. password: o
  5245. };
  5246. api.post("Settings::setLogin", i, function(e) {
  5247. !0 !== e && lychee.error(null, i, e)
  5248. })
  5249. };
  5250. basicModal.show({
  5251. body: "\n\t <p>\n\t Enter your current password:\n\t <input name='oldPassword' class='text' type='password' placeholder='Current Password' value=''>\n\t </p>\n\t <p>\n\t Your username and password will be changed to the following:\n\t <input name='username' class='text' type='text' placeholder='New Username' value=''>\n\t <input name='password' class='text' type='password' placeholder='New Password' value=''>\n\t </p>\n\t ",
  5252. buttons: {
  5253. action: {
  5254. title: "Change Login",
  5255. fn: e
  5256. },
  5257. cancel: {
  5258. title: "Cancel",
  5259. fn: basicModal.close
  5260. }
  5261. }
  5262. })
  5263. }, settings.setSorting = function() {
  5264. var e = [],
  5265. t = [],
  5266. n = function() {
  5267. t[0] = $(".basicModal select#settings_albums_type").val(), t[1] = $(".basicModal select#settings_albums_order").val(), e[0] = $(".basicModal select#settings_photos_type").val(), e[1] = $(".basicModal select#settings_photos_order").val(), basicModal.close(), albums.refresh();
  5268. var n = {
  5269. typeAlbums: t[0],
  5270. orderAlbums: t[1],
  5271. typePhotos: e[0],
  5272. orderPhotos: e[1]
  5273. };
  5274. api.post("Settings::setSorting", n, function(o) {
  5275. !0 === o ? (lychee.sortingAlbums = "ORDER BY " + t[0] + " " + t[1], lychee.sortingPhotos = "ORDER BY " + e[0] + " " + e[1], lychee.load()) : lychee.error(null, n, o)
  5276. })
  5277. };
  5278. basicModal.show({
  5279. body: "\n\t <p>\n\t Sort albums by\n\t <span class=\"select\">\n\t <select id='settings_albums_type'>\n\t <option value='id'>Creation Time</option>\n\t <option value='title'>Title</option>\n\t <option value='description'>Description</option>\n\t <option value='public'>Public</option>\n\t <option value='max_takestamp'>Latest Take Date</option>\n\t <option value='min_takestamp'>Oldest Take Date</option>\n\t </select>\n\t </span>\n\t in an\n\t <span class=\"select\">\n\t <select id='settings_albums_order'>\n\t <option value='ASC'>Ascending</option>\n\t <option value='DESC'>Descending</option>\n\t </select>\n\t </span>\n\t order.\n\t </p>\n\t <p>\n\t Sort photos by\n\t <span class=\"select\">\n\t <select id='settings_photos_type'>\n\t <option value='id'>Upload Time</option>\n\t <option value='takestamp'>Take Date</option>\n\t <option value='title'>Title</option>\n\t <option value='description'>Description</option>\n\t <option value='public'>Public</option>\n\t <option value='star'>Star</option>\n\t <option value='type'>Photo Format</option>\n\t </select>\n\t </span>\n\t in an\n\t <span class=\"select\">\n\t <select id='settings_photos_order'>\n\t <option value='ASC'>Ascending</option>\n\t <option value='DESC'>Descending</option>\n\t </select>\n\t </span>\n\t order.\n\t </p>\n\t ",
  5280. buttons: {
  5281. action: {
  5282. title: "Change Sorting",
  5283. fn: n
  5284. },
  5285. cancel: {
  5286. title: "Cancel",
  5287. fn: basicModal.close
  5288. }
  5289. }
  5290. }), "" !== lychee.sortingAlbums && (t = lychee.sortingAlbums.replace("ORDER BY ", "").split(" "), $(".basicModal select#settings_albums_type").val(t[0]), $(".basicModal select#settings_albums_order").val(t[1])), "" !== lychee.sortingPhotos && (e = lychee.sortingPhotos.replace("ORDER BY ", "").split(" "), $(".basicModal select#settings_photos_type").val(e[0]), $(".basicModal select#settings_photos_order").val(e[1]))
  5291. }, settings.setDropboxKey = function(e) {
  5292. var t = function(t) {
  5293. var n = t.key;
  5294. if (t.key.length < 1) return basicModal.error("key"), !1;
  5295. basicModal.close(), api.post("Settings::setDropboxKey", {
  5296. key: n
  5297. }, function(t) {
  5298. !0 === t ? (lychee.dropboxKey = n, e && lychee.loadDropbox(e)) : lychee.error(null, params, t)
  5299. })
  5300. },
  5301. n = lychee.html(_templateObject35, lychee.dropboxKey);
  5302. basicModal.show({
  5303. body: n,
  5304. buttons: {
  5305. action: {
  5306. title: "Set Dropbox Key",
  5307. fn: t
  5308. },
  5309. cancel: {
  5310. title: "Cancel",
  5311. fn: basicModal.close
  5312. }
  5313. }
  5314. })
  5315. }, sidebar = {
  5316. _dom: $(".sidebar"),
  5317. types: {
  5318. DEFAULT: 0,
  5319. TAGS: 1
  5320. },
  5321. createStructure: {}
  5322. }, sidebar.dom = function(e) {
  5323. return null == e || "" === e ? sidebar._dom : sidebar._dom.find(e)
  5324. }, sidebar.bind = function() {
  5325. var e = lychee.getEventName();
  5326. return sidebar.dom("#edit_title").off(e).on(e, function() {
  5327. visible.photo() ? photo.setTitle([photo.getID()]) : visible.album() && album.setTitle([album.getID()])
  5328. }), sidebar.dom("#edit_description").off(e).on(e, function() {
  5329. visible.photo() ? photo.setDescription(photo.getID()) : visible.album() && album.setDescription(album.getID())
  5330. }), sidebar.dom("#edit_tags").off(e).on(e, function() {
  5331. photo.editTags([photo.getID()])
  5332. }), sidebar.dom("#tags .tag span").off(e).on(e, function() {
  5333. photo.deleteTag(photo.getID(), $(this).data("index"))
  5334. }), !0
  5335. }, sidebar.toggle = function() {
  5336. return !(!visible.sidebar() && !visible.sidebarbutton()) && (header.dom(".button--info").toggleClass("active"), lychee.content.toggleClass("content--sidebar"), sidebar.dom().toggleClass("active"), !0)
  5337. }, sidebar.setSelectable = function() {
  5338. !0 === (!(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]) ? sidebar.dom().removeClass("notSelectable") : sidebar.dom().addClass("notSelectable")
  5339. }, sidebar.changeAttr = function(e) {
  5340. var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "-",
  5341. n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
  5342. return null != e && "" !== e && (null != t && "" !== t || (t = "-"), !1 === n && (t = lychee.escapeHTML(t)), sidebar.dom(".attr_" + e).html(t), !0)
  5343. }, sidebar.createStructure.photo = function(e) {
  5344. if (null == e || "" === e) return !1;
  5345. var t = !1,
  5346. n = e.takestamp + e.make + e.model + e.shutter + e.aperture + e.focal + e.iso,
  5347. o = {},
  5348. i = "";
  5349. switch (!1 === lychee.publicMode && (t = !0), e.public) {
  5350. case "0":
  5351. i = "No";
  5352. break;
  5353. case "1":
  5354. i = "Yes";
  5355. break;
  5356. case "2":
  5357. i = "Yes (Album)";
  5358. break;
  5359. default:
  5360. i = "-"
  5361. }
  5362. return o.basics = {
  5363. title: "Basics",
  5364. type: sidebar.types.DEFAULT,
  5365. rows: [{
  5366. title: "Title",
  5367. value: e.title,
  5368. editable: t
  5369. }, {
  5370. title: "Uploaded",
  5371. value: e.sysdate
  5372. }, {
  5373. title: "Description",
  5374. value: e.description,
  5375. editable: t
  5376. }]
  5377. }, o.image = {
  5378. title: "Image",
  5379. type: sidebar.types.DEFAULT,
  5380. rows: [{
  5381. title: "Size",
  5382. value: e.size
  5383. }, {
  5384. title: "Format",
  5385. value: e.type
  5386. }, {
  5387. title: "Resolution",
  5388. value: e.width + " x " + e.height
  5389. }]
  5390. }, !1 === lychee.publicMode ? o.tags = {
  5391. title: "Tags",
  5392. type: sidebar.types.TAGS,
  5393. value: build.tags(e.tags),
  5394. editable: t
  5395. } : o.tags = {}, o.exif = "0" !== n ? {
  5396. title: "Camera",
  5397. type: sidebar.types.DEFAULT,
  5398. rows: [{
  5399. title: "Captured",
  5400. value: e.takedate
  5401. }, {
  5402. title: "Make",
  5403. value: e.make
  5404. }, {
  5405. title: "Type/Model",
  5406. value: e.model
  5407. }, {
  5408. title: "Shutter Speed",
  5409. value: e.shutter
  5410. }, {
  5411. title: "Aperture",
  5412. value: e.aperture
  5413. }, {
  5414. title: "Focal Length",
  5415. value: e.focal
  5416. }, {
  5417. title: "ISO",
  5418. value: e.iso
  5419. }]
  5420. } : {}, o.sharing = {
  5421. title: "Sharing",
  5422. type: sidebar.types.DEFAULT,
  5423. rows: [{
  5424. title: "Public",
  5425. value: i
  5426. }]
  5427. }, o = [o.basics, o.image, o.tags, o.exif, o.sharing]
  5428. }, sidebar.createStructure.album = function(e) {
  5429. if (null == e || "" === e) return !1;
  5430. var t = !1,
  5431. n = {},
  5432. o = "",
  5433. i = "",
  5434. a = "",
  5435. r = "";
  5436. switch (!1 === lychee.publicMode && (t = !0), e.public) {
  5437. case "0":
  5438. o = "No";
  5439. break;
  5440. case "1":
  5441. o = "Yes";
  5442. break;
  5443. default:
  5444. o = "-"
  5445. }
  5446. switch (e.visible) {
  5447. case "0":
  5448. i = "Yes";
  5449. break;
  5450. case "1":
  5451. i = "No";
  5452. break;
  5453. default:
  5454. i = "-"
  5455. }
  5456. switch (e.downloadable) {
  5457. case "0":
  5458. a = "No";
  5459. break;
  5460. case "1":
  5461. a = "Yes";
  5462. break;
  5463. default:
  5464. a = "-"
  5465. }
  5466. switch (e.password) {
  5467. case "0":
  5468. r = "No";
  5469. break;
  5470. case "1":
  5471. r = "Yes";
  5472. break;
  5473. default:
  5474. r = "-"
  5475. }
  5476. return n.basics = {
  5477. title: "Basics",
  5478. type: sidebar.types.DEFAULT,
  5479. rows: [{
  5480. title: "Title",
  5481. value: e.title,
  5482. editable: t
  5483. }, {
  5484. title: "Description",
  5485. value: e.description,
  5486. editable: t
  5487. }]
  5488. }, n.album = {
  5489. title: "Album",
  5490. type: sidebar.types.DEFAULT,
  5491. rows: [{
  5492. title: "Created",
  5493. value: e.sysdate
  5494. }, {
  5495. title: "Images",
  5496. value: e.num
  5497. }]
  5498. }, n.share = {
  5499. title: "Share",
  5500. type: sidebar.types.DEFAULT,
  5501. rows: [{
  5502. title: "Public",
  5503. value: o
  5504. }, {
  5505. title: "Hidden",
  5506. value: i
  5507. }, {
  5508. title: "Downloadable",
  5509. value: a
  5510. }, {
  5511. title: "Password",
  5512. value: r
  5513. }]
  5514. }, n = [n.basics, n.album, n.share]
  5515. }, sidebar.render = function(e) {
  5516. if (null == e || "" === e || !1 === e) return !1;
  5517. var t = "",
  5518. n = function(e) {
  5519. var t = "";
  5520. return t += "\n\t\t <div class='sidebar__divider'>\n\t\t <h1>" + e.title + "</h1>\n\t\t </div>\n\t\t <table>\n\t\t ", e.rows.forEach(function(e) {
  5521. var n = e.value;
  5522. "" !== n && null != n || (n = "-"), n = lychee.html(_templateObject36, e.title.toLowerCase(), n), !0 === e.editable && (n += " " + build.editIcon("edit_" + e.title.toLowerCase())), t += lychee.html(_templateObject37, e.title, n)
  5523. }), t += "\n\t\t </table>\n\t\t "
  5524. },
  5525. o = function(e) {
  5526. var t = "",
  5527. n = "";
  5528. return !0 === e.editable && (n = build.editIcon("edit_tags")), t += lychee.html(_templateObject38, e.title, e.title.toLowerCase(), e.value, n)
  5529. };
  5530. return e.forEach(function(e) {
  5531. e.type === sidebar.types.DEFAULT ? t += n(e) : e.type === sidebar.types.TAGS && (t += o(e))
  5532. }), t
  5533. }, swipe = {
  5534. obj: null,
  5535. tolerance: 150,
  5536. offset: 0
  5537. }, swipe.start = function(e, t) {
  5538. return e && (swipe.obj = e), t && (swipe.tolerance = t), !0
  5539. }, swipe.move = function(e) {
  5540. if (null === swipe.obj) return !1;
  5541. swipe.offset = -1 * e.x, swipe.obj.css({
  5542. WebkitTransform: "translateX(" + swipe.offset + "px)",
  5543. MozTransform: "translateX(" + swipe.offset + "px)",
  5544. transform: "translateX(" + swipe.offset + "px)"
  5545. })
  5546. }, swipe.stop = function(e, t, n) {
  5547. if (null == swipe.obj) return !1;
  5548. e.x <= -swipe.tolerance ? t(!0) : e.x >= swipe.tolerance ? n(!0) : swipe.obj.css({
  5549. WebkitTransform: "translateX(0px)",
  5550. MozTransform: "translateX(0px)",
  5551. transform: "translateX(0px)"
  5552. }), swipe.obj = null, swipe.offset = 0
  5553. }, upload = {}, upload.show = function(e, t, n) {
  5554. basicModal.show({
  5555. body: build.uploadModal(e, t),
  5556. buttons: {
  5557. action: {
  5558. title: "Close",
  5559. class: "hidden",
  5560. fn: basicModal.close
  5561. }
  5562. },
  5563. callback: n
  5564. })
  5565. }, upload.notify = function(e, t) {
  5566. if (null != t && "" !== t || (t = "You can now manage your new photo(s)."), !window.webkitNotifications) return !1;
  5567. if (0 !== window.webkitNotifications.checkPermission() && window.webkitNotifications.requestPermission(), 0 === window.webkitNotifications.checkPermission() && e) {
  5568. window.webkitNotifications.createNotification("", e, t).show()
  5569. }
  5570. }, upload.start = {
  5571. local: function(e) {
  5572. var t = album.getID(),
  5573. n = !1,
  5574. o = !1,
  5575. i = function e(i, a) {
  5576. var r = new FormData,
  5577. l = new XMLHttpRequest,
  5578. s = 0,
  5579. c = 0,
  5580. u = !1,
  5581. d = function() {
  5582. window.onbeforeunload = null, $("#upload_files").val(""), !1 === n && !1 === o ? (basicModal.close(), upload.notify("Upload complete")) : !1 === n && !0 === o ? ($(".basicModal #basicModal__action.hidden").show(), upload.notify("Upload complete")) : ($(".basicModal #basicModal__action.hidden").show(), upload.notify("Upload complete", "Failed to upload one or more photos.")), albums.refresh(), !1 === album.getID() ? lychee.goto("0") : album.load(t)
  5583. };
  5584. r.append("function", "Photo::add"), r.append("albumID", t), r.append(0, a), l.open("POST", api.path), l.onload = function() {
  5585. var e = null,
  5586. t = !1,
  5587. r = "";
  5588. try {
  5589. e = JSON.parse(l.responseText)
  5590. } catch (t) {
  5591. e = ""
  5592. }
  5593. a.ready = !0, 200 === l.status && function(e) {
  5594. return !isNaN(parseFloat(e)) && isFinite(e)
  5595. }(e) ? $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Finished").addClass("success") : ("Error:" === e.substr(0, 6) ? (r = e.substr(6) + " Please take a look at the console of your browser for further details.", n = !0, $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Failed").addClass("error"), !0 === n && lychee.error("Upload failed. Server returned an error!", l, e)) : "Warning:" === e.substr(0, 8) ? (r = e.substr(8), o = !0, $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Skipped").addClass("warning"), !0 === n && lychee.error("Upload failed. Server returned a warning!", l, e)) : (r = "Server returned an unknown response. Please take a look at the console of your browser for further details.", n = !0, $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Failed").addClass("error"), !0 === n && lychee.error("Upload failed. Server returned an unkown error!", l, e)), $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") p.notice").html(r).show());
  5596. for (var s = 0; s < i.length; s++)
  5597. if (!1 === i[s].ready) {
  5598. t = !0;
  5599. break
  5600. }!1 === t && d()
  5601. }, l.upload.onprogress = function(t) {
  5602. if (!0 !== t.lengthComputable) return !1;
  5603. if (c = t.loaded / t.total * 100 | 0, c > s && ($(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html(c + "%"), s = c), c >= 100 && !1 === u) {
  5604. var n = 0;
  5605. a.num + 1 > 4 && (n = 40 * (a.num + 1 - 4)), $(".basicModal .rows").scrollTop(n), $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Processing"), null != a.next && (e(i, a.next), u = !0)
  5606. }
  5607. }, l.send(r)
  5608. };
  5609. if (e.length <= 0) return !1;
  5610. !1 !== t && !0 !== visible.albums() || (t = 0);
  5611. for (var a = 0; a < e.length; a++) e[a].num = a, e[a].ready = !1, a < e.length - 1 ? e[a].next = e[a + 1] : e[a].next = null;
  5612. window.onbeforeunload = function() {
  5613. return "Lychee is currently uploading!"
  5614. }, upload.show("Uploading", e, function() {
  5615. i(e, e[0])
  5616. })
  5617. },
  5618. url: function() {
  5619. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
  5620. t = album.getID();
  5621. e = "string" == typeof e ? e : "", !1 === t && (t = 0);
  5622. var n = function(e) {
  5623. var n = [];
  5624. e.link && e.link.length > 3 ? (basicModal.close(), n[0] = {
  5625. name: e.link
  5626. }, upload.show("Importing URL", n, function() {
  5627. $(".basicModal .rows .row .status").html("Importing");
  5628. var n = {
  5629. url: e.link,
  5630. albumID: t
  5631. };
  5632. api.post("Import::url", n, function(e) {
  5633. !0 !== e ? ($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(), $(".basicModal .rows .row .status").html("Finished").addClass("warning"), $(".basicModal #basicModal__action.hidden").show(), lychee.error(null, n, e)) : basicModal.close(), upload.notify("Import complete"), albums.refresh(), !1 === album.getID() ? lychee.goto("0") : album.load(t)
  5634. })
  5635. })) : basicModal.error("link")
  5636. };
  5637. basicModal.show({
  5638. body: lychee.html(_templateObject39, e),
  5639. buttons: {
  5640. action: {
  5641. title: "Import",
  5642. fn: n
  5643. },
  5644. cancel: {
  5645. title: "Cancel",
  5646. fn: basicModal.close
  5647. }
  5648. }
  5649. })
  5650. },
  5651. server: function() {
  5652. var e = album.getID();
  5653. !1 === e && (e = 0);
  5654. var t = function(t) {
  5655. var n = [];
  5656. n[0] = {
  5657. name: t.path
  5658. }, upload.show("Importing from server", n, function() {
  5659. $(".basicModal .rows .row .status").html("Importing");
  5660. var n = {
  5661. albumID: e,
  5662. path: t.path
  5663. };
  5664. api.post("Import::server", n, function(t) {
  5665. if (albums.refresh(), upload.notify("Import complete"), "Notice: Import only contained albums!" === t) return visible.albums() ? lychee.load() : lychee.goto(), basicModal.close(), !0;
  5666. "Warning: Folder empty or no readable files to process!" === t ? ($(".basicModal .rows .row p.notice").html("Folder empty or no readable files to process. Please take a look at the log (Settings -> Show Log) for further details.").show(), $(".basicModal .rows .row .status").html("Failed").addClass("error"), lychee.error("Could not start import because the folder was empty!", n, t)) : !0 !== t ? ($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(), $(".basicModal .rows .row .status").html("Finished").addClass("warning"), lychee.error(null, n, t)) : basicModal.close(), !1 === album.getID() ? lychee.goto("0") : album.load(e), $(".basicModal #basicModal__action.hidden").show()
  5667. })
  5668. })
  5669. };
  5670. basicModal.show({
  5671. body: lychee.html(_templateObject40, lychee.location),
  5672. buttons: {
  5673. action: {
  5674. title: "Import",
  5675. fn: t
  5676. },
  5677. cancel: {
  5678. title: "Cancel",
  5679. fn: basicModal.close
  5680. }
  5681. }
  5682. })
  5683. },
  5684. dropbox: function() {
  5685. var e = album.getID();
  5686. !1 === e && (e = 0);
  5687. var t = function(t) {
  5688. for (var n = "", o = 0; o < t.length; o++) n += t[o].link + ",", t[o] = {
  5689. name: t[o].link
  5690. };
  5691. n = n.substr(0, n.length - 1), upload.show("Importing from Dropbox", t, function() {
  5692. $(".basicModal .rows .row .status").html("Importing");
  5693. var t = {
  5694. url: n,
  5695. albumID: e
  5696. };
  5697. api.post("Import::url", t, function(n) {
  5698. !0 !== n ? ($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(), $(".basicModal .rows .row .status").html("Finished").addClass("warning"), $(".basicModal #basicModal__action.hidden").show(), lychee.error(null, t, n)) : basicModal.close(), upload.notify("Import complete"), albums.refresh(), !1 === album.getID() ? lychee.goto("0") : album.load(e)
  5699. })
  5700. })
  5701. };
  5702. lychee.loadDropbox(function() {
  5703. Dropbox.choose({
  5704. linkType: "direct",
  5705. multiselect: !0,
  5706. success: t
  5707. })
  5708. })
  5709. }
  5710. }, view = {}, view.albums = {
  5711. init: function() {
  5712. view.albums.title(), view.albums.content.init()
  5713. },
  5714. title: function() {
  5715. lychee.setTitle("Albums", !1)
  5716. },
  5717. content: {
  5718. scrollPosition: 0,
  5719. init: function() {
  5720. var e = "",
  5721. t = "";
  5722. !1 === lychee.publicMode && (albums.parse(albums.json.smartalbums.unsorted), albums.parse(albums.json.smartalbums.public), albums.parse(albums.json.smartalbums.starred), albums.parse(albums.json.smartalbums.recent), e = build.divider("Smart Albums") + build.album(albums.json.smartalbums.unsorted) + build.album(albums.json.smartalbums.public) + build.album(albums.json.smartalbums.starred) + build.album(albums.json.smartalbums.recent)), albums.json.albums && 0 !== albums.json.num && ($.each(albums.json.albums, function() {
  5723. albums.parse(this), t += build.album(this)
  5724. }), !1 === lychee.publicMode && (t = build.divider("Albums") + t)), "" === e && "" === t ? (lychee.content.html(""), $("body").append(build.no_content("eye"))) : lychee.content.html(e + t), null != view.albums.content.scrollPosition && 0 !== view.albums.content.scrollPosition && $(document).scrollTop(view.albums.content.scrollPosition)
  5725. },
  5726. title: function(e) {
  5727. var t = albums.getByID(e).title;
  5728. t = lychee.escapeHTML(t), $('.album[data-id="' + e + '"] .overlay h1').html(t).attr("title", t)
  5729. },
  5730. delete: function(e) {
  5731. $('.album[data-id="' + e + '"]').css("opacity", 0).animate({
  5732. width: 0,
  5733. marginLeft: 0
  5734. }, 300, function() {
  5735. $(this).remove(), albums.json.num <= 0 && lychee.content.find(".divider:last-child").remove()
  5736. })
  5737. }
  5738. }
  5739. }, view.album = {
  5740. init: function() {
  5741. album.parse(), view.album.sidebar(), view.album.title(), view.album.public(), view.album.content.init(), album.json.init = 1
  5742. },
  5743. title: function() {
  5744. if ((visible.album() || !album.json.init) && !visible.photo()) switch (album.getID()) {
  5745. case "f":
  5746. lychee.setTitle("Starred", !1);
  5747. break;
  5748. case "s":
  5749. lychee.setTitle("Public", !1);
  5750. break;
  5751. case "r":
  5752. lychee.setTitle("Recent", !1);
  5753. break;
  5754. case "0":
  5755. lychee.setTitle("Unsorted", !1);
  5756. break;
  5757. default:
  5758. album.json.init && sidebar.changeAttr("title", album.json.title), lychee.setTitle(album.json.title, !0)
  5759. }
  5760. },
  5761. content: {
  5762. init: function() {
  5763. var e = "";
  5764. album.json.content && !1 !== album.json.content && $.each(album.json.photos, function() {
  5765. e += build.photo(this)
  5766. }), view.albums.content.scrollPosition = $(document).scrollTop(), requestAnimationFrame(function() {
  5767. return $(document).scrollTop(0)
  5768. }), lychee.content.html(e)
  5769. },
  5770. title: function(e) {
  5771. var t = album.json.content[e].title;
  5772. t = lychee.escapeHTML(t), $('.photo[data-id="' + e + '"] .overlay h1').html(t).attr("title", t)
  5773. },
  5774. star: function(e) {
  5775. var t = $('.photo[data-id="' + e + '"] .icn-star');
  5776. "1" === album.json.content[e].star ? t.addClass("badge--visible") : t.removeClass("badge--visible")
  5777. },
  5778. public: function(e) {
  5779. var t = $('.photo[data-id="' + e + '"] .icn-share');
  5780. "1" === album.json.content[e].public ? t.addClass("badge--visible") : t.removeClass("badge--visible")
  5781. },
  5782. delete: function(e) {
  5783. $('.photo[data-id="' + e + '"]').css("opacity", 0).animate({
  5784. width: 0,
  5785. marginLeft: 0
  5786. }, 300, function() {
  5787. $(this).remove(), visible.albums() || (album.json.num--, view.album.num())
  5788. })
  5789. }
  5790. },
  5791. description: function() {
  5792. sidebar.changeAttr("description", album.json.description)
  5793. },
  5794. num: function() {
  5795. sidebar.changeAttr("images", album.json.num)
  5796. },
  5797. public: function() {
  5798. "1" === album.json.public ? ($("#button_share_album").addClass("active").attr("title", "Share Album"), $(".photo .iconic-share").remove(), album.json.init && sidebar.changeAttr("public", "Yes")) : ($("#button_share_album").removeClass("active").attr("title", "Make Public"), album.json.init && sidebar.changeAttr("public", "No"))
  5799. },
  5800. hidden: function() {
  5801. "1" === album.json.visible ? sidebar.changeAttr("hidden", "No") : sidebar.changeAttr("hidden", "Yes")
  5802. },
  5803. downloadable: function() {
  5804. "1" === album.json.downloadable ? sidebar.changeAttr("downloadable", "Yes") : sidebar.changeAttr("downloadable", "No")
  5805. },
  5806. password: function() {
  5807. "1" === album.json.password ? sidebar.changeAttr("password", "Yes") : sidebar.changeAttr("password", "No")
  5808. },
  5809. sidebar: function(e) {
  5810. function t() {
  5811. return e.apply(this, arguments)
  5812. }
  5813. return t.toString = function() {
  5814. return e.toString()
  5815. }, t
  5816. }(function() {
  5817. if ((visible.album() || !album.json.init) && !visible.photo()) {
  5818. var e = sidebar.createStructure.album(album.json),
  5819. t = sidebar.render(e);
  5820. sidebar.dom(".sidebar__wrapper").html(t), sidebar.bind()
  5821. }
  5822. })
  5823. }, view.photo = {
  5824. init: function() {
  5825. photo.parse(), view.photo.sidebar(), view.photo.title(), view.photo.star(), view.photo.public(), view.photo.photo(), photo.json.init = 1
  5826. },
  5827. show: function() {
  5828. lychee.content.addClass("view"), header.setMode("photo"), $("body").css("overflow", "hidden");
  5829. var e = null;
  5830. $(document).bind("mousemove", function() {
  5831. clearTimeout(e), header.show(), e = setTimeout(header.hide, 2500)
  5832. }), lychee.animate(lychee.imageview, "fadeIn")
  5833. },
  5834. hide: function() {
  5835. header.show(), lychee.content.removeClass("view"), header.setMode("album"), $("body").css("overflow", "auto"), $(document).unbind("mousemove"), lychee.animate(lychee.imageview, "fadeOut"), setTimeout(function() {
  5836. lychee.imageview.hide(), view.album.sidebar()
  5837. }, 300)
  5838. },
  5839. title: function() {
  5840. photo.json.init && sidebar.changeAttr("title", photo.json.title), lychee.setTitle(photo.json.title, !0)
  5841. },
  5842. description: function() {
  5843. photo.json.init && sidebar.changeAttr("description", photo.json.description)
  5844. },
  5845. star: function() {
  5846. "1" === photo.json.star ? $("#button_star").addClass("active").attr("title", "Unstar Photo") : ($("#button_star").removeClass("active"), $("#button_star").attr("title", "Star Photo"))
  5847. },
  5848. public: function() {
  5849. "1" === photo.json.public || "2" === photo.json.public ? ($("#button_share").addClass("active").attr("title", "Share Photo"), photo.json.init && sidebar.changeAttr("public", "Yes")) : ($("#button_share").removeClass("active").attr("title", "Make Public"), photo.json.init && sidebar.changeAttr("public", "No"))
  5850. },
  5851. tags: function() {
  5852. sidebar.changeAttr("tags", build.tags(photo.json.tags), !0), sidebar.bind()
  5853. },
  5854. photo: function(e) {
  5855. function t() {
  5856. return e.apply(this, arguments)
  5857. }
  5858. return t.toString = function() {
  5859. return e.toString()
  5860. }, t
  5861. }(function() {
  5862. lychee.imageview.html(build.imageview(photo.json, visible.header()));
  5863. var e = lychee.imageview.find("a#next"),
  5864. t = lychee.imageview.find("a#previous"),
  5865. n = photo.getID(),
  5866. o = album.json && album.json.content && album.json.content[n] && null != album.json.content[n].nextPhoto && "" !== album.json.content[n].nextPhoto,
  5867. i = album.json && album.json.content && album.json.content[n] && null != album.json.content[n].previousPhoto && "" !== album.json.content[n].previousPhoto;
  5868. if (!1 === o || !0 === lychee.viewMode) e.hide();
  5869. else {
  5870. var a = album.json.content[n].nextPhoto,
  5871. r = album.json.content[a];
  5872. e.css("background-image", lychee.html(_templateObject41, r.thumbUrl))
  5873. }
  5874. if (!1 === i || !0 === lychee.viewMode) t.hide();
  5875. else {
  5876. var l = album.json.content[n].previousPhoto,
  5877. s = album.json.content[l];
  5878. t.css("background-image", lychee.html(_templateObject41, s.thumbUrl))
  5879. }
  5880. }),
  5881. sidebar: function(e) {
  5882. function t() {
  5883. return e.apply(this, arguments)
  5884. }
  5885. return t.toString = function() {
  5886. return e.toString()
  5887. }, t
  5888. }(function() {
  5889. var e = sidebar.createStructure.photo(photo.json),
  5890. t = sidebar.render(e);
  5891. sidebar.dom(".sidebar__wrapper").html(t), sidebar.bind()
  5892. })
  5893. }, visible = {}, visible.albums = function() {
  5894. return !!header.dom(".header__toolbar--public").hasClass("header__toolbar--visible") || !!header.dom(".header__toolbar--albums").hasClass("header__toolbar--visible")
  5895. }, visible.album = function() {
  5896. return !!header.dom(".header__toolbar--album").hasClass("header__toolbar--visible")
  5897. }, visible.photo = function() {
  5898. return $("#imageview.fadeIn").length > 0
  5899. }, visible.search = function() {
  5900. return null != search.hash
  5901. }, visible.sidebar = function() {
  5902. return !0 === sidebar.dom().hasClass("active")
  5903. }, visible.sidebarbutton = function() {
  5904. return !!visible.photo() || !!(visible.album() && $("#button_info_album:visible").length > 0)
  5905. }, visible.header = function() {
  5906. return !0 !== header.dom().hasClass("header--hidden")
  5907. }, visible.contextMenu = function() {
  5908. return basicContext.visible()
  5909. }, visible.multiselect = function() {
  5910. return $("#multiselect").length > 0
  5911. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement