· 8 years ago · Oct 12, 2017, 11:16 PM
1/******/ (function(modules) { // webpackBootstrap
2/******/ // The module cache
3/******/ var installedModules = {};
4/******/
5/******/ // The require function
6/******/ function __webpack_require__(moduleId) {
7/******/
8/******/ // Check if module is in cache
9/******/ if(installedModules[moduleId]) {
10/******/ return installedModules[moduleId].exports;
11/******/ }
12/******/ // Create a new module (and put it into the cache)
13/******/ var module = installedModules[moduleId] = {
14/******/ i: moduleId,
15/******/ l: false,
16/******/ exports: {}
17/******/ };
18/******/
19/******/ // Execute the module function
20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ // Flag the module as loaded
23/******/ module.l = true;
24/******/
25/******/ // Return the exports of the module
26/******/ return module.exports;
27/******/ }
28/******/
29/******/
30/******/ // expose the modules object (__webpack_modules__)
31/******/ __webpack_require__.m = modules;
32/******/
33/******/ // expose the module cache
34/******/ __webpack_require__.c = installedModules;
35/******/
36/******/ // define getter function for harmony exports
37/******/ __webpack_require__.d = function(exports, name, getter) {
38/******/ if(!__webpack_require__.o(exports, name)) {
39/******/ Object.defineProperty(exports, name, {
40/******/ configurable: false,
41/******/ enumerable: true,
42/******/ get: getter
43/******/ });
44/******/ }
45/******/ };
46/******/
47/******/ // getDefaultExport function for compatibility with non-harmony modules
48/******/ __webpack_require__.n = function(module) {
49/******/ var getter = module && module.__esModule ?
50/******/ function getDefault() { return module['default']; } :
51/******/ function getModuleExports() { return module; };
52/******/ __webpack_require__.d(getter, 'a', getter);
53/******/ return getter;
54/******/ };
55/******/
56/******/ // Object.prototype.hasOwnProperty.call
57/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58/******/
59/******/ // __webpack_public_path__
60/******/ __webpack_require__.p = "";
61/******/
62/******/ // Load entry module and return exports
63/******/ return __webpack_require__(__webpack_require__.s = 3);
64/******/ })
65/************************************************************************/
66/******/ ([
67/* 0 */
68/***/ (function(module, exports, __webpack_require__) {
69
70"use strict";
71var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
72
73var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
74
75/*! ScrollMagic v2.0.5 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
76
77!function (e, t) {
78 true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (t),
79 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
80 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
81 __WEBPACK_AMD_DEFINE_FACTORY__),
82 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ? module.exports = t() : e.ScrollMagic = t();
83}(undefined, function () {
84 "use strict";
85 var e = function e() {};e.version = "2.0.5", window.addEventListener("mousewheel", function () {});var t = "data-scrollmagic-pin-spacer";e.Controller = function (r) {
86 var o,
87 s,
88 a = "ScrollMagic.Controller",
89 l = "FORWARD",
90 c = "REVERSE",
91 u = "PAUSED",
92 f = n.defaults,
93 d = this,
94 h = i.extend({}, f, r),
95 g = [],
96 p = !1,
97 v = 0,
98 m = u,
99 w = !0,
100 y = 0,
101 S = !0,
102 b = function b() {
103 for (var e in h) {
104 f.hasOwnProperty(e) || delete h[e];
105 }if (h.container = i.get.elements(h.container)[0], !h.container) throw a + " init failed.";w = h.container === window || h.container === document.body || !document.body.contains(h.container), w && (h.container = window), y = z(), h.container.addEventListener("resize", T), h.container.addEventListener("scroll", T), h.refreshInterval = parseInt(h.refreshInterval) || f.refreshInterval, E();
106 },
107 E = function E() {
108 h.refreshInterval > 0 && (s = window.setTimeout(A, h.refreshInterval));
109 },
110 x = function x() {
111 return h.vertical ? i.get.scrollTop(h.container) : i.get.scrollLeft(h.container);
112 },
113 z = function z() {
114 return h.vertical ? i.get.height(h.container) : i.get.width(h.container);
115 },
116 C = this._setScrollPos = function (e) {
117 h.vertical ? w ? window.scrollTo(i.get.scrollLeft(), e) : h.container.scrollTop = e : w ? window.scrollTo(e, i.get.scrollTop()) : h.container.scrollLeft = e;
118 },
119 F = function F() {
120 if (S && p) {
121 var e = i.type.Array(p) ? p : g.slice(0);p = !1;var t = v;v = d.scrollPos();var n = v - t;0 !== n && (m = n > 0 ? l : c), m === c && e.reverse(), e.forEach(function (e) {
122 e.update(!0);
123 });
124 }
125 },
126 L = function L() {
127 o = i.rAF(F);
128 },
129 T = function T(e) {
130 "resize" == e.type && (y = z(), m = u), p !== !0 && (p = !0, L());
131 },
132 A = function A() {
133 if (!w && y != z()) {
134 var e;try {
135 e = new Event("resize", { bubbles: !1, cancelable: !1 });
136 } catch (t) {
137 e = document.createEvent("Event"), e.initEvent("resize", !1, !1);
138 }h.container.dispatchEvent(e);
139 }g.forEach(function (e) {
140 e.refresh();
141 }), E();
142 };this._options = h;var O = function O(e) {
143 if (e.length <= 1) return e;var t = e.slice(0);return t.sort(function (e, t) {
144 return e.scrollOffset() > t.scrollOffset() ? 1 : -1;
145 }), t;
146 };return this.addScene = function (t) {
147 if (i.type.Array(t)) t.forEach(function (e) {
148 d.addScene(e);
149 });else if (t instanceof e.Scene) if (t.controller() !== d) t.addTo(d);else if (g.indexOf(t) < 0) {
150 g.push(t), g = O(g), t.on("shift.controller_sort", function () {
151 g = O(g);
152 });for (var n in h.globalSceneOptions) {
153 t[n] && t[n].call(t, h.globalSceneOptions[n]);
154 }
155 }return d;
156 }, this.removeScene = function (e) {
157 if (i.type.Array(e)) e.forEach(function (e) {
158 d.removeScene(e);
159 });else {
160 var t = g.indexOf(e);t > -1 && (e.off("shift.controller_sort"), g.splice(t, 1), e.remove());
161 }return d;
162 }, this.updateScene = function (t, n) {
163 return i.type.Array(t) ? t.forEach(function (e) {
164 d.updateScene(e, n);
165 }) : n ? t.update(!0) : p !== !0 && t instanceof e.Scene && (p = p || [], -1 == p.indexOf(t) && p.push(t), p = O(p), L()), d;
166 }, this.update = function (e) {
167 return T({ type: "resize" }), e && F(), d;
168 }, this.scrollTo = function (n, r) {
169 if (i.type.Number(n)) C.call(h.container, n, r);else if (n instanceof e.Scene) n.controller() === d && d.scrollTo(n.scrollOffset(), r);else if (i.type.Function(n)) C = n;else {
170 var o = i.get.elements(n)[0];if (o) {
171 for (; o.parentNode.hasAttribute(t);) {
172 o = o.parentNode;
173 }var s = h.vertical ? "top" : "left",
174 a = i.get.offset(h.container),
175 l = i.get.offset(o);w || (a[s] -= d.scrollPos()), d.scrollTo(l[s] - a[s], r);
176 }
177 }return d;
178 }, this.scrollPos = function (e) {
179 return arguments.length ? (i.type.Function(e) && (x = e), d) : x.call(d);
180 }, this.info = function (e) {
181 var t = { size: y, vertical: h.vertical, scrollPos: v, scrollDirection: m, container: h.container, isDocument: w };return arguments.length ? void 0 !== t[e] ? t[e] : void 0 : t;
182 }, this.loglevel = function () {
183 return d;
184 }, this.enabled = function (e) {
185 return arguments.length ? (S != e && (S = !!e, d.updateScene(g, !0)), d) : S;
186 }, this.destroy = function (e) {
187 window.clearTimeout(s);for (var t = g.length; t--;) {
188 g[t].destroy(e);
189 }return h.container.removeEventListener("resize", T), h.container.removeEventListener("scroll", T), i.cAF(o), null;
190 }, b(), d;
191 };var n = { defaults: { container: window, vertical: !0, globalSceneOptions: {}, loglevel: 2, refreshInterval: 100 } };e.Controller.addOption = function (e, t) {
192 n.defaults[e] = t;
193 }, e.Controller.extend = function (t) {
194 var n = this;e.Controller = function () {
195 return n.apply(this, arguments), this.$super = i.extend({}, this), t.apply(this, arguments) || this;
196 }, i.extend(e.Controller, n), e.Controller.prototype = n.prototype, e.Controller.prototype.constructor = e.Controller;
197 }, e.Scene = function (n) {
198 var o,
199 s,
200 a = "BEFORE",
201 l = "DURING",
202 c = "AFTER",
203 u = r.defaults,
204 f = this,
205 d = i.extend({}, u, n),
206 h = a,
207 g = 0,
208 p = { start: 0, end: 0 },
209 v = 0,
210 m = !0,
211 w = function w() {
212 for (var e in d) {
213 u.hasOwnProperty(e) || delete d[e];
214 }for (var t in u) {
215 L(t);
216 }C();
217 },
218 y = {};this.on = function (e, t) {
219 return i.type.Function(t) && (e = e.trim().split(" "), e.forEach(function (e) {
220 var n = e.split("."),
221 r = n[0],
222 i = n[1];"*" != r && (y[r] || (y[r] = []), y[r].push({ namespace: i || "", callback: t }));
223 })), f;
224 }, this.off = function (e, t) {
225 return e ? (e = e.trim().split(" "), e.forEach(function (e) {
226 var n = e.split("."),
227 r = n[0],
228 i = n[1] || "",
229 o = "*" === r ? Object.keys(y) : [r];o.forEach(function (e) {
230 for (var n = y[e] || [], r = n.length; r--;) {
231 var o = n[r];!o || i !== o.namespace && "*" !== i || t && t != o.callback || n.splice(r, 1);
232 }n.length || delete y[e];
233 });
234 }), f) : f;
235 }, this.trigger = function (t, n) {
236 if (t) {
237 var r = t.trim().split("."),
238 i = r[0],
239 o = r[1],
240 s = y[i];s && s.forEach(function (t) {
241 o && o !== t.namespace || t.callback.call(f, new e.Event(i, t.namespace, f, n));
242 });
243 }return f;
244 }, f.on("change.internal", function (e) {
245 "loglevel" !== e.what && "tweenChanges" !== e.what && ("triggerElement" === e.what ? E() : "reverse" === e.what && f.update());
246 }).on("shift.internal", function () {
247 S(), f.update();
248 }), this.addTo = function (t) {
249 return t instanceof e.Controller && s != t && (s && s.removeScene(f), s = t, C(), b(!0), E(!0), S(), s.info("container").addEventListener("resize", x), t.addScene(f), f.trigger("add", { controller: s }), f.update()), f;
250 }, this.enabled = function (e) {
251 return arguments.length ? (m != e && (m = !!e, f.update(!0)), f) : m;
252 }, this.remove = function () {
253 if (s) {
254 s.info("container").removeEventListener("resize", x);var e = s;s = void 0, e.removeScene(f), f.trigger("remove");
255 }return f;
256 }, this.destroy = function (e) {
257 return f.trigger("destroy", { reset: e }), f.remove(), f.off("*.*"), null;
258 }, this.update = function (e) {
259 if (s) if (e) {
260 if (s.enabled() && m) {
261 var t,
262 n = s.info("scrollPos");t = d.duration > 0 ? (n - p.start) / (p.end - p.start) : n >= p.start ? 1 : 0, f.trigger("update", { startPos: p.start, endPos: p.end, scrollPos: n }), f.progress(t);
263 } else T && h === l && O(!0);
264 } else s.updateScene(f, !1);return f;
265 }, this.refresh = function () {
266 return b(), E(), f;
267 }, this.progress = function (e) {
268 if (arguments.length) {
269 var t = !1,
270 n = h,
271 r = s ? s.info("scrollDirection") : "PAUSED",
272 i = d.reverse || e >= g;if (0 === d.duration ? (t = g != e, g = 1 > e && i ? 0 : 1, h = 0 === g ? a : l) : 0 > e && h !== a && i ? (g = 0, h = a, t = !0) : e >= 0 && 1 > e && i ? (g = e, h = l, t = !0) : e >= 1 && h !== c ? (g = 1, h = c, t = !0) : h !== l || i || O(), t) {
273 var o = { progress: g, state: h, scrollDirection: r },
274 u = h != n,
275 p = function p(e) {
276 f.trigger(e, o);
277 };u && n !== l && (p("enter"), p(n === a ? "start" : "end")), p("progress"), u && h !== l && (p(h === a ? "start" : "end"), p("leave"));
278 }return f;
279 }return g;
280 };var S = function S() {
281 p = { start: v + d.offset }, s && d.triggerElement && (p.start -= s.info("size") * d.triggerHook), p.end = p.start + d.duration;
282 },
283 b = function b(e) {
284 if (o) {
285 var t = "duration";F(t, o.call(f)) && !e && (f.trigger("change", { what: t, newval: d[t] }), f.trigger("shift", { reason: t }));
286 }
287 },
288 E = function E(e) {
289 var n = 0,
290 r = d.triggerElement;if (s && r) {
291 for (var o = s.info(), a = i.get.offset(o.container), l = o.vertical ? "top" : "left"; r.parentNode.hasAttribute(t);) {
292 r = r.parentNode;
293 }var c = i.get.offset(r);o.isDocument || (a[l] -= s.scrollPos()), n = c[l] - a[l];
294 }var u = n != v;v = n, u && !e && f.trigger("shift", { reason: "triggerElementPosition" });
295 },
296 x = function x() {
297 d.triggerHook > 0 && f.trigger("shift", { reason: "containerResize" });
298 },
299 z = i.extend(r.validate, { duration: function duration(e) {
300 if (i.type.String(e) && e.match(/^(\.|\d)*\d+%$/)) {
301 var t = parseFloat(e) / 100;e = function e() {
302 return s ? s.info("size") * t : 0;
303 };
304 }if (i.type.Function(e)) {
305 o = e;try {
306 e = parseFloat(o());
307 } catch (t) {
308 e = -1;
309 }
310 }if (e = parseFloat(e), !i.type.Number(e) || 0 > e) throw o ? (o = void 0, 0) : 0;return e;
311 } }),
312 C = function C(e) {
313 e = arguments.length ? [e] : Object.keys(z), e.forEach(function (e) {
314 var t;if (z[e]) try {
315 t = z[e](d[e]);
316 } catch (n) {
317 t = u[e];
318 } finally {
319 d[e] = t;
320 }
321 });
322 },
323 F = function F(e, t) {
324 var n = !1,
325 r = d[e];return d[e] != t && (d[e] = t, C(e), n = r != d[e]), n;
326 },
327 L = function L(e) {
328 f[e] || (f[e] = function (t) {
329 return arguments.length ? ("duration" === e && (o = void 0), F(e, t) && (f.trigger("change", { what: e, newval: d[e] }), r.shifts.indexOf(e) > -1 && f.trigger("shift", { reason: e })), f) : d[e];
330 });
331 };this.controller = function () {
332 return s;
333 }, this.state = function () {
334 return h;
335 }, this.scrollOffset = function () {
336 return p.start;
337 }, this.triggerPosition = function () {
338 var e = d.offset;return s && (e += d.triggerElement ? v : s.info("size") * f.triggerHook()), e;
339 };var T, A;f.on("shift.internal", function (e) {
340 var t = "duration" === e.reason;(h === c && t || h === l && 0 === d.duration) && O(), t && _();
341 }).on("progress.internal", function () {
342 O();
343 }).on("add.internal", function () {
344 _();
345 }).on("destroy.internal", function (e) {
346 f.removePin(e.reset);
347 });var O = function O(e) {
348 if (T && s) {
349 var t = s.info(),
350 n = A.spacer.firstChild;if (e || h !== l) {
351 var r = { position: A.inFlow ? "relative" : "absolute", top: 0, left: 0 },
352 o = i.css(n, "position") != r.position;A.pushFollowers ? d.duration > 0 && (h === c && 0 === parseFloat(i.css(A.spacer, "padding-top")) ? o = !0 : h === a && 0 === parseFloat(i.css(A.spacer, "padding-bottom")) && (o = !0)) : r[t.vertical ? "top" : "left"] = d.duration * g, i.css(n, r), o && _();
353 } else {
354 "fixed" != i.css(n, "position") && (i.css(n, { position: "fixed" }), _());var u = i.get.offset(A.spacer, !0),
355 f = d.reverse || 0 === d.duration ? t.scrollPos - p.start : Math.round(g * d.duration * 10) / 10;u[t.vertical ? "top" : "left"] += f, i.css(A.spacer.firstChild, { top: u.top, left: u.left });
356 }
357 }
358 },
359 _ = function _() {
360 if (T && s && A.inFlow) {
361 var e = h === l,
362 t = s.info("vertical"),
363 n = A.spacer.firstChild,
364 r = i.isMarginCollapseType(i.css(A.spacer, "display")),
365 o = {};A.relSize.width || A.relSize.autoFullWidth ? e ? i.css(T, { width: i.get.width(A.spacer) }) : i.css(T, { width: "100%" }) : (o["min-width"] = i.get.width(t ? T : n, !0, !0), o.width = e ? o["min-width"] : "auto"), A.relSize.height ? e ? i.css(T, { height: i.get.height(A.spacer) - (A.pushFollowers ? d.duration : 0) }) : i.css(T, { height: "100%" }) : (o["min-height"] = i.get.height(t ? n : T, !0, !r), o.height = e ? o["min-height"] : "auto"), A.pushFollowers && (o["padding" + (t ? "Top" : "Left")] = d.duration * g, o["padding" + (t ? "Bottom" : "Right")] = d.duration * (1 - g)), i.css(A.spacer, o);
366 }
367 },
368 N = function N() {
369 s && T && h === l && !s.info("isDocument") && O();
370 },
371 P = function P() {
372 s && T && h === l && ((A.relSize.width || A.relSize.autoFullWidth) && i.get.width(window) != i.get.width(A.spacer.parentNode) || A.relSize.height && i.get.height(window) != i.get.height(A.spacer.parentNode)) && _();
373 },
374 D = function D(e) {
375 s && T && h === l && !s.info("isDocument") && (e.preventDefault(), s._setScrollPos(s.info("scrollPos") - ((e.wheelDelta || e[s.info("vertical") ? "wheelDeltaY" : "wheelDeltaX"]) / 3 || 30 * -e.detail)));
376 };this.setPin = function (e, n) {
377 var r = { pushFollowers: !0, spacerClass: "scrollmagic-pin-spacer" };if (n = i.extend({}, r, n), e = i.get.elements(e)[0], !e) return f;if ("fixed" === i.css(e, "position")) return f;if (T) {
378 if (T === e) return f;f.removePin();
379 }T = e;var o = T.parentNode.style.display,
380 s = ["top", "left", "bottom", "right", "margin", "marginLeft", "marginRight", "marginTop", "marginBottom"];T.parentNode.style.display = "none";var a = "absolute" != i.css(T, "position"),
381 l = i.css(T, s.concat(["display"])),
382 c = i.css(T, ["width", "height"]);T.parentNode.style.display = o, !a && n.pushFollowers && (n.pushFollowers = !1);var u = T.parentNode.insertBefore(document.createElement("div"), T),
383 d = i.extend(l, { position: a ? "relative" : "absolute", boxSizing: "content-box", mozBoxSizing: "content-box", webkitBoxSizing: "content-box" });if (a || i.extend(d, i.css(T, ["width", "height"])), i.css(u, d), u.setAttribute(t, ""), i.addClass(u, n.spacerClass), A = { spacer: u, relSize: { width: "%" === c.width.slice(-1), height: "%" === c.height.slice(-1), autoFullWidth: "auto" === c.width && a && i.isMarginCollapseType(l.display) }, pushFollowers: n.pushFollowers, inFlow: a }, !T.___origStyle) {
384 T.___origStyle = {};var h = T.style,
385 g = s.concat(["width", "height", "position", "boxSizing", "mozBoxSizing", "webkitBoxSizing"]);g.forEach(function (e) {
386 T.___origStyle[e] = h[e] || "";
387 });
388 }return A.relSize.width && i.css(u, { width: c.width }), A.relSize.height && i.css(u, { height: c.height }), u.appendChild(T), i.css(T, { position: a ? "relative" : "absolute", margin: "auto", top: "auto", left: "auto", bottom: "auto", right: "auto" }), (A.relSize.width || A.relSize.autoFullWidth) && i.css(T, { boxSizing: "border-box", mozBoxSizing: "border-box", webkitBoxSizing: "border-box" }), window.addEventListener("scroll", N), window.addEventListener("resize", N), window.addEventListener("resize", P), T.addEventListener("mousewheel", D), T.addEventListener("DOMMouseScroll", D), O(), f;
389 }, this.removePin = function (e) {
390 if (T) {
391 if (h === l && O(!0), e || !s) {
392 var n = A.spacer.firstChild;if (n.hasAttribute(t)) {
393 var r = A.spacer.style,
394 o = ["margin", "marginLeft", "marginRight", "marginTop", "marginBottom"];margins = {}, o.forEach(function (e) {
395 margins[e] = r[e] || "";
396 }), i.css(n, margins);
397 }A.spacer.parentNode.insertBefore(n, A.spacer), A.spacer.parentNode.removeChild(A.spacer), T.parentNode.hasAttribute(t) || (i.css(T, T.___origStyle), delete T.___origStyle);
398 }window.removeEventListener("scroll", N), window.removeEventListener("resize", N), window.removeEventListener("resize", P), T.removeEventListener("mousewheel", D), T.removeEventListener("DOMMouseScroll", D), T = void 0;
399 }return f;
400 };var R,
401 k = [];return f.on("destroy.internal", function (e) {
402 f.removeClassToggle(e.reset);
403 }), this.setClassToggle = function (e, t) {
404 var n = i.get.elements(e);return 0 !== n.length && i.type.String(t) ? (k.length > 0 && f.removeClassToggle(), R = t, k = n, f.on("enter.internal_class leave.internal_class", function (e) {
405 var t = "enter" === e.type ? i.addClass : i.removeClass;k.forEach(function (e) {
406 t(e, R);
407 });
408 }), f) : f;
409 }, this.removeClassToggle = function (e) {
410 return e && k.forEach(function (e) {
411 i.removeClass(e, R);
412 }), f.off("start.internal_class end.internal_class"), R = void 0, k = [], f;
413 }, w(), f;
414 };var r = { defaults: { duration: 0, offset: 0, triggerElement: void 0, triggerHook: .5, reverse: !0, loglevel: 2 }, validate: { offset: function offset(e) {
415 if (e = parseFloat(e), !i.type.Number(e)) throw 0;return e;
416 }, triggerElement: function triggerElement(e) {
417 if (e = e || void 0) {
418 var t = i.get.elements(e)[0];if (!t) throw 0;e = t;
419 }return e;
420 }, triggerHook: function triggerHook(e) {
421 var t = { onCenter: .5, onEnter: 1, onLeave: 0 };if (i.type.Number(e)) e = Math.max(0, Math.min(parseFloat(e), 1));else {
422 if (!(e in t)) throw 0;e = t[e];
423 }return e;
424 }, reverse: function reverse(e) {
425 return !!e;
426 } }, shifts: ["duration", "offset", "triggerHook"] };e.Scene.addOption = function (e, t, n, i) {
427 e in r.defaults || (r.defaults[e] = t, r.validate[e] = n, i && r.shifts.push(e));
428 }, e.Scene.extend = function (t) {
429 var n = this;e.Scene = function () {
430 return n.apply(this, arguments), this.$super = i.extend({}, this), t.apply(this, arguments) || this;
431 }, i.extend(e.Scene, n), e.Scene.prototype = n.prototype, e.Scene.prototype.constructor = e.Scene;
432 }, e.Event = function (e, t, n, r) {
433 r = r || {};for (var i in r) {
434 this[i] = r[i];
435 }return this.type = e, this.target = this.currentTarget = n, this.namespace = t || "", this.timeStamp = this.timestamp = Date.now(), this;
436 };var i = e._util = function (e) {
437 var t,
438 n = {},
439 r = function r(e) {
440 return parseFloat(e) || 0;
441 },
442 i = function i(t) {
443 return t.currentStyle ? t.currentStyle : e.getComputedStyle(t);
444 },
445 o = function o(t, n, _o, s) {
446 if (n = n === document ? e : n, n === e) s = !1;else if (!f.DomElement(n)) return 0;t = t.charAt(0).toUpperCase() + t.substr(1).toLowerCase();var a = (_o ? n["offset" + t] || n["outer" + t] : n["client" + t] || n["inner" + t]) || 0;if (_o && s) {
447 var l = i(n);a += "Height" === t ? r(l.marginTop) + r(l.marginBottom) : r(l.marginLeft) + r(l.marginRight);
448 }return a;
449 },
450 s = function s(e) {
451 return e.replace(/^[^a-z]+([a-z])/g, "$1").replace(/-([a-z])/g, function (e) {
452 return e[1].toUpperCase();
453 });
454 };n.extend = function (e) {
455 for (e = e || {}, t = 1; t < arguments.length; t++) {
456 if (arguments[t]) for (var n in arguments[t]) {
457 arguments[t].hasOwnProperty(n) && (e[n] = arguments[t][n]);
458 }
459 }return e;
460 }, n.isMarginCollapseType = function (e) {
461 return ["block", "flex", "list-item", "table", "-webkit-box"].indexOf(e) > -1;
462 };var a = 0,
463 l = ["ms", "moz", "webkit", "o"],
464 c = e.requestAnimationFrame,
465 u = e.cancelAnimationFrame;for (t = 0; !c && t < l.length; ++t) {
466 c = e[l[t] + "RequestAnimationFrame"], u = e[l[t] + "CancelAnimationFrame"] || e[l[t] + "CancelRequestAnimationFrame"];
467 }c || (c = function c(t) {
468 var n = new Date().getTime(),
469 r = Math.max(0, 16 - (n - a)),
470 i = e.setTimeout(function () {
471 t(n + r);
472 }, r);return a = n + r, i;
473 }), u || (u = function u(t) {
474 e.clearTimeout(t);
475 }), n.rAF = c.bind(e), n.cAF = u.bind(e);var f = n.type = function (e) {
476 return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/, "$1").toLowerCase();
477 };f.String = function (e) {
478 return "string" === f(e);
479 }, f.Function = function (e) {
480 return "function" === f(e);
481 }, f.Array = function (e) {
482 return Array.isArray(e);
483 }, f.Number = function (e) {
484 return !f.Array(e) && e - parseFloat(e) + 1 >= 0;
485 }, f.DomElement = function (e) {
486 return "object" == (typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement)) ? e instanceof HTMLElement : e && "object" == (typeof e === "undefined" ? "undefined" : _typeof(e)) && null !== e && 1 === e.nodeType && "string" == typeof e.nodeName;
487 };var d = n.get = {};return d.elements = function (t) {
488 var n = [];if (f.String(t)) try {
489 t = document.querySelectorAll(t);
490 } catch (e) {
491 return n;
492 }if ("nodelist" === f(t) || f.Array(t)) for (var r = 0, i = n.length = t.length; i > r; r++) {
493 var o = t[r];n[r] = f.DomElement(o) ? o : d.elements(o);
494 } else (f.DomElement(t) || t === document || t === e) && (n = [t]);return n;
495 }, d.scrollTop = function (t) {
496 return t && "number" == typeof t.scrollTop ? t.scrollTop : e.pageYOffset || 0;
497 }, d.scrollLeft = function (t) {
498 return t && "number" == typeof t.scrollLeft ? t.scrollLeft : e.pageXOffset || 0;
499 }, d.width = function (e, t, n) {
500 return o("width", e, t, n);
501 }, d.height = function (e, t, n) {
502 return o("height", e, t, n);
503 }, d.offset = function (e, t) {
504 var n = { top: 0, left: 0 };if (e && e.getBoundingClientRect) {
505 var r = e.getBoundingClientRect();n.top = r.top, n.left = r.left, t || (n.top += d.scrollTop(), n.left += d.scrollLeft());
506 }return n;
507 }, n.addClass = function (e, t) {
508 t && (e.classList ? e.classList.add(t) : e.className += " " + t);
509 }, n.removeClass = function (e, t) {
510 t && (e.classList ? e.classList.remove(t) : e.className = e.className.replace(RegExp("(^|\\b)" + t.split(" ").join("|") + "(\\b|$)", "gi"), " "));
511 }, n.css = function (e, t) {
512 if (f.String(t)) return i(e)[s(t)];if (f.Array(t)) {
513 var n = {},
514 r = i(e);return t.forEach(function (e) {
515 n[e] = r[s(e)];
516 }), n;
517 }for (var o in t) {
518 var a = t[o];a == parseFloat(a) && (a += "px"), e.style[s(o)] = a;
519 }
520 }, n;
521 }(window || {});return e;
522});
523
524/***/ }),
525/* 1 */
526/***/ (function(module, exports, __webpack_require__) {
527
528"use strict";
529/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
530
531var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
532
533/*!
534 * jQuery JavaScript Library v3.2.1
535 * https://jquery.com/
536 *
537 * Includes Sizzle.js
538 * https://sizzlejs.com/
539 *
540 * Copyright JS Foundation and other contributors
541 * Released under the MIT license
542 * https://jquery.org/license
543 *
544 * Date: 2017-03-20T18:59Z
545 */
546(function (global, factory) {
547
548 "use strict";
549
550 if (( false ? "undefined" : _typeof(module)) === "object" && _typeof(module.exports) === "object") {
551
552 // For CommonJS and CommonJS-like environments where a proper `window`
553 // is present, execute the factory and get jQuery.
554 // For environments that do not have a `window` with a `document`
555 // (such as Node.js), expose a factory as module.exports.
556 // This accentuates the need for the creation of a real `window`.
557 // e.g. var jQuery = require("jquery")(window);
558 // See ticket #14549 for more info.
559 module.exports = global.document ? factory(global, true) : function (w) {
560 if (!w.document) {
561 throw new Error("jQuery requires a window with a document");
562 }
563 return factory(w);
564 };
565 } else {
566 factory(global);
567 }
568
569 // Pass this if window is not defined yet
570})(typeof window !== "undefined" ? window : undefined, function (window, noGlobal) {
571
572 // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
573 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
574 // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
575 // enough that all such attempts are guarded in a try block.
576 "use strict";
577
578 var arr = [];
579
580 var document = window.document;
581
582 var getProto = Object.getPrototypeOf;
583
584 var _slice = arr.slice;
585
586 var concat = arr.concat;
587
588 var push = arr.push;
589
590 var indexOf = arr.indexOf;
591
592 var class2type = {};
593
594 var toString = class2type.toString;
595
596 var hasOwn = class2type.hasOwnProperty;
597
598 var fnToString = hasOwn.toString;
599
600 var ObjectFunctionString = fnToString.call(Object);
601
602 var support = {};
603
604 function DOMEval(code, doc) {
605 doc = doc || document;
606
607 var script = doc.createElement("script");
608
609 script.text = code;
610 doc.head.appendChild(script).parentNode.removeChild(script);
611 }
612 /* global Symbol */
613 // Defining this global in .eslintrc.json would create a danger of using the global
614 // unguarded in another place, it seems safer to define global only for this module
615
616
617 var version = "3.2.1",
618
619
620 // Define a local copy of jQuery
621 jQuery = function jQuery(selector, context) {
622
623 // The jQuery object is actually just the init constructor 'enhanced'
624 // Need init if jQuery is called (just allow error to be thrown if not included)
625 return new jQuery.fn.init(selector, context);
626 },
627
628
629 // Support: Android <=4.0 only
630 // Make sure we trim BOM and NBSP
631 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
632
633
634 // Matches dashed string for camelizing
635 rmsPrefix = /^-ms-/,
636 rdashAlpha = /-([a-z])/g,
637
638
639 // Used by jQuery.camelCase as callback to replace()
640 fcamelCase = function fcamelCase(all, letter) {
641 return letter.toUpperCase();
642 };
643
644 jQuery.fn = jQuery.prototype = {
645
646 // The current version of jQuery being used
647 jquery: version,
648
649 constructor: jQuery,
650
651 // The default length of a jQuery object is 0
652 length: 0,
653
654 toArray: function toArray() {
655 return _slice.call(this);
656 },
657
658 // Get the Nth element in the matched element set OR
659 // Get the whole matched element set as a clean array
660 get: function get(num) {
661
662 // Return all the elements in a clean array
663 if (num == null) {
664 return _slice.call(this);
665 }
666
667 // Return just the one element from the set
668 return num < 0 ? this[num + this.length] : this[num];
669 },
670
671 // Take an array of elements and push it onto the stack
672 // (returning the new matched element set)
673 pushStack: function pushStack(elems) {
674
675 // Build a new jQuery matched element set
676 var ret = jQuery.merge(this.constructor(), elems);
677
678 // Add the old object onto the stack (as a reference)
679 ret.prevObject = this;
680
681 // Return the newly-formed element set
682 return ret;
683 },
684
685 // Execute a callback for every element in the matched set.
686 each: function each(callback) {
687 return jQuery.each(this, callback);
688 },
689
690 map: function map(callback) {
691 return this.pushStack(jQuery.map(this, function (elem, i) {
692 return callback.call(elem, i, elem);
693 }));
694 },
695
696 slice: function slice() {
697 return this.pushStack(_slice.apply(this, arguments));
698 },
699
700 first: function first() {
701 return this.eq(0);
702 },
703
704 last: function last() {
705 return this.eq(-1);
706 },
707
708 eq: function eq(i) {
709 var len = this.length,
710 j = +i + (i < 0 ? len : 0);
711 return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
712 },
713
714 end: function end() {
715 return this.prevObject || this.constructor();
716 },
717
718 // For internal use only.
719 // Behaves like an Array's method, not like a jQuery method.
720 push: push,
721 sort: arr.sort,
722 splice: arr.splice
723 };
724
725 jQuery.extend = jQuery.fn.extend = function () {
726 var options,
727 name,
728 src,
729 copy,
730 copyIsArray,
731 clone,
732 target = arguments[0] || {},
733 i = 1,
734 length = arguments.length,
735 deep = false;
736
737 // Handle a deep copy situation
738 if (typeof target === "boolean") {
739 deep = target;
740
741 // Skip the boolean and the target
742 target = arguments[i] || {};
743 i++;
744 }
745
746 // Handle case when target is a string or something (possible in deep copy)
747 if ((typeof target === "undefined" ? "undefined" : _typeof(target)) !== "object" && !jQuery.isFunction(target)) {
748 target = {};
749 }
750
751 // Extend jQuery itself if only one argument is passed
752 if (i === length) {
753 target = this;
754 i--;
755 }
756
757 for (; i < length; i++) {
758
759 // Only deal with non-null/undefined values
760 if ((options = arguments[i]) != null) {
761
762 // Extend the base object
763 for (name in options) {
764 src = target[name];
765 copy = options[name];
766
767 // Prevent never-ending loop
768 if (target === copy) {
769 continue;
770 }
771
772 // Recurse if we're merging plain objects or arrays
773 if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
774
775 if (copyIsArray) {
776 copyIsArray = false;
777 clone = src && Array.isArray(src) ? src : [];
778 } else {
779 clone = src && jQuery.isPlainObject(src) ? src : {};
780 }
781
782 // Never move original objects, clone them
783 target[name] = jQuery.extend(deep, clone, copy);
784
785 // Don't bring in undefined values
786 } else if (copy !== undefined) {
787 target[name] = copy;
788 }
789 }
790 }
791 }
792
793 // Return the modified object
794 return target;
795 };
796
797 jQuery.extend({
798
799 // Unique for each copy of jQuery on the page
800 expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
801
802 // Assume jQuery is ready without the ready module
803 isReady: true,
804
805 error: function error(msg) {
806 throw new Error(msg);
807 },
808
809 noop: function noop() {},
810
811 isFunction: function isFunction(obj) {
812 return jQuery.type(obj) === "function";
813 },
814
815 isWindow: function isWindow(obj) {
816 return obj != null && obj === obj.window;
817 },
818
819 isNumeric: function isNumeric(obj) {
820
821 // As of jQuery 3.0, isNumeric is limited to
822 // strings and numbers (primitives or objects)
823 // that can be coerced to finite numbers (gh-2662)
824 var type = jQuery.type(obj);
825 return (type === "number" || type === "string") &&
826
827 // parseFloat NaNs numeric-cast false positives ("")
828 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
829 // subtraction forces infinities to NaN
830 !isNaN(obj - parseFloat(obj));
831 },
832
833 isPlainObject: function isPlainObject(obj) {
834 var proto, Ctor;
835
836 // Detect obvious negatives
837 // Use toString instead of jQuery.type to catch host objects
838 if (!obj || toString.call(obj) !== "[object Object]") {
839 return false;
840 }
841
842 proto = getProto(obj);
843
844 // Objects with no prototype (e.g., `Object.create( null )`) are plain
845 if (!proto) {
846 return true;
847 }
848
849 // Objects with prototype are plain iff they were constructed by a global Object function
850 Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
851 return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
852 },
853
854 isEmptyObject: function isEmptyObject(obj) {
855
856 /* eslint-disable no-unused-vars */
857 // See https://github.com/eslint/eslint/issues/6125
858 var name;
859
860 for (name in obj) {
861 return false;
862 }
863 return true;
864 },
865
866 type: function type(obj) {
867 if (obj == null) {
868 return obj + "";
869 }
870
871 // Support: Android <=2.3 only (functionish RegExp)
872 return (typeof obj === "undefined" ? "undefined" : _typeof(obj)) === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
873 },
874
875 // Evaluates a script in a global context
876 globalEval: function globalEval(code) {
877 DOMEval(code);
878 },
879
880 // Convert dashed to camelCase; used by the css and data modules
881 // Support: IE <=9 - 11, Edge 12 - 13
882 // Microsoft forgot to hump their vendor prefix (#9572)
883 camelCase: function camelCase(string) {
884 return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
885 },
886
887 each: function each(obj, callback) {
888 var length,
889 i = 0;
890
891 if (isArrayLike(obj)) {
892 length = obj.length;
893 for (; i < length; i++) {
894 if (callback.call(obj[i], i, obj[i]) === false) {
895 break;
896 }
897 }
898 } else {
899 for (i in obj) {
900 if (callback.call(obj[i], i, obj[i]) === false) {
901 break;
902 }
903 }
904 }
905
906 return obj;
907 },
908
909 // Support: Android <=4.0 only
910 trim: function trim(text) {
911 return text == null ? "" : (text + "").replace(rtrim, "");
912 },
913
914 // results is for internal usage only
915 makeArray: function makeArray(arr, results) {
916 var ret = results || [];
917
918 if (arr != null) {
919 if (isArrayLike(Object(arr))) {
920 jQuery.merge(ret, typeof arr === "string" ? [arr] : arr);
921 } else {
922 push.call(ret, arr);
923 }
924 }
925
926 return ret;
927 },
928
929 inArray: function inArray(elem, arr, i) {
930 return arr == null ? -1 : indexOf.call(arr, elem, i);
931 },
932
933 // Support: Android <=4.0 only, PhantomJS 1 only
934 // push.apply(_, arraylike) throws on ancient WebKit
935 merge: function merge(first, second) {
936 var len = +second.length,
937 j = 0,
938 i = first.length;
939
940 for (; j < len; j++) {
941 first[i++] = second[j];
942 }
943
944 first.length = i;
945
946 return first;
947 },
948
949 grep: function grep(elems, callback, invert) {
950 var callbackInverse,
951 matches = [],
952 i = 0,
953 length = elems.length,
954 callbackExpect = !invert;
955
956 // Go through the array, only saving the items
957 // that pass the validator function
958 for (; i < length; i++) {
959 callbackInverse = !callback(elems[i], i);
960 if (callbackInverse !== callbackExpect) {
961 matches.push(elems[i]);
962 }
963 }
964
965 return matches;
966 },
967
968 // arg is for internal usage only
969 map: function map(elems, callback, arg) {
970 var length,
971 value,
972 i = 0,
973 ret = [];
974
975 // Go through the array, translating each of the items to their new values
976 if (isArrayLike(elems)) {
977 length = elems.length;
978 for (; i < length; i++) {
979 value = callback(elems[i], i, arg);
980
981 if (value != null) {
982 ret.push(value);
983 }
984 }
985
986 // Go through every key on the object,
987 } else {
988 for (i in elems) {
989 value = callback(elems[i], i, arg);
990
991 if (value != null) {
992 ret.push(value);
993 }
994 }
995 }
996
997 // Flatten any nested arrays
998 return concat.apply([], ret);
999 },
1000
1001 // A global GUID counter for objects
1002 guid: 1,
1003
1004 // Bind a function to a context, optionally partially applying any
1005 // arguments.
1006 proxy: function proxy(fn, context) {
1007 var tmp, args, proxy;
1008
1009 if (typeof context === "string") {
1010 tmp = fn[context];
1011 context = fn;
1012 fn = tmp;
1013 }
1014
1015 // Quick check to determine if target is callable, in the spec
1016 // this throws a TypeError, but we will just return undefined.
1017 if (!jQuery.isFunction(fn)) {
1018 return undefined;
1019 }
1020
1021 // Simulated bind
1022 args = _slice.call(arguments, 2);
1023 proxy = function proxy() {
1024 return fn.apply(context || this, args.concat(_slice.call(arguments)));
1025 };
1026
1027 // Set the guid of unique handler to the same of original handler, so it can be removed
1028 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
1029
1030 return proxy;
1031 },
1032
1033 now: Date.now,
1034
1035 // jQuery.support is not used in Core but other projects attach their
1036 // properties to it so it needs to exist.
1037 support: support
1038 });
1039
1040 if (typeof Symbol === "function") {
1041 jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
1042 }
1043
1044 // Populate the class2type map
1045 jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (i, name) {
1046 class2type["[object " + name + "]"] = name.toLowerCase();
1047 });
1048
1049 function isArrayLike(obj) {
1050
1051 // Support: real iOS 8.2 only (not reproducible in simulator)
1052 // `in` check used to prevent JIT error (gh-2145)
1053 // hasOwn isn't used here due to false negatives
1054 // regarding Nodelist length in IE
1055 var length = !!obj && "length" in obj && obj.length,
1056 type = jQuery.type(obj);
1057
1058 if (type === "function" || jQuery.isWindow(obj)) {
1059 return false;
1060 }
1061
1062 return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
1063 }
1064 var Sizzle =
1065 /*!
1066 * Sizzle CSS Selector Engine v2.3.3
1067 * https://sizzlejs.com/
1068 *
1069 * Copyright jQuery Foundation and other contributors
1070 * Released under the MIT license
1071 * http://jquery.org/license
1072 *
1073 * Date: 2016-08-08
1074 */
1075 function (window) {
1076
1077 var i,
1078 support,
1079 Expr,
1080 getText,
1081 isXML,
1082 tokenize,
1083 compile,
1084 select,
1085 outermostContext,
1086 sortInput,
1087 hasDuplicate,
1088
1089
1090 // Local document vars
1091 setDocument,
1092 document,
1093 docElem,
1094 documentIsHTML,
1095 rbuggyQSA,
1096 rbuggyMatches,
1097 matches,
1098 contains,
1099
1100
1101 // Instance-specific data
1102 expando = "sizzle" + 1 * new Date(),
1103 preferredDoc = window.document,
1104 dirruns = 0,
1105 done = 0,
1106 classCache = createCache(),
1107 tokenCache = createCache(),
1108 compilerCache = createCache(),
1109 sortOrder = function sortOrder(a, b) {
1110 if (a === b) {
1111 hasDuplicate = true;
1112 }
1113 return 0;
1114 },
1115
1116
1117 // Instance methods
1118 hasOwn = {}.hasOwnProperty,
1119 arr = [],
1120 pop = arr.pop,
1121 push_native = arr.push,
1122 push = arr.push,
1123 slice = arr.slice,
1124
1125 // Use a stripped-down indexOf as it's faster than native
1126 // https://jsperf.com/thor-indexof-vs-for/5
1127 indexOf = function indexOf(list, elem) {
1128 var i = 0,
1129 len = list.length;
1130 for (; i < len; i++) {
1131 if (list[i] === elem) {
1132 return i;
1133 }
1134 }
1135 return -1;
1136 },
1137 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
1138
1139
1140 // Regular expressions
1141
1142 // http://www.w3.org/TR/css3-selectors/#whitespace
1143 whitespace = "[\\x20\\t\\r\\n\\f]",
1144
1145
1146 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
1147 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
1148
1149
1150 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
1151 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
1152 // Operator (capture 2)
1153 "*([*^$|!~]?=)" + whitespace +
1154 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
1155 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]",
1156 pseudos = ":(" + identifier + ")(?:\\((" +
1157 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
1158 // 1. quoted (capture 3; capture 4 or capture 5)
1159 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
1160 // 2. simple (capture 6)
1161 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
1162 // 3. anything else (capture 2)
1163 ".*" + ")\\)|)",
1164
1165
1166 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
1167 rwhitespace = new RegExp(whitespace + "+", "g"),
1168 rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"),
1169 rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),
1170 rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"),
1171 rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"),
1172 rpseudo = new RegExp(pseudos),
1173 ridentifier = new RegExp("^" + identifier + "$"),
1174 matchExpr = {
1175 "ID": new RegExp("^#(" + identifier + ")"),
1176 "CLASS": new RegExp("^\\.(" + identifier + ")"),
1177 "TAG": new RegExp("^(" + identifier + "|[*])"),
1178 "ATTR": new RegExp("^" + attributes),
1179 "PSEUDO": new RegExp("^" + pseudos),
1180 "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
1181 "bool": new RegExp("^(?:" + booleans + ")$", "i"),
1182 // For use in libraries implementing .is()
1183 // We use this for POS matching in `select`
1184 "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
1185 },
1186 rinputs = /^(?:input|select|textarea|button)$/i,
1187 rheader = /^h\d$/i,
1188 rnative = /^[^{]+\{\s*\[native \w/,
1189
1190
1191 // Easily-parseable/retrievable ID or TAG or CLASS selectors
1192 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
1193 rsibling = /[+~]/,
1194
1195
1196 // CSS escapes
1197 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
1198 runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"),
1199 funescape = function funescape(_, escaped, escapedWhitespace) {
1200 var high = "0x" + escaped - 0x10000;
1201 // NaN means non-codepoint
1202 // Support: Firefox<24
1203 // Workaround erroneous numeric interpretation of +"0x"
1204 return high !== high || escapedWhitespace ? escaped : high < 0 ?
1205 // BMP codepoint
1206 String.fromCharCode(high + 0x10000) :
1207 // Supplemental Plane codepoint (surrogate pair)
1208 String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);
1209 },
1210
1211
1212 // CSS string/identifier serialization
1213 // https://drafts.csswg.org/cssom/#common-serializing-idioms
1214 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
1215 fcssescape = function fcssescape(ch, asCodePoint) {
1216 if (asCodePoint) {
1217
1218 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
1219 if (ch === "\0") {
1220 return "\uFFFD";
1221 }
1222
1223 // Control characters and (dependent upon position) numbers get escaped as code points
1224 return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
1225 }
1226
1227 // Other potentially-special ASCII characters get backslash-escaped
1228 return "\\" + ch;
1229 },
1230
1231
1232 // Used for iframes
1233 // See setDocument()
1234 // Removing the function wrapper causes a "Permission Denied"
1235 // error in IE
1236 unloadHandler = function unloadHandler() {
1237 setDocument();
1238 },
1239 disabledAncestor = addCombinator(function (elem) {
1240 return elem.disabled === true && ("form" in elem || "label" in elem);
1241 }, { dir: "parentNode", next: "legend" });
1242
1243 // Optimize for push.apply( _, NodeList )
1244 try {
1245 push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes);
1246 // Support: Android<4.0
1247 // Detect silently failing push.apply
1248 arr[preferredDoc.childNodes.length].nodeType;
1249 } catch (e) {
1250 push = { apply: arr.length ?
1251
1252 // Leverage slice if possible
1253 function (target, els) {
1254 push_native.apply(target, slice.call(els));
1255 } :
1256
1257 // Support: IE<9
1258 // Otherwise append directly
1259 function (target, els) {
1260 var j = target.length,
1261 i = 0;
1262 // Can't trust NodeList.length
1263 while (target[j++] = els[i++]) {}
1264 target.length = j - 1;
1265 }
1266 };
1267 }
1268
1269 function Sizzle(selector, context, results, seed) {
1270 var m,
1271 i,
1272 elem,
1273 nid,
1274 match,
1275 groups,
1276 newSelector,
1277 newContext = context && context.ownerDocument,
1278
1279
1280 // nodeType defaults to 9, since context defaults to document
1281 nodeType = context ? context.nodeType : 9;
1282
1283 results = results || [];
1284
1285 // Return early from calls with invalid selector or context
1286 if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
1287
1288 return results;
1289 }
1290
1291 // Try to shortcut find operations (as opposed to filters) in HTML documents
1292 if (!seed) {
1293
1294 if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
1295 setDocument(context);
1296 }
1297 context = context || document;
1298
1299 if (documentIsHTML) {
1300
1301 // If the selector is sufficiently simple, try using a "get*By*" DOM method
1302 // (excepting DocumentFragment context, where the methods don't exist)
1303 if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
1304
1305 // ID selector
1306 if (m = match[1]) {
1307
1308 // Document context
1309 if (nodeType === 9) {
1310 if (elem = context.getElementById(m)) {
1311
1312 // Support: IE, Opera, Webkit
1313 // TODO: identify versions
1314 // getElementById can match elements by name instead of ID
1315 if (elem.id === m) {
1316 results.push(elem);
1317 return results;
1318 }
1319 } else {
1320 return results;
1321 }
1322
1323 // Element context
1324 } else {
1325
1326 // Support: IE, Opera, Webkit
1327 // TODO: identify versions
1328 // getElementById can match elements by name instead of ID
1329 if (newContext && (elem = newContext.getElementById(m)) && contains(context, elem) && elem.id === m) {
1330
1331 results.push(elem);
1332 return results;
1333 }
1334 }
1335
1336 // Type selector
1337 } else if (match[2]) {
1338 push.apply(results, context.getElementsByTagName(selector));
1339 return results;
1340
1341 // Class selector
1342 } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) {
1343
1344 push.apply(results, context.getElementsByClassName(m));
1345 return results;
1346 }
1347 }
1348
1349 // Take advantage of querySelectorAll
1350 if (support.qsa && !compilerCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
1351
1352 if (nodeType !== 1) {
1353 newContext = context;
1354 newSelector = selector;
1355
1356 // qSA looks outside Element context, which is not what we want
1357 // Thanks to Andrew Dupont for this workaround technique
1358 // Support: IE <=8
1359 // Exclude object elements
1360 } else if (context.nodeName.toLowerCase() !== "object") {
1361
1362 // Capture the context ID, setting it first if necessary
1363 if (nid = context.getAttribute("id")) {
1364 nid = nid.replace(rcssescape, fcssescape);
1365 } else {
1366 context.setAttribute("id", nid = expando);
1367 }
1368
1369 // Prefix every selector in the list
1370 groups = tokenize(selector);
1371 i = groups.length;
1372 while (i--) {
1373 groups[i] = "#" + nid + " " + toSelector(groups[i]);
1374 }
1375 newSelector = groups.join(",");
1376
1377 // Expand context for sibling selectors
1378 newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
1379 }
1380
1381 if (newSelector) {
1382 try {
1383 push.apply(results, newContext.querySelectorAll(newSelector));
1384 return results;
1385 } catch (qsaError) {} finally {
1386 if (nid === expando) {
1387 context.removeAttribute("id");
1388 }
1389 }
1390 }
1391 }
1392 }
1393 }
1394
1395 // All others
1396 return select(selector.replace(rtrim, "$1"), context, results, seed);
1397 }
1398
1399 /**
1400 * Create key-value caches of limited size
1401 * @returns {function(string, object)} Returns the Object data after storing it on itself with
1402 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
1403 * deleting the oldest entry
1404 */
1405 function createCache() {
1406 var keys = [];
1407
1408 function cache(key, value) {
1409 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
1410 if (keys.push(key + " ") > Expr.cacheLength) {
1411 // Only keep the most recent entries
1412 delete cache[keys.shift()];
1413 }
1414 return cache[key + " "] = value;
1415 }
1416 return cache;
1417 }
1418
1419 /**
1420 * Mark a function for special use by Sizzle
1421 * @param {Function} fn The function to mark
1422 */
1423 function markFunction(fn) {
1424 fn[expando] = true;
1425 return fn;
1426 }
1427
1428 /**
1429 * Support testing using an element
1430 * @param {Function} fn Passed the created element and returns a boolean result
1431 */
1432 function assert(fn) {
1433 var el = document.createElement("fieldset");
1434
1435 try {
1436 return !!fn(el);
1437 } catch (e) {
1438 return false;
1439 } finally {
1440 // Remove from its parent by default
1441 if (el.parentNode) {
1442 el.parentNode.removeChild(el);
1443 }
1444 // release memory in IE
1445 el = null;
1446 }
1447 }
1448
1449 /**
1450 * Adds the same handler for all of the specified attrs
1451 * @param {String} attrs Pipe-separated list of attributes
1452 * @param {Function} handler The method that will be applied
1453 */
1454 function addHandle(attrs, handler) {
1455 var arr = attrs.split("|"),
1456 i = arr.length;
1457
1458 while (i--) {
1459 Expr.attrHandle[arr[i]] = handler;
1460 }
1461 }
1462
1463 /**
1464 * Checks document order of two siblings
1465 * @param {Element} a
1466 * @param {Element} b
1467 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
1468 */
1469 function siblingCheck(a, b) {
1470 var cur = b && a,
1471 diff = cur && a.nodeType === 1 && b.nodeType === 1 && a.sourceIndex - b.sourceIndex;
1472
1473 // Use IE sourceIndex if available on both nodes
1474 if (diff) {
1475 return diff;
1476 }
1477
1478 // Check if b follows a
1479 if (cur) {
1480 while (cur = cur.nextSibling) {
1481 if (cur === b) {
1482 return -1;
1483 }
1484 }
1485 }
1486
1487 return a ? 1 : -1;
1488 }
1489
1490 /**
1491 * Returns a function to use in pseudos for input types
1492 * @param {String} type
1493 */
1494 function createInputPseudo(type) {
1495 return function (elem) {
1496 var name = elem.nodeName.toLowerCase();
1497 return name === "input" && elem.type === type;
1498 };
1499 }
1500
1501 /**
1502 * Returns a function to use in pseudos for buttons
1503 * @param {String} type
1504 */
1505 function createButtonPseudo(type) {
1506 return function (elem) {
1507 var name = elem.nodeName.toLowerCase();
1508 return (name === "input" || name === "button") && elem.type === type;
1509 };
1510 }
1511
1512 /**
1513 * Returns a function to use in pseudos for :enabled/:disabled
1514 * @param {Boolean} disabled true for :disabled; false for :enabled
1515 */
1516 function createDisabledPseudo(disabled) {
1517
1518 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
1519 return function (elem) {
1520
1521 // Only certain elements can match :enabled or :disabled
1522 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
1523 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
1524 if ("form" in elem) {
1525
1526 // Check for inherited disabledness on relevant non-disabled elements:
1527 // * listed form-associated elements in a disabled fieldset
1528 // https://html.spec.whatwg.org/multipage/forms.html#category-listed
1529 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
1530 // * option elements in a disabled optgroup
1531 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
1532 // All such elements have a "form" property.
1533 if (elem.parentNode && elem.disabled === false) {
1534
1535 // Option elements defer to a parent optgroup if present
1536 if ("label" in elem) {
1537 if ("label" in elem.parentNode) {
1538 return elem.parentNode.disabled === disabled;
1539 } else {
1540 return elem.disabled === disabled;
1541 }
1542 }
1543
1544 // Support: IE 6 - 11
1545 // Use the isDisabled shortcut property to check for disabled fieldset ancestors
1546 return elem.isDisabled === disabled ||
1547
1548 // Where there is no isDisabled, check manually
1549 /* jshint -W018 */
1550 elem.isDisabled !== !disabled && disabledAncestor(elem) === disabled;
1551 }
1552
1553 return elem.disabled === disabled;
1554
1555 // Try to winnow out elements that can't be disabled before trusting the disabled property.
1556 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
1557 // even exist on them, let alone have a boolean value.
1558 } else if ("label" in elem) {
1559 return elem.disabled === disabled;
1560 }
1561
1562 // Remaining elements are neither :enabled nor :disabled
1563 return false;
1564 };
1565 }
1566
1567 /**
1568 * Returns a function to use in pseudos for positionals
1569 * @param {Function} fn
1570 */
1571 function createPositionalPseudo(fn) {
1572 return markFunction(function (argument) {
1573 argument = +argument;
1574 return markFunction(function (seed, matches) {
1575 var j,
1576 matchIndexes = fn([], seed.length, argument),
1577 i = matchIndexes.length;
1578
1579 // Match elements found at the specified indexes
1580 while (i--) {
1581 if (seed[j = matchIndexes[i]]) {
1582 seed[j] = !(matches[j] = seed[j]);
1583 }
1584 }
1585 });
1586 });
1587 }
1588
1589 /**
1590 * Checks a node for validity as a Sizzle context
1591 * @param {Element|Object=} context
1592 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1593 */
1594 function testContext(context) {
1595 return context && typeof context.getElementsByTagName !== "undefined" && context;
1596 }
1597
1598 // Expose support vars for convenience
1599 support = Sizzle.support = {};
1600
1601 /**
1602 * Detects XML nodes
1603 * @param {Element|Object} elem An element or a document
1604 * @returns {Boolean} True iff elem is a non-HTML XML node
1605 */
1606 isXML = Sizzle.isXML = function (elem) {
1607 // documentElement is verified for cases where it doesn't yet exist
1608 // (such as loading iframes in IE - #4833)
1609 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1610 return documentElement ? documentElement.nodeName !== "HTML" : false;
1611 };
1612
1613 /**
1614 * Sets document-related variables once based on the current document
1615 * @param {Element|Object} [doc] An element or document object to use to set the document
1616 * @returns {Object} Returns the current document
1617 */
1618 setDocument = Sizzle.setDocument = function (node) {
1619 var hasCompare,
1620 subWindow,
1621 doc = node ? node.ownerDocument || node : preferredDoc;
1622
1623 // Return early if doc is invalid or already selected
1624 if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
1625 return document;
1626 }
1627
1628 // Update global variables
1629 document = doc;
1630 docElem = document.documentElement;
1631 documentIsHTML = !isXML(document);
1632
1633 // Support: IE 9-11, Edge
1634 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1635 if (preferredDoc !== document && (subWindow = document.defaultView) && subWindow.top !== subWindow) {
1636
1637 // Support: IE 11, Edge
1638 if (subWindow.addEventListener) {
1639 subWindow.addEventListener("unload", unloadHandler, false);
1640
1641 // Support: IE 9 - 10 only
1642 } else if (subWindow.attachEvent) {
1643 subWindow.attachEvent("onunload", unloadHandler);
1644 }
1645 }
1646
1647 /* Attributes
1648 ---------------------------------------------------------------------- */
1649
1650 // Support: IE<8
1651 // Verify that getAttribute really returns attributes and not properties
1652 // (excepting IE8 booleans)
1653 support.attributes = assert(function (el) {
1654 el.className = "i";
1655 return !el.getAttribute("className");
1656 });
1657
1658 /* getElement(s)By*
1659 ---------------------------------------------------------------------- */
1660
1661 // Check if getElementsByTagName("*") returns only elements
1662 support.getElementsByTagName = assert(function (el) {
1663 el.appendChild(document.createComment(""));
1664 return !el.getElementsByTagName("*").length;
1665 });
1666
1667 // Support: IE<9
1668 support.getElementsByClassName = rnative.test(document.getElementsByClassName);
1669
1670 // Support: IE<10
1671 // Check if getElementById returns elements by name
1672 // The broken getElementById methods don't pick up programmatically-set names,
1673 // so use a roundabout getElementsByName test
1674 support.getById = assert(function (el) {
1675 docElem.appendChild(el).id = expando;
1676 return !document.getElementsByName || !document.getElementsByName(expando).length;
1677 });
1678
1679 // ID filter and find
1680 if (support.getById) {
1681 Expr.filter["ID"] = function (id) {
1682 var attrId = id.replace(runescape, funescape);
1683 return function (elem) {
1684 return elem.getAttribute("id") === attrId;
1685 };
1686 };
1687 Expr.find["ID"] = function (id, context) {
1688 if (typeof context.getElementById !== "undefined" && documentIsHTML) {
1689 var elem = context.getElementById(id);
1690 return elem ? [elem] : [];
1691 }
1692 };
1693 } else {
1694 Expr.filter["ID"] = function (id) {
1695 var attrId = id.replace(runescape, funescape);
1696 return function (elem) {
1697 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
1698 return node && node.value === attrId;
1699 };
1700 };
1701
1702 // Support: IE 6 - 7 only
1703 // getElementById is not reliable as a find shortcut
1704 Expr.find["ID"] = function (id, context) {
1705 if (typeof context.getElementById !== "undefined" && documentIsHTML) {
1706 var node,
1707 i,
1708 elems,
1709 elem = context.getElementById(id);
1710
1711 if (elem) {
1712
1713 // Verify the id attribute
1714 node = elem.getAttributeNode("id");
1715 if (node && node.value === id) {
1716 return [elem];
1717 }
1718
1719 // Fall back on getElementsByName
1720 elems = context.getElementsByName(id);
1721 i = 0;
1722 while (elem = elems[i++]) {
1723 node = elem.getAttributeNode("id");
1724 if (node && node.value === id) {
1725 return [elem];
1726 }
1727 }
1728 }
1729
1730 return [];
1731 }
1732 };
1733 }
1734
1735 // Tag
1736 Expr.find["TAG"] = support.getElementsByTagName ? function (tag, context) {
1737 if (typeof context.getElementsByTagName !== "undefined") {
1738 return context.getElementsByTagName(tag);
1739
1740 // DocumentFragment nodes don't have gEBTN
1741 } else if (support.qsa) {
1742 return context.querySelectorAll(tag);
1743 }
1744 } : function (tag, context) {
1745 var elem,
1746 tmp = [],
1747 i = 0,
1748
1749 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1750 results = context.getElementsByTagName(tag);
1751
1752 // Filter out possible comments
1753 if (tag === "*") {
1754 while (elem = results[i++]) {
1755 if (elem.nodeType === 1) {
1756 tmp.push(elem);
1757 }
1758 }
1759
1760 return tmp;
1761 }
1762 return results;
1763 };
1764
1765 // Class
1766 Expr.find["CLASS"] = support.getElementsByClassName && function (className, context) {
1767 if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
1768 return context.getElementsByClassName(className);
1769 }
1770 };
1771
1772 /* QSA/matchesSelector
1773 ---------------------------------------------------------------------- */
1774
1775 // QSA and matchesSelector support
1776
1777 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1778 rbuggyMatches = [];
1779
1780 // qSa(:focus) reports false when true (Chrome 21)
1781 // We allow this because of a bug in IE8/9 that throws an error
1782 // whenever `document.activeElement` is accessed on an iframe
1783 // So, we allow :focus to pass through QSA all the time to avoid the IE error
1784 // See https://bugs.jquery.com/ticket/13378
1785 rbuggyQSA = [];
1786
1787 if (support.qsa = rnative.test(document.querySelectorAll)) {
1788 // Build QSA regex
1789 // Regex strategy adopted from Diego Perini
1790 assert(function (el) {
1791 // Select is set to empty string on purpose
1792 // This is to test IE's treatment of not explicitly
1793 // setting a boolean content attribute,
1794 // since its presence should be enough
1795 // https://bugs.jquery.com/ticket/12359
1796 docElem.appendChild(el).innerHTML = "<a id='" + expando + "'></a>" + "<select id='" + expando + "-\r\\' msallowcapture=''>" + "<option selected=''></option></select>";
1797
1798 // Support: IE8, Opera 11-12.16
1799 // Nothing should be selected when empty strings follow ^= or $= or *=
1800 // The test attribute must be unknown in Opera but "safe" for WinRT
1801 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1802 if (el.querySelectorAll("[msallowcapture^='']").length) {
1803 rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
1804 }
1805
1806 // Support: IE8
1807 // Boolean attributes and "value" are not treated correctly
1808 if (!el.querySelectorAll("[selected]").length) {
1809 rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
1810 }
1811
1812 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1813 if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
1814 rbuggyQSA.push("~=");
1815 }
1816
1817 // Webkit/Opera - :checked should return selected option elements
1818 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1819 // IE8 throws error here and will not see later tests
1820 if (!el.querySelectorAll(":checked").length) {
1821 rbuggyQSA.push(":checked");
1822 }
1823
1824 // Support: Safari 8+, iOS 8+
1825 // https://bugs.webkit.org/show_bug.cgi?id=136851
1826 // In-page `selector#id sibling-combinator selector` fails
1827 if (!el.querySelectorAll("a#" + expando + "+*").length) {
1828 rbuggyQSA.push(".#.+[+~]");
1829 }
1830 });
1831
1832 assert(function (el) {
1833 el.innerHTML = "<a href='' disabled='disabled'></a>" + "<select disabled='disabled'><option/></select>";
1834
1835 // Support: Windows 8 Native Apps
1836 // The type and name attributes are restricted during .innerHTML assignment
1837 var input = document.createElement("input");
1838 input.setAttribute("type", "hidden");
1839 el.appendChild(input).setAttribute("name", "D");
1840
1841 // Support: IE8
1842 // Enforce case-sensitivity of name attribute
1843 if (el.querySelectorAll("[name=d]").length) {
1844 rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
1845 }
1846
1847 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1848 // IE8 throws error here and will not see later tests
1849 if (el.querySelectorAll(":enabled").length !== 2) {
1850 rbuggyQSA.push(":enabled", ":disabled");
1851 }
1852
1853 // Support: IE9-11+
1854 // IE's :disabled selector does not pick up the children of disabled fieldsets
1855 docElem.appendChild(el).disabled = true;
1856 if (el.querySelectorAll(":disabled").length !== 2) {
1857 rbuggyQSA.push(":enabled", ":disabled");
1858 }
1859
1860 // Opera 10-11 does not throw on post-comma invalid pseudos
1861 el.querySelectorAll("*,:x");
1862 rbuggyQSA.push(",.*:");
1863 });
1864 }
1865
1866 if (support.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) {
1867
1868 assert(function (el) {
1869 // Check to see if it's possible to do matchesSelector
1870 // on a disconnected node (IE 9)
1871 support.disconnectedMatch = matches.call(el, "*");
1872
1873 // This should fail with an exception
1874 // Gecko does not error, returns false instead
1875 matches.call(el, "[s!='']:x");
1876 rbuggyMatches.push("!=", pseudos);
1877 });
1878 }
1879
1880 rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
1881 rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
1882
1883 /* Contains
1884 ---------------------------------------------------------------------- */
1885 hasCompare = rnative.test(docElem.compareDocumentPosition);
1886
1887 // Element contains another
1888 // Purposefully self-exclusive
1889 // As in, an element does not contain itself
1890 contains = hasCompare || rnative.test(docElem.contains) ? function (a, b) {
1891 var adown = a.nodeType === 9 ? a.documentElement : a,
1892 bup = b && b.parentNode;
1893 return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
1894 } : function (a, b) {
1895 if (b) {
1896 while (b = b.parentNode) {
1897 if (b === a) {
1898 return true;
1899 }
1900 }
1901 }
1902 return false;
1903 };
1904
1905 /* Sorting
1906 ---------------------------------------------------------------------- */
1907
1908 // Document order sorting
1909 sortOrder = hasCompare ? function (a, b) {
1910
1911 // Flag for duplicate removal
1912 if (a === b) {
1913 hasDuplicate = true;
1914 return 0;
1915 }
1916
1917 // Sort on method existence if only one input has compareDocumentPosition
1918 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1919 if (compare) {
1920 return compare;
1921 }
1922
1923 // Calculate position if both inputs belong to the same document
1924 compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) :
1925
1926 // Otherwise we know they are disconnected
1927 1;
1928
1929 // Disconnected nodes
1930 if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
1931
1932 // Choose the first element that is related to our preferred document
1933 if (a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
1934 return -1;
1935 }
1936 if (b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
1937 return 1;
1938 }
1939
1940 // Maintain original order
1941 return sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0;
1942 }
1943
1944 return compare & 4 ? -1 : 1;
1945 } : function (a, b) {
1946 // Exit early if the nodes are identical
1947 if (a === b) {
1948 hasDuplicate = true;
1949 return 0;
1950 }
1951
1952 var cur,
1953 i = 0,
1954 aup = a.parentNode,
1955 bup = b.parentNode,
1956 ap = [a],
1957 bp = [b];
1958
1959 // Parentless nodes are either documents or disconnected
1960 if (!aup || !bup) {
1961 return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0;
1962
1963 // If the nodes are siblings, we can do a quick check
1964 } else if (aup === bup) {
1965 return siblingCheck(a, b);
1966 }
1967
1968 // Otherwise we need full lists of their ancestors for comparison
1969 cur = a;
1970 while (cur = cur.parentNode) {
1971 ap.unshift(cur);
1972 }
1973 cur = b;
1974 while (cur = cur.parentNode) {
1975 bp.unshift(cur);
1976 }
1977
1978 // Walk down the tree looking for a discrepancy
1979 while (ap[i] === bp[i]) {
1980 i++;
1981 }
1982
1983 return i ?
1984 // Do a sibling check if the nodes have a common ancestor
1985 siblingCheck(ap[i], bp[i]) :
1986
1987 // Otherwise nodes in our document sort first
1988 ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
1989 };
1990
1991 return document;
1992 };
1993
1994 Sizzle.matches = function (expr, elements) {
1995 return Sizzle(expr, null, null, elements);
1996 };
1997
1998 Sizzle.matchesSelector = function (elem, expr) {
1999 // Set document vars if needed
2000 if ((elem.ownerDocument || elem) !== document) {
2001 setDocument(elem);
2002 }
2003
2004 // Make sure that attribute selectors are quoted
2005 expr = expr.replace(rattributeQuotes, "='$1']");
2006
2007 if (support.matchesSelector && documentIsHTML && !compilerCache[expr + " "] && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
2008
2009 try {
2010 var ret = matches.call(elem, expr);
2011
2012 // IE 9's matchesSelector returns false on disconnected nodes
2013 if (ret || support.disconnectedMatch ||
2014 // As well, disconnected nodes are said to be in a document
2015 // fragment in IE 9
2016 elem.document && elem.document.nodeType !== 11) {
2017 return ret;
2018 }
2019 } catch (e) {}
2020 }
2021
2022 return Sizzle(expr, document, null, [elem]).length > 0;
2023 };
2024
2025 Sizzle.contains = function (context, elem) {
2026 // Set document vars if needed
2027 if ((context.ownerDocument || context) !== document) {
2028 setDocument(context);
2029 }
2030 return contains(context, elem);
2031 };
2032
2033 Sizzle.attr = function (elem, name) {
2034 // Set document vars if needed
2035 if ((elem.ownerDocument || elem) !== document) {
2036 setDocument(elem);
2037 }
2038
2039 var fn = Expr.attrHandle[name.toLowerCase()],
2040
2041 // Don't get fooled by Object.prototype properties (jQuery #13807)
2042 val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined;
2043
2044 return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
2045 };
2046
2047 Sizzle.escape = function (sel) {
2048 return (sel + "").replace(rcssescape, fcssescape);
2049 };
2050
2051 Sizzle.error = function (msg) {
2052 throw new Error("Syntax error, unrecognized expression: " + msg);
2053 };
2054
2055 /**
2056 * Document sorting and removing duplicates
2057 * @param {ArrayLike} results
2058 */
2059 Sizzle.uniqueSort = function (results) {
2060 var elem,
2061 duplicates = [],
2062 j = 0,
2063 i = 0;
2064
2065 // Unless we *know* we can detect duplicates, assume their presence
2066 hasDuplicate = !support.detectDuplicates;
2067 sortInput = !support.sortStable && results.slice(0);
2068 results.sort(sortOrder);
2069
2070 if (hasDuplicate) {
2071 while (elem = results[i++]) {
2072 if (elem === results[i]) {
2073 j = duplicates.push(i);
2074 }
2075 }
2076 while (j--) {
2077 results.splice(duplicates[j], 1);
2078 }
2079 }
2080
2081 // Clear input after sorting to release objects
2082 // See https://github.com/jquery/sizzle/pull/225
2083 sortInput = null;
2084
2085 return results;
2086 };
2087
2088 /**
2089 * Utility function for retrieving the text value of an array of DOM nodes
2090 * @param {Array|Element} elem
2091 */
2092 getText = Sizzle.getText = function (elem) {
2093 var node,
2094 ret = "",
2095 i = 0,
2096 nodeType = elem.nodeType;
2097
2098 if (!nodeType) {
2099 // If no nodeType, this is expected to be an array
2100 while (node = elem[i++]) {
2101 // Do not traverse comment nodes
2102 ret += getText(node);
2103 }
2104 } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
2105 // Use textContent for elements
2106 // innerText usage removed for consistency of new lines (jQuery #11153)
2107 if (typeof elem.textContent === "string") {
2108 return elem.textContent;
2109 } else {
2110 // Traverse its children
2111 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
2112 ret += getText(elem);
2113 }
2114 }
2115 } else if (nodeType === 3 || nodeType === 4) {
2116 return elem.nodeValue;
2117 }
2118 // Do not include comment or processing instruction nodes
2119
2120 return ret;
2121 };
2122
2123 Expr = Sizzle.selectors = {
2124
2125 // Can be adjusted by the user
2126 cacheLength: 50,
2127
2128 createPseudo: markFunction,
2129
2130 match: matchExpr,
2131
2132 attrHandle: {},
2133
2134 find: {},
2135
2136 relative: {
2137 ">": { dir: "parentNode", first: true },
2138 " ": { dir: "parentNode" },
2139 "+": { dir: "previousSibling", first: true },
2140 "~": { dir: "previousSibling" }
2141 },
2142
2143 preFilter: {
2144 "ATTR": function ATTR(match) {
2145 match[1] = match[1].replace(runescape, funescape);
2146
2147 // Move the given value to match[3] whether quoted or unquoted
2148 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
2149
2150 if (match[2] === "~=") {
2151 match[3] = " " + match[3] + " ";
2152 }
2153
2154 return match.slice(0, 4);
2155 },
2156
2157 "CHILD": function CHILD(match) {
2158 /* matches from matchExpr["CHILD"]
2159 1 type (only|nth|...)
2160 2 what (child|of-type)
2161 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
2162 4 xn-component of xn+y argument ([+-]?\d*n|)
2163 5 sign of xn-component
2164 6 x of xn-component
2165 7 sign of y-component
2166 8 y of y-component
2167 */
2168 match[1] = match[1].toLowerCase();
2169
2170 if (match[1].slice(0, 3) === "nth") {
2171 // nth-* requires argument
2172 if (!match[3]) {
2173 Sizzle.error(match[0]);
2174 }
2175
2176 // numeric x and y parameters for Expr.filter.CHILD
2177 // remember that false/true cast respectively to 0/1
2178 match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
2179 match[5] = +(match[7] + match[8] || match[3] === "odd");
2180
2181 // other types prohibit arguments
2182 } else if (match[3]) {
2183 Sizzle.error(match[0]);
2184 }
2185
2186 return match;
2187 },
2188
2189 "PSEUDO": function PSEUDO(match) {
2190 var excess,
2191 unquoted = !match[6] && match[2];
2192
2193 if (matchExpr["CHILD"].test(match[0])) {
2194 return null;
2195 }
2196
2197 // Accept quoted arguments as-is
2198 if (match[3]) {
2199 match[2] = match[4] || match[5] || "";
2200
2201 // Strip excess characters from unquoted arguments
2202 } else if (unquoted && rpseudo.test(unquoted) && (
2203 // Get excess from tokenize (recursively)
2204 excess = tokenize(unquoted, true)) && (
2205 // advance to the next closing parenthesis
2206 excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
2207
2208 // excess is a negative index
2209 match[0] = match[0].slice(0, excess);
2210 match[2] = unquoted.slice(0, excess);
2211 }
2212
2213 // Return only captures needed by the pseudo filter method (type and argument)
2214 return match.slice(0, 3);
2215 }
2216 },
2217
2218 filter: {
2219
2220 "TAG": function TAG(nodeNameSelector) {
2221 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
2222 return nodeNameSelector === "*" ? function () {
2223 return true;
2224 } : function (elem) {
2225 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
2226 };
2227 },
2228
2229 "CLASS": function CLASS(className) {
2230 var pattern = classCache[className + " "];
2231
2232 return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function (elem) {
2233 return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "");
2234 });
2235 },
2236
2237 "ATTR": function ATTR(name, operator, check) {
2238 return function (elem) {
2239 var result = Sizzle.attr(elem, name);
2240
2241 if (result == null) {
2242 return operator === "!=";
2243 }
2244 if (!operator) {
2245 return true;
2246 }
2247
2248 result += "";
2249
2250 return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.slice(-check.length) === check : operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" : false;
2251 };
2252 },
2253
2254 "CHILD": function CHILD(type, what, argument, first, last) {
2255 var simple = type.slice(0, 3) !== "nth",
2256 forward = type.slice(-4) !== "last",
2257 ofType = what === "of-type";
2258
2259 return first === 1 && last === 0 ?
2260
2261 // Shortcut for :nth-*(n)
2262 function (elem) {
2263 return !!elem.parentNode;
2264 } : function (elem, context, xml) {
2265 var cache,
2266 uniqueCache,
2267 outerCache,
2268 node,
2269 nodeIndex,
2270 start,
2271 dir = simple !== forward ? "nextSibling" : "previousSibling",
2272 parent = elem.parentNode,
2273 name = ofType && elem.nodeName.toLowerCase(),
2274 useCache = !xml && !ofType,
2275 diff = false;
2276
2277 if (parent) {
2278
2279 // :(first|last|only)-(child|of-type)
2280 if (simple) {
2281 while (dir) {
2282 node = elem;
2283 while (node = node[dir]) {
2284 if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
2285
2286 return false;
2287 }
2288 }
2289 // Reverse direction for :only-* (if we haven't yet done so)
2290 start = dir = type === "only" && !start && "nextSibling";
2291 }
2292 return true;
2293 }
2294
2295 start = [forward ? parent.firstChild : parent.lastChild];
2296
2297 // non-xml :nth-child(...) stores cache data on `parent`
2298 if (forward && useCache) {
2299
2300 // Seek `elem` from a previously-cached index
2301
2302 // ...in a gzip-friendly way
2303 node = parent;
2304 outerCache = node[expando] || (node[expando] = {});
2305
2306 // Support: IE <9 only
2307 // Defend against cloned attroperties (jQuery gh-1709)
2308 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});
2309
2310 cache = uniqueCache[type] || [];
2311 nodeIndex = cache[0] === dirruns && cache[1];
2312 diff = nodeIndex && cache[2];
2313 node = nodeIndex && parent.childNodes[nodeIndex];
2314
2315 while (node = ++nodeIndex && node && node[dir] || (
2316
2317 // Fallback to seeking `elem` from the start
2318 diff = nodeIndex = 0) || start.pop()) {
2319
2320 // When found, cache indexes on `parent` and break
2321 if (node.nodeType === 1 && ++diff && node === elem) {
2322 uniqueCache[type] = [dirruns, nodeIndex, diff];
2323 break;
2324 }
2325 }
2326 } else {
2327 // Use previously-cached element index if available
2328 if (useCache) {
2329 // ...in a gzip-friendly way
2330 node = elem;
2331 outerCache = node[expando] || (node[expando] = {});
2332
2333 // Support: IE <9 only
2334 // Defend against cloned attroperties (jQuery gh-1709)
2335 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});
2336
2337 cache = uniqueCache[type] || [];
2338 nodeIndex = cache[0] === dirruns && cache[1];
2339 diff = nodeIndex;
2340 }
2341
2342 // xml :nth-child(...)
2343 // or :nth-last-child(...) or :nth(-last)?-of-type(...)
2344 if (diff === false) {
2345 // Use the same loop as above to seek `elem` from the start
2346 while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
2347
2348 if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
2349
2350 // Cache the index of each encountered element
2351 if (useCache) {
2352 outerCache = node[expando] || (node[expando] = {});
2353
2354 // Support: IE <9 only
2355 // Defend against cloned attroperties (jQuery gh-1709)
2356 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});
2357
2358 uniqueCache[type] = [dirruns, diff];
2359 }
2360
2361 if (node === elem) {
2362 break;
2363 }
2364 }
2365 }
2366 }
2367 }
2368
2369 // Incorporate the offset, then check against cycle size
2370 diff -= last;
2371 return diff === first || diff % first === 0 && diff / first >= 0;
2372 }
2373 };
2374 },
2375
2376 "PSEUDO": function PSEUDO(pseudo, argument) {
2377 // pseudo-class names are case-insensitive
2378 // http://www.w3.org/TR/selectors/#pseudo-classes
2379 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
2380 // Remember that setFilters inherits from pseudos
2381 var args,
2382 fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo);
2383
2384 // The user may use createPseudo to indicate that
2385 // arguments are needed to create the filter function
2386 // just as Sizzle does
2387 if (fn[expando]) {
2388 return fn(argument);
2389 }
2390
2391 // But maintain support for old signatures
2392 if (fn.length > 1) {
2393 args = [pseudo, pseudo, "", argument];
2394 return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {
2395 var idx,
2396 matched = fn(seed, argument),
2397 i = matched.length;
2398 while (i--) {
2399 idx = indexOf(seed, matched[i]);
2400 seed[idx] = !(matches[idx] = matched[i]);
2401 }
2402 }) : function (elem) {
2403 return fn(elem, 0, args);
2404 };
2405 }
2406
2407 return fn;
2408 }
2409 },
2410
2411 pseudos: {
2412 // Potentially complex pseudos
2413 "not": markFunction(function (selector) {
2414 // Trim the selector passed to compile
2415 // to avoid treating leading and trailing
2416 // spaces as combinators
2417 var input = [],
2418 results = [],
2419 matcher = compile(selector.replace(rtrim, "$1"));
2420
2421 return matcher[expando] ? markFunction(function (seed, matches, context, xml) {
2422 var elem,
2423 unmatched = matcher(seed, null, xml, []),
2424 i = seed.length;
2425
2426 // Match elements unmatched by `matcher`
2427 while (i--) {
2428 if (elem = unmatched[i]) {
2429 seed[i] = !(matches[i] = elem);
2430 }
2431 }
2432 }) : function (elem, context, xml) {
2433 input[0] = elem;
2434 matcher(input, null, xml, results);
2435 // Don't keep the element (issue #299)
2436 input[0] = null;
2437 return !results.pop();
2438 };
2439 }),
2440
2441 "has": markFunction(function (selector) {
2442 return function (elem) {
2443 return Sizzle(selector, elem).length > 0;
2444 };
2445 }),
2446
2447 "contains": markFunction(function (text) {
2448 text = text.replace(runescape, funescape);
2449 return function (elem) {
2450 return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
2451 };
2452 }),
2453
2454 // "Whether an element is represented by a :lang() selector
2455 // is based solely on the element's language value
2456 // being equal to the identifier C,
2457 // or beginning with the identifier C immediately followed by "-".
2458 // The matching of C against the element's language value is performed case-insensitively.
2459 // The identifier C does not have to be a valid language name."
2460 // http://www.w3.org/TR/selectors/#lang-pseudo
2461 "lang": markFunction(function (lang) {
2462 // lang value must be a valid identifier
2463 if (!ridentifier.test(lang || "")) {
2464 Sizzle.error("unsupported lang: " + lang);
2465 }
2466 lang = lang.replace(runescape, funescape).toLowerCase();
2467 return function (elem) {
2468 var elemLang;
2469 do {
2470 if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
2471
2472 elemLang = elemLang.toLowerCase();
2473 return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
2474 }
2475 } while ((elem = elem.parentNode) && elem.nodeType === 1);
2476 return false;
2477 };
2478 }),
2479
2480 // Miscellaneous
2481 "target": function target(elem) {
2482 var hash = window.location && window.location.hash;
2483 return hash && hash.slice(1) === elem.id;
2484 },
2485
2486 "root": function root(elem) {
2487 return elem === docElem;
2488 },
2489
2490 "focus": function focus(elem) {
2491 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
2492 },
2493
2494 // Boolean properties
2495 "enabled": createDisabledPseudo(false),
2496 "disabled": createDisabledPseudo(true),
2497
2498 "checked": function checked(elem) {
2499 // In CSS3, :checked should return both checked and selected elements
2500 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2501 var nodeName = elem.nodeName.toLowerCase();
2502 return nodeName === "input" && !!elem.checked || nodeName === "option" && !!elem.selected;
2503 },
2504
2505 "selected": function selected(elem) {
2506 // Accessing this property makes selected-by-default
2507 // options in Safari work properly
2508 if (elem.parentNode) {
2509 elem.parentNode.selectedIndex;
2510 }
2511
2512 return elem.selected === true;
2513 },
2514
2515 // Contents
2516 "empty": function empty(elem) {
2517 // http://www.w3.org/TR/selectors/#empty-pseudo
2518 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
2519 // but not by others (comment: 8; processing instruction: 7; etc.)
2520 // nodeType < 6 works because attributes (2) do not appear as children
2521 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
2522 if (elem.nodeType < 6) {
2523 return false;
2524 }
2525 }
2526 return true;
2527 },
2528
2529 "parent": function parent(elem) {
2530 return !Expr.pseudos["empty"](elem);
2531 },
2532
2533 // Element/input types
2534 "header": function header(elem) {
2535 return rheader.test(elem.nodeName);
2536 },
2537
2538 "input": function input(elem) {
2539 return rinputs.test(elem.nodeName);
2540 },
2541
2542 "button": function button(elem) {
2543 var name = elem.nodeName.toLowerCase();
2544 return name === "input" && elem.type === "button" || name === "button";
2545 },
2546
2547 "text": function text(elem) {
2548 var attr;
2549 return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && (
2550
2551 // Support: IE<8
2552 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2553 (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
2554 },
2555
2556 // Position-in-collection
2557 "first": createPositionalPseudo(function () {
2558 return [0];
2559 }),
2560
2561 "last": createPositionalPseudo(function (matchIndexes, length) {
2562 return [length - 1];
2563 }),
2564
2565 "eq": createPositionalPseudo(function (matchIndexes, length, argument) {
2566 return [argument < 0 ? argument + length : argument];
2567 }),
2568
2569 "even": createPositionalPseudo(function (matchIndexes, length) {
2570 var i = 0;
2571 for (; i < length; i += 2) {
2572 matchIndexes.push(i);
2573 }
2574 return matchIndexes;
2575 }),
2576
2577 "odd": createPositionalPseudo(function (matchIndexes, length) {
2578 var i = 1;
2579 for (; i < length; i += 2) {
2580 matchIndexes.push(i);
2581 }
2582 return matchIndexes;
2583 }),
2584
2585 "lt": createPositionalPseudo(function (matchIndexes, length, argument) {
2586 var i = argument < 0 ? argument + length : argument;
2587 for (; --i >= 0;) {
2588 matchIndexes.push(i);
2589 }
2590 return matchIndexes;
2591 }),
2592
2593 "gt": createPositionalPseudo(function (matchIndexes, length, argument) {
2594 var i = argument < 0 ? argument + length : argument;
2595 for (; ++i < length;) {
2596 matchIndexes.push(i);
2597 }
2598 return matchIndexes;
2599 })
2600 }
2601 };
2602
2603 Expr.pseudos["nth"] = Expr.pseudos["eq"];
2604
2605 // Add button/input type pseudos
2606 for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) {
2607 Expr.pseudos[i] = createInputPseudo(i);
2608 }
2609 for (i in { submit: true, reset: true }) {
2610 Expr.pseudos[i] = createButtonPseudo(i);
2611 }
2612
2613 // Easy API for creating new setFilters
2614 function setFilters() {}
2615 setFilters.prototype = Expr.filters = Expr.pseudos;
2616 Expr.setFilters = new setFilters();
2617
2618 tokenize = Sizzle.tokenize = function (selector, parseOnly) {
2619 var matched,
2620 match,
2621 tokens,
2622 type,
2623 soFar,
2624 groups,
2625 preFilters,
2626 cached = tokenCache[selector + " "];
2627
2628 if (cached) {
2629 return parseOnly ? 0 : cached.slice(0);
2630 }
2631
2632 soFar = selector;
2633 groups = [];
2634 preFilters = Expr.preFilter;
2635
2636 while (soFar) {
2637
2638 // Comma and first run
2639 if (!matched || (match = rcomma.exec(soFar))) {
2640 if (match) {
2641 // Don't consume trailing commas as valid
2642 soFar = soFar.slice(match[0].length) || soFar;
2643 }
2644 groups.push(tokens = []);
2645 }
2646
2647 matched = false;
2648
2649 // Combinators
2650 if (match = rcombinators.exec(soFar)) {
2651 matched = match.shift();
2652 tokens.push({
2653 value: matched,
2654 // Cast descendant combinators to space
2655 type: match[0].replace(rtrim, " ")
2656 });
2657 soFar = soFar.slice(matched.length);
2658 }
2659
2660 // Filters
2661 for (type in Expr.filter) {
2662 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
2663 matched = match.shift();
2664 tokens.push({
2665 value: matched,
2666 type: type,
2667 matches: match
2668 });
2669 soFar = soFar.slice(matched.length);
2670 }
2671 }
2672
2673 if (!matched) {
2674 break;
2675 }
2676 }
2677
2678 // Return the length of the invalid excess
2679 // if we're just parsing
2680 // Otherwise, throw an error or return tokens
2681 return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) :
2682 // Cache the tokens
2683 tokenCache(selector, groups).slice(0);
2684 };
2685
2686 function toSelector(tokens) {
2687 var i = 0,
2688 len = tokens.length,
2689 selector = "";
2690 for (; i < len; i++) {
2691 selector += tokens[i].value;
2692 }
2693 return selector;
2694 }
2695
2696 function addCombinator(matcher, combinator, base) {
2697 var dir = combinator.dir,
2698 skip = combinator.next,
2699 key = skip || dir,
2700 checkNonElements = base && key === "parentNode",
2701 doneName = done++;
2702
2703 return combinator.first ?
2704 // Check against closest ancestor/preceding element
2705 function (elem, context, xml) {
2706 while (elem = elem[dir]) {
2707 if (elem.nodeType === 1 || checkNonElements) {
2708 return matcher(elem, context, xml);
2709 }
2710 }
2711 return false;
2712 } :
2713
2714 // Check against all ancestor/preceding elements
2715 function (elem, context, xml) {
2716 var oldCache,
2717 uniqueCache,
2718 outerCache,
2719 newCache = [dirruns, doneName];
2720
2721 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2722 if (xml) {
2723 while (elem = elem[dir]) {
2724 if (elem.nodeType === 1 || checkNonElements) {
2725 if (matcher(elem, context, xml)) {
2726 return true;
2727 }
2728 }
2729 }
2730 } else {
2731 while (elem = elem[dir]) {
2732 if (elem.nodeType === 1 || checkNonElements) {
2733 outerCache = elem[expando] || (elem[expando] = {});
2734
2735 // Support: IE <9 only
2736 // Defend against cloned attroperties (jQuery gh-1709)
2737 uniqueCache = outerCache[elem.uniqueID] || (outerCache[elem.uniqueID] = {});
2738
2739 if (skip && skip === elem.nodeName.toLowerCase()) {
2740 elem = elem[dir] || elem;
2741 } else if ((oldCache = uniqueCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
2742
2743 // Assign to newCache so results back-propagate to previous elements
2744 return newCache[2] = oldCache[2];
2745 } else {
2746 // Reuse newcache so results back-propagate to previous elements
2747 uniqueCache[key] = newCache;
2748
2749 // A match means we're done; a fail means we have to keep checking
2750 if (newCache[2] = matcher(elem, context, xml)) {
2751 return true;
2752 }
2753 }
2754 }
2755 }
2756 }
2757 return false;
2758 };
2759 }
2760
2761 function elementMatcher(matchers) {
2762 return matchers.length > 1 ? function (elem, context, xml) {
2763 var i = matchers.length;
2764 while (i--) {
2765 if (!matchers[i](elem, context, xml)) {
2766 return false;
2767 }
2768 }
2769 return true;
2770 } : matchers[0];
2771 }
2772
2773 function multipleContexts(selector, contexts, results) {
2774 var i = 0,
2775 len = contexts.length;
2776 for (; i < len; i++) {
2777 Sizzle(selector, contexts[i], results);
2778 }
2779 return results;
2780 }
2781
2782 function condense(unmatched, map, filter, context, xml) {
2783 var elem,
2784 newUnmatched = [],
2785 i = 0,
2786 len = unmatched.length,
2787 mapped = map != null;
2788
2789 for (; i < len; i++) {
2790 if (elem = unmatched[i]) {
2791 if (!filter || filter(elem, context, xml)) {
2792 newUnmatched.push(elem);
2793 if (mapped) {
2794 map.push(i);
2795 }
2796 }
2797 }
2798 }
2799
2800 return newUnmatched;
2801 }
2802
2803 function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
2804 if (postFilter && !postFilter[expando]) {
2805 postFilter = setMatcher(postFilter);
2806 }
2807 if (postFinder && !postFinder[expando]) {
2808 postFinder = setMatcher(postFinder, postSelector);
2809 }
2810 return markFunction(function (seed, results, context, xml) {
2811 var temp,
2812 i,
2813 elem,
2814 preMap = [],
2815 postMap = [],
2816 preexisting = results.length,
2817
2818
2819 // Get initial elements from seed or context
2820 elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
2821
2822
2823 // Prefilter to get matcher input, preserving a map for seed-results synchronization
2824 matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems,
2825 matcherOut = matcher ?
2826 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2827 postFinder || (seed ? preFilter : preexisting || postFilter) ?
2828
2829 // ...intermediate processing is necessary
2830 [] :
2831
2832 // ...otherwise use results directly
2833 results : matcherIn;
2834
2835 // Find primary matches
2836 if (matcher) {
2837 matcher(matcherIn, matcherOut, context, xml);
2838 }
2839
2840 // Apply postFilter
2841 if (postFilter) {
2842 temp = condense(matcherOut, postMap);
2843 postFilter(temp, [], context, xml);
2844
2845 // Un-match failing elements by moving them back to matcherIn
2846 i = temp.length;
2847 while (i--) {
2848 if (elem = temp[i]) {
2849 matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
2850 }
2851 }
2852 }
2853
2854 if (seed) {
2855 if (postFinder || preFilter) {
2856 if (postFinder) {
2857 // Get the final matcherOut by condensing this intermediate into postFinder contexts
2858 temp = [];
2859 i = matcherOut.length;
2860 while (i--) {
2861 if (elem = matcherOut[i]) {
2862 // Restore matcherIn since elem is not yet a final match
2863 temp.push(matcherIn[i] = elem);
2864 }
2865 }
2866 postFinder(null, matcherOut = [], temp, xml);
2867 }
2868
2869 // Move matched elements from seed to results to keep them synchronized
2870 i = matcherOut.length;
2871 while (i--) {
2872 if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {
2873
2874 seed[temp] = !(results[temp] = elem);
2875 }
2876 }
2877 }
2878
2879 // Add elements to results, through postFinder if defined
2880 } else {
2881 matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
2882 if (postFinder) {
2883 postFinder(null, results, matcherOut, xml);
2884 } else {
2885 push.apply(results, matcherOut);
2886 }
2887 }
2888 });
2889 }
2890
2891 function matcherFromTokens(tokens) {
2892 var checkContext,
2893 matcher,
2894 j,
2895 len = tokens.length,
2896 leadingRelative = Expr.relative[tokens[0].type],
2897 implicitRelative = leadingRelative || Expr.relative[" "],
2898 i = leadingRelative ? 1 : 0,
2899
2900
2901 // The foundational matcher ensures that elements are reachable from top-level context(s)
2902 matchContext = addCombinator(function (elem) {
2903 return elem === checkContext;
2904 }, implicitRelative, true),
2905 matchAnyContext = addCombinator(function (elem) {
2906 return indexOf(checkContext, elem) > -1;
2907 }, implicitRelative, true),
2908 matchers = [function (elem, context, xml) {
2909 var ret = !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
2910 // Avoid hanging onto element (issue #299)
2911 checkContext = null;
2912 return ret;
2913 }];
2914
2915 for (; i < len; i++) {
2916 if (matcher = Expr.relative[tokens[i].type]) {
2917 matchers = [addCombinator(elementMatcher(matchers), matcher)];
2918 } else {
2919 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
2920
2921 // Return special upon seeing a positional matcher
2922 if (matcher[expando]) {
2923 // Find the next relative operator (if any) for proper handling
2924 j = ++i;
2925 for (; j < len; j++) {
2926 if (Expr.relative[tokens[j].type]) {
2927 break;
2928 }
2929 }
2930 return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(
2931 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2932 tokens.slice(0, i - 1).concat({ value: tokens[i - 2].type === " " ? "*" : "" })).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));
2933 }
2934 matchers.push(matcher);
2935 }
2936 }
2937
2938 return elementMatcher(matchers);
2939 }
2940
2941 function matcherFromGroupMatchers(elementMatchers, setMatchers) {
2942 var bySet = setMatchers.length > 0,
2943 byElement = elementMatchers.length > 0,
2944 superMatcher = function superMatcher(seed, context, xml, results, outermost) {
2945 var elem,
2946 j,
2947 matcher,
2948 matchedCount = 0,
2949 i = "0",
2950 unmatched = seed && [],
2951 setMatched = [],
2952 contextBackup = outermostContext,
2953
2954 // We must always have either seed elements or outermost context
2955 elems = seed || byElement && Expr.find["TAG"]("*", outermost),
2956
2957 // Use integer dirruns iff this is the outermost matcher
2958 dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1,
2959 len = elems.length;
2960
2961 if (outermost) {
2962 outermostContext = context === document || context || outermost;
2963 }
2964
2965 // Add elements passing elementMatchers directly to results
2966 // Support: IE<9, Safari
2967 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2968 for (; i !== len && (elem = elems[i]) != null; i++) {
2969 if (byElement && elem) {
2970 j = 0;
2971 if (!context && elem.ownerDocument !== document) {
2972 setDocument(elem);
2973 xml = !documentIsHTML;
2974 }
2975 while (matcher = elementMatchers[j++]) {
2976 if (matcher(elem, context || document, xml)) {
2977 results.push(elem);
2978 break;
2979 }
2980 }
2981 if (outermost) {
2982 dirruns = dirrunsUnique;
2983 }
2984 }
2985
2986 // Track unmatched elements for set filters
2987 if (bySet) {
2988 // They will have gone through all possible matchers
2989 if (elem = !matcher && elem) {
2990 matchedCount--;
2991 }
2992
2993 // Lengthen the array for every element, matched or not
2994 if (seed) {
2995 unmatched.push(elem);
2996 }
2997 }
2998 }
2999
3000 // `i` is now the count of elements visited above, and adding it to `matchedCount`
3001 // makes the latter nonnegative.
3002 matchedCount += i;
3003
3004 // Apply set filters to unmatched elements
3005 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
3006 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
3007 // no element matchers and no seed.
3008 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
3009 // case, which will result in a "00" `matchedCount` that differs from `i` but is also
3010 // numerically zero.
3011 if (bySet && i !== matchedCount) {
3012 j = 0;
3013 while (matcher = setMatchers[j++]) {
3014 matcher(unmatched, setMatched, context, xml);
3015 }
3016
3017 if (seed) {
3018 // Reintegrate element matches to eliminate the need for sorting
3019 if (matchedCount > 0) {
3020 while (i--) {
3021 if (!(unmatched[i] || setMatched[i])) {
3022 setMatched[i] = pop.call(results);
3023 }
3024 }
3025 }
3026
3027 // Discard index placeholder values to get only actual matches
3028 setMatched = condense(setMatched);
3029 }
3030
3031 // Add matches to results
3032 push.apply(results, setMatched);
3033
3034 // Seedless set matches succeeding multiple successful matchers stipulate sorting
3035 if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
3036
3037 Sizzle.uniqueSort(results);
3038 }
3039 }
3040
3041 // Override manipulation of globals by nested matchers
3042 if (outermost) {
3043 dirruns = dirrunsUnique;
3044 outermostContext = contextBackup;
3045 }
3046
3047 return unmatched;
3048 };
3049
3050 return bySet ? markFunction(superMatcher) : superMatcher;
3051 }
3052
3053 compile = Sizzle.compile = function (selector, match /* Internal Use Only */) {
3054 var i,
3055 setMatchers = [],
3056 elementMatchers = [],
3057 cached = compilerCache[selector + " "];
3058
3059 if (!cached) {
3060 // Generate a function of recursive functions that can be used to check each element
3061 if (!match) {
3062 match = tokenize(selector);
3063 }
3064 i = match.length;
3065 while (i--) {
3066 cached = matcherFromTokens(match[i]);
3067 if (cached[expando]) {
3068 setMatchers.push(cached);
3069 } else {
3070 elementMatchers.push(cached);
3071 }
3072 }
3073
3074 // Cache the compiled function
3075 cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
3076
3077 // Save selector and tokenization
3078 cached.selector = selector;
3079 }
3080 return cached;
3081 };
3082
3083 /**
3084 * A low-level selection function that works with Sizzle's compiled
3085 * selector functions
3086 * @param {String|Function} selector A selector or a pre-compiled
3087 * selector function built with Sizzle.compile
3088 * @param {Element} context
3089 * @param {Array} [results]
3090 * @param {Array} [seed] A set of elements to match against
3091 */
3092 select = Sizzle.select = function (selector, context, results, seed) {
3093 var i,
3094 tokens,
3095 token,
3096 type,
3097 find,
3098 compiled = typeof selector === "function" && selector,
3099 match = !seed && tokenize(selector = compiled.selector || selector);
3100
3101 results = results || [];
3102
3103 // Try to minimize operations if there is only one selector in the list and no seed
3104 // (the latter of which guarantees us context)
3105 if (match.length === 1) {
3106
3107 // Reduce context if the leading compound selector is an ID
3108 tokens = match[0] = match[0].slice(0);
3109 if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
3110
3111 context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
3112 if (!context) {
3113 return results;
3114
3115 // Precompiled matchers will still verify ancestry, so step up a level
3116 } else if (compiled) {
3117 context = context.parentNode;
3118 }
3119
3120 selector = selector.slice(tokens.shift().value.length);
3121 }
3122
3123 // Fetch a seed set for right-to-left matching
3124 i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
3125 while (i--) {
3126 token = tokens[i];
3127
3128 // Abort if we hit a combinator
3129 if (Expr.relative[type = token.type]) {
3130 break;
3131 }
3132 if (find = Expr.find[type]) {
3133 // Search, expanding context for leading sibling combinators
3134 if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {
3135
3136 // If seed is empty or no tokens remain, we can return early
3137 tokens.splice(i, 1);
3138 selector = seed.length && toSelector(tokens);
3139 if (!selector) {
3140 push.apply(results, seed);
3141 return results;
3142 }
3143
3144 break;
3145 }
3146 }
3147 }
3148 }
3149
3150 // Compile and execute a filtering function if one is not provided
3151 // Provide `match` to avoid retokenization if we modified the selector above
3152 (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context);
3153 return results;
3154 };
3155
3156 // One-time assignments
3157
3158 // Sort stability
3159 support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
3160
3161 // Support: Chrome 14-35+
3162 // Always assume duplicates if they aren't passed to the comparison function
3163 support.detectDuplicates = !!hasDuplicate;
3164
3165 // Initialize against the default document
3166 setDocument();
3167
3168 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
3169 // Detached nodes confoundingly follow *each other*
3170 support.sortDetached = assert(function (el) {
3171 // Should return 1, but returns 4 (following)
3172 return el.compareDocumentPosition(document.createElement("fieldset")) & 1;
3173 });
3174
3175 // Support: IE<8
3176 // Prevent attribute/property "interpolation"
3177 // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
3178 if (!assert(function (el) {
3179 el.innerHTML = "<a href='#'></a>";
3180 return el.firstChild.getAttribute("href") === "#";
3181 })) {
3182 addHandle("type|href|height|width", function (elem, name, isXML) {
3183 if (!isXML) {
3184 return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
3185 }
3186 });
3187 }
3188
3189 // Support: IE<9
3190 // Use defaultValue in place of getAttribute("value")
3191 if (!support.attributes || !assert(function (el) {
3192 el.innerHTML = "<input/>";
3193 el.firstChild.setAttribute("value", "");
3194 return el.firstChild.getAttribute("value") === "";
3195 })) {
3196 addHandle("value", function (elem, name, isXML) {
3197 if (!isXML && elem.nodeName.toLowerCase() === "input") {
3198 return elem.defaultValue;
3199 }
3200 });
3201 }
3202
3203 // Support: IE<9
3204 // Use getAttributeNode to fetch booleans when getAttribute lies
3205 if (!assert(function (el) {
3206 return el.getAttribute("disabled") == null;
3207 })) {
3208 addHandle(booleans, function (elem, name, isXML) {
3209 var val;
3210 if (!isXML) {
3211 return elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
3212 }
3213 });
3214 }
3215
3216 return Sizzle;
3217 }(window);
3218
3219 jQuery.find = Sizzle;
3220 jQuery.expr = Sizzle.selectors;
3221
3222 // Deprecated
3223 jQuery.expr[":"] = jQuery.expr.pseudos;
3224 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
3225 jQuery.text = Sizzle.getText;
3226 jQuery.isXMLDoc = Sizzle.isXML;
3227 jQuery.contains = Sizzle.contains;
3228 jQuery.escapeSelector = Sizzle.escape;
3229
3230 var dir = function dir(elem, _dir, until) {
3231 var matched = [],
3232 truncate = until !== undefined;
3233
3234 while ((elem = elem[_dir]) && elem.nodeType !== 9) {
3235 if (elem.nodeType === 1) {
3236 if (truncate && jQuery(elem).is(until)) {
3237 break;
3238 }
3239 matched.push(elem);
3240 }
3241 }
3242 return matched;
3243 };
3244
3245 var _siblings = function _siblings(n, elem) {
3246 var matched = [];
3247
3248 for (; n; n = n.nextSibling) {
3249 if (n.nodeType === 1 && n !== elem) {
3250 matched.push(n);
3251 }
3252 }
3253
3254 return matched;
3255 };
3256
3257 var rneedsContext = jQuery.expr.match.needsContext;
3258
3259 function nodeName(elem, name) {
3260
3261 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
3262 };
3263 var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
3264
3265 var risSimple = /^.[^:#\[\.,]*$/;
3266
3267 // Implement the identical functionality for filter and not
3268 function winnow(elements, qualifier, not) {
3269 if (jQuery.isFunction(qualifier)) {
3270 return jQuery.grep(elements, function (elem, i) {
3271 return !!qualifier.call(elem, i, elem) !== not;
3272 });
3273 }
3274
3275 // Single element
3276 if (qualifier.nodeType) {
3277 return jQuery.grep(elements, function (elem) {
3278 return elem === qualifier !== not;
3279 });
3280 }
3281
3282 // Arraylike of elements (jQuery, arguments, Array)
3283 if (typeof qualifier !== "string") {
3284 return jQuery.grep(elements, function (elem) {
3285 return indexOf.call(qualifier, elem) > -1 !== not;
3286 });
3287 }
3288
3289 // Simple selector that can be filtered directly, removing non-Elements
3290 if (risSimple.test(qualifier)) {
3291 return jQuery.filter(qualifier, elements, not);
3292 }
3293
3294 // Complex selector, compare the two sets, removing non-Elements
3295 qualifier = jQuery.filter(qualifier, elements);
3296 return jQuery.grep(elements, function (elem) {
3297 return indexOf.call(qualifier, elem) > -1 !== not && elem.nodeType === 1;
3298 });
3299 }
3300
3301 jQuery.filter = function (expr, elems, not) {
3302 var elem = elems[0];
3303
3304 if (not) {
3305 expr = ":not(" + expr + ")";
3306 }
3307
3308 if (elems.length === 1 && elem.nodeType === 1) {
3309 return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
3310 }
3311
3312 return jQuery.find.matches(expr, jQuery.grep(elems, function (elem) {
3313 return elem.nodeType === 1;
3314 }));
3315 };
3316
3317 jQuery.fn.extend({
3318 find: function find(selector) {
3319 var i,
3320 ret,
3321 len = this.length,
3322 self = this;
3323
3324 if (typeof selector !== "string") {
3325 return this.pushStack(jQuery(selector).filter(function () {
3326 for (i = 0; i < len; i++) {
3327 if (jQuery.contains(self[i], this)) {
3328 return true;
3329 }
3330 }
3331 }));
3332 }
3333
3334 ret = this.pushStack([]);
3335
3336 for (i = 0; i < len; i++) {
3337 jQuery.find(selector, self[i], ret);
3338 }
3339
3340 return len > 1 ? jQuery.uniqueSort(ret) : ret;
3341 },
3342 filter: function filter(selector) {
3343 return this.pushStack(winnow(this, selector || [], false));
3344 },
3345 not: function not(selector) {
3346 return this.pushStack(winnow(this, selector || [], true));
3347 },
3348 is: function is(selector) {
3349 return !!winnow(this,
3350
3351 // If this is a positional/relative selector, check membership in the returned set
3352 // so $("p:first").is("p:last") won't return true for a doc with two "p".
3353 typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length;
3354 }
3355 });
3356
3357 // Initialize a jQuery object
3358
3359
3360 // A central reference to the root jQuery(document)
3361 var rootjQuery,
3362
3363
3364 // A simple way to check for HTML strings
3365 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
3366 // Strict HTML recognition (#11290: must start with <)
3367 // Shortcut simple #id case for speed
3368 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
3369 init = jQuery.fn.init = function (selector, context, root) {
3370 var match, elem;
3371
3372 // HANDLE: $(""), $(null), $(undefined), $(false)
3373 if (!selector) {
3374 return this;
3375 }
3376
3377 // Method init() accepts an alternate rootjQuery
3378 // so migrate can support jQuery.sub (gh-2101)
3379 root = root || rootjQuery;
3380
3381 // Handle HTML strings
3382 if (typeof selector === "string") {
3383 if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
3384
3385 // Assume that strings that start and end with <> are HTML and skip the regex check
3386 match = [null, selector, null];
3387 } else {
3388 match = rquickExpr.exec(selector);
3389 }
3390
3391 // Match html or make sure no context is specified for #id
3392 if (match && (match[1] || !context)) {
3393
3394 // HANDLE: $(html) -> $(array)
3395 if (match[1]) {
3396 context = context instanceof jQuery ? context[0] : context;
3397
3398 // Option to run scripts is true for back-compat
3399 // Intentionally let the error be thrown if parseHTML is not present
3400 jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true));
3401
3402 // HANDLE: $(html, props)
3403 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
3404 for (match in context) {
3405
3406 // Properties of context are called as methods if possible
3407 if (jQuery.isFunction(this[match])) {
3408 this[match](context[match]);
3409
3410 // ...and otherwise set as attributes
3411 } else {
3412 this.attr(match, context[match]);
3413 }
3414 }
3415 }
3416
3417 return this;
3418
3419 // HANDLE: $(#id)
3420 } else {
3421 elem = document.getElementById(match[2]);
3422
3423 if (elem) {
3424
3425 // Inject the element directly into the jQuery object
3426 this[0] = elem;
3427 this.length = 1;
3428 }
3429 return this;
3430 }
3431
3432 // HANDLE: $(expr, $(...))
3433 } else if (!context || context.jquery) {
3434 return (context || root).find(selector);
3435
3436 // HANDLE: $(expr, context)
3437 // (which is just equivalent to: $(context).find(expr)
3438 } else {
3439 return this.constructor(context).find(selector);
3440 }
3441
3442 // HANDLE: $(DOMElement)
3443 } else if (selector.nodeType) {
3444 this[0] = selector;
3445 this.length = 1;
3446 return this;
3447
3448 // HANDLE: $(function)
3449 // Shortcut for document ready
3450 } else if (jQuery.isFunction(selector)) {
3451 return root.ready !== undefined ? root.ready(selector) :
3452
3453 // Execute immediately if ready is not present
3454 selector(jQuery);
3455 }
3456
3457 return jQuery.makeArray(selector, this);
3458 };
3459
3460 // Give the init function the jQuery prototype for later instantiation
3461 init.prototype = jQuery.fn;
3462
3463 // Initialize central reference
3464 rootjQuery = jQuery(document);
3465
3466 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
3467
3468
3469 // Methods guaranteed to produce a unique set when starting from a unique set
3470 guaranteedUnique = {
3471 children: true,
3472 contents: true,
3473 next: true,
3474 prev: true
3475 };
3476
3477 jQuery.fn.extend({
3478 has: function has(target) {
3479 var targets = jQuery(target, this),
3480 l = targets.length;
3481
3482 return this.filter(function () {
3483 var i = 0;
3484 for (; i < l; i++) {
3485 if (jQuery.contains(this, targets[i])) {
3486 return true;
3487 }
3488 }
3489 });
3490 },
3491
3492 closest: function closest(selectors, context) {
3493 var cur,
3494 i = 0,
3495 l = this.length,
3496 matched = [],
3497 targets = typeof selectors !== "string" && jQuery(selectors);
3498
3499 // Positional selectors never match, since there's no _selection_ context
3500 if (!rneedsContext.test(selectors)) {
3501 for (; i < l; i++) {
3502 for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
3503
3504 // Always skip document fragments
3505 if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 :
3506
3507 // Don't pass non-elements to Sizzle
3508 cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {
3509
3510 matched.push(cur);
3511 break;
3512 }
3513 }
3514 }
3515 }
3516
3517 return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
3518 },
3519
3520 // Determine the position of an element within the set
3521 index: function index(elem) {
3522
3523 // No argument, return index in parent
3524 if (!elem) {
3525 return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
3526 }
3527
3528 // Index in selector
3529 if (typeof elem === "string") {
3530 return indexOf.call(jQuery(elem), this[0]);
3531 }
3532
3533 // Locate the position of the desired element
3534 return indexOf.call(this,
3535
3536 // If it receives a jQuery object, the first element is used
3537 elem.jquery ? elem[0] : elem);
3538 },
3539
3540 add: function add(selector, context) {
3541 return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context))));
3542 },
3543
3544 addBack: function addBack(selector) {
3545 return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
3546 }
3547 });
3548
3549 function sibling(cur, dir) {
3550 while ((cur = cur[dir]) && cur.nodeType !== 1) {}
3551 return cur;
3552 }
3553
3554 jQuery.each({
3555 parent: function parent(elem) {
3556 var parent = elem.parentNode;
3557 return parent && parent.nodeType !== 11 ? parent : null;
3558 },
3559 parents: function parents(elem) {
3560 return dir(elem, "parentNode");
3561 },
3562 parentsUntil: function parentsUntil(elem, i, until) {
3563 return dir(elem, "parentNode", until);
3564 },
3565 next: function next(elem) {
3566 return sibling(elem, "nextSibling");
3567 },
3568 prev: function prev(elem) {
3569 return sibling(elem, "previousSibling");
3570 },
3571 nextAll: function nextAll(elem) {
3572 return dir(elem, "nextSibling");
3573 },
3574 prevAll: function prevAll(elem) {
3575 return dir(elem, "previousSibling");
3576 },
3577 nextUntil: function nextUntil(elem, i, until) {
3578 return dir(elem, "nextSibling", until);
3579 },
3580 prevUntil: function prevUntil(elem, i, until) {
3581 return dir(elem, "previousSibling", until);
3582 },
3583 siblings: function siblings(elem) {
3584 return _siblings((elem.parentNode || {}).firstChild, elem);
3585 },
3586 children: function children(elem) {
3587 return _siblings(elem.firstChild);
3588 },
3589 contents: function contents(elem) {
3590 if (nodeName(elem, "iframe")) {
3591 return elem.contentDocument;
3592 }
3593
3594 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
3595 // Treat the template element as a regular one in browsers that
3596 // don't support it.
3597 if (nodeName(elem, "template")) {
3598 elem = elem.content || elem;
3599 }
3600
3601 return jQuery.merge([], elem.childNodes);
3602 }
3603 }, function (name, fn) {
3604 jQuery.fn[name] = function (until, selector) {
3605 var matched = jQuery.map(this, fn, until);
3606
3607 if (name.slice(-5) !== "Until") {
3608 selector = until;
3609 }
3610
3611 if (selector && typeof selector === "string") {
3612 matched = jQuery.filter(selector, matched);
3613 }
3614
3615 if (this.length > 1) {
3616
3617 // Remove duplicates
3618 if (!guaranteedUnique[name]) {
3619 jQuery.uniqueSort(matched);
3620 }
3621
3622 // Reverse order for parents* and prev-derivatives
3623 if (rparentsprev.test(name)) {
3624 matched.reverse();
3625 }
3626 }
3627
3628 return this.pushStack(matched);
3629 };
3630 });
3631 var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
3632
3633 // Convert String-formatted options into Object-formatted ones
3634 function createOptions(options) {
3635 var object = {};
3636 jQuery.each(options.match(rnothtmlwhite) || [], function (_, flag) {
3637 object[flag] = true;
3638 });
3639 return object;
3640 }
3641
3642 /*
3643 * Create a callback list using the following parameters:
3644 *
3645 * options: an optional list of space-separated options that will change how
3646 * the callback list behaves or a more traditional option object
3647 *
3648 * By default a callback list will act like an event callback list and can be
3649 * "fired" multiple times.
3650 *
3651 * Possible options:
3652 *
3653 * once: will ensure the callback list can only be fired once (like a Deferred)
3654 *
3655 * memory: will keep track of previous values and will call any callback added
3656 * after the list has been fired right away with the latest "memorized"
3657 * values (like a Deferred)
3658 *
3659 * unique: will ensure a callback can only be added once (no duplicate in the list)
3660 *
3661 * stopOnFalse: interrupt callings when a callback returns false
3662 *
3663 */
3664 jQuery.Callbacks = function (options) {
3665
3666 // Convert options from String-formatted to Object-formatted if needed
3667 // (we check in cache first)
3668 options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options);
3669
3670 var // Flag to know if list is currently firing
3671 firing,
3672
3673
3674 // Last fire value for non-forgettable lists
3675 memory,
3676
3677
3678 // Flag to know if list was already fired
3679 _fired,
3680
3681
3682 // Flag to prevent firing
3683 _locked,
3684
3685
3686 // Actual callback list
3687 list = [],
3688
3689
3690 // Queue of execution data for repeatable lists
3691 queue = [],
3692
3693
3694 // Index of currently firing callback (modified by add/remove as needed)
3695 firingIndex = -1,
3696
3697
3698 // Fire callbacks
3699 fire = function fire() {
3700
3701 // Enforce single-firing
3702 _locked = _locked || options.once;
3703
3704 // Execute callbacks for all pending executions,
3705 // respecting firingIndex overrides and runtime changes
3706 _fired = firing = true;
3707 for (; queue.length; firingIndex = -1) {
3708 memory = queue.shift();
3709 while (++firingIndex < list.length) {
3710
3711 // Run callback and check for early termination
3712 if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {
3713
3714 // Jump to end and forget the data so .add doesn't re-fire
3715 firingIndex = list.length;
3716 memory = false;
3717 }
3718 }
3719 }
3720
3721 // Forget the data if we're done with it
3722 if (!options.memory) {
3723 memory = false;
3724 }
3725
3726 firing = false;
3727
3728 // Clean up if we're done firing for good
3729 if (_locked) {
3730
3731 // Keep an empty list if we have data for future add calls
3732 if (memory) {
3733 list = [];
3734
3735 // Otherwise, this object is spent
3736 } else {
3737 list = "";
3738 }
3739 }
3740 },
3741
3742
3743 // Actual Callbacks object
3744 self = {
3745
3746 // Add a callback or a collection of callbacks to the list
3747 add: function add() {
3748 if (list) {
3749
3750 // If we have memory from a past run, we should fire after adding
3751 if (memory && !firing) {
3752 firingIndex = list.length - 1;
3753 queue.push(memory);
3754 }
3755
3756 (function add(args) {
3757 jQuery.each(args, function (_, arg) {
3758 if (jQuery.isFunction(arg)) {
3759 if (!options.unique || !self.has(arg)) {
3760 list.push(arg);
3761 }
3762 } else if (arg && arg.length && jQuery.type(arg) !== "string") {
3763
3764 // Inspect recursively
3765 add(arg);
3766 }
3767 });
3768 })(arguments);
3769
3770 if (memory && !firing) {
3771 fire();
3772 }
3773 }
3774 return this;
3775 },
3776
3777 // Remove a callback from the list
3778 remove: function remove() {
3779 jQuery.each(arguments, function (_, arg) {
3780 var index;
3781 while ((index = jQuery.inArray(arg, list, index)) > -1) {
3782 list.splice(index, 1);
3783
3784 // Handle firing indexes
3785 if (index <= firingIndex) {
3786 firingIndex--;
3787 }
3788 }
3789 });
3790 return this;
3791 },
3792
3793 // Check if a given callback is in the list.
3794 // If no argument is given, return whether or not list has callbacks attached.
3795 has: function has(fn) {
3796 return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;
3797 },
3798
3799 // Remove all callbacks from the list
3800 empty: function empty() {
3801 if (list) {
3802 list = [];
3803 }
3804 return this;
3805 },
3806
3807 // Disable .fire and .add
3808 // Abort any current/pending executions
3809 // Clear all callbacks and values
3810 disable: function disable() {
3811 _locked = queue = [];
3812 list = memory = "";
3813 return this;
3814 },
3815 disabled: function disabled() {
3816 return !list;
3817 },
3818
3819 // Disable .fire
3820 // Also disable .add unless we have memory (since it would have no effect)
3821 // Abort any pending executions
3822 lock: function lock() {
3823 _locked = queue = [];
3824 if (!memory && !firing) {
3825 list = memory = "";
3826 }
3827 return this;
3828 },
3829 locked: function locked() {
3830 return !!_locked;
3831 },
3832
3833 // Call all callbacks with the given context and arguments
3834 fireWith: function fireWith(context, args) {
3835 if (!_locked) {
3836 args = args || [];
3837 args = [context, args.slice ? args.slice() : args];
3838 queue.push(args);
3839 if (!firing) {
3840 fire();
3841 }
3842 }
3843 return this;
3844 },
3845
3846 // Call all the callbacks with the given arguments
3847 fire: function fire() {
3848 self.fireWith(this, arguments);
3849 return this;
3850 },
3851
3852 // To know if the callbacks have already been called at least once
3853 fired: function fired() {
3854 return !!_fired;
3855 }
3856 };
3857
3858 return self;
3859 };
3860
3861 function Identity(v) {
3862 return v;
3863 }
3864 function Thrower(ex) {
3865 throw ex;
3866 }
3867
3868 function adoptValue(value, resolve, reject, noValue) {
3869 var method;
3870
3871 try {
3872
3873 // Check for promise aspect first to privilege synchronous behavior
3874 if (value && jQuery.isFunction(method = value.promise)) {
3875 method.call(value).done(resolve).fail(reject);
3876
3877 // Other thenables
3878 } else if (value && jQuery.isFunction(method = value.then)) {
3879 method.call(value, resolve, reject);
3880
3881 // Other non-thenables
3882 } else {
3883
3884 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
3885 // * false: [ value ].slice( 0 ) => resolve( value )
3886 // * true: [ value ].slice( 1 ) => resolve()
3887 resolve.apply(undefined, [value].slice(noValue));
3888 }
3889
3890 // For Promises/A+, convert exceptions into rejections
3891 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
3892 // Deferred#then to conditionally suppress rejection.
3893 } catch (value) {
3894
3895 // Support: Android 4.0 only
3896 // Strict mode functions invoked without .call/.apply get global-object context
3897 reject.apply(undefined, [value]);
3898 }
3899 }
3900
3901 jQuery.extend({
3902
3903 Deferred: function Deferred(func) {
3904 var tuples = [
3905
3906 // action, add listener, callbacks,
3907 // ... .then handlers, argument index, [final state]
3908 ["notify", "progress", jQuery.Callbacks("memory"), jQuery.Callbacks("memory"), 2], ["resolve", "done", jQuery.Callbacks("once memory"), jQuery.Callbacks("once memory"), 0, "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), jQuery.Callbacks("once memory"), 1, "rejected"]],
3909 _state = "pending",
3910 _promise = {
3911 state: function state() {
3912 return _state;
3913 },
3914 always: function always() {
3915 deferred.done(arguments).fail(arguments);
3916 return this;
3917 },
3918 "catch": function _catch(fn) {
3919 return _promise.then(null, fn);
3920 },
3921
3922 // Keep pipe for back-compat
3923 pipe: function pipe() /* fnDone, fnFail, fnProgress */{
3924 var fns = arguments;
3925
3926 return jQuery.Deferred(function (newDefer) {
3927 jQuery.each(tuples, function (i, tuple) {
3928
3929 // Map tuples (progress, done, fail) to arguments (done, fail, progress)
3930 var fn = jQuery.isFunction(fns[tuple[4]]) && fns[tuple[4]];
3931
3932 // deferred.progress(function() { bind to newDefer or newDefer.notify })
3933 // deferred.done(function() { bind to newDefer or newDefer.resolve })
3934 // deferred.fail(function() { bind to newDefer or newDefer.reject })
3935 deferred[tuple[1]](function () {
3936 var returned = fn && fn.apply(this, arguments);
3937 if (returned && jQuery.isFunction(returned.promise)) {
3938 returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
3939 } else {
3940 newDefer[tuple[0] + "With"](this, fn ? [returned] : arguments);
3941 }
3942 });
3943 });
3944 fns = null;
3945 }).promise();
3946 },
3947 then: function then(onFulfilled, onRejected, onProgress) {
3948 var maxDepth = 0;
3949 function resolve(depth, deferred, handler, special) {
3950 return function () {
3951 var that = this,
3952 args = arguments,
3953 mightThrow = function mightThrow() {
3954 var returned, then;
3955
3956 // Support: Promises/A+ section 2.3.3.3.3
3957 // https://promisesaplus.com/#point-59
3958 // Ignore double-resolution attempts
3959 if (depth < maxDepth) {
3960 return;
3961 }
3962
3963 returned = handler.apply(that, args);
3964
3965 // Support: Promises/A+ section 2.3.1
3966 // https://promisesaplus.com/#point-48
3967 if (returned === deferred.promise()) {
3968 throw new TypeError("Thenable self-resolution");
3969 }
3970
3971 // Support: Promises/A+ sections 2.3.3.1, 3.5
3972 // https://promisesaplus.com/#point-54
3973 // https://promisesaplus.com/#point-75
3974 // Retrieve `then` only once
3975 then = returned && (
3976
3977 // Support: Promises/A+ section 2.3.4
3978 // https://promisesaplus.com/#point-64
3979 // Only check objects and functions for thenability
3980 (typeof returned === "undefined" ? "undefined" : _typeof(returned)) === "object" || typeof returned === "function") && returned.then;
3981
3982 // Handle a returned thenable
3983 if (jQuery.isFunction(then)) {
3984
3985 // Special processors (notify) just wait for resolution
3986 if (special) {
3987 then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special));
3988
3989 // Normal processors (resolve) also hook into progress
3990 } else {
3991
3992 // ...and disregard older resolution values
3993 maxDepth++;
3994
3995 then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special), resolve(maxDepth, deferred, Identity, deferred.notifyWith));
3996 }
3997
3998 // Handle all other returned values
3999 } else {
4000
4001 // Only substitute handlers pass on context
4002 // and multiple values (non-spec behavior)
4003 if (handler !== Identity) {
4004 that = undefined;
4005 args = [returned];
4006 }
4007
4008 // Process the value(s)
4009 // Default process is resolve
4010 (special || deferred.resolveWith)(that, args);
4011 }
4012 },
4013
4014
4015 // Only normal processors (resolve) catch and reject exceptions
4016 process = special ? mightThrow : function () {
4017 try {
4018 mightThrow();
4019 } catch (e) {
4020
4021 if (jQuery.Deferred.exceptionHook) {
4022 jQuery.Deferred.exceptionHook(e, process.stackTrace);
4023 }
4024
4025 // Support: Promises/A+ section 2.3.3.3.4.1
4026 // https://promisesaplus.com/#point-61
4027 // Ignore post-resolution exceptions
4028 if (depth + 1 >= maxDepth) {
4029
4030 // Only substitute handlers pass on context
4031 // and multiple values (non-spec behavior)
4032 if (handler !== Thrower) {
4033 that = undefined;
4034 args = [e];
4035 }
4036
4037 deferred.rejectWith(that, args);
4038 }
4039 }
4040 };
4041
4042 // Support: Promises/A+ section 2.3.3.3.1
4043 // https://promisesaplus.com/#point-57
4044 // Re-resolve promises immediately to dodge false rejection from
4045 // subsequent errors
4046 if (depth) {
4047 process();
4048 } else {
4049
4050 // Call an optional hook to record the stack, in case of exception
4051 // since it's otherwise lost when execution goes async
4052 if (jQuery.Deferred.getStackHook) {
4053 process.stackTrace = jQuery.Deferred.getStackHook();
4054 }
4055 window.setTimeout(process);
4056 }
4057 };
4058 }
4059
4060 return jQuery.Deferred(function (newDefer) {
4061
4062 // progress_handlers.add( ... )
4063 tuples[0][3].add(resolve(0, newDefer, jQuery.isFunction(onProgress) ? onProgress : Identity, newDefer.notifyWith));
4064
4065 // fulfilled_handlers.add( ... )
4066 tuples[1][3].add(resolve(0, newDefer, jQuery.isFunction(onFulfilled) ? onFulfilled : Identity));
4067
4068 // rejected_handlers.add( ... )
4069 tuples[2][3].add(resolve(0, newDefer, jQuery.isFunction(onRejected) ? onRejected : Thrower));
4070 }).promise();
4071 },
4072
4073 // Get a promise for this deferred
4074 // If obj is provided, the promise aspect is added to the object
4075 promise: function promise(obj) {
4076 return obj != null ? jQuery.extend(obj, _promise) : _promise;
4077 }
4078 },
4079 deferred = {};
4080
4081 // Add list-specific methods
4082 jQuery.each(tuples, function (i, tuple) {
4083 var list = tuple[2],
4084 stateString = tuple[5];
4085
4086 // promise.progress = list.add
4087 // promise.done = list.add
4088 // promise.fail = list.add
4089 _promise[tuple[1]] = list.add;
4090
4091 // Handle state
4092 if (stateString) {
4093 list.add(function () {
4094
4095 // state = "resolved" (i.e., fulfilled)
4096 // state = "rejected"
4097 _state = stateString;
4098 },
4099
4100 // rejected_callbacks.disable
4101 // fulfilled_callbacks.disable
4102 tuples[3 - i][2].disable,
4103
4104 // progress_callbacks.lock
4105 tuples[0][2].lock);
4106 }
4107
4108 // progress_handlers.fire
4109 // fulfilled_handlers.fire
4110 // rejected_handlers.fire
4111 list.add(tuple[3].fire);
4112
4113 // deferred.notify = function() { deferred.notifyWith(...) }
4114 // deferred.resolve = function() { deferred.resolveWith(...) }
4115 // deferred.reject = function() { deferred.rejectWith(...) }
4116 deferred[tuple[0]] = function () {
4117 deferred[tuple[0] + "With"](this === deferred ? undefined : this, arguments);
4118 return this;
4119 };
4120
4121 // deferred.notifyWith = list.fireWith
4122 // deferred.resolveWith = list.fireWith
4123 // deferred.rejectWith = list.fireWith
4124 deferred[tuple[0] + "With"] = list.fireWith;
4125 });
4126
4127 // Make the deferred a promise
4128 _promise.promise(deferred);
4129
4130 // Call given func if any
4131 if (func) {
4132 func.call(deferred, deferred);
4133 }
4134
4135 // All done!
4136 return deferred;
4137 },
4138
4139 // Deferred helper
4140 when: function when(singleValue) {
4141 var
4142
4143 // count of uncompleted subordinates
4144 remaining = arguments.length,
4145
4146
4147 // count of unprocessed arguments
4148 i = remaining,
4149
4150
4151 // subordinate fulfillment data
4152 resolveContexts = Array(i),
4153 resolveValues = _slice.call(arguments),
4154
4155
4156 // the master Deferred
4157 master = jQuery.Deferred(),
4158
4159
4160 // subordinate callback factory
4161 updateFunc = function updateFunc(i) {
4162 return function (value) {
4163 resolveContexts[i] = this;
4164 resolveValues[i] = arguments.length > 1 ? _slice.call(arguments) : value;
4165 if (! --remaining) {
4166 master.resolveWith(resolveContexts, resolveValues);
4167 }
4168 };
4169 };
4170
4171 // Single- and empty arguments are adopted like Promise.resolve
4172 if (remaining <= 1) {
4173 adoptValue(singleValue, master.done(updateFunc(i)).resolve, master.reject, !remaining);
4174
4175 // Use .then() to unwrap secondary thenables (cf. gh-3000)
4176 if (master.state() === "pending" || jQuery.isFunction(resolveValues[i] && resolveValues[i].then)) {
4177
4178 return master.then();
4179 }
4180 }
4181
4182 // Multiple arguments are aggregated like Promise.all array elements
4183 while (i--) {
4184 adoptValue(resolveValues[i], updateFunc(i), master.reject);
4185 }
4186
4187 return master.promise();
4188 }
4189 });
4190
4191 // These usually indicate a programmer mistake during development,
4192 // warn about them ASAP rather than swallowing them by default.
4193 var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
4194
4195 jQuery.Deferred.exceptionHook = function (error, stack) {
4196
4197 // Support: IE 8 - 9 only
4198 // Console exists when dev tools are open, which can happen at any time
4199 if (window.console && window.console.warn && error && rerrorNames.test(error.name)) {
4200 window.console.warn("jQuery.Deferred exception: " + error.message, error.stack, stack);
4201 }
4202 };
4203
4204 jQuery.readyException = function (error) {
4205 window.setTimeout(function () {
4206 throw error;
4207 });
4208 };
4209
4210 // The deferred used on DOM ready
4211 var readyList = jQuery.Deferred();
4212
4213 jQuery.fn.ready = function (fn) {
4214
4215 readyList.then(fn)
4216
4217 // Wrap jQuery.readyException in a function so that the lookup
4218 // happens at the time of error handling instead of callback
4219 // registration.
4220 .catch(function (error) {
4221 jQuery.readyException(error);
4222 });
4223
4224 return this;
4225 };
4226
4227 jQuery.extend({
4228
4229 // Is the DOM ready to be used? Set to true once it occurs.
4230 isReady: false,
4231
4232 // A counter to track how many items to wait for before
4233 // the ready event fires. See #6781
4234 readyWait: 1,
4235
4236 // Handle when the DOM is ready
4237 ready: function ready(wait) {
4238
4239 // Abort if there are pending holds or we're already ready
4240 if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
4241 return;
4242 }
4243
4244 // Remember that the DOM is ready
4245 jQuery.isReady = true;
4246
4247 // If a normal DOM Ready event fired, decrement, and wait if need be
4248 if (wait !== true && --jQuery.readyWait > 0) {
4249 return;
4250 }
4251
4252 // If there are functions bound, to execute
4253 readyList.resolveWith(document, [jQuery]);
4254 }
4255 });
4256
4257 jQuery.ready.then = readyList.then;
4258
4259 // The ready event handler and self cleanup method
4260 function completed() {
4261 document.removeEventListener("DOMContentLoaded", completed);
4262 window.removeEventListener("load", completed);
4263 jQuery.ready();
4264 }
4265
4266 // Catch cases where $(document).ready() is called
4267 // after the browser event has already occurred.
4268 // Support: IE <=9 - 10 only
4269 // Older IE sometimes signals "interactive" too soon
4270 if (document.readyState === "complete" || document.readyState !== "loading" && !document.documentElement.doScroll) {
4271
4272 // Handle it asynchronously to allow scripts the opportunity to delay ready
4273 window.setTimeout(jQuery.ready);
4274 } else {
4275
4276 // Use the handy event callback
4277 document.addEventListener("DOMContentLoaded", completed);
4278
4279 // A fallback to window.onload, that will always work
4280 window.addEventListener("load", completed);
4281 }
4282
4283 // Multifunctional method to get and set values of a collection
4284 // The value/s can optionally be executed if it's a function
4285 var access = function access(elems, fn, key, value, chainable, emptyGet, raw) {
4286 var i = 0,
4287 len = elems.length,
4288 bulk = key == null;
4289
4290 // Sets many values
4291 if (jQuery.type(key) === "object") {
4292 chainable = true;
4293 for (i in key) {
4294 access(elems, fn, i, key[i], true, emptyGet, raw);
4295 }
4296
4297 // Sets one value
4298 } else if (value !== undefined) {
4299 chainable = true;
4300
4301 if (!jQuery.isFunction(value)) {
4302 raw = true;
4303 }
4304
4305 if (bulk) {
4306
4307 // Bulk operations run against the entire set
4308 if (raw) {
4309 fn.call(elems, value);
4310 fn = null;
4311
4312 // ...except when executing function values
4313 } else {
4314 bulk = fn;
4315 fn = function fn(elem, key, value) {
4316 return bulk.call(jQuery(elem), value);
4317 };
4318 }
4319 }
4320
4321 if (fn) {
4322 for (; i < len; i++) {
4323 fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
4324 }
4325 }
4326 }
4327
4328 if (chainable) {
4329 return elems;
4330 }
4331
4332 // Gets
4333 if (bulk) {
4334 return fn.call(elems);
4335 }
4336
4337 return len ? fn(elems[0], key) : emptyGet;
4338 };
4339 var acceptData = function acceptData(owner) {
4340
4341 // Accepts only:
4342 // - Node
4343 // - Node.ELEMENT_NODE
4344 // - Node.DOCUMENT_NODE
4345 // - Object
4346 // - Any
4347 return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
4348 };
4349
4350 function Data() {
4351 this.expando = jQuery.expando + Data.uid++;
4352 }
4353
4354 Data.uid = 1;
4355
4356 Data.prototype = {
4357
4358 cache: function cache(owner) {
4359
4360 // Check if the owner object already has a cache
4361 var value = owner[this.expando];
4362
4363 // If not, create one
4364 if (!value) {
4365 value = {};
4366
4367 // We can accept data for non-element nodes in modern browsers,
4368 // but we should not, see #8335.
4369 // Always return an empty object.
4370 if (acceptData(owner)) {
4371
4372 // If it is a node unlikely to be stringify-ed or looped over
4373 // use plain assignment
4374 if (owner.nodeType) {
4375 owner[this.expando] = value;
4376
4377 // Otherwise secure it in a non-enumerable property
4378 // configurable must be true to allow the property to be
4379 // deleted when data is removed
4380 } else {
4381 Object.defineProperty(owner, this.expando, {
4382 value: value,
4383 configurable: true
4384 });
4385 }
4386 }
4387 }
4388
4389 return value;
4390 },
4391 set: function set(owner, data, value) {
4392 var prop,
4393 cache = this.cache(owner);
4394
4395 // Handle: [ owner, key, value ] args
4396 // Always use camelCase key (gh-2257)
4397 if (typeof data === "string") {
4398 cache[jQuery.camelCase(data)] = value;
4399
4400 // Handle: [ owner, { properties } ] args
4401 } else {
4402
4403 // Copy the properties one-by-one to the cache object
4404 for (prop in data) {
4405 cache[jQuery.camelCase(prop)] = data[prop];
4406 }
4407 }
4408 return cache;
4409 },
4410 get: function get(owner, key) {
4411 return key === undefined ? this.cache(owner) :
4412
4413 // Always use camelCase key (gh-2257)
4414 owner[this.expando] && owner[this.expando][jQuery.camelCase(key)];
4415 },
4416 access: function access(owner, key, value) {
4417
4418 // In cases where either:
4419 //
4420 // 1. No key was specified
4421 // 2. A string key was specified, but no value provided
4422 //
4423 // Take the "read" path and allow the get method to determine
4424 // which value to return, respectively either:
4425 //
4426 // 1. The entire cache object
4427 // 2. The data stored at the key
4428 //
4429 if (key === undefined || key && typeof key === "string" && value === undefined) {
4430
4431 return this.get(owner, key);
4432 }
4433
4434 // When the key is not a string, or both a key and value
4435 // are specified, set or extend (existing objects) with either:
4436 //
4437 // 1. An object of properties
4438 // 2. A key and value
4439 //
4440 this.set(owner, key, value);
4441
4442 // Since the "set" path can have two possible entry points
4443 // return the expected data based on which path was taken[*]
4444 return value !== undefined ? value : key;
4445 },
4446 remove: function remove(owner, key) {
4447 var i,
4448 cache = owner[this.expando];
4449
4450 if (cache === undefined) {
4451 return;
4452 }
4453
4454 if (key !== undefined) {
4455
4456 // Support array or space separated string of keys
4457 if (Array.isArray(key)) {
4458
4459 // If key is an array of keys...
4460 // We always set camelCase keys, so remove that.
4461 key = key.map(jQuery.camelCase);
4462 } else {
4463 key = jQuery.camelCase(key);
4464
4465 // If a key with the spaces exists, use it.
4466 // Otherwise, create an array by matching non-whitespace
4467 key = key in cache ? [key] : key.match(rnothtmlwhite) || [];
4468 }
4469
4470 i = key.length;
4471
4472 while (i--) {
4473 delete cache[key[i]];
4474 }
4475 }
4476
4477 // Remove the expando if there's no more data
4478 if (key === undefined || jQuery.isEmptyObject(cache)) {
4479
4480 // Support: Chrome <=35 - 45
4481 // Webkit & Blink performance suffers when deleting properties
4482 // from DOM nodes, so set to undefined instead
4483 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
4484 if (owner.nodeType) {
4485 owner[this.expando] = undefined;
4486 } else {
4487 delete owner[this.expando];
4488 }
4489 }
4490 },
4491 hasData: function hasData(owner) {
4492 var cache = owner[this.expando];
4493 return cache !== undefined && !jQuery.isEmptyObject(cache);
4494 }
4495 };
4496 var dataPriv = new Data();
4497
4498 var dataUser = new Data();
4499
4500 // Implementation Summary
4501 //
4502 // 1. Enforce API surface and semantic compatibility with 1.9.x branch
4503 // 2. Improve the module's maintainability by reducing the storage
4504 // paths to a single mechanism.
4505 // 3. Use the same single mechanism to support "private" and "user" data.
4506 // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
4507 // 5. Avoid exposing implementation details on user objects (eg. expando properties)
4508 // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
4509
4510 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
4511 rmultiDash = /[A-Z]/g;
4512
4513 function getData(data) {
4514 if (data === "true") {
4515 return true;
4516 }
4517
4518 if (data === "false") {
4519 return false;
4520 }
4521
4522 if (data === "null") {
4523 return null;
4524 }
4525
4526 // Only convert to a number if it doesn't change the string
4527 if (data === +data + "") {
4528 return +data;
4529 }
4530
4531 if (rbrace.test(data)) {
4532 return JSON.parse(data);
4533 }
4534
4535 return data;
4536 }
4537
4538 function dataAttr(elem, key, data) {
4539 var name;
4540
4541 // If nothing was found internally, try to fetch any
4542 // data from the HTML5 data-* attribute
4543 if (data === undefined && elem.nodeType === 1) {
4544 name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
4545 data = elem.getAttribute(name);
4546
4547 if (typeof data === "string") {
4548 try {
4549 data = getData(data);
4550 } catch (e) {}
4551
4552 // Make sure we set the data so it isn't changed later
4553 dataUser.set(elem, key, data);
4554 } else {
4555 data = undefined;
4556 }
4557 }
4558 return data;
4559 }
4560
4561 jQuery.extend({
4562 hasData: function hasData(elem) {
4563 return dataUser.hasData(elem) || dataPriv.hasData(elem);
4564 },
4565
4566 data: function data(elem, name, _data) {
4567 return dataUser.access(elem, name, _data);
4568 },
4569
4570 removeData: function removeData(elem, name) {
4571 dataUser.remove(elem, name);
4572 },
4573
4574 // TODO: Now that all calls to _data and _removeData have been replaced
4575 // with direct calls to dataPriv methods, these can be deprecated.
4576 _data: function _data(elem, name, data) {
4577 return dataPriv.access(elem, name, data);
4578 },
4579
4580 _removeData: function _removeData(elem, name) {
4581 dataPriv.remove(elem, name);
4582 }
4583 });
4584
4585 jQuery.fn.extend({
4586 data: function data(key, value) {
4587 var i,
4588 name,
4589 data,
4590 elem = this[0],
4591 attrs = elem && elem.attributes;
4592
4593 // Gets all values
4594 if (key === undefined) {
4595 if (this.length) {
4596 data = dataUser.get(elem);
4597
4598 if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
4599 i = attrs.length;
4600 while (i--) {
4601
4602 // Support: IE 11 only
4603 // The attrs elements can be null (#14894)
4604 if (attrs[i]) {
4605 name = attrs[i].name;
4606 if (name.indexOf("data-") === 0) {
4607 name = jQuery.camelCase(name.slice(5));
4608 dataAttr(elem, name, data[name]);
4609 }
4610 }
4611 }
4612 dataPriv.set(elem, "hasDataAttrs", true);
4613 }
4614 }
4615
4616 return data;
4617 }
4618
4619 // Sets multiple values
4620 if ((typeof key === "undefined" ? "undefined" : _typeof(key)) === "object") {
4621 return this.each(function () {
4622 dataUser.set(this, key);
4623 });
4624 }
4625
4626 return access(this, function (value) {
4627 var data;
4628
4629 // The calling jQuery object (element matches) is not empty
4630 // (and therefore has an element appears at this[ 0 ]) and the
4631 // `value` parameter was not undefined. An empty jQuery object
4632 // will result in `undefined` for elem = this[ 0 ] which will
4633 // throw an exception if an attempt to read a data cache is made.
4634 if (elem && value === undefined) {
4635
4636 // Attempt to get data from the cache
4637 // The key will always be camelCased in Data
4638 data = dataUser.get(elem, key);
4639 if (data !== undefined) {
4640 return data;
4641 }
4642
4643 // Attempt to "discover" the data in
4644 // HTML5 custom data-* attrs
4645 data = dataAttr(elem, key);
4646 if (data !== undefined) {
4647 return data;
4648 }
4649
4650 // We tried really hard, but the data doesn't exist.
4651 return;
4652 }
4653
4654 // Set the data...
4655 this.each(function () {
4656
4657 // We always store the camelCased key
4658 dataUser.set(this, key, value);
4659 });
4660 }, null, value, arguments.length > 1, null, true);
4661 },
4662
4663 removeData: function removeData(key) {
4664 return this.each(function () {
4665 dataUser.remove(this, key);
4666 });
4667 }
4668 });
4669
4670 jQuery.extend({
4671 queue: function queue(elem, type, data) {
4672 var queue;
4673
4674 if (elem) {
4675 type = (type || "fx") + "queue";
4676 queue = dataPriv.get(elem, type);
4677
4678 // Speed up dequeue by getting out quickly if this is just a lookup
4679 if (data) {
4680 if (!queue || Array.isArray(data)) {
4681 queue = dataPriv.access(elem, type, jQuery.makeArray(data));
4682 } else {
4683 queue.push(data);
4684 }
4685 }
4686 return queue || [];
4687 }
4688 },
4689
4690 dequeue: function dequeue(elem, type) {
4691 type = type || "fx";
4692
4693 var queue = jQuery.queue(elem, type),
4694 startLength = queue.length,
4695 fn = queue.shift(),
4696 hooks = jQuery._queueHooks(elem, type),
4697 next = function next() {
4698 jQuery.dequeue(elem, type);
4699 };
4700
4701 // If the fx queue is dequeued, always remove the progress sentinel
4702 if (fn === "inprogress") {
4703 fn = queue.shift();
4704 startLength--;
4705 }
4706
4707 if (fn) {
4708
4709 // Add a progress sentinel to prevent the fx queue from being
4710 // automatically dequeued
4711 if (type === "fx") {
4712 queue.unshift("inprogress");
4713 }
4714
4715 // Clear up the last queue stop function
4716 delete hooks.stop;
4717 fn.call(elem, next, hooks);
4718 }
4719
4720 if (!startLength && hooks) {
4721 hooks.empty.fire();
4722 }
4723 },
4724
4725 // Not public - generate a queueHooks object, or return the current one
4726 _queueHooks: function _queueHooks(elem, type) {
4727 var key = type + "queueHooks";
4728 return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
4729 empty: jQuery.Callbacks("once memory").add(function () {
4730 dataPriv.remove(elem, [type + "queue", key]);
4731 })
4732 });
4733 }
4734 });
4735
4736 jQuery.fn.extend({
4737 queue: function queue(type, data) {
4738 var setter = 2;
4739
4740 if (typeof type !== "string") {
4741 data = type;
4742 type = "fx";
4743 setter--;
4744 }
4745
4746 if (arguments.length < setter) {
4747 return jQuery.queue(this[0], type);
4748 }
4749
4750 return data === undefined ? this : this.each(function () {
4751 var queue = jQuery.queue(this, type, data);
4752
4753 // Ensure a hooks for this queue
4754 jQuery._queueHooks(this, type);
4755
4756 if (type === "fx" && queue[0] !== "inprogress") {
4757 jQuery.dequeue(this, type);
4758 }
4759 });
4760 },
4761 dequeue: function dequeue(type) {
4762 return this.each(function () {
4763 jQuery.dequeue(this, type);
4764 });
4765 },
4766 clearQueue: function clearQueue(type) {
4767 return this.queue(type || "fx", []);
4768 },
4769
4770 // Get a promise resolved when queues of a certain type
4771 // are emptied (fx is the type by default)
4772 promise: function promise(type, obj) {
4773 var tmp,
4774 count = 1,
4775 defer = jQuery.Deferred(),
4776 elements = this,
4777 i = this.length,
4778 resolve = function resolve() {
4779 if (! --count) {
4780 defer.resolveWith(elements, [elements]);
4781 }
4782 };
4783
4784 if (typeof type !== "string") {
4785 obj = type;
4786 type = undefined;
4787 }
4788 type = type || "fx";
4789
4790 while (i--) {
4791 tmp = dataPriv.get(elements[i], type + "queueHooks");
4792 if (tmp && tmp.empty) {
4793 count++;
4794 tmp.empty.add(resolve);
4795 }
4796 }
4797 resolve();
4798 return defer.promise(obj);
4799 }
4800 });
4801 var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
4802
4803 var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
4804
4805 var cssExpand = ["Top", "Right", "Bottom", "Left"];
4806
4807 var isHiddenWithinTree = function isHiddenWithinTree(elem, el) {
4808
4809 // isHiddenWithinTree might be called from jQuery#filter function;
4810 // in that case, element will be second argument
4811 elem = el || elem;
4812
4813 // Inline style trumps all
4814 return elem.style.display === "none" || elem.style.display === "" &&
4815
4816 // Otherwise, check computed style
4817 // Support: Firefox <=43 - 45
4818 // Disconnected elements can have computed display: none, so first confirm that elem is
4819 // in the document.
4820 jQuery.contains(elem.ownerDocument, elem) && jQuery.css(elem, "display") === "none";
4821 };
4822
4823 var swap = function swap(elem, options, callback, args) {
4824 var ret,
4825 name,
4826 old = {};
4827
4828 // Remember the old values, and insert the new ones
4829 for (name in options) {
4830 old[name] = elem.style[name];
4831 elem.style[name] = options[name];
4832 }
4833
4834 ret = callback.apply(elem, args || []);
4835
4836 // Revert the old values
4837 for (name in options) {
4838 elem.style[name] = old[name];
4839 }
4840
4841 return ret;
4842 };
4843
4844 function adjustCSS(elem, prop, valueParts, tween) {
4845 var adjusted,
4846 scale = 1,
4847 maxIterations = 20,
4848 currentValue = tween ? function () {
4849 return tween.cur();
4850 } : function () {
4851 return jQuery.css(elem, prop, "");
4852 },
4853 initial = currentValue(),
4854 unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"),
4855
4856
4857 // Starting value computation is required for potential unit mismatches
4858 initialInUnit = (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
4859
4860 if (initialInUnit && initialInUnit[3] !== unit) {
4861
4862 // Trust units reported by jQuery.css
4863 unit = unit || initialInUnit[3];
4864
4865 // Make sure we update the tween properties later on
4866 valueParts = valueParts || [];
4867
4868 // Iteratively approximate from a nonzero starting point
4869 initialInUnit = +initial || 1;
4870
4871 do {
4872
4873 // If previous iteration zeroed out, double until we get *something*.
4874 // Use string for doubling so we don't accidentally see scale as unchanged below
4875 scale = scale || ".5";
4876
4877 // Adjust and apply
4878 initialInUnit = initialInUnit / scale;
4879 jQuery.style(elem, prop, initialInUnit + unit);
4880
4881 // Update scale, tolerating zero or NaN from tween.cur()
4882 // Break the loop if scale is unchanged or perfect, or if we've just had enough.
4883 } while (scale !== (scale = currentValue() / initial) && scale !== 1 && --maxIterations);
4884 }
4885
4886 if (valueParts) {
4887 initialInUnit = +initialInUnit || +initial || 0;
4888
4889 // Apply relative offset (+=/-=) if specified
4890 adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
4891 if (tween) {
4892 tween.unit = unit;
4893 tween.start = initialInUnit;
4894 tween.end = adjusted;
4895 }
4896 }
4897 return adjusted;
4898 }
4899
4900 var defaultDisplayMap = {};
4901
4902 function getDefaultDisplay(elem) {
4903 var temp,
4904 doc = elem.ownerDocument,
4905 nodeName = elem.nodeName,
4906 display = defaultDisplayMap[nodeName];
4907
4908 if (display) {
4909 return display;
4910 }
4911
4912 temp = doc.body.appendChild(doc.createElement(nodeName));
4913 display = jQuery.css(temp, "display");
4914
4915 temp.parentNode.removeChild(temp);
4916
4917 if (display === "none") {
4918 display = "block";
4919 }
4920 defaultDisplayMap[nodeName] = display;
4921
4922 return display;
4923 }
4924
4925 function showHide(elements, show) {
4926 var display,
4927 elem,
4928 values = [],
4929 index = 0,
4930 length = elements.length;
4931
4932 // Determine new display value for elements that need to change
4933 for (; index < length; index++) {
4934 elem = elements[index];
4935 if (!elem.style) {
4936 continue;
4937 }
4938
4939 display = elem.style.display;
4940 if (show) {
4941
4942 // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
4943 // check is required in this first loop unless we have a nonempty display value (either
4944 // inline or about-to-be-restored)
4945 if (display === "none") {
4946 values[index] = dataPriv.get(elem, "display") || null;
4947 if (!values[index]) {
4948 elem.style.display = "";
4949 }
4950 }
4951 if (elem.style.display === "" && isHiddenWithinTree(elem)) {
4952 values[index] = getDefaultDisplay(elem);
4953 }
4954 } else {
4955 if (display !== "none") {
4956 values[index] = "none";
4957
4958 // Remember what we're overwriting
4959 dataPriv.set(elem, "display", display);
4960 }
4961 }
4962 }
4963
4964 // Set the display of the elements in a second loop to avoid constant reflow
4965 for (index = 0; index < length; index++) {
4966 if (values[index] != null) {
4967 elements[index].style.display = values[index];
4968 }
4969 }
4970
4971 return elements;
4972 }
4973
4974 jQuery.fn.extend({
4975 show: function show() {
4976 return showHide(this, true);
4977 },
4978 hide: function hide() {
4979 return showHide(this);
4980 },
4981 toggle: function toggle(state) {
4982 if (typeof state === "boolean") {
4983 return state ? this.show() : this.hide();
4984 }
4985
4986 return this.each(function () {
4987 if (isHiddenWithinTree(this)) {
4988 jQuery(this).show();
4989 } else {
4990 jQuery(this).hide();
4991 }
4992 });
4993 }
4994 });
4995 var rcheckableType = /^(?:checkbox|radio)$/i;
4996
4997 var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i;
4998
4999 var rscriptType = /^$|\/(?:java|ecma)script/i;
5000
5001 // We have to close these tags to support XHTML (#13200)
5002 var wrapMap = {
5003
5004 // Support: IE <=9 only
5005 option: [1, "<select multiple='multiple'>", "</select>"],
5006
5007 // XHTML parsers do not magically insert elements in the
5008 // same way that tag soup parsers do. So we cannot shorten
5009 // this by omitting <tbody> or other required elements.
5010 thead: [1, "<table>", "</table>"],
5011 col: [2, "<table><colgroup>", "</colgroup></table>"],
5012 tr: [2, "<table><tbody>", "</tbody></table>"],
5013 td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
5014
5015 _default: [0, "", ""]
5016 };
5017
5018 // Support: IE <=9 only
5019 wrapMap.optgroup = wrapMap.option;
5020
5021 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5022 wrapMap.th = wrapMap.td;
5023
5024 function getAll(context, tag) {
5025
5026 // Support: IE <=9 - 11 only
5027 // Use typeof to avoid zero-argument method invocation on host objects (#15151)
5028 var ret;
5029
5030 if (typeof context.getElementsByTagName !== "undefined") {
5031 ret = context.getElementsByTagName(tag || "*");
5032 } else if (typeof context.querySelectorAll !== "undefined") {
5033 ret = context.querySelectorAll(tag || "*");
5034 } else {
5035 ret = [];
5036 }
5037
5038 if (tag === undefined || tag && nodeName(context, tag)) {
5039 return jQuery.merge([context], ret);
5040 }
5041
5042 return ret;
5043 }
5044
5045 // Mark scripts as having already been evaluated
5046 function setGlobalEval(elems, refElements) {
5047 var i = 0,
5048 l = elems.length;
5049
5050 for (; i < l; i++) {
5051 dataPriv.set(elems[i], "globalEval", !refElements || dataPriv.get(refElements[i], "globalEval"));
5052 }
5053 }
5054
5055 var rhtml = /<|&#?\w+;/;
5056
5057 function buildFragment(elems, context, scripts, selection, ignored) {
5058 var elem,
5059 tmp,
5060 tag,
5061 wrap,
5062 contains,
5063 j,
5064 fragment = context.createDocumentFragment(),
5065 nodes = [],
5066 i = 0,
5067 l = elems.length;
5068
5069 for (; i < l; i++) {
5070 elem = elems[i];
5071
5072 if (elem || elem === 0) {
5073
5074 // Add nodes directly
5075 if (jQuery.type(elem) === "object") {
5076
5077 // Support: Android <=4.0 only, PhantomJS 1 only
5078 // push.apply(_, arraylike) throws on ancient WebKit
5079 jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
5080
5081 // Convert non-html into a text node
5082 } else if (!rhtml.test(elem)) {
5083 nodes.push(context.createTextNode(elem));
5084
5085 // Convert html into DOM nodes
5086 } else {
5087 tmp = tmp || fragment.appendChild(context.createElement("div"));
5088
5089 // Deserialize a standard representation
5090 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
5091 wrap = wrapMap[tag] || wrapMap._default;
5092 tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];
5093
5094 // Descend through wrappers to the right content
5095 j = wrap[0];
5096 while (j--) {
5097 tmp = tmp.lastChild;
5098 }
5099
5100 // Support: Android <=4.0 only, PhantomJS 1 only
5101 // push.apply(_, arraylike) throws on ancient WebKit
5102 jQuery.merge(nodes, tmp.childNodes);
5103
5104 // Remember the top-level container
5105 tmp = fragment.firstChild;
5106
5107 // Ensure the created nodes are orphaned (#12392)
5108 tmp.textContent = "";
5109 }
5110 }
5111 }
5112
5113 // Remove wrapper from fragment
5114 fragment.textContent = "";
5115
5116 i = 0;
5117 while (elem = nodes[i++]) {
5118
5119 // Skip elements already in the context collection (trac-4087)
5120 if (selection && jQuery.inArray(elem, selection) > -1) {
5121 if (ignored) {
5122 ignored.push(elem);
5123 }
5124 continue;
5125 }
5126
5127 contains = jQuery.contains(elem.ownerDocument, elem);
5128
5129 // Append to fragment
5130 tmp = getAll(fragment.appendChild(elem), "script");
5131
5132 // Preserve script evaluation history
5133 if (contains) {
5134 setGlobalEval(tmp);
5135 }
5136
5137 // Capture executables
5138 if (scripts) {
5139 j = 0;
5140 while (elem = tmp[j++]) {
5141 if (rscriptType.test(elem.type || "")) {
5142 scripts.push(elem);
5143 }
5144 }
5145 }
5146 }
5147
5148 return fragment;
5149 }
5150
5151 (function () {
5152 var fragment = document.createDocumentFragment(),
5153 div = fragment.appendChild(document.createElement("div")),
5154 input = document.createElement("input");
5155
5156 // Support: Android 4.0 - 4.3 only
5157 // Check state lost if the name is set (#11217)
5158 // Support: Windows Web Apps (WWA)
5159 // `name` and `type` must use .setAttribute for WWA (#14901)
5160 input.setAttribute("type", "radio");
5161 input.setAttribute("checked", "checked");
5162 input.setAttribute("name", "t");
5163
5164 div.appendChild(input);
5165
5166 // Support: Android <=4.1 only
5167 // Older WebKit doesn't clone checked state correctly in fragments
5168 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
5169
5170 // Support: IE <=11 only
5171 // Make sure textarea (and checkbox) defaultValue is properly cloned
5172 div.innerHTML = "<textarea>x</textarea>";
5173 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
5174 })();
5175 var documentElement = document.documentElement;
5176
5177 var rkeyEvent = /^key/,
5178 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
5179 rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5180
5181 function returnTrue() {
5182 return true;
5183 }
5184
5185 function returnFalse() {
5186 return false;
5187 }
5188
5189 // Support: IE <=9 only
5190 // See #13393 for more info
5191 function safeActiveElement() {
5192 try {
5193 return document.activeElement;
5194 } catch (err) {}
5195 }
5196
5197 function _on(elem, types, selector, data, fn, one) {
5198 var origFn, type;
5199
5200 // Types can be a map of types/handlers
5201 if ((typeof types === "undefined" ? "undefined" : _typeof(types)) === "object") {
5202
5203 // ( types-Object, selector, data )
5204 if (typeof selector !== "string") {
5205
5206 // ( types-Object, data )
5207 data = data || selector;
5208 selector = undefined;
5209 }
5210 for (type in types) {
5211 _on(elem, type, selector, data, types[type], one);
5212 }
5213 return elem;
5214 }
5215
5216 if (data == null && fn == null) {
5217
5218 // ( types, fn )
5219 fn = selector;
5220 data = selector = undefined;
5221 } else if (fn == null) {
5222 if (typeof selector === "string") {
5223
5224 // ( types, selector, fn )
5225 fn = data;
5226 data = undefined;
5227 } else {
5228
5229 // ( types, data, fn )
5230 fn = data;
5231 data = selector;
5232 selector = undefined;
5233 }
5234 }
5235 if (fn === false) {
5236 fn = returnFalse;
5237 } else if (!fn) {
5238 return elem;
5239 }
5240
5241 if (one === 1) {
5242 origFn = fn;
5243 fn = function fn(event) {
5244
5245 // Can use an empty set, since event contains the info
5246 jQuery().off(event);
5247 return origFn.apply(this, arguments);
5248 };
5249
5250 // Use same guid so caller can remove using origFn
5251 fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
5252 }
5253 return elem.each(function () {
5254 jQuery.event.add(this, types, fn, data, selector);
5255 });
5256 }
5257
5258 /*
5259 * Helper functions for managing events -- not part of the public interface.
5260 * Props to Dean Edwards' addEvent library for many of the ideas.
5261 */
5262 jQuery.event = {
5263
5264 global: {},
5265
5266 add: function add(elem, types, handler, data, selector) {
5267
5268 var handleObjIn,
5269 eventHandle,
5270 tmp,
5271 events,
5272 t,
5273 handleObj,
5274 special,
5275 handlers,
5276 type,
5277 namespaces,
5278 origType,
5279 elemData = dataPriv.get(elem);
5280
5281 // Don't attach events to noData or text/comment nodes (but allow plain objects)
5282 if (!elemData) {
5283 return;
5284 }
5285
5286 // Caller can pass in an object of custom data in lieu of the handler
5287 if (handler.handler) {
5288 handleObjIn = handler;
5289 handler = handleObjIn.handler;
5290 selector = handleObjIn.selector;
5291 }
5292
5293 // Ensure that invalid selectors throw exceptions at attach time
5294 // Evaluate against documentElement in case elem is a non-element node (e.g., document)
5295 if (selector) {
5296 jQuery.find.matchesSelector(documentElement, selector);
5297 }
5298
5299 // Make sure that the handler has a unique ID, used to find/remove it later
5300 if (!handler.guid) {
5301 handler.guid = jQuery.guid++;
5302 }
5303
5304 // Init the element's event structure and main handler, if this is the first
5305 if (!(events = elemData.events)) {
5306 events = elemData.events = {};
5307 }
5308 if (!(eventHandle = elemData.handle)) {
5309 eventHandle = elemData.handle = function (e) {
5310
5311 // Discard the second event of a jQuery.event.trigger() and
5312 // when an event is called after a page has unloaded
5313 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : undefined;
5314 };
5315 }
5316
5317 // Handle multiple events separated by a space
5318 types = (types || "").match(rnothtmlwhite) || [""];
5319 t = types.length;
5320 while (t--) {
5321 tmp = rtypenamespace.exec(types[t]) || [];
5322 type = origType = tmp[1];
5323 namespaces = (tmp[2] || "").split(".").sort();
5324
5325 // There *must* be a type, no attaching namespace-only handlers
5326 if (!type) {
5327 continue;
5328 }
5329
5330 // If event changes its type, use the special event handlers for the changed type
5331 special = jQuery.event.special[type] || {};
5332
5333 // If selector defined, determine special event api type, otherwise given type
5334 type = (selector ? special.delegateType : special.bindType) || type;
5335
5336 // Update special based on newly reset type
5337 special = jQuery.event.special[type] || {};
5338
5339 // handleObj is passed to all event handlers
5340 handleObj = jQuery.extend({
5341 type: type,
5342 origType: origType,
5343 data: data,
5344 handler: handler,
5345 guid: handler.guid,
5346 selector: selector,
5347 needsContext: selector && jQuery.expr.match.needsContext.test(selector),
5348 namespace: namespaces.join(".")
5349 }, handleObjIn);
5350
5351 // Init the event handler queue if we're the first
5352 if (!(handlers = events[type])) {
5353 handlers = events[type] = [];
5354 handlers.delegateCount = 0;
5355
5356 // Only use addEventListener if the special events handler returns false
5357 if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
5358
5359 if (elem.addEventListener) {
5360 elem.addEventListener(type, eventHandle);
5361 }
5362 }
5363 }
5364
5365 if (special.add) {
5366 special.add.call(elem, handleObj);
5367
5368 if (!handleObj.handler.guid) {
5369 handleObj.handler.guid = handler.guid;
5370 }
5371 }
5372
5373 // Add to the element's handler list, delegates in front
5374 if (selector) {
5375 handlers.splice(handlers.delegateCount++, 0, handleObj);
5376 } else {
5377 handlers.push(handleObj);
5378 }
5379
5380 // Keep track of which events have ever been used, for event optimization
5381 jQuery.event.global[type] = true;
5382 }
5383 },
5384
5385 // Detach an event or set of events from an element
5386 remove: function remove(elem, types, handler, selector, mappedTypes) {
5387
5388 var j,
5389 origCount,
5390 tmp,
5391 events,
5392 t,
5393 handleObj,
5394 special,
5395 handlers,
5396 type,
5397 namespaces,
5398 origType,
5399 elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
5400
5401 if (!elemData || !(events = elemData.events)) {
5402 return;
5403 }
5404
5405 // Once for each type.namespace in types; type may be omitted
5406 types = (types || "").match(rnothtmlwhite) || [""];
5407 t = types.length;
5408 while (t--) {
5409 tmp = rtypenamespace.exec(types[t]) || [];
5410 type = origType = tmp[1];
5411 namespaces = (tmp[2] || "").split(".").sort();
5412
5413 // Unbind all events (on this namespace, if provided) for the element
5414 if (!type) {
5415 for (type in events) {
5416 jQuery.event.remove(elem, type + types[t], handler, selector, true);
5417 }
5418 continue;
5419 }
5420
5421 special = jQuery.event.special[type] || {};
5422 type = (selector ? special.delegateType : special.bindType) || type;
5423 handlers = events[type] || [];
5424 tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
5425
5426 // Remove matching events
5427 origCount = j = handlers.length;
5428 while (j--) {
5429 handleObj = handlers[j];
5430
5431 if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
5432 handlers.splice(j, 1);
5433
5434 if (handleObj.selector) {
5435 handlers.delegateCount--;
5436 }
5437 if (special.remove) {
5438 special.remove.call(elem, handleObj);
5439 }
5440 }
5441 }
5442
5443 // Remove generic event handler if we removed something and no more handlers exist
5444 // (avoids potential for endless recursion during removal of special event handlers)
5445 if (origCount && !handlers.length) {
5446 if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
5447
5448 jQuery.removeEvent(elem, type, elemData.handle);
5449 }
5450
5451 delete events[type];
5452 }
5453 }
5454
5455 // Remove data and the expando if it's no longer used
5456 if (jQuery.isEmptyObject(events)) {
5457 dataPriv.remove(elem, "handle events");
5458 }
5459 },
5460
5461 dispatch: function dispatch(nativeEvent) {
5462
5463 // Make a writable jQuery.Event from the native event object
5464 var event = jQuery.event.fix(nativeEvent);
5465
5466 var i,
5467 j,
5468 ret,
5469 matched,
5470 handleObj,
5471 handlerQueue,
5472 args = new Array(arguments.length),
5473 handlers = (dataPriv.get(this, "events") || {})[event.type] || [],
5474 special = jQuery.event.special[event.type] || {};
5475
5476 // Use the fix-ed jQuery.Event rather than the (read-only) native event
5477 args[0] = event;
5478
5479 for (i = 1; i < arguments.length; i++) {
5480 args[i] = arguments[i];
5481 }
5482
5483 event.delegateTarget = this;
5484
5485 // Call the preDispatch hook for the mapped type, and let it bail if desired
5486 if (special.preDispatch && special.preDispatch.call(this, event) === false) {
5487 return;
5488 }
5489
5490 // Determine handlers
5491 handlerQueue = jQuery.event.handlers.call(this, event, handlers);
5492
5493 // Run delegates first; they may want to stop propagation beneath us
5494 i = 0;
5495 while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
5496 event.currentTarget = matched.elem;
5497
5498 j = 0;
5499 while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
5500
5501 // Triggered event must either 1) have no namespace, or 2) have namespace(s)
5502 // a subset or equal to those in the bound event (both can have no namespace).
5503 if (!event.rnamespace || event.rnamespace.test(handleObj.namespace)) {
5504
5505 event.handleObj = handleObj;
5506 event.data = handleObj.data;
5507
5508 ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
5509
5510 if (ret !== undefined) {
5511 if ((event.result = ret) === false) {
5512 event.preventDefault();
5513 event.stopPropagation();
5514 }
5515 }
5516 }
5517 }
5518 }
5519
5520 // Call the postDispatch hook for the mapped type
5521 if (special.postDispatch) {
5522 special.postDispatch.call(this, event);
5523 }
5524
5525 return event.result;
5526 },
5527
5528 handlers: function handlers(event, _handlers) {
5529 var i,
5530 handleObj,
5531 sel,
5532 matchedHandlers,
5533 matchedSelectors,
5534 handlerQueue = [],
5535 delegateCount = _handlers.delegateCount,
5536 cur = event.target;
5537
5538 // Find delegate handlers
5539 if (delegateCount &&
5540
5541 // Support: IE <=9
5542 // Black-hole SVG <use> instance trees (trac-13180)
5543 cur.nodeType &&
5544
5545 // Support: Firefox <=42
5546 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
5547 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
5548 // Support: IE 11 only
5549 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
5550 !(event.type === "click" && event.button >= 1)) {
5551
5552 for (; cur !== this; cur = cur.parentNode || this) {
5553
5554 // Don't check non-elements (#13208)
5555 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5556 if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) {
5557 matchedHandlers = [];
5558 matchedSelectors = {};
5559 for (i = 0; i < delegateCount; i++) {
5560 handleObj = _handlers[i];
5561
5562 // Don't conflict with Object.prototype properties (#13203)
5563 sel = handleObj.selector + " ";
5564
5565 if (matchedSelectors[sel] === undefined) {
5566 matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
5567 }
5568 if (matchedSelectors[sel]) {
5569 matchedHandlers.push(handleObj);
5570 }
5571 }
5572 if (matchedHandlers.length) {
5573 handlerQueue.push({ elem: cur, handlers: matchedHandlers });
5574 }
5575 }
5576 }
5577 }
5578
5579 // Add the remaining (directly-bound) handlers
5580 cur = this;
5581 if (delegateCount < _handlers.length) {
5582 handlerQueue.push({ elem: cur, handlers: _handlers.slice(delegateCount) });
5583 }
5584
5585 return handlerQueue;
5586 },
5587
5588 addProp: function addProp(name, hook) {
5589 Object.defineProperty(jQuery.Event.prototype, name, {
5590 enumerable: true,
5591 configurable: true,
5592
5593 get: jQuery.isFunction(hook) ? function () {
5594 if (this.originalEvent) {
5595 return hook(this.originalEvent);
5596 }
5597 } : function () {
5598 if (this.originalEvent) {
5599 return this.originalEvent[name];
5600 }
5601 },
5602
5603 set: function set(value) {
5604 Object.defineProperty(this, name, {
5605 enumerable: true,
5606 configurable: true,
5607 writable: true,
5608 value: value
5609 });
5610 }
5611 });
5612 },
5613
5614 fix: function fix(originalEvent) {
5615 return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
5616 },
5617
5618 special: {
5619 load: {
5620
5621 // Prevent triggered image.load events from bubbling to window.load
5622 noBubble: true
5623 },
5624 focus: {
5625
5626 // Fire native event if possible so blur/focus sequence is correct
5627 trigger: function trigger() {
5628 if (this !== safeActiveElement() && this.focus) {
5629 this.focus();
5630 return false;
5631 }
5632 },
5633 delegateType: "focusin"
5634 },
5635 blur: {
5636 trigger: function trigger() {
5637 if (this === safeActiveElement() && this.blur) {
5638 this.blur();
5639 return false;
5640 }
5641 },
5642 delegateType: "focusout"
5643 },
5644 click: {
5645
5646 // For checkbox, fire native event so checked state will be right
5647 trigger: function trigger() {
5648 if (this.type === "checkbox" && this.click && nodeName(this, "input")) {
5649 this.click();
5650 return false;
5651 }
5652 },
5653
5654 // For cross-browser consistency, don't fire native .click() on links
5655 _default: function _default(event) {
5656 return nodeName(event.target, "a");
5657 }
5658 },
5659
5660 beforeunload: {
5661 postDispatch: function postDispatch(event) {
5662
5663 // Support: Firefox 20+
5664 // Firefox doesn't alert if the returnValue field is not set.
5665 if (event.result !== undefined && event.originalEvent) {
5666 event.originalEvent.returnValue = event.result;
5667 }
5668 }
5669 }
5670 }
5671 };
5672
5673 jQuery.removeEvent = function (elem, type, handle) {
5674
5675 // This "if" is needed for plain objects
5676 if (elem.removeEventListener) {
5677 elem.removeEventListener(type, handle);
5678 }
5679 };
5680
5681 jQuery.Event = function (src, props) {
5682
5683 // Allow instantiation without the 'new' keyword
5684 if (!(this instanceof jQuery.Event)) {
5685 return new jQuery.Event(src, props);
5686 }
5687
5688 // Event object
5689 if (src && src.type) {
5690 this.originalEvent = src;
5691 this.type = src.type;
5692
5693 // Events bubbling up the document may have been marked as prevented
5694 // by a handler lower down the tree; reflect the correct value.
5695 this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined &&
5696
5697 // Support: Android <=2.3 only
5698 src.returnValue === false ? returnTrue : returnFalse;
5699
5700 // Create target properties
5701 // Support: Safari <=6 - 7 only
5702 // Target should not be a text node (#504, #13143)
5703 this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
5704
5705 this.currentTarget = src.currentTarget;
5706 this.relatedTarget = src.relatedTarget;
5707
5708 // Event type
5709 } else {
5710 this.type = src;
5711 }
5712
5713 // Put explicitly provided properties onto the event object
5714 if (props) {
5715 jQuery.extend(this, props);
5716 }
5717
5718 // Create a timestamp if incoming event doesn't have one
5719 this.timeStamp = src && src.timeStamp || jQuery.now();
5720
5721 // Mark it as fixed
5722 this[jQuery.expando] = true;
5723 };
5724
5725 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5726 // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5727 jQuery.Event.prototype = {
5728 constructor: jQuery.Event,
5729 isDefaultPrevented: returnFalse,
5730 isPropagationStopped: returnFalse,
5731 isImmediatePropagationStopped: returnFalse,
5732 isSimulated: false,
5733
5734 preventDefault: function preventDefault() {
5735 var e = this.originalEvent;
5736
5737 this.isDefaultPrevented = returnTrue;
5738
5739 if (e && !this.isSimulated) {
5740 e.preventDefault();
5741 }
5742 },
5743 stopPropagation: function stopPropagation() {
5744 var e = this.originalEvent;
5745
5746 this.isPropagationStopped = returnTrue;
5747
5748 if (e && !this.isSimulated) {
5749 e.stopPropagation();
5750 }
5751 },
5752 stopImmediatePropagation: function stopImmediatePropagation() {
5753 var e = this.originalEvent;
5754
5755 this.isImmediatePropagationStopped = returnTrue;
5756
5757 if (e && !this.isSimulated) {
5758 e.stopImmediatePropagation();
5759 }
5760
5761 this.stopPropagation();
5762 }
5763 };
5764
5765 // Includes all common event props including KeyEvent and MouseEvent specific props
5766 jQuery.each({
5767 altKey: true,
5768 bubbles: true,
5769 cancelable: true,
5770 changedTouches: true,
5771 ctrlKey: true,
5772 detail: true,
5773 eventPhase: true,
5774 metaKey: true,
5775 pageX: true,
5776 pageY: true,
5777 shiftKey: true,
5778 view: true,
5779 "char": true,
5780 charCode: true,
5781 key: true,
5782 keyCode: true,
5783 button: true,
5784 buttons: true,
5785 clientX: true,
5786 clientY: true,
5787 offsetX: true,
5788 offsetY: true,
5789 pointerId: true,
5790 pointerType: true,
5791 screenX: true,
5792 screenY: true,
5793 targetTouches: true,
5794 toElement: true,
5795 touches: true,
5796
5797 which: function which(event) {
5798 var button = event.button;
5799
5800 // Add which for key events
5801 if (event.which == null && rkeyEvent.test(event.type)) {
5802 return event.charCode != null ? event.charCode : event.keyCode;
5803 }
5804
5805 // Add which for click: 1 === left; 2 === middle; 3 === right
5806 if (!event.which && button !== undefined && rmouseEvent.test(event.type)) {
5807 if (button & 1) {
5808 return 1;
5809 }
5810
5811 if (button & 2) {
5812 return 3;
5813 }
5814
5815 if (button & 4) {
5816 return 2;
5817 }
5818
5819 return 0;
5820 }
5821
5822 return event.which;
5823 }
5824 }, jQuery.event.addProp);
5825
5826 // Create mouseenter/leave events using mouseover/out and event-time checks
5827 // so that event delegation works in jQuery.
5828 // Do the same for pointerenter/pointerleave and pointerover/pointerout
5829 //
5830 // Support: Safari 7 only
5831 // Safari sends mouseenter too often; see:
5832 // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
5833 // for the description of the bug (it existed in older Chrome versions as well).
5834 jQuery.each({
5835 mouseenter: "mouseover",
5836 mouseleave: "mouseout",
5837 pointerenter: "pointerover",
5838 pointerleave: "pointerout"
5839 }, function (orig, fix) {
5840 jQuery.event.special[orig] = {
5841 delegateType: fix,
5842 bindType: fix,
5843
5844 handle: function handle(event) {
5845 var ret,
5846 target = this,
5847 related = event.relatedTarget,
5848 handleObj = event.handleObj;
5849
5850 // For mouseenter/leave call the handler if related is outside the target.
5851 // NB: No relatedTarget if the mouse left/entered the browser window
5852 if (!related || related !== target && !jQuery.contains(target, related)) {
5853 event.type = handleObj.origType;
5854 ret = handleObj.handler.apply(this, arguments);
5855 event.type = fix;
5856 }
5857 return ret;
5858 }
5859 };
5860 });
5861
5862 jQuery.fn.extend({
5863
5864 on: function on(types, selector, data, fn) {
5865 return _on(this, types, selector, data, fn);
5866 },
5867 one: function one(types, selector, data, fn) {
5868 return _on(this, types, selector, data, fn, 1);
5869 },
5870 off: function off(types, selector, fn) {
5871 var handleObj, type;
5872 if (types && types.preventDefault && types.handleObj) {
5873
5874 // ( event ) dispatched jQuery.Event
5875 handleObj = types.handleObj;
5876 jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler);
5877 return this;
5878 }
5879 if ((typeof types === "undefined" ? "undefined" : _typeof(types)) === "object") {
5880
5881 // ( types-object [, selector] )
5882 for (type in types) {
5883 this.off(type, selector, types[type]);
5884 }
5885 return this;
5886 }
5887 if (selector === false || typeof selector === "function") {
5888
5889 // ( types [, fn] )
5890 fn = selector;
5891 selector = undefined;
5892 }
5893 if (fn === false) {
5894 fn = returnFalse;
5895 }
5896 return this.each(function () {
5897 jQuery.event.remove(this, types, fn, selector);
5898 });
5899 }
5900 });
5901
5902 var
5903
5904 /* eslint-disable max-len */
5905
5906 // See https://github.com/eslint/eslint/issues/3229
5907 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
5908
5909
5910 /* eslint-enable */
5911
5912 // Support: IE <=10 - 11, Edge 12 - 13
5913 // In IE/Edge using regex groups here causes severe slowdowns.
5914 // See https://connect.microsoft.com/IE/feedback/details/1736512/
5915 rnoInnerhtml = /<script|<style|<link/i,
5916
5917
5918 // checked="checked" or checked
5919 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5920 rscriptTypeMasked = /^true\/(.*)/,
5921 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5922
5923 // Prefer a tbody over its parent table for containing new rows
5924 function manipulationTarget(elem, content) {
5925 if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
5926
5927 return jQuery(">tbody", elem)[0] || elem;
5928 }
5929
5930 return elem;
5931 }
5932
5933 // Replace/restore the type attribute of script elements for safe DOM manipulation
5934 function disableScript(elem) {
5935 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
5936 return elem;
5937 }
5938 function restoreScript(elem) {
5939 var match = rscriptTypeMasked.exec(elem.type);
5940
5941 if (match) {
5942 elem.type = match[1];
5943 } else {
5944 elem.removeAttribute("type");
5945 }
5946
5947 return elem;
5948 }
5949
5950 function cloneCopyEvent(src, dest) {
5951 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
5952
5953 if (dest.nodeType !== 1) {
5954 return;
5955 }
5956
5957 // 1. Copy private data: events, handlers, etc.
5958 if (dataPriv.hasData(src)) {
5959 pdataOld = dataPriv.access(src);
5960 pdataCur = dataPriv.set(dest, pdataOld);
5961 events = pdataOld.events;
5962
5963 if (events) {
5964 delete pdataCur.handle;
5965 pdataCur.events = {};
5966
5967 for (type in events) {
5968 for (i = 0, l = events[type].length; i < l; i++) {
5969 jQuery.event.add(dest, type, events[type][i]);
5970 }
5971 }
5972 }
5973 }
5974
5975 // 2. Copy user data
5976 if (dataUser.hasData(src)) {
5977 udataOld = dataUser.access(src);
5978 udataCur = jQuery.extend({}, udataOld);
5979
5980 dataUser.set(dest, udataCur);
5981 }
5982 }
5983
5984 // Fix IE bugs, see support tests
5985 function fixInput(src, dest) {
5986 var nodeName = dest.nodeName.toLowerCase();
5987
5988 // Fails to persist the checked state of a cloned checkbox or radio button.
5989 if (nodeName === "input" && rcheckableType.test(src.type)) {
5990 dest.checked = src.checked;
5991
5992 // Fails to return the selected option to the default selected state when cloning options
5993 } else if (nodeName === "input" || nodeName === "textarea") {
5994 dest.defaultValue = src.defaultValue;
5995 }
5996 }
5997
5998 function domManip(collection, args, callback, ignored) {
5999
6000 // Flatten any nested arrays
6001 args = concat.apply([], args);
6002
6003 var fragment,
6004 first,
6005 scripts,
6006 hasScripts,
6007 node,
6008 doc,
6009 i = 0,
6010 l = collection.length,
6011 iNoClone = l - 1,
6012 value = args[0],
6013 isFunction = jQuery.isFunction(value);
6014
6015 // We can't cloneNode fragments that contain checked, in WebKit
6016 if (isFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
6017 return collection.each(function (index) {
6018 var self = collection.eq(index);
6019 if (isFunction) {
6020 args[0] = value.call(this, index, self.html());
6021 }
6022 domManip(self, args, callback, ignored);
6023 });
6024 }
6025
6026 if (l) {
6027 fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
6028 first = fragment.firstChild;
6029
6030 if (fragment.childNodes.length === 1) {
6031 fragment = first;
6032 }
6033
6034 // Require either new content or an interest in ignored elements to invoke the callback
6035 if (first || ignored) {
6036 scripts = jQuery.map(getAll(fragment, "script"), disableScript);
6037 hasScripts = scripts.length;
6038
6039 // Use the original fragment for the last item
6040 // instead of the first because it can end up
6041 // being emptied incorrectly in certain situations (#8070).
6042 for (; i < l; i++) {
6043 node = fragment;
6044
6045 if (i !== iNoClone) {
6046 node = jQuery.clone(node, true, true);
6047
6048 // Keep references to cloned scripts for later restoration
6049 if (hasScripts) {
6050
6051 // Support: Android <=4.0 only, PhantomJS 1 only
6052 // push.apply(_, arraylike) throws on ancient WebKit
6053 jQuery.merge(scripts, getAll(node, "script"));
6054 }
6055 }
6056
6057 callback.call(collection[i], node, i);
6058 }
6059
6060 if (hasScripts) {
6061 doc = scripts[scripts.length - 1].ownerDocument;
6062
6063 // Reenable scripts
6064 jQuery.map(scripts, restoreScript);
6065
6066 // Evaluate executable scripts on first document insertion
6067 for (i = 0; i < hasScripts; i++) {
6068 node = scripts[i];
6069 if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
6070
6071 if (node.src) {
6072
6073 // Optional AJAX dependency, but won't run scripts if not present
6074 if (jQuery._evalUrl) {
6075 jQuery._evalUrl(node.src);
6076 }
6077 } else {
6078 DOMEval(node.textContent.replace(rcleanScript, ""), doc);
6079 }
6080 }
6081 }
6082 }
6083 }
6084 }
6085
6086 return collection;
6087 }
6088
6089 function _remove(elem, selector, keepData) {
6090 var node,
6091 nodes = selector ? jQuery.filter(selector, elem) : elem,
6092 i = 0;
6093
6094 for (; (node = nodes[i]) != null; i++) {
6095 if (!keepData && node.nodeType === 1) {
6096 jQuery.cleanData(getAll(node));
6097 }
6098
6099 if (node.parentNode) {
6100 if (keepData && jQuery.contains(node.ownerDocument, node)) {
6101 setGlobalEval(getAll(node, "script"));
6102 }
6103 node.parentNode.removeChild(node);
6104 }
6105 }
6106
6107 return elem;
6108 }
6109
6110 jQuery.extend({
6111 htmlPrefilter: function htmlPrefilter(html) {
6112 return html.replace(rxhtmlTag, "<$1></$2>");
6113 },
6114
6115 clone: function clone(elem, dataAndEvents, deepDataAndEvents) {
6116 var i,
6117 l,
6118 srcElements,
6119 destElements,
6120 clone = elem.cloneNode(true),
6121 inPage = jQuery.contains(elem.ownerDocument, elem);
6122
6123 // Fix IE cloning issues
6124 if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
6125
6126 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
6127 destElements = getAll(clone);
6128 srcElements = getAll(elem);
6129
6130 for (i = 0, l = srcElements.length; i < l; i++) {
6131 fixInput(srcElements[i], destElements[i]);
6132 }
6133 }
6134
6135 // Copy the events from the original to the clone
6136 if (dataAndEvents) {
6137 if (deepDataAndEvents) {
6138 srcElements = srcElements || getAll(elem);
6139 destElements = destElements || getAll(clone);
6140
6141 for (i = 0, l = srcElements.length; i < l; i++) {
6142 cloneCopyEvent(srcElements[i], destElements[i]);
6143 }
6144 } else {
6145 cloneCopyEvent(elem, clone);
6146 }
6147 }
6148
6149 // Preserve script evaluation history
6150 destElements = getAll(clone, "script");
6151 if (destElements.length > 0) {
6152 setGlobalEval(destElements, !inPage && getAll(elem, "script"));
6153 }
6154
6155 // Return the cloned set
6156 return clone;
6157 },
6158
6159 cleanData: function cleanData(elems) {
6160 var data,
6161 elem,
6162 type,
6163 special = jQuery.event.special,
6164 i = 0;
6165
6166 for (; (elem = elems[i]) !== undefined; i++) {
6167 if (acceptData(elem)) {
6168 if (data = elem[dataPriv.expando]) {
6169 if (data.events) {
6170 for (type in data.events) {
6171 if (special[type]) {
6172 jQuery.event.remove(elem, type);
6173
6174 // This is a shortcut to avoid jQuery.event.remove's overhead
6175 } else {
6176 jQuery.removeEvent(elem, type, data.handle);
6177 }
6178 }
6179 }
6180
6181 // Support: Chrome <=35 - 45+
6182 // Assign undefined instead of using delete, see Data#remove
6183 elem[dataPriv.expando] = undefined;
6184 }
6185 if (elem[dataUser.expando]) {
6186
6187 // Support: Chrome <=35 - 45+
6188 // Assign undefined instead of using delete, see Data#remove
6189 elem[dataUser.expando] = undefined;
6190 }
6191 }
6192 }
6193 }
6194 });
6195
6196 jQuery.fn.extend({
6197 detach: function detach(selector) {
6198 return _remove(this, selector, true);
6199 },
6200
6201 remove: function remove(selector) {
6202 return _remove(this, selector);
6203 },
6204
6205 text: function text(value) {
6206 return access(this, function (value) {
6207 return value === undefined ? jQuery.text(this) : this.empty().each(function () {
6208 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
6209 this.textContent = value;
6210 }
6211 });
6212 }, null, value, arguments.length);
6213 },
6214
6215 append: function append() {
6216 return domManip(this, arguments, function (elem) {
6217 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
6218 var target = manipulationTarget(this, elem);
6219 target.appendChild(elem);
6220 }
6221 });
6222 },
6223
6224 prepend: function prepend() {
6225 return domManip(this, arguments, function (elem) {
6226 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
6227 var target = manipulationTarget(this, elem);
6228 target.insertBefore(elem, target.firstChild);
6229 }
6230 });
6231 },
6232
6233 before: function before() {
6234 return domManip(this, arguments, function (elem) {
6235 if (this.parentNode) {
6236 this.parentNode.insertBefore(elem, this);
6237 }
6238 });
6239 },
6240
6241 after: function after() {
6242 return domManip(this, arguments, function (elem) {
6243 if (this.parentNode) {
6244 this.parentNode.insertBefore(elem, this.nextSibling);
6245 }
6246 });
6247 },
6248
6249 empty: function empty() {
6250 var elem,
6251 i = 0;
6252
6253 for (; (elem = this[i]) != null; i++) {
6254 if (elem.nodeType === 1) {
6255
6256 // Prevent memory leaks
6257 jQuery.cleanData(getAll(elem, false));
6258
6259 // Remove any remaining nodes
6260 elem.textContent = "";
6261 }
6262 }
6263
6264 return this;
6265 },
6266
6267 clone: function clone(dataAndEvents, deepDataAndEvents) {
6268 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6269 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6270
6271 return this.map(function () {
6272 return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
6273 });
6274 },
6275
6276 html: function html(value) {
6277 return access(this, function (value) {
6278 var elem = this[0] || {},
6279 i = 0,
6280 l = this.length;
6281
6282 if (value === undefined && elem.nodeType === 1) {
6283 return elem.innerHTML;
6284 }
6285
6286 // See if we can take a shortcut and just use innerHTML
6287 if (typeof value === "string" && !rnoInnerhtml.test(value) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
6288
6289 value = jQuery.htmlPrefilter(value);
6290
6291 try {
6292 for (; i < l; i++) {
6293 elem = this[i] || {};
6294
6295 // Remove element nodes and prevent memory leaks
6296 if (elem.nodeType === 1) {
6297 jQuery.cleanData(getAll(elem, false));
6298 elem.innerHTML = value;
6299 }
6300 }
6301
6302 elem = 0;
6303
6304 // If using innerHTML throws an exception, use the fallback method
6305 } catch (e) {}
6306 }
6307
6308 if (elem) {
6309 this.empty().append(value);
6310 }
6311 }, null, value, arguments.length);
6312 },
6313
6314 replaceWith: function replaceWith() {
6315 var ignored = [];
6316
6317 // Make the changes, replacing each non-ignored context element with the new content
6318 return domManip(this, arguments, function (elem) {
6319 var parent = this.parentNode;
6320
6321 if (jQuery.inArray(this, ignored) < 0) {
6322 jQuery.cleanData(getAll(this));
6323 if (parent) {
6324 parent.replaceChild(elem, this);
6325 }
6326 }
6327
6328 // Force callback invocation
6329 }, ignored);
6330 }
6331 });
6332
6333 jQuery.each({
6334 appendTo: "append",
6335 prependTo: "prepend",
6336 insertBefore: "before",
6337 insertAfter: "after",
6338 replaceAll: "replaceWith"
6339 }, function (name, original) {
6340 jQuery.fn[name] = function (selector) {
6341 var elems,
6342 ret = [],
6343 insert = jQuery(selector),
6344 last = insert.length - 1,
6345 i = 0;
6346
6347 for (; i <= last; i++) {
6348 elems = i === last ? this : this.clone(true);
6349 jQuery(insert[i])[original](elems);
6350
6351 // Support: Android <=4.0 only, PhantomJS 1 only
6352 // .get() because push.apply(_, arraylike) throws on ancient WebKit
6353 push.apply(ret, elems.get());
6354 }
6355
6356 return this.pushStack(ret);
6357 };
6358 });
6359 var rmargin = /^margin/;
6360
6361 var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
6362
6363 var getStyles = function getStyles(elem) {
6364
6365 // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6366 // IE throws on elements created in popups
6367 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6368 var view = elem.ownerDocument.defaultView;
6369
6370 if (!view || !view.opener) {
6371 view = window;
6372 }
6373
6374 return view.getComputedStyle(elem);
6375 };
6376
6377 (function () {
6378
6379 // Executing both pixelPosition & boxSizingReliable tests require only one layout
6380 // so they're executed at the same time to save the second computation.
6381 function computeStyleTests() {
6382
6383 // This is a singleton, we need to execute it only once
6384 if (!div) {
6385 return;
6386 }
6387
6388 div.style.cssText = "box-sizing:border-box;" + "position:relative;display:block;" + "margin:auto;border:1px;padding:1px;" + "top:1%;width:50%";
6389 div.innerHTML = "";
6390 documentElement.appendChild(container);
6391
6392 var divStyle = window.getComputedStyle(div);
6393 pixelPositionVal = divStyle.top !== "1%";
6394
6395 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
6396 reliableMarginLeftVal = divStyle.marginLeft === "2px";
6397 boxSizingReliableVal = divStyle.width === "4px";
6398
6399 // Support: Android 4.0 - 4.3 only
6400 // Some styles come back with percentage values, even though they shouldn't
6401 div.style.marginRight = "50%";
6402 pixelMarginRightVal = divStyle.marginRight === "4px";
6403
6404 documentElement.removeChild(container);
6405
6406 // Nullify the div so it wouldn't be stored in the memory and
6407 // it will also be a sign that checks already performed
6408 div = null;
6409 }
6410
6411 var pixelPositionVal,
6412 boxSizingReliableVal,
6413 pixelMarginRightVal,
6414 reliableMarginLeftVal,
6415 container = document.createElement("div"),
6416 div = document.createElement("div");
6417
6418 // Finish early in limited (non-browser) environments
6419 if (!div.style) {
6420 return;
6421 }
6422
6423 // Support: IE <=9 - 11 only
6424 // Style of cloned element affects source element cloned (#8908)
6425 div.style.backgroundClip = "content-box";
6426 div.cloneNode(true).style.backgroundClip = "";
6427 support.clearCloneStyle = div.style.backgroundClip === "content-box";
6428
6429 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + "padding:0;margin-top:1px;position:absolute";
6430 container.appendChild(div);
6431
6432 jQuery.extend(support, {
6433 pixelPosition: function pixelPosition() {
6434 computeStyleTests();
6435 return pixelPositionVal;
6436 },
6437 boxSizingReliable: function boxSizingReliable() {
6438 computeStyleTests();
6439 return boxSizingReliableVal;
6440 },
6441 pixelMarginRight: function pixelMarginRight() {
6442 computeStyleTests();
6443 return pixelMarginRightVal;
6444 },
6445 reliableMarginLeft: function reliableMarginLeft() {
6446 computeStyleTests();
6447 return reliableMarginLeftVal;
6448 }
6449 });
6450 })();
6451
6452 function curCSS(elem, name, computed) {
6453 var width,
6454 minWidth,
6455 maxWidth,
6456 ret,
6457
6458
6459 // Support: Firefox 51+
6460 // Retrieving style before computed somehow
6461 // fixes an issue with getting wrong values
6462 // on detached elements
6463 style = elem.style;
6464
6465 computed = computed || getStyles(elem);
6466
6467 // getPropertyValue is needed for:
6468 // .css('filter') (IE 9 only, #12537)
6469 // .css('--customProperty) (#3144)
6470 if (computed) {
6471 ret = computed.getPropertyValue(name) || computed[name];
6472
6473 if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {
6474 ret = jQuery.style(elem, name);
6475 }
6476
6477 // A tribute to the "awesome hack by Dean Edwards"
6478 // Android Browser returns percentage for some values,
6479 // but width seems to be reliably pixels.
6480 // This is against the CSSOM draft spec:
6481 // https://drafts.csswg.org/cssom/#resolved-values
6482 if (!support.pixelMarginRight() && rnumnonpx.test(ret) && rmargin.test(name)) {
6483
6484 // Remember the original values
6485 width = style.width;
6486 minWidth = style.minWidth;
6487 maxWidth = style.maxWidth;
6488
6489 // Put in the new values to get a computed value out
6490 style.minWidth = style.maxWidth = style.width = ret;
6491 ret = computed.width;
6492
6493 // Revert the changed values
6494 style.width = width;
6495 style.minWidth = minWidth;
6496 style.maxWidth = maxWidth;
6497 }
6498 }
6499
6500 return ret !== undefined ?
6501
6502 // Support: IE <=9 - 11 only
6503 // IE returns zIndex value as an integer.
6504 ret + "" : ret;
6505 }
6506
6507 function addGetHookIf(conditionFn, hookFn) {
6508
6509 // Define the hook, we'll check on the first run if it's really needed.
6510 return {
6511 get: function get() {
6512 if (conditionFn()) {
6513
6514 // Hook not needed (or it's not possible to use it due
6515 // to missing dependency), remove it.
6516 delete this.get;
6517 return;
6518 }
6519
6520 // Hook needed; redefine it so that the support test is not executed again.
6521 return (this.get = hookFn).apply(this, arguments);
6522 }
6523 };
6524 }
6525
6526 var
6527
6528 // Swappable if display is none or starts with table
6529 // except "table", "table-cell", or "table-caption"
6530 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6531 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6532 rcustomProp = /^--/,
6533 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6534 cssNormalTransform = {
6535 letterSpacing: "0",
6536 fontWeight: "400"
6537 },
6538 cssPrefixes = ["Webkit", "Moz", "ms"],
6539 emptyStyle = document.createElement("div").style;
6540
6541 // Return a css property mapped to a potentially vendor prefixed property
6542 function vendorPropName(name) {
6543
6544 // Shortcut for names that are not vendor prefixed
6545 if (name in emptyStyle) {
6546 return name;
6547 }
6548
6549 // Check for vendor prefixed names
6550 var capName = name[0].toUpperCase() + name.slice(1),
6551 i = cssPrefixes.length;
6552
6553 while (i--) {
6554 name = cssPrefixes[i] + capName;
6555 if (name in emptyStyle) {
6556 return name;
6557 }
6558 }
6559 }
6560
6561 // Return a property mapped along what jQuery.cssProps suggests or to
6562 // a vendor prefixed property.
6563 function finalPropName(name) {
6564 var ret = jQuery.cssProps[name];
6565 if (!ret) {
6566 ret = jQuery.cssProps[name] = vendorPropName(name) || name;
6567 }
6568 return ret;
6569 }
6570
6571 function setPositiveNumber(elem, value, subtract) {
6572
6573 // Any relative (+/-) values have already been
6574 // normalized at this point
6575 var matches = rcssNum.exec(value);
6576 return matches ?
6577
6578 // Guard against undefined "subtract", e.g., when used as in cssHooks
6579 Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") : value;
6580 }
6581
6582 function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
6583 var i,
6584 val = 0;
6585
6586 // If we already have the right measurement, avoid augmentation
6587 if (extra === (isBorderBox ? "border" : "content")) {
6588 i = 4;
6589
6590 // Otherwise initialize for horizontal or vertical properties
6591 } else {
6592 i = name === "width" ? 1 : 0;
6593 }
6594
6595 for (; i < 4; i += 2) {
6596
6597 // Both box models exclude margin, so add it if we want it
6598 if (extra === "margin") {
6599 val += jQuery.css(elem, extra + cssExpand[i], true, styles);
6600 }
6601
6602 if (isBorderBox) {
6603
6604 // border-box includes padding, so remove it if we want content
6605 if (extra === "content") {
6606 val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
6607 }
6608
6609 // At this point, extra isn't border nor margin, so remove border
6610 if (extra !== "margin") {
6611 val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
6612 }
6613 } else {
6614
6615 // At this point, extra isn't content, so add padding
6616 val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
6617
6618 // At this point, extra isn't content nor padding, so add border
6619 if (extra !== "padding") {
6620 val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
6621 }
6622 }
6623 }
6624
6625 return val;
6626 }
6627
6628 function getWidthOrHeight(elem, name, extra) {
6629
6630 // Start with computed style
6631 var valueIsBorderBox,
6632 styles = getStyles(elem),
6633 val = curCSS(elem, name, styles),
6634 isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
6635
6636 // Computed unit is not pixels. Stop here and return.
6637 if (rnumnonpx.test(val)) {
6638 return val;
6639 }
6640
6641 // Check for style in case a browser which returns unreliable values
6642 // for getComputedStyle silently falls back to the reliable elem.style
6643 valueIsBorderBox = isBorderBox && (support.boxSizingReliable() || val === elem.style[name]);
6644
6645 // Fall back to offsetWidth/Height when value is "auto"
6646 // This happens for inline elements with no explicit setting (gh-3571)
6647 if (val === "auto") {
6648 val = elem["offset" + name[0].toUpperCase() + name.slice(1)];
6649 }
6650
6651 // Normalize "", auto, and prepare for extra
6652 val = parseFloat(val) || 0;
6653
6654 // Use the active box-sizing model to add/subtract irrelevant styles
6655 return val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles) + "px";
6656 }
6657
6658 jQuery.extend({
6659
6660 // Add in style property hooks for overriding the default
6661 // behavior of getting and setting a style property
6662 cssHooks: {
6663 opacity: {
6664 get: function get(elem, computed) {
6665 if (computed) {
6666
6667 // We should always get a number back from opacity
6668 var ret = curCSS(elem, "opacity");
6669 return ret === "" ? "1" : ret;
6670 }
6671 }
6672 }
6673 },
6674
6675 // Don't automatically add "px" to these possibly-unitless properties
6676 cssNumber: {
6677 "animationIterationCount": true,
6678 "columnCount": true,
6679 "fillOpacity": true,
6680 "flexGrow": true,
6681 "flexShrink": true,
6682 "fontWeight": true,
6683 "lineHeight": true,
6684 "opacity": true,
6685 "order": true,
6686 "orphans": true,
6687 "widows": true,
6688 "zIndex": true,
6689 "zoom": true
6690 },
6691
6692 // Add in properties whose names you wish to fix before
6693 // setting or getting the value
6694 cssProps: {
6695 "float": "cssFloat"
6696 },
6697
6698 // Get and set the style property on a DOM Node
6699 style: function style(elem, name, value, extra) {
6700
6701 // Don't set styles on text and comment nodes
6702 if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
6703 return;
6704 }
6705
6706 // Make sure that we're working with the right name
6707 var ret,
6708 type,
6709 hooks,
6710 origName = jQuery.camelCase(name),
6711 isCustomProp = rcustomProp.test(name),
6712 style = elem.style;
6713
6714 // Make sure that we're working with the right name. We don't
6715 // want to query the value if it is a CSS custom property
6716 // since they are user-defined.
6717 if (!isCustomProp) {
6718 name = finalPropName(origName);
6719 }
6720
6721 // Gets hook for the prefixed version, then unprefixed version
6722 hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
6723
6724 // Check if we're setting a value
6725 if (value !== undefined) {
6726 type = typeof value === "undefined" ? "undefined" : _typeof(value);
6727
6728 // Convert "+=" or "-=" to relative numbers (#7345)
6729 if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
6730 value = adjustCSS(elem, name, ret);
6731
6732 // Fixes bug #9237
6733 type = "number";
6734 }
6735
6736 // Make sure that null and NaN values aren't set (#7116)
6737 if (value == null || value !== value) {
6738 return;
6739 }
6740
6741 // If a number was passed in, add the unit (except for certain CSS properties)
6742 if (type === "number") {
6743 value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
6744 }
6745
6746 // background-* props affect original clone's values
6747 if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
6748 style[name] = "inherit";
6749 }
6750
6751 // If a hook was provided, use that value, otherwise just set the specified value
6752 if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
6753
6754 if (isCustomProp) {
6755 style.setProperty(name, value);
6756 } else {
6757 style[name] = value;
6758 }
6759 }
6760 } else {
6761
6762 // If a hook was provided get the non-computed value from there
6763 if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
6764
6765 return ret;
6766 }
6767
6768 // Otherwise just get the value from the style object
6769 return style[name];
6770 }
6771 },
6772
6773 css: function css(elem, name, extra, styles) {
6774 var val,
6775 num,
6776 hooks,
6777 origName = jQuery.camelCase(name),
6778 isCustomProp = rcustomProp.test(name);
6779
6780 // Make sure that we're working with the right name. We don't
6781 // want to modify the value if it is a CSS custom property
6782 // since they are user-defined.
6783 if (!isCustomProp) {
6784 name = finalPropName(origName);
6785 }
6786
6787 // Try prefixed name followed by the unprefixed name
6788 hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
6789
6790 // If a hook was provided get the computed value from there
6791 if (hooks && "get" in hooks) {
6792 val = hooks.get(elem, true, extra);
6793 }
6794
6795 // Otherwise, if a way to get the computed value exists, use that
6796 if (val === undefined) {
6797 val = curCSS(elem, name, styles);
6798 }
6799
6800 // Convert "normal" to computed value
6801 if (val === "normal" && name in cssNormalTransform) {
6802 val = cssNormalTransform[name];
6803 }
6804
6805 // Make numeric if forced or a qualifier was provided and val looks numeric
6806 if (extra === "" || extra) {
6807 num = parseFloat(val);
6808 return extra === true || isFinite(num) ? num || 0 : val;
6809 }
6810
6811 return val;
6812 }
6813 });
6814
6815 jQuery.each(["height", "width"], function (i, name) {
6816 jQuery.cssHooks[name] = {
6817 get: function get(elem, computed, extra) {
6818 if (computed) {
6819
6820 // Certain elements can have dimension info if we invisibly show them
6821 // but it must have a current display style that would benefit
6822 return rdisplayswap.test(jQuery.css(elem, "display")) && (
6823
6824 // Support: Safari 8+
6825 // Table columns in Safari have non-zero offsetWidth & zero
6826 // getBoundingClientRect().width unless display is changed.
6827 // Support: IE <=11 only
6828 // Running getBoundingClientRect on a disconnected node
6829 // in IE throws an error.
6830 !elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function () {
6831 return getWidthOrHeight(elem, name, extra);
6832 }) : getWidthOrHeight(elem, name, extra);
6833 }
6834 },
6835
6836 set: function set(elem, value, extra) {
6837 var matches,
6838 styles = extra && getStyles(elem),
6839 subtract = extra && augmentWidthOrHeight(elem, name, extra, jQuery.css(elem, "boxSizing", false, styles) === "border-box", styles);
6840
6841 // Convert to pixels if value adjustment is needed
6842 if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
6843
6844 elem.style[name] = value;
6845 value = jQuery.css(elem, name);
6846 }
6847
6848 return setPositiveNumber(elem, value, subtract);
6849 }
6850 };
6851 });
6852
6853 jQuery.cssHooks.marginLeft = addGetHookIf(support.reliableMarginLeft, function (elem, computed) {
6854 if (computed) {
6855 return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function () {
6856 return elem.getBoundingClientRect().left;
6857 })) + "px";
6858 }
6859 });
6860
6861 // These hooks are used by animate to expand properties
6862 jQuery.each({
6863 margin: "",
6864 padding: "",
6865 border: "Width"
6866 }, function (prefix, suffix) {
6867 jQuery.cssHooks[prefix + suffix] = {
6868 expand: function expand(value) {
6869 var i = 0,
6870 expanded = {},
6871
6872
6873 // Assumes a single number if not a string
6874 parts = typeof value === "string" ? value.split(" ") : [value];
6875
6876 for (; i < 4; i++) {
6877 expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0];
6878 }
6879
6880 return expanded;
6881 }
6882 };
6883
6884 if (!rmargin.test(prefix)) {
6885 jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
6886 }
6887 });
6888
6889 jQuery.fn.extend({
6890 css: function css(name, value) {
6891 return access(this, function (elem, name, value) {
6892 var styles,
6893 len,
6894 map = {},
6895 i = 0;
6896
6897 if (Array.isArray(name)) {
6898 styles = getStyles(elem);
6899 len = name.length;
6900
6901 for (; i < len; i++) {
6902 map[name[i]] = jQuery.css(elem, name[i], false, styles);
6903 }
6904
6905 return map;
6906 }
6907
6908 return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name);
6909 }, name, value, arguments.length > 1);
6910 }
6911 });
6912
6913 function Tween(elem, options, prop, end, easing) {
6914 return new Tween.prototype.init(elem, options, prop, end, easing);
6915 }
6916 jQuery.Tween = Tween;
6917
6918 Tween.prototype = {
6919 constructor: Tween,
6920 init: function init(elem, options, prop, end, easing, unit) {
6921 this.elem = elem;
6922 this.prop = prop;
6923 this.easing = easing || jQuery.easing._default;
6924 this.options = options;
6925 this.start = this.now = this.cur();
6926 this.end = end;
6927 this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
6928 },
6929 cur: function cur() {
6930 var hooks = Tween.propHooks[this.prop];
6931
6932 return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
6933 },
6934 run: function run(percent) {
6935 var eased,
6936 hooks = Tween.propHooks[this.prop];
6937
6938 if (this.options.duration) {
6939 this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration);
6940 } else {
6941 this.pos = eased = percent;
6942 }
6943 this.now = (this.end - this.start) * eased + this.start;
6944
6945 if (this.options.step) {
6946 this.options.step.call(this.elem, this.now, this);
6947 }
6948
6949 if (hooks && hooks.set) {
6950 hooks.set(this);
6951 } else {
6952 Tween.propHooks._default.set(this);
6953 }
6954 return this;
6955 }
6956 };
6957
6958 Tween.prototype.init.prototype = Tween.prototype;
6959
6960 Tween.propHooks = {
6961 _default: {
6962 get: function get(tween) {
6963 var result;
6964
6965 // Use a property on the element directly when it is not a DOM element,
6966 // or when there is no matching style property that exists.
6967 if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
6968 return tween.elem[tween.prop];
6969 }
6970
6971 // Passing an empty string as a 3rd parameter to .css will automatically
6972 // attempt a parseFloat and fallback to a string if the parse fails.
6973 // Simple values such as "10px" are parsed to Float;
6974 // complex values such as "rotate(1rad)" are returned as-is.
6975 result = jQuery.css(tween.elem, tween.prop, "");
6976
6977 // Empty strings, null, undefined and "auto" are converted to 0.
6978 return !result || result === "auto" ? 0 : result;
6979 },
6980 set: function set(tween) {
6981
6982 // Use step hook for back compat.
6983 // Use cssHook if its there.
6984 // Use .style if available and use plain properties where available.
6985 if (jQuery.fx.step[tween.prop]) {
6986 jQuery.fx.step[tween.prop](tween);
6987 } else if (tween.elem.nodeType === 1 && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) {
6988 jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
6989 } else {
6990 tween.elem[tween.prop] = tween.now;
6991 }
6992 }
6993 }
6994 };
6995
6996 // Support: IE <=9 only
6997 // Panic based approach to setting things on disconnected nodes
6998 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
6999 set: function set(tween) {
7000 if (tween.elem.nodeType && tween.elem.parentNode) {
7001 tween.elem[tween.prop] = tween.now;
7002 }
7003 }
7004 };
7005
7006 jQuery.easing = {
7007 linear: function linear(p) {
7008 return p;
7009 },
7010 swing: function swing(p) {
7011 return 0.5 - Math.cos(p * Math.PI) / 2;
7012 },
7013 _default: "swing"
7014 };
7015
7016 jQuery.fx = Tween.prototype.init;
7017
7018 // Back compat <1.8 extension point
7019 jQuery.fx.step = {};
7020
7021 var fxNow,
7022 inProgress,
7023 rfxtypes = /^(?:toggle|show|hide)$/,
7024 rrun = /queueHooks$/;
7025
7026 function schedule() {
7027 if (inProgress) {
7028 if (document.hidden === false && window.requestAnimationFrame) {
7029 window.requestAnimationFrame(schedule);
7030 } else {
7031 window.setTimeout(schedule, jQuery.fx.interval);
7032 }
7033
7034 jQuery.fx.tick();
7035 }
7036 }
7037
7038 // Animations created synchronously will run synchronously
7039 function createFxNow() {
7040 window.setTimeout(function () {
7041 fxNow = undefined;
7042 });
7043 return fxNow = jQuery.now();
7044 }
7045
7046 // Generate parameters to create a standard animation
7047 function genFx(type, includeWidth) {
7048 var which,
7049 i = 0,
7050 attrs = { height: type };
7051
7052 // If we include width, step value is 1 to do all cssExpand values,
7053 // otherwise step value is 2 to skip over Left and Right
7054 includeWidth = includeWidth ? 1 : 0;
7055 for (; i < 4; i += 2 - includeWidth) {
7056 which = cssExpand[i];
7057 attrs["margin" + which] = attrs["padding" + which] = type;
7058 }
7059
7060 if (includeWidth) {
7061 attrs.opacity = attrs.width = type;
7062 }
7063
7064 return attrs;
7065 }
7066
7067 function createTween(value, prop, animation) {
7068 var tween,
7069 collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]),
7070 index = 0,
7071 length = collection.length;
7072 for (; index < length; index++) {
7073 if (tween = collection[index].call(animation, prop, value)) {
7074
7075 // We're done with this property
7076 return tween;
7077 }
7078 }
7079 }
7080
7081 function defaultPrefilter(elem, props, opts) {
7082 var prop,
7083 value,
7084 toggle,
7085 hooks,
7086 oldfire,
7087 propTween,
7088 restoreDisplay,
7089 display,
7090 isBox = "width" in props || "height" in props,
7091 anim = this,
7092 orig = {},
7093 style = elem.style,
7094 hidden = elem.nodeType && isHiddenWithinTree(elem),
7095 dataShow = dataPriv.get(elem, "fxshow");
7096
7097 // Queue-skipping animations hijack the fx hooks
7098 if (!opts.queue) {
7099 hooks = jQuery._queueHooks(elem, "fx");
7100 if (hooks.unqueued == null) {
7101 hooks.unqueued = 0;
7102 oldfire = hooks.empty.fire;
7103 hooks.empty.fire = function () {
7104 if (!hooks.unqueued) {
7105 oldfire();
7106 }
7107 };
7108 }
7109 hooks.unqueued++;
7110
7111 anim.always(function () {
7112
7113 // Ensure the complete handler is called before this completes
7114 anim.always(function () {
7115 hooks.unqueued--;
7116 if (!jQuery.queue(elem, "fx").length) {
7117 hooks.empty.fire();
7118 }
7119 });
7120 });
7121 }
7122
7123 // Detect show/hide animations
7124 for (prop in props) {
7125 value = props[prop];
7126 if (rfxtypes.test(value)) {
7127 delete props[prop];
7128 toggle = toggle || value === "toggle";
7129 if (value === (hidden ? "hide" : "show")) {
7130
7131 // Pretend to be hidden if this is a "show" and
7132 // there is still data from a stopped show/hide
7133 if (value === "show" && dataShow && dataShow[prop] !== undefined) {
7134 hidden = true;
7135
7136 // Ignore all other no-op show/hide data
7137 } else {
7138 continue;
7139 }
7140 }
7141 orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
7142 }
7143 }
7144
7145 // Bail out if this is a no-op like .hide().hide()
7146 propTween = !jQuery.isEmptyObject(props);
7147 if (!propTween && jQuery.isEmptyObject(orig)) {
7148 return;
7149 }
7150
7151 // Restrict "overflow" and "display" styles during box animations
7152 if (isBox && elem.nodeType === 1) {
7153
7154 // Support: IE <=9 - 11, Edge 12 - 13
7155 // Record all 3 overflow attributes because IE does not infer the shorthand
7156 // from identically-valued overflowX and overflowY
7157 opts.overflow = [style.overflow, style.overflowX, style.overflowY];
7158
7159 // Identify a display type, preferring old show/hide data over the CSS cascade
7160 restoreDisplay = dataShow && dataShow.display;
7161 if (restoreDisplay == null) {
7162 restoreDisplay = dataPriv.get(elem, "display");
7163 }
7164 display = jQuery.css(elem, "display");
7165 if (display === "none") {
7166 if (restoreDisplay) {
7167 display = restoreDisplay;
7168 } else {
7169
7170 // Get nonempty value(s) by temporarily forcing visibility
7171 showHide([elem], true);
7172 restoreDisplay = elem.style.display || restoreDisplay;
7173 display = jQuery.css(elem, "display");
7174 showHide([elem]);
7175 }
7176 }
7177
7178 // Animate inline elements as inline-block
7179 if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
7180 if (jQuery.css(elem, "float") === "none") {
7181
7182 // Restore the original display value at the end of pure show/hide animations
7183 if (!propTween) {
7184 anim.done(function () {
7185 style.display = restoreDisplay;
7186 });
7187 if (restoreDisplay == null) {
7188 display = style.display;
7189 restoreDisplay = display === "none" ? "" : display;
7190 }
7191 }
7192 style.display = "inline-block";
7193 }
7194 }
7195 }
7196
7197 if (opts.overflow) {
7198 style.overflow = "hidden";
7199 anim.always(function () {
7200 style.overflow = opts.overflow[0];
7201 style.overflowX = opts.overflow[1];
7202 style.overflowY = opts.overflow[2];
7203 });
7204 }
7205
7206 // Implement show/hide animations
7207 propTween = false;
7208 for (prop in orig) {
7209
7210 // General show/hide setup for this element animation
7211 if (!propTween) {
7212 if (dataShow) {
7213 if ("hidden" in dataShow) {
7214 hidden = dataShow.hidden;
7215 }
7216 } else {
7217 dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay });
7218 }
7219
7220 // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
7221 if (toggle) {
7222 dataShow.hidden = !hidden;
7223 }
7224
7225 // Show elements before animating them
7226 if (hidden) {
7227 showHide([elem], true);
7228 }
7229
7230 /* eslint-disable no-loop-func */
7231
7232 anim.done(function () {
7233
7234 /* eslint-enable no-loop-func */
7235
7236 // The final step of a "hide" animation is actually hiding the element
7237 if (!hidden) {
7238 showHide([elem]);
7239 }
7240 dataPriv.remove(elem, "fxshow");
7241 for (prop in orig) {
7242 jQuery.style(elem, prop, orig[prop]);
7243 }
7244 });
7245 }
7246
7247 // Per-property setup
7248 propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
7249 if (!(prop in dataShow)) {
7250 dataShow[prop] = propTween.start;
7251 if (hidden) {
7252 propTween.end = propTween.start;
7253 propTween.start = 0;
7254 }
7255 }
7256 }
7257 }
7258
7259 function propFilter(props, specialEasing) {
7260 var index, name, easing, value, hooks;
7261
7262 // camelCase, specialEasing and expand cssHook pass
7263 for (index in props) {
7264 name = jQuery.camelCase(index);
7265 easing = specialEasing[name];
7266 value = props[index];
7267 if (Array.isArray(value)) {
7268 easing = value[1];
7269 value = props[index] = value[0];
7270 }
7271
7272 if (index !== name) {
7273 props[name] = value;
7274 delete props[index];
7275 }
7276
7277 hooks = jQuery.cssHooks[name];
7278 if (hooks && "expand" in hooks) {
7279 value = hooks.expand(value);
7280 delete props[name];
7281
7282 // Not quite $.extend, this won't overwrite existing keys.
7283 // Reusing 'index' because we have the correct "name"
7284 for (index in value) {
7285 if (!(index in props)) {
7286 props[index] = value[index];
7287 specialEasing[index] = easing;
7288 }
7289 }
7290 } else {
7291 specialEasing[name] = easing;
7292 }
7293 }
7294 }
7295
7296 function Animation(elem, properties, options) {
7297 var result,
7298 stopped,
7299 index = 0,
7300 length = Animation.prefilters.length,
7301 deferred = jQuery.Deferred().always(function () {
7302
7303 // Don't match elem in the :animated selector
7304 delete tick.elem;
7305 }),
7306 tick = function tick() {
7307 if (stopped) {
7308 return false;
7309 }
7310 var currentTime = fxNow || createFxNow(),
7311 remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
7312
7313
7314 // Support: Android 2.3 only
7315 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
7316 temp = remaining / animation.duration || 0,
7317 percent = 1 - temp,
7318 index = 0,
7319 length = animation.tweens.length;
7320
7321 for (; index < length; index++) {
7322 animation.tweens[index].run(percent);
7323 }
7324
7325 deferred.notifyWith(elem, [animation, percent, remaining]);
7326
7327 // If there's more to do, yield
7328 if (percent < 1 && length) {
7329 return remaining;
7330 }
7331
7332 // If this was an empty animation, synthesize a final progress notification
7333 if (!length) {
7334 deferred.notifyWith(elem, [animation, 1, 0]);
7335 }
7336
7337 // Resolve the animation and report its conclusion
7338 deferred.resolveWith(elem, [animation]);
7339 return false;
7340 },
7341 animation = deferred.promise({
7342 elem: elem,
7343 props: jQuery.extend({}, properties),
7344 opts: jQuery.extend(true, {
7345 specialEasing: {},
7346 easing: jQuery.easing._default
7347 }, options),
7348 originalProperties: properties,
7349 originalOptions: options,
7350 startTime: fxNow || createFxNow(),
7351 duration: options.duration,
7352 tweens: [],
7353 createTween: function createTween(prop, end) {
7354 var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing);
7355 animation.tweens.push(tween);
7356 return tween;
7357 },
7358 stop: function stop(gotoEnd) {
7359 var index = 0,
7360
7361
7362 // If we are going to the end, we want to run all the tweens
7363 // otherwise we skip this part
7364 length = gotoEnd ? animation.tweens.length : 0;
7365 if (stopped) {
7366 return this;
7367 }
7368 stopped = true;
7369 for (; index < length; index++) {
7370 animation.tweens[index].run(1);
7371 }
7372
7373 // Resolve when we played the last frame; otherwise, reject
7374 if (gotoEnd) {
7375 deferred.notifyWith(elem, [animation, 1, 0]);
7376 deferred.resolveWith(elem, [animation, gotoEnd]);
7377 } else {
7378 deferred.rejectWith(elem, [animation, gotoEnd]);
7379 }
7380 return this;
7381 }
7382 }),
7383 props = animation.props;
7384
7385 propFilter(props, animation.opts.specialEasing);
7386
7387 for (; index < length; index++) {
7388 result = Animation.prefilters[index].call(animation, elem, props, animation.opts);
7389 if (result) {
7390 if (jQuery.isFunction(result.stop)) {
7391 jQuery._queueHooks(animation.elem, animation.opts.queue).stop = jQuery.proxy(result.stop, result);
7392 }
7393 return result;
7394 }
7395 }
7396
7397 jQuery.map(props, createTween, animation);
7398
7399 if (jQuery.isFunction(animation.opts.start)) {
7400 animation.opts.start.call(elem, animation);
7401 }
7402
7403 // Attach callbacks from options
7404 animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
7405
7406 jQuery.fx.timer(jQuery.extend(tick, {
7407 elem: elem,
7408 anim: animation,
7409 queue: animation.opts.queue
7410 }));
7411
7412 return animation;
7413 }
7414
7415 jQuery.Animation = jQuery.extend(Animation, {
7416
7417 tweeners: {
7418 "*": [function (prop, value) {
7419 var tween = this.createTween(prop, value);
7420 adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
7421 return tween;
7422 }]
7423 },
7424
7425 tweener: function tweener(props, callback) {
7426 if (jQuery.isFunction(props)) {
7427 callback = props;
7428 props = ["*"];
7429 } else {
7430 props = props.match(rnothtmlwhite);
7431 }
7432
7433 var prop,
7434 index = 0,
7435 length = props.length;
7436
7437 for (; index < length; index++) {
7438 prop = props[index];
7439 Animation.tweeners[prop] = Animation.tweeners[prop] || [];
7440 Animation.tweeners[prop].unshift(callback);
7441 }
7442 },
7443
7444 prefilters: [defaultPrefilter],
7445
7446 prefilter: function prefilter(callback, prepend) {
7447 if (prepend) {
7448 Animation.prefilters.unshift(callback);
7449 } else {
7450 Animation.prefilters.push(callback);
7451 }
7452 }
7453 });
7454
7455 jQuery.speed = function (speed, easing, fn) {
7456 var opt = speed && (typeof speed === "undefined" ? "undefined" : _typeof(speed)) === "object" ? jQuery.extend({}, speed) : {
7457 complete: fn || !fn && easing || jQuery.isFunction(speed) && speed,
7458 duration: speed,
7459 easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
7460 };
7461
7462 // Go to the end state if fx are off
7463 if (jQuery.fx.off) {
7464 opt.duration = 0;
7465 } else {
7466 if (typeof opt.duration !== "number") {
7467 if (opt.duration in jQuery.fx.speeds) {
7468 opt.duration = jQuery.fx.speeds[opt.duration];
7469 } else {
7470 opt.duration = jQuery.fx.speeds._default;
7471 }
7472 }
7473 }
7474
7475 // Normalize opt.queue - true/undefined/null -> "fx"
7476 if (opt.queue == null || opt.queue === true) {
7477 opt.queue = "fx";
7478 }
7479
7480 // Queueing
7481 opt.old = opt.complete;
7482
7483 opt.complete = function () {
7484 if (jQuery.isFunction(opt.old)) {
7485 opt.old.call(this);
7486 }
7487
7488 if (opt.queue) {
7489 jQuery.dequeue(this, opt.queue);
7490 }
7491 };
7492
7493 return opt;
7494 };
7495
7496 jQuery.fn.extend({
7497 fadeTo: function fadeTo(speed, to, easing, callback) {
7498
7499 // Show any hidden elements after setting opacity to 0
7500 return this.filter(isHiddenWithinTree).css("opacity", 0).show()
7501
7502 // Animate to the value specified
7503 .end().animate({ opacity: to }, speed, easing, callback);
7504 },
7505 animate: function animate(prop, speed, easing, callback) {
7506 var empty = jQuery.isEmptyObject(prop),
7507 optall = jQuery.speed(speed, easing, callback),
7508 doAnimation = function doAnimation() {
7509
7510 // Operate on a copy of prop so per-property easing won't be lost
7511 var anim = Animation(this, jQuery.extend({}, prop), optall);
7512
7513 // Empty animations, or finishing resolves immediately
7514 if (empty || dataPriv.get(this, "finish")) {
7515 anim.stop(true);
7516 }
7517 };
7518 doAnimation.finish = doAnimation;
7519
7520 return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
7521 },
7522 stop: function stop(type, clearQueue, gotoEnd) {
7523 var stopQueue = function stopQueue(hooks) {
7524 var stop = hooks.stop;
7525 delete hooks.stop;
7526 stop(gotoEnd);
7527 };
7528
7529 if (typeof type !== "string") {
7530 gotoEnd = clearQueue;
7531 clearQueue = type;
7532 type = undefined;
7533 }
7534 if (clearQueue && type !== false) {
7535 this.queue(type || "fx", []);
7536 }
7537
7538 return this.each(function () {
7539 var dequeue = true,
7540 index = type != null && type + "queueHooks",
7541 timers = jQuery.timers,
7542 data = dataPriv.get(this);
7543
7544 if (index) {
7545 if (data[index] && data[index].stop) {
7546 stopQueue(data[index]);
7547 }
7548 } else {
7549 for (index in data) {
7550 if (data[index] && data[index].stop && rrun.test(index)) {
7551 stopQueue(data[index]);
7552 }
7553 }
7554 }
7555
7556 for (index = timers.length; index--;) {
7557 if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
7558
7559 timers[index].anim.stop(gotoEnd);
7560 dequeue = false;
7561 timers.splice(index, 1);
7562 }
7563 }
7564
7565 // Start the next in the queue if the last step wasn't forced.
7566 // Timers currently will call their complete callbacks, which
7567 // will dequeue but only if they were gotoEnd.
7568 if (dequeue || !gotoEnd) {
7569 jQuery.dequeue(this, type);
7570 }
7571 });
7572 },
7573 finish: function finish(type) {
7574 if (type !== false) {
7575 type = type || "fx";
7576 }
7577 return this.each(function () {
7578 var index,
7579 data = dataPriv.get(this),
7580 queue = data[type + "queue"],
7581 hooks = data[type + "queueHooks"],
7582 timers = jQuery.timers,
7583 length = queue ? queue.length : 0;
7584
7585 // Enable finishing flag on private data
7586 data.finish = true;
7587
7588 // Empty the queue first
7589 jQuery.queue(this, type, []);
7590
7591 if (hooks && hooks.stop) {
7592 hooks.stop.call(this, true);
7593 }
7594
7595 // Look for any active animations, and finish them
7596 for (index = timers.length; index--;) {
7597 if (timers[index].elem === this && timers[index].queue === type) {
7598 timers[index].anim.stop(true);
7599 timers.splice(index, 1);
7600 }
7601 }
7602
7603 // Look for any animations in the old queue and finish them
7604 for (index = 0; index < length; index++) {
7605 if (queue[index] && queue[index].finish) {
7606 queue[index].finish.call(this);
7607 }
7608 }
7609
7610 // Turn off finishing flag
7611 delete data.finish;
7612 });
7613 }
7614 });
7615
7616 jQuery.each(["toggle", "show", "hide"], function (i, name) {
7617 var cssFn = jQuery.fn[name];
7618 jQuery.fn[name] = function (speed, easing, callback) {
7619 return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);
7620 };
7621 });
7622
7623 // Generate shortcuts for custom animations
7624 jQuery.each({
7625 slideDown: genFx("show"),
7626 slideUp: genFx("hide"),
7627 slideToggle: genFx("toggle"),
7628 fadeIn: { opacity: "show" },
7629 fadeOut: { opacity: "hide" },
7630 fadeToggle: { opacity: "toggle" }
7631 }, function (name, props) {
7632 jQuery.fn[name] = function (speed, easing, callback) {
7633 return this.animate(props, speed, easing, callback);
7634 };
7635 });
7636
7637 jQuery.timers = [];
7638 jQuery.fx.tick = function () {
7639 var timer,
7640 i = 0,
7641 timers = jQuery.timers;
7642
7643 fxNow = jQuery.now();
7644
7645 for (; i < timers.length; i++) {
7646 timer = timers[i];
7647
7648 // Run the timer and safely remove it when done (allowing for external removal)
7649 if (!timer() && timers[i] === timer) {
7650 timers.splice(i--, 1);
7651 }
7652 }
7653
7654 if (!timers.length) {
7655 jQuery.fx.stop();
7656 }
7657 fxNow = undefined;
7658 };
7659
7660 jQuery.fx.timer = function (timer) {
7661 jQuery.timers.push(timer);
7662 jQuery.fx.start();
7663 };
7664
7665 jQuery.fx.interval = 13;
7666 jQuery.fx.start = function () {
7667 if (inProgress) {
7668 return;
7669 }
7670
7671 inProgress = true;
7672 schedule();
7673 };
7674
7675 jQuery.fx.stop = function () {
7676 inProgress = null;
7677 };
7678
7679 jQuery.fx.speeds = {
7680 slow: 600,
7681 fast: 200,
7682
7683 // Default speed
7684 _default: 400
7685 };
7686
7687 // Based off of the plugin by Clint Helfers, with permission.
7688 // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7689 jQuery.fn.delay = function (time, type) {
7690 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
7691 type = type || "fx";
7692
7693 return this.queue(type, function (next, hooks) {
7694 var timeout = window.setTimeout(next, time);
7695 hooks.stop = function () {
7696 window.clearTimeout(timeout);
7697 };
7698 });
7699 };
7700
7701 (function () {
7702 var input = document.createElement("input"),
7703 select = document.createElement("select"),
7704 opt = select.appendChild(document.createElement("option"));
7705
7706 input.type = "checkbox";
7707
7708 // Support: Android <=4.3 only
7709 // Default value for a checkbox should be "on"
7710 support.checkOn = input.value !== "";
7711
7712 // Support: IE <=11 only
7713 // Must access selectedIndex to make default options select
7714 support.optSelected = opt.selected;
7715
7716 // Support: IE <=11 only
7717 // An input loses its value after becoming a radio
7718 input = document.createElement("input");
7719 input.value = "t";
7720 input.type = "radio";
7721 support.radioValue = input.value === "t";
7722 })();
7723
7724 var boolHook,
7725 attrHandle = jQuery.expr.attrHandle;
7726
7727 jQuery.fn.extend({
7728 attr: function attr(name, value) {
7729 return access(this, jQuery.attr, name, value, arguments.length > 1);
7730 },
7731
7732 removeAttr: function removeAttr(name) {
7733 return this.each(function () {
7734 jQuery.removeAttr(this, name);
7735 });
7736 }
7737 });
7738
7739 jQuery.extend({
7740 attr: function attr(elem, name, value) {
7741 var ret,
7742 hooks,
7743 nType = elem.nodeType;
7744
7745 // Don't get/set attributes on text, comment and attribute nodes
7746 if (nType === 3 || nType === 8 || nType === 2) {
7747 return;
7748 }
7749
7750 // Fallback to prop when attributes are not supported
7751 if (typeof elem.getAttribute === "undefined") {
7752 return jQuery.prop(elem, name, value);
7753 }
7754
7755 // Attribute hooks are determined by the lowercase version
7756 // Grab necessary hook if one is defined
7757 if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
7758 hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : undefined);
7759 }
7760
7761 if (value !== undefined) {
7762 if (value === null) {
7763 jQuery.removeAttr(elem, name);
7764 return;
7765 }
7766
7767 if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
7768 return ret;
7769 }
7770
7771 elem.setAttribute(name, value + "");
7772 return value;
7773 }
7774
7775 if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
7776 return ret;
7777 }
7778
7779 ret = jQuery.find.attr(elem, name);
7780
7781 // Non-existent attributes return null, we normalize to undefined
7782 return ret == null ? undefined : ret;
7783 },
7784
7785 attrHooks: {
7786 type: {
7787 set: function set(elem, value) {
7788 if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
7789 var val = elem.value;
7790 elem.setAttribute("type", value);
7791 if (val) {
7792 elem.value = val;
7793 }
7794 return value;
7795 }
7796 }
7797 }
7798 },
7799
7800 removeAttr: function removeAttr(elem, value) {
7801 var name,
7802 i = 0,
7803
7804
7805 // Attribute names can contain non-HTML whitespace characters
7806 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
7807 attrNames = value && value.match(rnothtmlwhite);
7808
7809 if (attrNames && elem.nodeType === 1) {
7810 while (name = attrNames[i++]) {
7811 elem.removeAttribute(name);
7812 }
7813 }
7814 }
7815 });
7816
7817 // Hooks for boolean attributes
7818 boolHook = {
7819 set: function set(elem, value, name) {
7820 if (value === false) {
7821
7822 // Remove boolean attributes when set to false
7823 jQuery.removeAttr(elem, name);
7824 } else {
7825 elem.setAttribute(name, name);
7826 }
7827 return name;
7828 }
7829 };
7830
7831 jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function (i, name) {
7832 var getter = attrHandle[name] || jQuery.find.attr;
7833
7834 attrHandle[name] = function (elem, name, isXML) {
7835 var ret,
7836 handle,
7837 lowercaseName = name.toLowerCase();
7838
7839 if (!isXML) {
7840
7841 // Avoid an infinite loop by temporarily removing this function from the getter
7842 handle = attrHandle[lowercaseName];
7843 attrHandle[lowercaseName] = ret;
7844 ret = getter(elem, name, isXML) != null ? lowercaseName : null;
7845 attrHandle[lowercaseName] = handle;
7846 }
7847 return ret;
7848 };
7849 });
7850
7851 var rfocusable = /^(?:input|select|textarea|button)$/i,
7852 rclickable = /^(?:a|area)$/i;
7853
7854 jQuery.fn.extend({
7855 prop: function prop(name, value) {
7856 return access(this, jQuery.prop, name, value, arguments.length > 1);
7857 },
7858
7859 removeProp: function removeProp(name) {
7860 return this.each(function () {
7861 delete this[jQuery.propFix[name] || name];
7862 });
7863 }
7864 });
7865
7866 jQuery.extend({
7867 prop: function prop(elem, name, value) {
7868 var ret,
7869 hooks,
7870 nType = elem.nodeType;
7871
7872 // Don't get/set properties on text, comment and attribute nodes
7873 if (nType === 3 || nType === 8 || nType === 2) {
7874 return;
7875 }
7876
7877 if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
7878
7879 // Fix name and attach hooks
7880 name = jQuery.propFix[name] || name;
7881 hooks = jQuery.propHooks[name];
7882 }
7883
7884 if (value !== undefined) {
7885 if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
7886 return ret;
7887 }
7888
7889 return elem[name] = value;
7890 }
7891
7892 if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
7893 return ret;
7894 }
7895
7896 return elem[name];
7897 },
7898
7899 propHooks: {
7900 tabIndex: {
7901 get: function get(elem) {
7902
7903 // Support: IE <=9 - 11 only
7904 // elem.tabIndex doesn't always return the
7905 // correct value when it hasn't been explicitly set
7906 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
7907 // Use proper attribute retrieval(#12072)
7908 var tabindex = jQuery.find.attr(elem, "tabindex");
7909
7910 if (tabindex) {
7911 return parseInt(tabindex, 10);
7912 }
7913
7914 if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
7915 return 0;
7916 }
7917
7918 return -1;
7919 }
7920 }
7921 },
7922
7923 propFix: {
7924 "for": "htmlFor",
7925 "class": "className"
7926 }
7927 });
7928
7929 // Support: IE <=11 only
7930 // Accessing the selectedIndex property
7931 // forces the browser to respect setting selected
7932 // on the option
7933 // The getter ensures a default option is selected
7934 // when in an optgroup
7935 // eslint rule "no-unused-expressions" is disabled for this code
7936 // since it considers such accessions noop
7937 if (!support.optSelected) {
7938 jQuery.propHooks.selected = {
7939 get: function get(elem) {
7940
7941 /* eslint no-unused-expressions: "off" */
7942
7943 var parent = elem.parentNode;
7944 if (parent && parent.parentNode) {
7945 parent.parentNode.selectedIndex;
7946 }
7947 return null;
7948 },
7949 set: function set(elem) {
7950
7951 /* eslint no-unused-expressions: "off" */
7952
7953 var parent = elem.parentNode;
7954 if (parent) {
7955 parent.selectedIndex;
7956
7957 if (parent.parentNode) {
7958 parent.parentNode.selectedIndex;
7959 }
7960 }
7961 }
7962 };
7963 }
7964
7965 jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
7966 jQuery.propFix[this.toLowerCase()] = this;
7967 });
7968
7969 // Strip and collapse whitespace according to HTML spec
7970 // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
7971 function stripAndCollapse(value) {
7972 var tokens = value.match(rnothtmlwhite) || [];
7973 return tokens.join(" ");
7974 }
7975
7976 function getClass(elem) {
7977 return elem.getAttribute && elem.getAttribute("class") || "";
7978 }
7979
7980 jQuery.fn.extend({
7981 addClass: function addClass(value) {
7982 var classes,
7983 elem,
7984 cur,
7985 curValue,
7986 clazz,
7987 j,
7988 finalValue,
7989 i = 0;
7990
7991 if (jQuery.isFunction(value)) {
7992 return this.each(function (j) {
7993 jQuery(this).addClass(value.call(this, j, getClass(this)));
7994 });
7995 }
7996
7997 if (typeof value === "string" && value) {
7998 classes = value.match(rnothtmlwhite) || [];
7999
8000 while (elem = this[i++]) {
8001 curValue = getClass(elem);
8002 cur = elem.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
8003
8004 if (cur) {
8005 j = 0;
8006 while (clazz = classes[j++]) {
8007 if (cur.indexOf(" " + clazz + " ") < 0) {
8008 cur += clazz + " ";
8009 }
8010 }
8011
8012 // Only assign if different to avoid unneeded rendering.
8013 finalValue = stripAndCollapse(cur);
8014 if (curValue !== finalValue) {
8015 elem.setAttribute("class", finalValue);
8016 }
8017 }
8018 }
8019 }
8020
8021 return this;
8022 },
8023
8024 removeClass: function removeClass(value) {
8025 var classes,
8026 elem,
8027 cur,
8028 curValue,
8029 clazz,
8030 j,
8031 finalValue,
8032 i = 0;
8033
8034 if (jQuery.isFunction(value)) {
8035 return this.each(function (j) {
8036 jQuery(this).removeClass(value.call(this, j, getClass(this)));
8037 });
8038 }
8039
8040 if (!arguments.length) {
8041 return this.attr("class", "");
8042 }
8043
8044 if (typeof value === "string" && value) {
8045 classes = value.match(rnothtmlwhite) || [];
8046
8047 while (elem = this[i++]) {
8048 curValue = getClass(elem);
8049
8050 // This expression is here for better compressibility (see addClass)
8051 cur = elem.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
8052
8053 if (cur) {
8054 j = 0;
8055 while (clazz = classes[j++]) {
8056
8057 // Remove *all* instances
8058 while (cur.indexOf(" " + clazz + " ") > -1) {
8059 cur = cur.replace(" " + clazz + " ", " ");
8060 }
8061 }
8062
8063 // Only assign if different to avoid unneeded rendering.
8064 finalValue = stripAndCollapse(cur);
8065 if (curValue !== finalValue) {
8066 elem.setAttribute("class", finalValue);
8067 }
8068 }
8069 }
8070 }
8071
8072 return this;
8073 },
8074
8075 toggleClass: function toggleClass(value, stateVal) {
8076 var type = typeof value === "undefined" ? "undefined" : _typeof(value);
8077
8078 if (typeof stateVal === "boolean" && type === "string") {
8079 return stateVal ? this.addClass(value) : this.removeClass(value);
8080 }
8081
8082 if (jQuery.isFunction(value)) {
8083 return this.each(function (i) {
8084 jQuery(this).toggleClass(value.call(this, i, getClass(this), stateVal), stateVal);
8085 });
8086 }
8087
8088 return this.each(function () {
8089 var className, i, self, classNames;
8090
8091 if (type === "string") {
8092
8093 // Toggle individual class names
8094 i = 0;
8095 self = jQuery(this);
8096 classNames = value.match(rnothtmlwhite) || [];
8097
8098 while (className = classNames[i++]) {
8099
8100 // Check each className given, space separated list
8101 if (self.hasClass(className)) {
8102 self.removeClass(className);
8103 } else {
8104 self.addClass(className);
8105 }
8106 }
8107
8108 // Toggle whole class name
8109 } else if (value === undefined || type === "boolean") {
8110 className = getClass(this);
8111 if (className) {
8112
8113 // Store className if set
8114 dataPriv.set(this, "__className__", className);
8115 }
8116
8117 // If the element has a class name or if we're passed `false`,
8118 // then remove the whole classname (if there was one, the above saved it).
8119 // Otherwise bring back whatever was previously saved (if anything),
8120 // falling back to the empty string if nothing was stored.
8121 if (this.setAttribute) {
8122 this.setAttribute("class", className || value === false ? "" : dataPriv.get(this, "__className__") || "");
8123 }
8124 }
8125 });
8126 },
8127
8128 hasClass: function hasClass(selector) {
8129 var className,
8130 elem,
8131 i = 0;
8132
8133 className = " " + selector + " ";
8134 while (elem = this[i++]) {
8135 if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) {
8136 return true;
8137 }
8138 }
8139
8140 return false;
8141 }
8142 });
8143
8144 var rreturn = /\r/g;
8145
8146 jQuery.fn.extend({
8147 val: function val(value) {
8148 var hooks,
8149 ret,
8150 isFunction,
8151 elem = this[0];
8152
8153 if (!arguments.length) {
8154 if (elem) {
8155 hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
8156
8157 if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
8158 return ret;
8159 }
8160
8161 ret = elem.value;
8162
8163 // Handle most common string cases
8164 if (typeof ret === "string") {
8165 return ret.replace(rreturn, "");
8166 }
8167
8168 // Handle cases where value is null/undef or number
8169 return ret == null ? "" : ret;
8170 }
8171
8172 return;
8173 }
8174
8175 isFunction = jQuery.isFunction(value);
8176
8177 return this.each(function (i) {
8178 var val;
8179
8180 if (this.nodeType !== 1) {
8181 return;
8182 }
8183
8184 if (isFunction) {
8185 val = value.call(this, i, jQuery(this).val());
8186 } else {
8187 val = value;
8188 }
8189
8190 // Treat null/undefined as ""; convert numbers to string
8191 if (val == null) {
8192 val = "";
8193 } else if (typeof val === "number") {
8194 val += "";
8195 } else if (Array.isArray(val)) {
8196 val = jQuery.map(val, function (value) {
8197 return value == null ? "" : value + "";
8198 });
8199 }
8200
8201 hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
8202
8203 // If set returns undefined, fall back to normal setting
8204 if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
8205 this.value = val;
8206 }
8207 });
8208 }
8209 });
8210
8211 jQuery.extend({
8212 valHooks: {
8213 option: {
8214 get: function get(elem) {
8215
8216 var val = jQuery.find.attr(elem, "value");
8217 return val != null ? val :
8218
8219 // Support: IE <=10 - 11 only
8220 // option.text throws exceptions (#14686, #14858)
8221 // Strip and collapse whitespace
8222 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
8223 stripAndCollapse(jQuery.text(elem));
8224 }
8225 },
8226 select: {
8227 get: function get(elem) {
8228 var value,
8229 option,
8230 i,
8231 options = elem.options,
8232 index = elem.selectedIndex,
8233 one = elem.type === "select-one",
8234 values = one ? null : [],
8235 max = one ? index + 1 : options.length;
8236
8237 if (index < 0) {
8238 i = max;
8239 } else {
8240 i = one ? index : 0;
8241 }
8242
8243 // Loop through all the selected options
8244 for (; i < max; i++) {
8245 option = options[i];
8246
8247 // Support: IE <=9 only
8248 // IE8-9 doesn't update selected after form reset (#2551)
8249 if ((option.selected || i === index) &&
8250
8251 // Don't return options that are disabled or in a disabled optgroup
8252 !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
8253
8254 // Get the specific value for the option
8255 value = jQuery(option).val();
8256
8257 // We don't need an array for one selects
8258 if (one) {
8259 return value;
8260 }
8261
8262 // Multi-Selects return an array
8263 values.push(value);
8264 }
8265 }
8266
8267 return values;
8268 },
8269
8270 set: function set(elem, value) {
8271 var optionSet,
8272 option,
8273 options = elem.options,
8274 values = jQuery.makeArray(value),
8275 i = options.length;
8276
8277 while (i--) {
8278 option = options[i];
8279
8280 /* eslint-disable no-cond-assign */
8281
8282 if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) {
8283 optionSet = true;
8284 }
8285
8286 /* eslint-enable no-cond-assign */
8287 }
8288
8289 // Force browsers to behave consistently when non-matching value is set
8290 if (!optionSet) {
8291 elem.selectedIndex = -1;
8292 }
8293 return values;
8294 }
8295 }
8296 }
8297 });
8298
8299 // Radios and checkboxes getter/setter
8300 jQuery.each(["radio", "checkbox"], function () {
8301 jQuery.valHooks[this] = {
8302 set: function set(elem, value) {
8303 if (Array.isArray(value)) {
8304 return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
8305 }
8306 }
8307 };
8308 if (!support.checkOn) {
8309 jQuery.valHooks[this].get = function (elem) {
8310 return elem.getAttribute("value") === null ? "on" : elem.value;
8311 };
8312 }
8313 });
8314
8315 // Return jQuery for attributes-only inclusion
8316
8317
8318 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
8319
8320 jQuery.extend(jQuery.event, {
8321
8322 trigger: function trigger(event, data, elem, onlyHandlers) {
8323
8324 var i,
8325 cur,
8326 tmp,
8327 bubbleType,
8328 ontype,
8329 handle,
8330 special,
8331 eventPath = [elem || document],
8332 type = hasOwn.call(event, "type") ? event.type : event,
8333 namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
8334
8335 cur = tmp = elem = elem || document;
8336
8337 // Don't do events on text and comment nodes
8338 if (elem.nodeType === 3 || elem.nodeType === 8) {
8339 return;
8340 }
8341
8342 // focus/blur morphs to focusin/out; ensure we're not firing them right now
8343 if (rfocusMorph.test(type + jQuery.event.triggered)) {
8344 return;
8345 }
8346
8347 if (type.indexOf(".") > -1) {
8348
8349 // Namespaced trigger; create a regexp to match event type in handle()
8350 namespaces = type.split(".");
8351 type = namespaces.shift();
8352 namespaces.sort();
8353 }
8354 ontype = type.indexOf(":") < 0 && "on" + type;
8355
8356 // Caller can pass in a jQuery.Event object, Object, or just an event type string
8357 event = event[jQuery.expando] ? event : new jQuery.Event(type, (typeof event === "undefined" ? "undefined" : _typeof(event)) === "object" && event);
8358
8359 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
8360 event.isTrigger = onlyHandlers ? 2 : 3;
8361 event.namespace = namespaces.join(".");
8362 event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
8363
8364 // Clean up the event in case it is being reused
8365 event.result = undefined;
8366 if (!event.target) {
8367 event.target = elem;
8368 }
8369
8370 // Clone any incoming data and prepend the event, creating the handler arg list
8371 data = data == null ? [event] : jQuery.makeArray(data, [event]);
8372
8373 // Allow special events to draw outside the lines
8374 special = jQuery.event.special[type] || {};
8375 if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
8376 return;
8377 }
8378
8379 // Determine event propagation path in advance, per W3C events spec (#9951)
8380 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
8381 if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
8382
8383 bubbleType = special.delegateType || type;
8384 if (!rfocusMorph.test(bubbleType + type)) {
8385 cur = cur.parentNode;
8386 }
8387 for (; cur; cur = cur.parentNode) {
8388 eventPath.push(cur);
8389 tmp = cur;
8390 }
8391
8392 // Only add window if we got to document (e.g., not plain obj or detached DOM)
8393 if (tmp === (elem.ownerDocument || document)) {
8394 eventPath.push(tmp.defaultView || tmp.parentWindow || window);
8395 }
8396 }
8397
8398 // Fire handlers on the event path
8399 i = 0;
8400 while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
8401
8402 event.type = i > 1 ? bubbleType : special.bindType || type;
8403
8404 // jQuery handler
8405 handle = (dataPriv.get(cur, "events") || {})[event.type] && dataPriv.get(cur, "handle");
8406 if (handle) {
8407 handle.apply(cur, data);
8408 }
8409
8410 // Native handler
8411 handle = ontype && cur[ontype];
8412 if (handle && handle.apply && acceptData(cur)) {
8413 event.result = handle.apply(cur, data);
8414 if (event.result === false) {
8415 event.preventDefault();
8416 }
8417 }
8418 }
8419 event.type = type;
8420
8421 // If nobody prevented the default action, do it now
8422 if (!onlyHandlers && !event.isDefaultPrevented()) {
8423
8424 if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
8425
8426 // Call a native DOM method on the target with the same name as the event.
8427 // Don't do default actions on window, that's where global variables be (#6170)
8428 if (ontype && jQuery.isFunction(elem[type]) && !jQuery.isWindow(elem)) {
8429
8430 // Don't re-trigger an onFOO event when we call its FOO() method
8431 tmp = elem[ontype];
8432
8433 if (tmp) {
8434 elem[ontype] = null;
8435 }
8436
8437 // Prevent re-triggering of the same event, since we already bubbled it above
8438 jQuery.event.triggered = type;
8439 elem[type]();
8440 jQuery.event.triggered = undefined;
8441
8442 if (tmp) {
8443 elem[ontype] = tmp;
8444 }
8445 }
8446 }
8447 }
8448
8449 return event.result;
8450 },
8451
8452 // Piggyback on a donor event to simulate a different one
8453 // Used only for `focus(in | out)` events
8454 simulate: function simulate(type, elem, event) {
8455 var e = jQuery.extend(new jQuery.Event(), event, {
8456 type: type,
8457 isSimulated: true
8458 });
8459
8460 jQuery.event.trigger(e, null, elem);
8461 }
8462
8463 });
8464
8465 jQuery.fn.extend({
8466
8467 trigger: function trigger(type, data) {
8468 return this.each(function () {
8469 jQuery.event.trigger(type, data, this);
8470 });
8471 },
8472 triggerHandler: function triggerHandler(type, data) {
8473 var elem = this[0];
8474 if (elem) {
8475 return jQuery.event.trigger(type, data, elem, true);
8476 }
8477 }
8478 });
8479
8480 jQuery.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 (i, name) {
8481
8482 // Handle event binding
8483 jQuery.fn[name] = function (data, fn) {
8484 return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
8485 };
8486 });
8487
8488 jQuery.fn.extend({
8489 hover: function hover(fnOver, fnOut) {
8490 return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
8491 }
8492 });
8493
8494 support.focusin = "onfocusin" in window;
8495
8496 // Support: Firefox <=44
8497 // Firefox doesn't have focus(in | out) events
8498 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
8499 //
8500 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
8501 // focus(in | out) events fire after focus & blur events,
8502 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
8503 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
8504 if (!support.focusin) {
8505 jQuery.each({ focus: "focusin", blur: "focusout" }, function (orig, fix) {
8506
8507 // Attach a single capturing handler on the document while someone wants focusin/focusout
8508 var handler = function handler(event) {
8509 jQuery.event.simulate(fix, event.target, jQuery.event.fix(event));
8510 };
8511
8512 jQuery.event.special[fix] = {
8513 setup: function setup() {
8514 var doc = this.ownerDocument || this,
8515 attaches = dataPriv.access(doc, fix);
8516
8517 if (!attaches) {
8518 doc.addEventListener(orig, handler, true);
8519 }
8520 dataPriv.access(doc, fix, (attaches || 0) + 1);
8521 },
8522 teardown: function teardown() {
8523 var doc = this.ownerDocument || this,
8524 attaches = dataPriv.access(doc, fix) - 1;
8525
8526 if (!attaches) {
8527 doc.removeEventListener(orig, handler, true);
8528 dataPriv.remove(doc, fix);
8529 } else {
8530 dataPriv.access(doc, fix, attaches);
8531 }
8532 }
8533 };
8534 });
8535 }
8536 var location = window.location;
8537
8538 var nonce = jQuery.now();
8539
8540 var rquery = /\?/;
8541
8542 // Cross-browser xml parsing
8543 jQuery.parseXML = function (data) {
8544 var xml;
8545 if (!data || typeof data !== "string") {
8546 return null;
8547 }
8548
8549 // Support: IE 9 - 11 only
8550 // IE throws on parseFromString with invalid input.
8551 try {
8552 xml = new window.DOMParser().parseFromString(data, "text/xml");
8553 } catch (e) {
8554 xml = undefined;
8555 }
8556
8557 if (!xml || xml.getElementsByTagName("parsererror").length) {
8558 jQuery.error("Invalid XML: " + data);
8559 }
8560 return xml;
8561 };
8562
8563 var rbracket = /\[\]$/,
8564 rCRLF = /\r?\n/g,
8565 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8566 rsubmittable = /^(?:input|select|textarea|keygen)/i;
8567
8568 function buildParams(prefix, obj, traditional, add) {
8569 var name;
8570
8571 if (Array.isArray(obj)) {
8572
8573 // Serialize array item.
8574 jQuery.each(obj, function (i, v) {
8575 if (traditional || rbracket.test(prefix)) {
8576
8577 // Treat each array item as a scalar.
8578 add(prefix, v);
8579 } else {
8580
8581 // Item is non-scalar (array or object), encode its numeric index.
8582 buildParams(prefix + "[" + ((typeof v === "undefined" ? "undefined" : _typeof(v)) === "object" && v != null ? i : "") + "]", v, traditional, add);
8583 }
8584 });
8585 } else if (!traditional && jQuery.type(obj) === "object") {
8586
8587 // Serialize object item.
8588 for (name in obj) {
8589 buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
8590 }
8591 } else {
8592
8593 // Serialize scalar item.
8594 add(prefix, obj);
8595 }
8596 }
8597
8598 // Serialize an array of form elements or a set of
8599 // key/values into a query string
8600 jQuery.param = function (a, traditional) {
8601 var prefix,
8602 s = [],
8603 add = function add(key, valueOrFunction) {
8604
8605 // If value is a function, invoke it and use its return value
8606 var value = jQuery.isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction;
8607
8608 s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
8609 };
8610
8611 // If an array was passed in, assume that it is an array of form elements.
8612 if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
8613
8614 // Serialize the form elements
8615 jQuery.each(a, function () {
8616 add(this.name, this.value);
8617 });
8618 } else {
8619
8620 // If traditional, encode the "old" way (the way 1.3.2 or older
8621 // did it), otherwise encode params recursively.
8622 for (prefix in a) {
8623 buildParams(prefix, a[prefix], traditional, add);
8624 }
8625 }
8626
8627 // Return the resulting serialization
8628 return s.join("&");
8629 };
8630
8631 jQuery.fn.extend({
8632 serialize: function serialize() {
8633 return jQuery.param(this.serializeArray());
8634 },
8635 serializeArray: function serializeArray() {
8636 return this.map(function () {
8637
8638 // Can add propHook for "elements" to filter or add form elements
8639 var elements = jQuery.prop(this, "elements");
8640 return elements ? jQuery.makeArray(elements) : this;
8641 }).filter(function () {
8642 var type = this.type;
8643
8644 // Use .is( ":disabled" ) so that fieldset[disabled] works
8645 return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));
8646 }).map(function (i, elem) {
8647 var val = jQuery(this).val();
8648
8649 if (val == null) {
8650 return null;
8651 }
8652
8653 if (Array.isArray(val)) {
8654 return jQuery.map(val, function (val) {
8655 return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
8656 });
8657 }
8658
8659 return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
8660 }).get();
8661 }
8662 });
8663
8664 var r20 = /%20/g,
8665 rhash = /#.*$/,
8666 rantiCache = /([?&])_=[^&]*/,
8667 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8668
8669
8670 // #7653, #8125, #8152: local protocol detection
8671 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8672 rnoContent = /^(?:GET|HEAD)$/,
8673 rprotocol = /^\/\//,
8674
8675
8676 /* Prefilters
8677 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8678 * 2) These are called:
8679 * - BEFORE asking for a transport
8680 * - AFTER param serialization (s.data is a string if s.processData is true)
8681 * 3) key is the dataType
8682 * 4) the catchall symbol "*" can be used
8683 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8684 */
8685 prefilters = {},
8686
8687
8688 /* Transports bindings
8689 * 1) key is the dataType
8690 * 2) the catchall symbol "*" can be used
8691 * 3) selection will start with transport dataType and THEN go to "*" if needed
8692 */
8693 transports = {},
8694
8695
8696 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8697 allTypes = "*/".concat("*"),
8698
8699
8700 // Anchor tag for parsing the document origin
8701 originAnchor = document.createElement("a");
8702 originAnchor.href = location.href;
8703
8704 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8705 function addToPrefiltersOrTransports(structure) {
8706
8707 // dataTypeExpression is optional and defaults to "*"
8708 return function (dataTypeExpression, func) {
8709
8710 if (typeof dataTypeExpression !== "string") {
8711 func = dataTypeExpression;
8712 dataTypeExpression = "*";
8713 }
8714
8715 var dataType,
8716 i = 0,
8717 dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
8718
8719 if (jQuery.isFunction(func)) {
8720
8721 // For each dataType in the dataTypeExpression
8722 while (dataType = dataTypes[i++]) {
8723
8724 // Prepend if requested
8725 if (dataType[0] === "+") {
8726 dataType = dataType.slice(1) || "*";
8727 (structure[dataType] = structure[dataType] || []).unshift(func);
8728
8729 // Otherwise append
8730 } else {
8731 (structure[dataType] = structure[dataType] || []).push(func);
8732 }
8733 }
8734 }
8735 };
8736 }
8737
8738 // Base inspection function for prefilters and transports
8739 function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
8740
8741 var inspected = {},
8742 seekingTransport = structure === transports;
8743
8744 function inspect(dataType) {
8745 var selected;
8746 inspected[dataType] = true;
8747 jQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) {
8748 var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
8749 if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
8750
8751 options.dataTypes.unshift(dataTypeOrTransport);
8752 inspect(dataTypeOrTransport);
8753 return false;
8754 } else if (seekingTransport) {
8755 return !(selected = dataTypeOrTransport);
8756 }
8757 });
8758 return selected;
8759 }
8760
8761 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
8762 }
8763
8764 // A special extend for ajax options
8765 // that takes "flat" options (not to be deep extended)
8766 // Fixes #9887
8767 function ajaxExtend(target, src) {
8768 var key,
8769 deep,
8770 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8771
8772 for (key in src) {
8773 if (src[key] !== undefined) {
8774 (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
8775 }
8776 }
8777 if (deep) {
8778 jQuery.extend(true, target, deep);
8779 }
8780
8781 return target;
8782 }
8783
8784 /* Handles responses to an ajax request:
8785 * - finds the right dataType (mediates between content-type and expected dataType)
8786 * - returns the corresponding response
8787 */
8788 function ajaxHandleResponses(s, jqXHR, responses) {
8789
8790 var ct,
8791 type,
8792 finalDataType,
8793 firstDataType,
8794 contents = s.contents,
8795 dataTypes = s.dataTypes;
8796
8797 // Remove auto dataType and get content-type in the process
8798 while (dataTypes[0] === "*") {
8799 dataTypes.shift();
8800 if (ct === undefined) {
8801 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8802 }
8803 }
8804
8805 // Check if we're dealing with a known content-type
8806 if (ct) {
8807 for (type in contents) {
8808 if (contents[type] && contents[type].test(ct)) {
8809 dataTypes.unshift(type);
8810 break;
8811 }
8812 }
8813 }
8814
8815 // Check to see if we have a response for the expected dataType
8816 if (dataTypes[0] in responses) {
8817 finalDataType = dataTypes[0];
8818 } else {
8819
8820 // Try convertible dataTypes
8821 for (type in responses) {
8822 if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
8823 finalDataType = type;
8824 break;
8825 }
8826 if (!firstDataType) {
8827 firstDataType = type;
8828 }
8829 }
8830
8831 // Or just use first one
8832 finalDataType = finalDataType || firstDataType;
8833 }
8834
8835 // If we found a dataType
8836 // We add the dataType to the list if needed
8837 // and return the corresponding response
8838 if (finalDataType) {
8839 if (finalDataType !== dataTypes[0]) {
8840 dataTypes.unshift(finalDataType);
8841 }
8842 return responses[finalDataType];
8843 }
8844 }
8845
8846 /* Chain conversions given the request and the original response
8847 * Also sets the responseXXX fields on the jqXHR instance
8848 */
8849 function ajaxConvert(s, response, jqXHR, isSuccess) {
8850 var conv2,
8851 current,
8852 conv,
8853 tmp,
8854 prev,
8855 converters = {},
8856
8857
8858 // Work with a copy of dataTypes in case we need to modify it for conversion
8859 dataTypes = s.dataTypes.slice();
8860
8861 // Create converters map with lowercased keys
8862 if (dataTypes[1]) {
8863 for (conv in s.converters) {
8864 converters[conv.toLowerCase()] = s.converters[conv];
8865 }
8866 }
8867
8868 current = dataTypes.shift();
8869
8870 // Convert to each sequential dataType
8871 while (current) {
8872
8873 if (s.responseFields[current]) {
8874 jqXHR[s.responseFields[current]] = response;
8875 }
8876
8877 // Apply the dataFilter if provided
8878 if (!prev && isSuccess && s.dataFilter) {
8879 response = s.dataFilter(response, s.dataType);
8880 }
8881
8882 prev = current;
8883 current = dataTypes.shift();
8884
8885 if (current) {
8886
8887 // There's only work to do if current dataType is non-auto
8888 if (current === "*") {
8889
8890 current = prev;
8891
8892 // Convert response if prev dataType is non-auto and differs from current
8893 } else if (prev !== "*" && prev !== current) {
8894
8895 // Seek a direct converter
8896 conv = converters[prev + " " + current] || converters["* " + current];
8897
8898 // If none found, seek a pair
8899 if (!conv) {
8900 for (conv2 in converters) {
8901
8902 // If conv2 outputs current
8903 tmp = conv2.split(" ");
8904 if (tmp[1] === current) {
8905
8906 // If prev can be converted to accepted input
8907 conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
8908 if (conv) {
8909
8910 // Condense equivalence converters
8911 if (conv === true) {
8912 conv = converters[conv2];
8913
8914 // Otherwise, insert the intermediate dataType
8915 } else if (converters[conv2] !== true) {
8916 current = tmp[0];
8917 dataTypes.unshift(tmp[1]);
8918 }
8919 break;
8920 }
8921 }
8922 }
8923 }
8924
8925 // Apply converter (if not an equivalence)
8926 if (conv !== true) {
8927
8928 // Unless errors are allowed to bubble, catch and return them
8929 if (conv && s.throws) {
8930 response = conv(response);
8931 } else {
8932 try {
8933 response = conv(response);
8934 } catch (e) {
8935 return {
8936 state: "parsererror",
8937 error: conv ? e : "No conversion from " + prev + " to " + current
8938 };
8939 }
8940 }
8941 }
8942 }
8943 }
8944 }
8945
8946 return { state: "success", data: response };
8947 }
8948
8949 jQuery.extend({
8950
8951 // Counter for holding the number of active queries
8952 active: 0,
8953
8954 // Last-Modified header cache for next request
8955 lastModified: {},
8956 etag: {},
8957
8958 ajaxSettings: {
8959 url: location.href,
8960 type: "GET",
8961 isLocal: rlocalProtocol.test(location.protocol),
8962 global: true,
8963 processData: true,
8964 async: true,
8965 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8966
8967 /*
8968 timeout: 0,
8969 data: null,
8970 dataType: null,
8971 username: null,
8972 password: null,
8973 cache: null,
8974 throws: false,
8975 traditional: false,
8976 headers: {},
8977 */
8978
8979 accepts: {
8980 "*": allTypes,
8981 text: "text/plain",
8982 html: "text/html",
8983 xml: "application/xml, text/xml",
8984 json: "application/json, text/javascript"
8985 },
8986
8987 contents: {
8988 xml: /\bxml\b/,
8989 html: /\bhtml/,
8990 json: /\bjson\b/
8991 },
8992
8993 responseFields: {
8994 xml: "responseXML",
8995 text: "responseText",
8996 json: "responseJSON"
8997 },
8998
8999 // Data converters
9000 // Keys separate source (or catchall "*") and destination types with a single space
9001 converters: {
9002
9003 // Convert anything to text
9004 "* text": String,
9005
9006 // Text to html (true = no transformation)
9007 "text html": true,
9008
9009 // Evaluate text as a json expression
9010 "text json": JSON.parse,
9011
9012 // Parse text as xml
9013 "text xml": jQuery.parseXML
9014 },
9015
9016 // For options that shouldn't be deep extended:
9017 // you can add your own custom options here if
9018 // and when you create one that shouldn't be
9019 // deep extended (see ajaxExtend)
9020 flatOptions: {
9021 url: true,
9022 context: true
9023 }
9024 },
9025
9026 // Creates a full fledged settings object into target
9027 // with both ajaxSettings and settings fields.
9028 // If target is omitted, writes into ajaxSettings.
9029 ajaxSetup: function ajaxSetup(target, settings) {
9030 return settings ?
9031
9032 // Building a settings object
9033 ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :
9034
9035 // Extending ajaxSettings
9036 ajaxExtend(jQuery.ajaxSettings, target);
9037 },
9038
9039 ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
9040 ajaxTransport: addToPrefiltersOrTransports(transports),
9041
9042 // Main method
9043 ajax: function ajax(url, options) {
9044
9045 // If url is an object, simulate pre-1.5 signature
9046 if ((typeof url === "undefined" ? "undefined" : _typeof(url)) === "object") {
9047 options = url;
9048 url = undefined;
9049 }
9050
9051 // Force options to be an object
9052 options = options || {};
9053
9054 var transport,
9055
9056
9057 // URL without anti-cache param
9058 cacheURL,
9059
9060
9061 // Response headers
9062 responseHeadersString,
9063 responseHeaders,
9064
9065
9066 // timeout handle
9067 timeoutTimer,
9068
9069
9070 // Url cleanup var
9071 urlAnchor,
9072
9073
9074 // Request state (becomes false upon send and true upon completion)
9075 completed,
9076
9077
9078 // To know if global events are to be dispatched
9079 fireGlobals,
9080
9081
9082 // Loop variable
9083 i,
9084
9085
9086 // uncached part of the url
9087 uncached,
9088
9089
9090 // Create the final options object
9091 s = jQuery.ajaxSetup({}, options),
9092
9093
9094 // Callbacks context
9095 callbackContext = s.context || s,
9096
9097
9098 // Context for global events is callbackContext if it is a DOM node or jQuery collection
9099 globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event,
9100
9101
9102 // Deferreds
9103 deferred = jQuery.Deferred(),
9104 completeDeferred = jQuery.Callbacks("once memory"),
9105
9106
9107 // Status-dependent callbacks
9108 _statusCode = s.statusCode || {},
9109
9110
9111 // Headers (they are sent all at once)
9112 requestHeaders = {},
9113 requestHeadersNames = {},
9114
9115
9116 // Default abort message
9117 strAbort = "canceled",
9118
9119
9120 // Fake xhr
9121 jqXHR = {
9122 readyState: 0,
9123
9124 // Builds headers hashtable if needed
9125 getResponseHeader: function getResponseHeader(key) {
9126 var match;
9127 if (completed) {
9128 if (!responseHeaders) {
9129 responseHeaders = {};
9130 while (match = rheaders.exec(responseHeadersString)) {
9131 responseHeaders[match[1].toLowerCase()] = match[2];
9132 }
9133 }
9134 match = responseHeaders[key.toLowerCase()];
9135 }
9136 return match == null ? null : match;
9137 },
9138
9139 // Raw string
9140 getAllResponseHeaders: function getAllResponseHeaders() {
9141 return completed ? responseHeadersString : null;
9142 },
9143
9144 // Caches the header
9145 setRequestHeader: function setRequestHeader(name, value) {
9146 if (completed == null) {
9147 name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
9148 requestHeaders[name] = value;
9149 }
9150 return this;
9151 },
9152
9153 // Overrides response content-type header
9154 overrideMimeType: function overrideMimeType(type) {
9155 if (completed == null) {
9156 s.mimeType = type;
9157 }
9158 return this;
9159 },
9160
9161 // Status-dependent callbacks
9162 statusCode: function statusCode(map) {
9163 var code;
9164 if (map) {
9165 if (completed) {
9166
9167 // Execute the appropriate callbacks
9168 jqXHR.always(map[jqXHR.status]);
9169 } else {
9170
9171 // Lazy-add the new callbacks in a way that preserves old ones
9172 for (code in map) {
9173 _statusCode[code] = [_statusCode[code], map[code]];
9174 }
9175 }
9176 }
9177 return this;
9178 },
9179
9180 // Cancel the request
9181 abort: function abort(statusText) {
9182 var finalText = statusText || strAbort;
9183 if (transport) {
9184 transport.abort(finalText);
9185 }
9186 done(0, finalText);
9187 return this;
9188 }
9189 };
9190
9191 // Attach deferreds
9192 deferred.promise(jqXHR);
9193
9194 // Add protocol if not provided (prefilters might expect it)
9195 // Handle falsy url in the settings object (#10093: consistency with old signature)
9196 // We also use the url parameter if available
9197 s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//");
9198
9199 // Alias method option to type as per ticket #12004
9200 s.type = options.method || options.type || s.method || s.type;
9201
9202 // Extract dataTypes list
9203 s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];
9204
9205 // A cross-domain request is in order when the origin doesn't match the current origin.
9206 if (s.crossDomain == null) {
9207 urlAnchor = document.createElement("a");
9208
9209 // Support: IE <=8 - 11, Edge 12 - 13
9210 // IE throws exception on accessing the href property if url is malformed,
9211 // e.g. http://example.com:80x/
9212 try {
9213 urlAnchor.href = s.url;
9214
9215 // Support: IE <=8 - 11 only
9216 // Anchor's host property isn't correctly set when s.url is relative
9217 urlAnchor.href = urlAnchor.href;
9218 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
9219 } catch (e) {
9220
9221 // If there is an error parsing the URL, assume it is crossDomain,
9222 // it can be rejected by the transport if it is invalid
9223 s.crossDomain = true;
9224 }
9225 }
9226
9227 // Convert data if not already a string
9228 if (s.data && s.processData && typeof s.data !== "string") {
9229 s.data = jQuery.param(s.data, s.traditional);
9230 }
9231
9232 // Apply prefilters
9233 inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
9234
9235 // If request was aborted inside a prefilter, stop there
9236 if (completed) {
9237 return jqXHR;
9238 }
9239
9240 // We can fire global events as of now if asked to
9241 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
9242 fireGlobals = jQuery.event && s.global;
9243
9244 // Watch for a new set of requests
9245 if (fireGlobals && jQuery.active++ === 0) {
9246 jQuery.event.trigger("ajaxStart");
9247 }
9248
9249 // Uppercase the type
9250 s.type = s.type.toUpperCase();
9251
9252 // Determine if request has content
9253 s.hasContent = !rnoContent.test(s.type);
9254
9255 // Save the URL in case we're toying with the If-Modified-Since
9256 // and/or If-None-Match header later on
9257 // Remove hash to simplify url manipulation
9258 cacheURL = s.url.replace(rhash, "");
9259
9260 // More options handling for requests with no content
9261 if (!s.hasContent) {
9262
9263 // Remember the hash so we can put it back
9264 uncached = s.url.slice(cacheURL.length);
9265
9266 // If data is available, append data to url
9267 if (s.data) {
9268 cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;
9269
9270 // #9682: remove data so that it's not used in an eventual retry
9271 delete s.data;
9272 }
9273
9274 // Add or update anti-cache param if needed
9275 if (s.cache === false) {
9276 cacheURL = cacheURL.replace(rantiCache, "$1");
9277 uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++ + uncached;
9278 }
9279
9280 // Put hash and anti-cache on the URL that will be requested (gh-1732)
9281 s.url = cacheURL + uncached;
9282
9283 // Change '%20' to '+' if this is encoded form body content (gh-2658)
9284 } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
9285 s.data = s.data.replace(r20, "+");
9286 }
9287
9288 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9289 if (s.ifModified) {
9290 if (jQuery.lastModified[cacheURL]) {
9291 jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
9292 }
9293 if (jQuery.etag[cacheURL]) {
9294 jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
9295 }
9296 }
9297
9298 // Set the correct header, if data is being sent
9299 if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
9300 jqXHR.setRequestHeader("Content-Type", s.contentType);
9301 }
9302
9303 // Set the Accepts header for the server, depending on the dataType
9304 jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]);
9305
9306 // Check for headers option
9307 for (i in s.headers) {
9308 jqXHR.setRequestHeader(i, s.headers[i]);
9309 }
9310
9311 // Allow custom headers/mimetypes and early abort
9312 if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed)) {
9313
9314 // Abort if not done already and return
9315 return jqXHR.abort();
9316 }
9317
9318 // Aborting is no longer a cancellation
9319 strAbort = "abort";
9320
9321 // Install callbacks on deferreds
9322 completeDeferred.add(s.complete);
9323 jqXHR.done(s.success);
9324 jqXHR.fail(s.error);
9325
9326 // Get transport
9327 transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
9328
9329 // If no transport, we auto-abort
9330 if (!transport) {
9331 done(-1, "No Transport");
9332 } else {
9333 jqXHR.readyState = 1;
9334
9335 // Send global event
9336 if (fireGlobals) {
9337 globalEventContext.trigger("ajaxSend", [jqXHR, s]);
9338 }
9339
9340 // If request was aborted inside ajaxSend, stop there
9341 if (completed) {
9342 return jqXHR;
9343 }
9344
9345 // Timeout
9346 if (s.async && s.timeout > 0) {
9347 timeoutTimer = window.setTimeout(function () {
9348 jqXHR.abort("timeout");
9349 }, s.timeout);
9350 }
9351
9352 try {
9353 completed = false;
9354 transport.send(requestHeaders, done);
9355 } catch (e) {
9356
9357 // Rethrow post-completion exceptions
9358 if (completed) {
9359 throw e;
9360 }
9361
9362 // Propagate others as results
9363 done(-1, e);
9364 }
9365 }
9366
9367 // Callback for when everything is done
9368 function done(status, nativeStatusText, responses, headers) {
9369 var isSuccess,
9370 success,
9371 error,
9372 response,
9373 modified,
9374 statusText = nativeStatusText;
9375
9376 // Ignore repeat invocations
9377 if (completed) {
9378 return;
9379 }
9380
9381 completed = true;
9382
9383 // Clear timeout if it exists
9384 if (timeoutTimer) {
9385 window.clearTimeout(timeoutTimer);
9386 }
9387
9388 // Dereference transport for early garbage collection
9389 // (no matter how long the jqXHR object will be used)
9390 transport = undefined;
9391
9392 // Cache response headers
9393 responseHeadersString = headers || "";
9394
9395 // Set readyState
9396 jqXHR.readyState = status > 0 ? 4 : 0;
9397
9398 // Determine if successful
9399 isSuccess = status >= 200 && status < 300 || status === 304;
9400
9401 // Get response data
9402 if (responses) {
9403 response = ajaxHandleResponses(s, jqXHR, responses);
9404 }
9405
9406 // Convert no matter what (that way responseXXX fields are always set)
9407 response = ajaxConvert(s, response, jqXHR, isSuccess);
9408
9409 // If successful, handle type chaining
9410 if (isSuccess) {
9411
9412 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9413 if (s.ifModified) {
9414 modified = jqXHR.getResponseHeader("Last-Modified");
9415 if (modified) {
9416 jQuery.lastModified[cacheURL] = modified;
9417 }
9418 modified = jqXHR.getResponseHeader("etag");
9419 if (modified) {
9420 jQuery.etag[cacheURL] = modified;
9421 }
9422 }
9423
9424 // if no content
9425 if (status === 204 || s.type === "HEAD") {
9426 statusText = "nocontent";
9427
9428 // if not modified
9429 } else if (status === 304) {
9430 statusText = "notmodified";
9431
9432 // If we have data, let's convert it
9433 } else {
9434 statusText = response.state;
9435 success = response.data;
9436 error = response.error;
9437 isSuccess = !error;
9438 }
9439 } else {
9440
9441 // Extract error from statusText and normalize for non-aborts
9442 error = statusText;
9443 if (status || !statusText) {
9444 statusText = "error";
9445 if (status < 0) {
9446 status = 0;
9447 }
9448 }
9449 }
9450
9451 // Set data for the fake xhr object
9452 jqXHR.status = status;
9453 jqXHR.statusText = (nativeStatusText || statusText) + "";
9454
9455 // Success/Error
9456 if (isSuccess) {
9457 deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
9458 } else {
9459 deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
9460 }
9461
9462 // Status-dependent callbacks
9463 jqXHR.statusCode(_statusCode);
9464 _statusCode = undefined;
9465
9466 if (fireGlobals) {
9467 globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
9468 }
9469
9470 // Complete
9471 completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
9472
9473 if (fireGlobals) {
9474 globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
9475
9476 // Handle the global AJAX counter
9477 if (! --jQuery.active) {
9478 jQuery.event.trigger("ajaxStop");
9479 }
9480 }
9481 }
9482
9483 return jqXHR;
9484 },
9485
9486 getJSON: function getJSON(url, data, callback) {
9487 return jQuery.get(url, data, callback, "json");
9488 },
9489
9490 getScript: function getScript(url, callback) {
9491 return jQuery.get(url, undefined, callback, "script");
9492 }
9493 });
9494
9495 jQuery.each(["get", "post"], function (i, method) {
9496 jQuery[method] = function (url, data, callback, type) {
9497
9498 // Shift arguments if data argument was omitted
9499 if (jQuery.isFunction(data)) {
9500 type = type || callback;
9501 callback = data;
9502 data = undefined;
9503 }
9504
9505 // The url can be an options object (which then must have .url)
9506 return jQuery.ajax(jQuery.extend({
9507 url: url,
9508 type: method,
9509 dataType: type,
9510 data: data,
9511 success: callback
9512 }, jQuery.isPlainObject(url) && url));
9513 };
9514 });
9515
9516 jQuery._evalUrl = function (url) {
9517 return jQuery.ajax({
9518 url: url,
9519
9520 // Make this explicit, since user can override this through ajaxSetup (#11264)
9521 type: "GET",
9522 dataType: "script",
9523 cache: true,
9524 async: false,
9525 global: false,
9526 "throws": true
9527 });
9528 };
9529
9530 jQuery.fn.extend({
9531 wrapAll: function wrapAll(html) {
9532 var wrap;
9533
9534 if (this[0]) {
9535 if (jQuery.isFunction(html)) {
9536 html = html.call(this[0]);
9537 }
9538
9539 // The elements to wrap the target around
9540 wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
9541
9542 if (this[0].parentNode) {
9543 wrap.insertBefore(this[0]);
9544 }
9545
9546 wrap.map(function () {
9547 var elem = this;
9548
9549 while (elem.firstElementChild) {
9550 elem = elem.firstElementChild;
9551 }
9552
9553 return elem;
9554 }).append(this);
9555 }
9556
9557 return this;
9558 },
9559
9560 wrapInner: function wrapInner(html) {
9561 if (jQuery.isFunction(html)) {
9562 return this.each(function (i) {
9563 jQuery(this).wrapInner(html.call(this, i));
9564 });
9565 }
9566
9567 return this.each(function () {
9568 var self = jQuery(this),
9569 contents = self.contents();
9570
9571 if (contents.length) {
9572 contents.wrapAll(html);
9573 } else {
9574 self.append(html);
9575 }
9576 });
9577 },
9578
9579 wrap: function wrap(html) {
9580 var isFunction = jQuery.isFunction(html);
9581
9582 return this.each(function (i) {
9583 jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
9584 });
9585 },
9586
9587 unwrap: function unwrap(selector) {
9588 this.parent(selector).not("body").each(function () {
9589 jQuery(this).replaceWith(this.childNodes);
9590 });
9591 return this;
9592 }
9593 });
9594
9595 jQuery.expr.pseudos.hidden = function (elem) {
9596 return !jQuery.expr.pseudos.visible(elem);
9597 };
9598 jQuery.expr.pseudos.visible = function (elem) {
9599 return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
9600 };
9601
9602 jQuery.ajaxSettings.xhr = function () {
9603 try {
9604 return new window.XMLHttpRequest();
9605 } catch (e) {}
9606 };
9607
9608 var xhrSuccessStatus = {
9609
9610 // File protocol always yields status code 0, assume 200
9611 0: 200,
9612
9613 // Support: IE <=9 only
9614 // #1450: sometimes IE returns 1223 when it should be 204
9615 1223: 204
9616 },
9617 xhrSupported = jQuery.ajaxSettings.xhr();
9618
9619 support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
9620 support.ajax = xhrSupported = !!xhrSupported;
9621
9622 jQuery.ajaxTransport(function (options) {
9623 var _callback, errorCallback;
9624
9625 // Cross domain only allowed if supported through XMLHttpRequest
9626 if (support.cors || xhrSupported && !options.crossDomain) {
9627 return {
9628 send: function send(headers, complete) {
9629 var i,
9630 xhr = options.xhr();
9631
9632 xhr.open(options.type, options.url, options.async, options.username, options.password);
9633
9634 // Apply custom fields if provided
9635 if (options.xhrFields) {
9636 for (i in options.xhrFields) {
9637 xhr[i] = options.xhrFields[i];
9638 }
9639 }
9640
9641 // Override mime type if needed
9642 if (options.mimeType && xhr.overrideMimeType) {
9643 xhr.overrideMimeType(options.mimeType);
9644 }
9645
9646 // X-Requested-With header
9647 // For cross-domain requests, seeing as conditions for a preflight are
9648 // akin to a jigsaw puzzle, we simply never set it to be sure.
9649 // (it can always be set on a per-request basis or even using ajaxSetup)
9650 // For same-domain requests, won't change header if already provided.
9651 if (!options.crossDomain && !headers["X-Requested-With"]) {
9652 headers["X-Requested-With"] = "XMLHttpRequest";
9653 }
9654
9655 // Set headers
9656 for (i in headers) {
9657 xhr.setRequestHeader(i, headers[i]);
9658 }
9659
9660 // Callback
9661 _callback = function callback(type) {
9662 return function () {
9663 if (_callback) {
9664 _callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
9665
9666 if (type === "abort") {
9667 xhr.abort();
9668 } else if (type === "error") {
9669
9670 // Support: IE <=9 only
9671 // On a manual native abort, IE9 throws
9672 // errors on any property access that is not readyState
9673 if (typeof xhr.status !== "number") {
9674 complete(0, "error");
9675 } else {
9676 complete(
9677
9678 // File: protocol always yields status 0; see #8605, #14207
9679 xhr.status, xhr.statusText);
9680 }
9681 } else {
9682 complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText,
9683
9684 // Support: IE <=9 only
9685 // IE9 has no XHR2 but throws on binary (trac-11426)
9686 // For XHR2 non-text, let the caller handle it (gh-2498)
9687 (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText }, xhr.getAllResponseHeaders());
9688 }
9689 }
9690 };
9691 };
9692
9693 // Listen to events
9694 xhr.onload = _callback();
9695 errorCallback = xhr.onerror = _callback("error");
9696
9697 // Support: IE 9 only
9698 // Use onreadystatechange to replace onabort
9699 // to handle uncaught aborts
9700 if (xhr.onabort !== undefined) {
9701 xhr.onabort = errorCallback;
9702 } else {
9703 xhr.onreadystatechange = function () {
9704
9705 // Check readyState before timeout as it changes
9706 if (xhr.readyState === 4) {
9707
9708 // Allow onerror to be called first,
9709 // but that will not handle a native abort
9710 // Also, save errorCallback to a variable
9711 // as xhr.onerror cannot be accessed
9712 window.setTimeout(function () {
9713 if (_callback) {
9714 errorCallback();
9715 }
9716 });
9717 }
9718 };
9719 }
9720
9721 // Create the abort callback
9722 _callback = _callback("abort");
9723
9724 try {
9725
9726 // Do send the request (this may raise an exception)
9727 xhr.send(options.hasContent && options.data || null);
9728 } catch (e) {
9729
9730 // #14683: Only rethrow if this hasn't been notified as an error yet
9731 if (_callback) {
9732 throw e;
9733 }
9734 }
9735 },
9736
9737 abort: function abort() {
9738 if (_callback) {
9739 _callback();
9740 }
9741 }
9742 };
9743 }
9744 });
9745
9746 // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
9747 jQuery.ajaxPrefilter(function (s) {
9748 if (s.crossDomain) {
9749 s.contents.script = false;
9750 }
9751 });
9752
9753 // Install script dataType
9754 jQuery.ajaxSetup({
9755 accepts: {
9756 script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript"
9757 },
9758 contents: {
9759 script: /\b(?:java|ecma)script\b/
9760 },
9761 converters: {
9762 "text script": function textScript(text) {
9763 jQuery.globalEval(text);
9764 return text;
9765 }
9766 }
9767 });
9768
9769 // Handle cache's special case and crossDomain
9770 jQuery.ajaxPrefilter("script", function (s) {
9771 if (s.cache === undefined) {
9772 s.cache = false;
9773 }
9774 if (s.crossDomain) {
9775 s.type = "GET";
9776 }
9777 });
9778
9779 // Bind script tag hack transport
9780 jQuery.ajaxTransport("script", function (s) {
9781
9782 // This transport only deals with cross domain requests
9783 if (s.crossDomain) {
9784 var script, _callback2;
9785 return {
9786 send: function send(_, complete) {
9787 script = jQuery("<script>").prop({
9788 charset: s.scriptCharset,
9789 src: s.url
9790 }).on("load error", _callback2 = function callback(evt) {
9791 script.remove();
9792 _callback2 = null;
9793 if (evt) {
9794 complete(evt.type === "error" ? 404 : 200, evt.type);
9795 }
9796 });
9797
9798 // Use native DOM manipulation to avoid our domManip AJAX trickery
9799 document.head.appendChild(script[0]);
9800 },
9801 abort: function abort() {
9802 if (_callback2) {
9803 _callback2();
9804 }
9805 }
9806 };
9807 }
9808 });
9809
9810 var oldCallbacks = [],
9811 rjsonp = /(=)\?(?=&|$)|\?\?/;
9812
9813 // Default jsonp settings
9814 jQuery.ajaxSetup({
9815 jsonp: "callback",
9816 jsonpCallback: function jsonpCallback() {
9817 var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce++;
9818 this[callback] = true;
9819 return callback;
9820 }
9821 });
9822
9823 // Detect, normalize options and install callbacks for jsonp requests
9824 jQuery.ajaxPrefilter("json jsonp", function (s, originalSettings, jqXHR) {
9825
9826 var callbackName,
9827 overwritten,
9828 responseContainer,
9829 jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data");
9830
9831 // Handle iff the expected data type is "jsonp" or we have a parameter to set
9832 if (jsonProp || s.dataTypes[0] === "jsonp") {
9833
9834 // Get callback name, remembering preexisting value associated with it
9835 callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
9836
9837 // Insert callback into url or form data
9838 if (jsonProp) {
9839 s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
9840 } else if (s.jsonp !== false) {
9841 s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
9842 }
9843
9844 // Use data converter to retrieve json after script execution
9845 s.converters["script json"] = function () {
9846 if (!responseContainer) {
9847 jQuery.error(callbackName + " was not called");
9848 }
9849 return responseContainer[0];
9850 };
9851
9852 // Force json dataType
9853 s.dataTypes[0] = "json";
9854
9855 // Install callback
9856 overwritten = window[callbackName];
9857 window[callbackName] = function () {
9858 responseContainer = arguments;
9859 };
9860
9861 // Clean-up function (fires after converters)
9862 jqXHR.always(function () {
9863
9864 // If previous value didn't exist - remove it
9865 if (overwritten === undefined) {
9866 jQuery(window).removeProp(callbackName);
9867
9868 // Otherwise restore preexisting value
9869 } else {
9870 window[callbackName] = overwritten;
9871 }
9872
9873 // Save back as free
9874 if (s[callbackName]) {
9875
9876 // Make sure that re-using the options doesn't screw things around
9877 s.jsonpCallback = originalSettings.jsonpCallback;
9878
9879 // Save the callback name for future use
9880 oldCallbacks.push(callbackName);
9881 }
9882
9883 // Call if it was a function and we have a response
9884 if (responseContainer && jQuery.isFunction(overwritten)) {
9885 overwritten(responseContainer[0]);
9886 }
9887
9888 responseContainer = overwritten = undefined;
9889 });
9890
9891 // Delegate to script
9892 return "script";
9893 }
9894 });
9895
9896 // Support: Safari 8 only
9897 // In Safari 8 documents created via document.implementation.createHTMLDocument
9898 // collapse sibling forms: the second one becomes a child of the first one.
9899 // Because of that, this security measure has to be disabled in Safari 8.
9900 // https://bugs.webkit.org/show_bug.cgi?id=137337
9901 support.createHTMLDocument = function () {
9902 var body = document.implementation.createHTMLDocument("").body;
9903 body.innerHTML = "<form></form><form></form>";
9904 return body.childNodes.length === 2;
9905 }();
9906
9907 // Argument "data" should be string of html
9908 // context (optional): If specified, the fragment will be created in this context,
9909 // defaults to document
9910 // keepScripts (optional): If true, will include scripts passed in the html string
9911 jQuery.parseHTML = function (data, context, keepScripts) {
9912 if (typeof data !== "string") {
9913 return [];
9914 }
9915 if (typeof context === "boolean") {
9916 keepScripts = context;
9917 context = false;
9918 }
9919
9920 var base, parsed, scripts;
9921
9922 if (!context) {
9923
9924 // Stop scripts or inline event handlers from being executed immediately
9925 // by using document.implementation
9926 if (support.createHTMLDocument) {
9927 context = document.implementation.createHTMLDocument("");
9928
9929 // Set the base href for the created document
9930 // so any parsed elements with URLs
9931 // are based on the document's URL (gh-2965)
9932 base = context.createElement("base");
9933 base.href = document.location.href;
9934 context.head.appendChild(base);
9935 } else {
9936 context = document;
9937 }
9938 }
9939
9940 parsed = rsingleTag.exec(data);
9941 scripts = !keepScripts && [];
9942
9943 // Single tag
9944 if (parsed) {
9945 return [context.createElement(parsed[1])];
9946 }
9947
9948 parsed = buildFragment([data], context, scripts);
9949
9950 if (scripts && scripts.length) {
9951 jQuery(scripts).remove();
9952 }
9953
9954 return jQuery.merge([], parsed.childNodes);
9955 };
9956
9957 /**
9958 * Load a url into a page
9959 */
9960 jQuery.fn.load = function (url, params, callback) {
9961 var selector,
9962 type,
9963 response,
9964 self = this,
9965 off = url.indexOf(" ");
9966
9967 if (off > -1) {
9968 selector = stripAndCollapse(url.slice(off));
9969 url = url.slice(0, off);
9970 }
9971
9972 // If it's a function
9973 if (jQuery.isFunction(params)) {
9974
9975 // We assume that it's the callback
9976 callback = params;
9977 params = undefined;
9978
9979 // Otherwise, build a param string
9980 } else if (params && (typeof params === "undefined" ? "undefined" : _typeof(params)) === "object") {
9981 type = "POST";
9982 }
9983
9984 // If we have elements to modify, make the request
9985 if (self.length > 0) {
9986 jQuery.ajax({
9987 url: url,
9988
9989 // If "type" variable is undefined, then "GET" method will be used.
9990 // Make value of this field explicit since
9991 // user can override it through ajaxSetup method
9992 type: type || "GET",
9993 dataType: "html",
9994 data: params
9995 }).done(function (responseText) {
9996
9997 // Save response for use in complete callback
9998 response = arguments;
9999
10000 self.html(selector ?
10001
10002 // If a selector was specified, locate the right elements in a dummy div
10003 // Exclude scripts to avoid IE 'Permission Denied' errors
10004 jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) :
10005
10006 // Otherwise use the full result
10007 responseText);
10008
10009 // If the request succeeds, this function gets "data", "status", "jqXHR"
10010 // but they are ignored because response was set above.
10011 // If it fails, this function gets "jqXHR", "status", "error"
10012 }).always(callback && function (jqXHR, status) {
10013 self.each(function () {
10014 callback.apply(this, response || [jqXHR.responseText, status, jqXHR]);
10015 });
10016 });
10017 }
10018
10019 return this;
10020 };
10021
10022 // Attach a bunch of functions for handling common AJAX events
10023 jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (i, type) {
10024 jQuery.fn[type] = function (fn) {
10025 return this.on(type, fn);
10026 };
10027 });
10028
10029 jQuery.expr.pseudos.animated = function (elem) {
10030 return jQuery.grep(jQuery.timers, function (fn) {
10031 return elem === fn.elem;
10032 }).length;
10033 };
10034
10035 jQuery.offset = {
10036 setOffset: function setOffset(elem, options, i) {
10037 var curPosition,
10038 curLeft,
10039 curCSSTop,
10040 curTop,
10041 curOffset,
10042 curCSSLeft,
10043 calculatePosition,
10044 position = jQuery.css(elem, "position"),
10045 curElem = jQuery(elem),
10046 props = {};
10047
10048 // Set position first, in-case top/left are set even on static elem
10049 if (position === "static") {
10050 elem.style.position = "relative";
10051 }
10052
10053 curOffset = curElem.offset();
10054 curCSSTop = jQuery.css(elem, "top");
10055 curCSSLeft = jQuery.css(elem, "left");
10056 calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
10057
10058 // Need to be able to calculate position if either
10059 // top or left is auto and position is either absolute or fixed
10060 if (calculatePosition) {
10061 curPosition = curElem.position();
10062 curTop = curPosition.top;
10063 curLeft = curPosition.left;
10064 } else {
10065 curTop = parseFloat(curCSSTop) || 0;
10066 curLeft = parseFloat(curCSSLeft) || 0;
10067 }
10068
10069 if (jQuery.isFunction(options)) {
10070
10071 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
10072 options = options.call(elem, i, jQuery.extend({}, curOffset));
10073 }
10074
10075 if (options.top != null) {
10076 props.top = options.top - curOffset.top + curTop;
10077 }
10078 if (options.left != null) {
10079 props.left = options.left - curOffset.left + curLeft;
10080 }
10081
10082 if ("using" in options) {
10083 options.using.call(elem, props);
10084 } else {
10085 curElem.css(props);
10086 }
10087 }
10088 };
10089
10090 jQuery.fn.extend({
10091 offset: function offset(options) {
10092
10093 // Preserve chaining for setter
10094 if (arguments.length) {
10095 return options === undefined ? this : this.each(function (i) {
10096 jQuery.offset.setOffset(this, options, i);
10097 });
10098 }
10099
10100 var doc,
10101 docElem,
10102 rect,
10103 win,
10104 elem = this[0];
10105
10106 if (!elem) {
10107 return;
10108 }
10109
10110 // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
10111 // Support: IE <=11 only
10112 // Running getBoundingClientRect on a
10113 // disconnected node in IE throws an error
10114 if (!elem.getClientRects().length) {
10115 return { top: 0, left: 0 };
10116 }
10117
10118 rect = elem.getBoundingClientRect();
10119
10120 doc = elem.ownerDocument;
10121 docElem = doc.documentElement;
10122 win = doc.defaultView;
10123
10124 return {
10125 top: rect.top + win.pageYOffset - docElem.clientTop,
10126 left: rect.left + win.pageXOffset - docElem.clientLeft
10127 };
10128 },
10129
10130 position: function position() {
10131 if (!this[0]) {
10132 return;
10133 }
10134
10135 var offsetParent,
10136 offset,
10137 elem = this[0],
10138 parentOffset = { top: 0, left: 0 };
10139
10140 // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
10141 // because it is its only offset parent
10142 if (jQuery.css(elem, "position") === "fixed") {
10143
10144 // Assume getBoundingClientRect is there when computed position is fixed
10145 offset = elem.getBoundingClientRect();
10146 } else {
10147
10148 // Get *real* offsetParent
10149 offsetParent = this.offsetParent();
10150
10151 // Get correct offsets
10152 offset = this.offset();
10153 if (!nodeName(offsetParent[0], "html")) {
10154 parentOffset = offsetParent.offset();
10155 }
10156
10157 // Add offsetParent borders
10158 parentOffset = {
10159 top: parentOffset.top + jQuery.css(offsetParent[0], "borderTopWidth", true),
10160 left: parentOffset.left + jQuery.css(offsetParent[0], "borderLeftWidth", true)
10161 };
10162 }
10163
10164 // Subtract parent offsets and element margins
10165 return {
10166 top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
10167 left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
10168 };
10169 },
10170
10171 // This method will return documentElement in the following cases:
10172 // 1) For the element inside the iframe without offsetParent, this method will return
10173 // documentElement of the parent window
10174 // 2) For the hidden or detached element
10175 // 3) For body or html element, i.e. in case of the html node - it will return itself
10176 //
10177 // but those exceptions were never presented as a real life use-cases
10178 // and might be considered as more preferable results.
10179 //
10180 // This logic, however, is not guaranteed and can change at any point in the future
10181 offsetParent: function offsetParent() {
10182 return this.map(function () {
10183 var offsetParent = this.offsetParent;
10184
10185 while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
10186 offsetParent = offsetParent.offsetParent;
10187 }
10188
10189 return offsetParent || documentElement;
10190 });
10191 }
10192 });
10193
10194 // Create scrollLeft and scrollTop methods
10195 jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (method, prop) {
10196 var top = "pageYOffset" === prop;
10197
10198 jQuery.fn[method] = function (val) {
10199 return access(this, function (elem, method, val) {
10200
10201 // Coalesce documents and windows
10202 var win;
10203 if (jQuery.isWindow(elem)) {
10204 win = elem;
10205 } else if (elem.nodeType === 9) {
10206 win = elem.defaultView;
10207 }
10208
10209 if (val === undefined) {
10210 return win ? win[prop] : elem[method];
10211 }
10212
10213 if (win) {
10214 win.scrollTo(!top ? val : win.pageXOffset, top ? val : win.pageYOffset);
10215 } else {
10216 elem[method] = val;
10217 }
10218 }, method, val, arguments.length);
10219 };
10220 });
10221
10222 // Support: Safari <=7 - 9.1, Chrome <=37 - 49
10223 // Add the top/left cssHooks using jQuery.fn.position
10224 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10225 // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
10226 // getComputedStyle returns percent when specified for top/left/bottom/right;
10227 // rather than make the css module depend on the offset module, just check for it here
10228 jQuery.each(["top", "left"], function (i, prop) {
10229 jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function (elem, computed) {
10230 if (computed) {
10231 computed = curCSS(elem, prop);
10232
10233 // If curCSS returns percentage, fallback to offset
10234 return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed;
10235 }
10236 });
10237 });
10238
10239 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10240 jQuery.each({ Height: "height", Width: "width" }, function (name, type) {
10241 jQuery.each({ padding: "inner" + name, content: type, "": "outer" + name }, function (defaultExtra, funcName) {
10242
10243 // Margin is only for outerHeight, outerWidth
10244 jQuery.fn[funcName] = function (margin, value) {
10245 var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
10246 extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
10247
10248 return access(this, function (elem, type, value) {
10249 var doc;
10250
10251 if (jQuery.isWindow(elem)) {
10252
10253 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
10254 return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
10255 }
10256
10257 // Get document width or height
10258 if (elem.nodeType === 9) {
10259 doc = elem.documentElement;
10260
10261 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
10262 // whichever is greatest
10263 return Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name]);
10264 }
10265
10266 return value === undefined ?
10267
10268 // Get width or height on the element, requesting but not forcing parseFloat
10269 jQuery.css(elem, type, extra) :
10270
10271 // Set width or height on the element
10272 jQuery.style(elem, type, value, extra);
10273 }, type, chainable ? margin : undefined, chainable);
10274 };
10275 });
10276 });
10277
10278 jQuery.fn.extend({
10279
10280 bind: function bind(types, data, fn) {
10281 return this.on(types, null, data, fn);
10282 },
10283 unbind: function unbind(types, fn) {
10284 return this.off(types, null, fn);
10285 },
10286
10287 delegate: function delegate(selector, types, data, fn) {
10288 return this.on(types, selector, data, fn);
10289 },
10290 undelegate: function undelegate(selector, types, fn) {
10291
10292 // ( namespace ) or ( selector, types [, fn] )
10293 return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
10294 }
10295 });
10296
10297 jQuery.holdReady = function (hold) {
10298 if (hold) {
10299 jQuery.readyWait++;
10300 } else {
10301 jQuery.ready(true);
10302 }
10303 };
10304 jQuery.isArray = Array.isArray;
10305 jQuery.parseJSON = JSON.parse;
10306 jQuery.nodeName = nodeName;
10307
10308 // Register as a named AMD module, since jQuery can be concatenated with other
10309 // files that may use define, but not via a proper concatenation script that
10310 // understands anonymous AMD modules. A named AMD is safest and most robust
10311 // way to register. Lowercase jquery is used because AMD module names are
10312 // derived from file names, and jQuery is normally delivered in a lowercase
10313 // file name. Do this after creating the global so that if an AMD module wants
10314 // to call noConflict to hide this version of jQuery, it will work.
10315
10316 // Note that for maximum portability, libraries that are not jQuery should
10317 // declare themselves as anonymous modules, and avoid setting a global if an
10318 // AMD loader is present. jQuery is a special case. For more information, see
10319 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10320
10321 if (true) {
10322 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
10323 return jQuery;
10324 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
10325 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
10326 }
10327
10328 var
10329
10330 // Map over jQuery in case of overwrite
10331 _jQuery = window.jQuery,
10332
10333
10334 // Map over the $ in case of overwrite
10335 _$ = window.$;
10336
10337 jQuery.noConflict = function (deep) {
10338 if (window.$ === jQuery) {
10339 window.$ = _$;
10340 }
10341
10342 if (deep && window.jQuery === jQuery) {
10343 window.jQuery = _jQuery;
10344 }
10345
10346 return jQuery;
10347 };
10348
10349 // Expose jQuery and $ identifiers, even in AMD
10350 // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10351 // and CommonJS for browser emulators (#13566)
10352 if (!noGlobal) {
10353 window.jQuery = window.$ = jQuery;
10354 }
10355
10356 return jQuery;
10357});
10358/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)(module)))
10359
10360/***/ }),
10361/* 2 */
10362/***/ (function(module, exports, __webpack_require__) {
10363
10364"use strict";
10365var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
10366
10367var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
10368
10369/*! tether 1.4.0 */
10370
10371(function (root, factory) {
10372 if (true) {
10373 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
10374 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
10375 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
10376 __WEBPACK_AMD_DEFINE_FACTORY__),
10377 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
10378 } else if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') {
10379 module.exports = factory(require, exports, module);
10380 } else {
10381 root.Tether = factory();
10382 }
10383})(undefined, function (require, exports, module) {
10384
10385 'use strict';
10386
10387 var _createClass = function () {
10388 function defineProperties(target, props) {
10389 for (var i = 0; i < props.length; i++) {
10390 var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
10391 }
10392 }return function (Constructor, protoProps, staticProps) {
10393 if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
10394 };
10395 }();
10396
10397 function _classCallCheck(instance, Constructor) {
10398 if (!(instance instanceof Constructor)) {
10399 throw new TypeError('Cannot call a class as a function');
10400 }
10401 }
10402
10403 var TetherBase = undefined;
10404 if (typeof TetherBase === 'undefined') {
10405 TetherBase = { modules: [] };
10406 }
10407
10408 var zeroElement = null;
10409
10410 // Same as native getBoundingClientRect, except it takes into account parent <frame> offsets
10411 // if the element lies within a nested document (<frame> or <iframe>-like).
10412 function getActualBoundingClientRect(node) {
10413 var boundingRect = node.getBoundingClientRect();
10414
10415 // The original object returned by getBoundingClientRect is immutable, so we clone it
10416 // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9
10417 var rect = {};
10418 for (var k in boundingRect) {
10419 rect[k] = boundingRect[k];
10420 }
10421
10422 if (node.ownerDocument !== document) {
10423 var _frameElement = node.ownerDocument.defaultView.frameElement;
10424 if (_frameElement) {
10425 var frameRect = getActualBoundingClientRect(_frameElement);
10426 rect.top += frameRect.top;
10427 rect.bottom += frameRect.top;
10428 rect.left += frameRect.left;
10429 rect.right += frameRect.left;
10430 }
10431 }
10432
10433 return rect;
10434 }
10435
10436 function getScrollParents(el) {
10437 // In firefox if the el is inside an iframe with display: none; window.getComputedStyle() will return null;
10438 // https://bugzilla.mozilla.org/show_bug.cgi?id=548397
10439 var computedStyle = getComputedStyle(el) || {};
10440 var position = computedStyle.position;
10441 var parents = [];
10442
10443 if (position === 'fixed') {
10444 return [el];
10445 }
10446
10447 var parent = el;
10448 while ((parent = parent.parentNode) && parent && parent.nodeType === 1) {
10449 var style = undefined;
10450 try {
10451 style = getComputedStyle(parent);
10452 } catch (err) {}
10453
10454 if (typeof style === 'undefined' || style === null) {
10455 parents.push(parent);
10456 return parents;
10457 }
10458
10459 var _style = style;
10460 var overflow = _style.overflow;
10461 var overflowX = _style.overflowX;
10462 var overflowY = _style.overflowY;
10463
10464 if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {
10465 if (position !== 'absolute' || ['relative', 'absolute', 'fixed'].indexOf(style.position) >= 0) {
10466 parents.push(parent);
10467 }
10468 }
10469 }
10470
10471 parents.push(el.ownerDocument.body);
10472
10473 // If the node is within a frame, account for the parent window scroll
10474 if (el.ownerDocument !== document) {
10475 parents.push(el.ownerDocument.defaultView);
10476 }
10477
10478 return parents;
10479 }
10480
10481 var uniqueId = function () {
10482 var id = 0;
10483 return function () {
10484 return ++id;
10485 };
10486 }();
10487
10488 var zeroPosCache = {};
10489 var getOrigin = function getOrigin() {
10490 // getBoundingClientRect is unfortunately too accurate. It introduces a pixel or two of
10491 // jitter as the user scrolls that messes with our ability to detect if two positions
10492 // are equivilant or not. We place an element at the top left of the page that will
10493 // get the same jitter, so we can cancel the two out.
10494 var node = zeroElement;
10495 if (!node || !document.body.contains(node)) {
10496 node = document.createElement('div');
10497 node.setAttribute('data-tether-id', uniqueId());
10498 extend(node.style, {
10499 top: 0,
10500 left: 0,
10501 position: 'absolute'
10502 });
10503
10504 document.body.appendChild(node);
10505
10506 zeroElement = node;
10507 }
10508
10509 var id = node.getAttribute('data-tether-id');
10510 if (typeof zeroPosCache[id] === 'undefined') {
10511 zeroPosCache[id] = getActualBoundingClientRect(node);
10512
10513 // Clear the cache when this position call is done
10514 defer(function () {
10515 delete zeroPosCache[id];
10516 });
10517 }
10518
10519 return zeroPosCache[id];
10520 };
10521
10522 function removeUtilElements() {
10523 if (zeroElement) {
10524 document.body.removeChild(zeroElement);
10525 }
10526 zeroElement = null;
10527 };
10528
10529 function getBounds(el) {
10530 var doc = undefined;
10531 if (el === document) {
10532 doc = document;
10533 el = document.documentElement;
10534 } else {
10535 doc = el.ownerDocument;
10536 }
10537
10538 var docEl = doc.documentElement;
10539
10540 var box = getActualBoundingClientRect(el);
10541
10542 var origin = getOrigin();
10543
10544 box.top -= origin.top;
10545 box.left -= origin.left;
10546
10547 if (typeof box.width === 'undefined') {
10548 box.width = document.body.scrollWidth - box.left - box.right;
10549 }
10550 if (typeof box.height === 'undefined') {
10551 box.height = document.body.scrollHeight - box.top - box.bottom;
10552 }
10553
10554 box.top = box.top - docEl.clientTop;
10555 box.left = box.left - docEl.clientLeft;
10556 box.right = doc.body.clientWidth - box.width - box.left;
10557 box.bottom = doc.body.clientHeight - box.height - box.top;
10558
10559 return box;
10560 }
10561
10562 function getOffsetParent(el) {
10563 return el.offsetParent || document.documentElement;
10564 }
10565
10566 var _scrollBarSize = null;
10567 function getScrollBarSize() {
10568 if (_scrollBarSize) {
10569 return _scrollBarSize;
10570 }
10571 var inner = document.createElement('div');
10572 inner.style.width = '100%';
10573 inner.style.height = '200px';
10574
10575 var outer = document.createElement('div');
10576 extend(outer.style, {
10577 position: 'absolute',
10578 top: 0,
10579 left: 0,
10580 pointerEvents: 'none',
10581 visibility: 'hidden',
10582 width: '200px',
10583 height: '150px',
10584 overflow: 'hidden'
10585 });
10586
10587 outer.appendChild(inner);
10588
10589 document.body.appendChild(outer);
10590
10591 var widthContained = inner.offsetWidth;
10592 outer.style.overflow = 'scroll';
10593 var widthScroll = inner.offsetWidth;
10594
10595 if (widthContained === widthScroll) {
10596 widthScroll = outer.clientWidth;
10597 }
10598
10599 document.body.removeChild(outer);
10600
10601 var width = widthContained - widthScroll;
10602
10603 _scrollBarSize = { width: width, height: width };
10604 return _scrollBarSize;
10605 }
10606
10607 function extend() {
10608 var out = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
10609
10610 var args = [];
10611
10612 Array.prototype.push.apply(args, arguments);
10613
10614 args.slice(1).forEach(function (obj) {
10615 if (obj) {
10616 for (var key in obj) {
10617 if ({}.hasOwnProperty.call(obj, key)) {
10618 out[key] = obj[key];
10619 }
10620 }
10621 }
10622 });
10623
10624 return out;
10625 }
10626
10627 function removeClass(el, name) {
10628 if (typeof el.classList !== 'undefined') {
10629 name.split(' ').forEach(function (cls) {
10630 if (cls.trim()) {
10631 el.classList.remove(cls);
10632 }
10633 });
10634 } else {
10635 var regex = new RegExp('(^| )' + name.split(' ').join('|') + '( |$)', 'gi');
10636 var className = getClassName(el).replace(regex, ' ');
10637 setClassName(el, className);
10638 }
10639 }
10640
10641 function addClass(el, name) {
10642 if (typeof el.classList !== 'undefined') {
10643 name.split(' ').forEach(function (cls) {
10644 if (cls.trim()) {
10645 el.classList.add(cls);
10646 }
10647 });
10648 } else {
10649 removeClass(el, name);
10650 var cls = getClassName(el) + (' ' + name);
10651 setClassName(el, cls);
10652 }
10653 }
10654
10655 function hasClass(el, name) {
10656 if (typeof el.classList !== 'undefined') {
10657 return el.classList.contains(name);
10658 }
10659 var className = getClassName(el);
10660 return new RegExp('(^| )' + name + '( |$)', 'gi').test(className);
10661 }
10662
10663 function getClassName(el) {
10664 // Can't use just SVGAnimatedString here since nodes within a Frame in IE have
10665 // completely separately SVGAnimatedString base classes
10666 if (el.className instanceof el.ownerDocument.defaultView.SVGAnimatedString) {
10667 return el.className.baseVal;
10668 }
10669 return el.className;
10670 }
10671
10672 function setClassName(el, className) {
10673 el.setAttribute('class', className);
10674 }
10675
10676 function updateClasses(el, add, all) {
10677 // Of the set of 'all' classes, we need the 'add' classes, and only the
10678 // 'add' classes to be set.
10679 all.forEach(function (cls) {
10680 if (add.indexOf(cls) === -1 && hasClass(el, cls)) {
10681 removeClass(el, cls);
10682 }
10683 });
10684
10685 add.forEach(function (cls) {
10686 if (!hasClass(el, cls)) {
10687 addClass(el, cls);
10688 }
10689 });
10690 }
10691
10692 var deferred = [];
10693
10694 var defer = function defer(fn) {
10695 deferred.push(fn);
10696 };
10697
10698 var flush = function flush() {
10699 var fn = undefined;
10700 while (fn = deferred.pop()) {
10701 fn();
10702 }
10703 };
10704
10705 var Evented = function () {
10706 function Evented() {
10707 _classCallCheck(this, Evented);
10708 }
10709
10710 _createClass(Evented, [{
10711 key: 'on',
10712 value: function on(event, handler, ctx) {
10713 var once = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
10714
10715 if (typeof this.bindings === 'undefined') {
10716 this.bindings = {};
10717 }
10718 if (typeof this.bindings[event] === 'undefined') {
10719 this.bindings[event] = [];
10720 }
10721 this.bindings[event].push({ handler: handler, ctx: ctx, once: once });
10722 }
10723 }, {
10724 key: 'once',
10725 value: function once(event, handler, ctx) {
10726 this.on(event, handler, ctx, true);
10727 }
10728 }, {
10729 key: 'off',
10730 value: function off(event, handler) {
10731 if (typeof this.bindings === 'undefined' || typeof this.bindings[event] === 'undefined') {
10732 return;
10733 }
10734
10735 if (typeof handler === 'undefined') {
10736 delete this.bindings[event];
10737 } else {
10738 var i = 0;
10739 while (i < this.bindings[event].length) {
10740 if (this.bindings[event][i].handler === handler) {
10741 this.bindings[event].splice(i, 1);
10742 } else {
10743 ++i;
10744 }
10745 }
10746 }
10747 }
10748 }, {
10749 key: 'trigger',
10750 value: function trigger(event) {
10751 if (typeof this.bindings !== 'undefined' && this.bindings[event]) {
10752 var i = 0;
10753
10754 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10755 args[_key - 1] = arguments[_key];
10756 }
10757
10758 while (i < this.bindings[event].length) {
10759 var _bindings$event$i = this.bindings[event][i];
10760 var handler = _bindings$event$i.handler;
10761 var ctx = _bindings$event$i.ctx;
10762 var once = _bindings$event$i.once;
10763
10764 var context = ctx;
10765 if (typeof context === 'undefined') {
10766 context = this;
10767 }
10768
10769 handler.apply(context, args);
10770
10771 if (once) {
10772 this.bindings[event].splice(i, 1);
10773 } else {
10774 ++i;
10775 }
10776 }
10777 }
10778 }
10779 }]);
10780
10781 return Evented;
10782 }();
10783
10784 TetherBase.Utils = {
10785 getActualBoundingClientRect: getActualBoundingClientRect,
10786 getScrollParents: getScrollParents,
10787 getBounds: getBounds,
10788 getOffsetParent: getOffsetParent,
10789 extend: extend,
10790 addClass: addClass,
10791 removeClass: removeClass,
10792 hasClass: hasClass,
10793 updateClasses: updateClasses,
10794 defer: defer,
10795 flush: flush,
10796 uniqueId: uniqueId,
10797 Evented: Evented,
10798 getScrollBarSize: getScrollBarSize,
10799 removeUtilElements: removeUtilElements
10800 };
10801 /* globals TetherBase, performance */
10802
10803 'use strict';
10804
10805 var _slicedToArray = function () {
10806 function sliceIterator(arr, i) {
10807 var _arr = [];var _n = true;var _d = false;var _e = undefined;try {
10808 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
10809 _arr.push(_s.value);if (i && _arr.length === i) break;
10810 }
10811 } catch (err) {
10812 _d = true;_e = err;
10813 } finally {
10814 try {
10815 if (!_n && _i['return']) _i['return']();
10816 } finally {
10817 if (_d) throw _e;
10818 }
10819 }return _arr;
10820 }return function (arr, i) {
10821 if (Array.isArray(arr)) {
10822 return arr;
10823 } else if (Symbol.iterator in Object(arr)) {
10824 return sliceIterator(arr, i);
10825 } else {
10826 throw new TypeError('Invalid attempt to destructure non-iterable instance');
10827 }
10828 };
10829 }();
10830
10831 var _createClass = function () {
10832 function defineProperties(target, props) {
10833 for (var i = 0; i < props.length; i++) {
10834 var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
10835 }
10836 }return function (Constructor, protoProps, staticProps) {
10837 if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
10838 };
10839 }();
10840
10841 var _get = function get(_x6, _x7, _x8) {
10842 var _again = true;_function: while (_again) {
10843 var object = _x6,
10844 property = _x7,
10845 receiver = _x8;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) {
10846 var parent = Object.getPrototypeOf(object);if (parent === null) {
10847 return undefined;
10848 } else {
10849 _x6 = parent;_x7 = property;_x8 = receiver;_again = true;desc = parent = undefined;continue _function;
10850 }
10851 } else if ('value' in desc) {
10852 return desc.value;
10853 } else {
10854 var getter = desc.get;if (getter === undefined) {
10855 return undefined;
10856 }return getter.call(receiver);
10857 }
10858 }
10859 };
10860
10861 function _classCallCheck(instance, Constructor) {
10862 if (!(instance instanceof Constructor)) {
10863 throw new TypeError('Cannot call a class as a function');
10864 }
10865 }
10866
10867 function _inherits(subClass, superClass) {
10868 if (typeof superClass !== 'function' && superClass !== null) {
10869 throw new TypeError('Super expression must either be null or a function, not ' + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
10870 }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
10871 }
10872
10873 if (typeof TetherBase === 'undefined') {
10874 throw new Error('You must include the utils.js file before tether.js');
10875 }
10876
10877 var _TetherBase$Utils = TetherBase.Utils;
10878 var getScrollParents = _TetherBase$Utils.getScrollParents;
10879 var getBounds = _TetherBase$Utils.getBounds;
10880 var getOffsetParent = _TetherBase$Utils.getOffsetParent;
10881 var extend = _TetherBase$Utils.extend;
10882 var addClass = _TetherBase$Utils.addClass;
10883 var removeClass = _TetherBase$Utils.removeClass;
10884 var updateClasses = _TetherBase$Utils.updateClasses;
10885 var defer = _TetherBase$Utils.defer;
10886 var flush = _TetherBase$Utils.flush;
10887 var getScrollBarSize = _TetherBase$Utils.getScrollBarSize;
10888 var removeUtilElements = _TetherBase$Utils.removeUtilElements;
10889
10890 function within(a, b) {
10891 var diff = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];
10892
10893 return a + diff >= b && b >= a - diff;
10894 }
10895
10896 var transformKey = function () {
10897 if (typeof document === 'undefined') {
10898 return '';
10899 }
10900 var el = document.createElement('div');
10901
10902 var transforms = ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform'];
10903 for (var i = 0; i < transforms.length; ++i) {
10904 var key = transforms[i];
10905 if (el.style[key] !== undefined) {
10906 return key;
10907 }
10908 }
10909 }();
10910
10911 var tethers = [];
10912
10913 var position = function position() {
10914 tethers.forEach(function (tether) {
10915 tether.position(false);
10916 });
10917 flush();
10918 };
10919
10920 function now() {
10921 if (typeof performance !== 'undefined' && typeof performance.now !== 'undefined') {
10922 return performance.now();
10923 }
10924 return +new Date();
10925 }
10926
10927 (function () {
10928 var lastCall = null;
10929 var lastDuration = null;
10930 var pendingTimeout = null;
10931
10932 var tick = function tick() {
10933 if (typeof lastDuration !== 'undefined' && lastDuration > 16) {
10934 // We voluntarily throttle ourselves if we can't manage 60fps
10935 lastDuration = Math.min(lastDuration - 16, 250);
10936
10937 // Just in case this is the last event, remember to position just once more
10938 pendingTimeout = setTimeout(tick, 250);
10939 return;
10940 }
10941
10942 if (typeof lastCall !== 'undefined' && now() - lastCall < 10) {
10943 // Some browsers call events a little too frequently, refuse to run more than is reasonable
10944 return;
10945 }
10946
10947 if (pendingTimeout != null) {
10948 clearTimeout(pendingTimeout);
10949 pendingTimeout = null;
10950 }
10951
10952 lastCall = now();
10953 position();
10954 lastDuration = now() - lastCall;
10955 };
10956
10957 if (typeof window !== 'undefined' && typeof window.addEventListener !== 'undefined') {
10958 ['resize', 'scroll', 'touchmove'].forEach(function (event) {
10959 window.addEventListener(event, tick);
10960 });
10961 }
10962 })();
10963
10964 var MIRROR_LR = {
10965 center: 'center',
10966 left: 'right',
10967 right: 'left'
10968 };
10969
10970 var MIRROR_TB = {
10971 middle: 'middle',
10972 top: 'bottom',
10973 bottom: 'top'
10974 };
10975
10976 var OFFSET_MAP = {
10977 top: 0,
10978 left: 0,
10979 middle: '50%',
10980 center: '50%',
10981 bottom: '100%',
10982 right: '100%'
10983 };
10984
10985 var autoToFixedAttachment = function autoToFixedAttachment(attachment, relativeToAttachment) {
10986 var left = attachment.left;
10987 var top = attachment.top;
10988
10989 if (left === 'auto') {
10990 left = MIRROR_LR[relativeToAttachment.left];
10991 }
10992
10993 if (top === 'auto') {
10994 top = MIRROR_TB[relativeToAttachment.top];
10995 }
10996
10997 return { left: left, top: top };
10998 };
10999
11000 var attachmentToOffset = function attachmentToOffset(attachment) {
11001 var left = attachment.left;
11002 var top = attachment.top;
11003
11004 if (typeof OFFSET_MAP[attachment.left] !== 'undefined') {
11005 left = OFFSET_MAP[attachment.left];
11006 }
11007
11008 if (typeof OFFSET_MAP[attachment.top] !== 'undefined') {
11009 top = OFFSET_MAP[attachment.top];
11010 }
11011
11012 return { left: left, top: top };
11013 };
11014
11015 function addOffset() {
11016 var out = { top: 0, left: 0 };
11017
11018 for (var _len = arguments.length, offsets = Array(_len), _key = 0; _key < _len; _key++) {
11019 offsets[_key] = arguments[_key];
11020 }
11021
11022 offsets.forEach(function (_ref) {
11023 var top = _ref.top;
11024 var left = _ref.left;
11025
11026 if (typeof top === 'string') {
11027 top = parseFloat(top, 10);
11028 }
11029 if (typeof left === 'string') {
11030 left = parseFloat(left, 10);
11031 }
11032
11033 out.top += top;
11034 out.left += left;
11035 });
11036
11037 return out;
11038 }
11039
11040 function offsetToPx(offset, size) {
11041 if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) {
11042 offset.left = parseFloat(offset.left, 10) / 100 * size.width;
11043 }
11044 if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) {
11045 offset.top = parseFloat(offset.top, 10) / 100 * size.height;
11046 }
11047
11048 return offset;
11049 }
11050
11051 var parseOffset = function parseOffset(value) {
11052 var _value$split = value.split(' ');
11053
11054 var _value$split2 = _slicedToArray(_value$split, 2);
11055
11056 var top = _value$split2[0];
11057 var left = _value$split2[1];
11058
11059 return { top: top, left: left };
11060 };
11061 var parseAttachment = parseOffset;
11062
11063 var TetherClass = function (_Evented) {
11064 _inherits(TetherClass, _Evented);
11065
11066 function TetherClass(options) {
11067 var _this = this;
11068
11069 _classCallCheck(this, TetherClass);
11070
11071 _get(Object.getPrototypeOf(TetherClass.prototype), 'constructor', this).call(this);
11072 this.position = this.position.bind(this);
11073
11074 tethers.push(this);
11075
11076 this.history = [];
11077
11078 this.setOptions(options, false);
11079
11080 TetherBase.modules.forEach(function (module) {
11081 if (typeof module.initialize !== 'undefined') {
11082 module.initialize.call(_this);
11083 }
11084 });
11085
11086 this.position();
11087 }
11088
11089 _createClass(TetherClass, [{
11090 key: 'getClass',
11091 value: function getClass() {
11092 var key = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
11093 var classes = this.options.classes;
11094
11095 if (typeof classes !== 'undefined' && classes[key]) {
11096 return this.options.classes[key];
11097 } else if (this.options.classPrefix) {
11098 return this.options.classPrefix + '-' + key;
11099 } else {
11100 return key;
11101 }
11102 }
11103 }, {
11104 key: 'setOptions',
11105 value: function setOptions(options) {
11106 var _this2 = this;
11107
11108 var pos = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
11109
11110 var defaults = {
11111 offset: '0 0',
11112 targetOffset: '0 0',
11113 targetAttachment: 'auto auto',
11114 classPrefix: 'tether'
11115 };
11116
11117 this.options = extend(defaults, options);
11118
11119 var _options = this.options;
11120 var element = _options.element;
11121 var target = _options.target;
11122 var targetModifier = _options.targetModifier;
11123
11124 this.element = element;
11125 this.target = target;
11126 this.targetModifier = targetModifier;
11127
11128 if (this.target === 'viewport') {
11129 this.target = document.body;
11130 this.targetModifier = 'visible';
11131 } else if (this.target === 'scroll-handle') {
11132 this.target = document.body;
11133 this.targetModifier = 'scroll-handle';
11134 }
11135
11136 ['element', 'target'].forEach(function (key) {
11137 if (typeof _this2[key] === 'undefined') {
11138 throw new Error('Tether Error: Both element and target must be defined');
11139 }
11140
11141 if (typeof _this2[key].jquery !== 'undefined') {
11142 _this2[key] = _this2[key][0];
11143 } else if (typeof _this2[key] === 'string') {
11144 _this2[key] = document.querySelector(_this2[key]);
11145 }
11146 });
11147
11148 addClass(this.element, this.getClass('element'));
11149 if (!(this.options.addTargetClasses === false)) {
11150 addClass(this.target, this.getClass('target'));
11151 }
11152
11153 if (!this.options.attachment) {
11154 throw new Error('Tether Error: You must provide an attachment');
11155 }
11156
11157 this.targetAttachment = parseAttachment(this.options.targetAttachment);
11158 this.attachment = parseAttachment(this.options.attachment);
11159 this.offset = parseOffset(this.options.offset);
11160 this.targetOffset = parseOffset(this.options.targetOffset);
11161
11162 if (typeof this.scrollParents !== 'undefined') {
11163 this.disable();
11164 }
11165
11166 if (this.targetModifier === 'scroll-handle') {
11167 this.scrollParents = [this.target];
11168 } else {
11169 this.scrollParents = getScrollParents(this.target);
11170 }
11171
11172 if (!(this.options.enabled === false)) {
11173 this.enable(pos);
11174 }
11175 }
11176 }, {
11177 key: 'getTargetBounds',
11178 value: function getTargetBounds() {
11179 if (typeof this.targetModifier !== 'undefined') {
11180 if (this.targetModifier === 'visible') {
11181 if (this.target === document.body) {
11182 return { top: pageYOffset, left: pageXOffset, height: innerHeight, width: innerWidth };
11183 } else {
11184 var bounds = getBounds(this.target);
11185
11186 var out = {
11187 height: bounds.height,
11188 width: bounds.width,
11189 top: bounds.top,
11190 left: bounds.left
11191 };
11192
11193 out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top));
11194 out.height = Math.min(out.height, bounds.height - (bounds.top + bounds.height - (pageYOffset + innerHeight)));
11195 out.height = Math.min(innerHeight, out.height);
11196 out.height -= 2;
11197
11198 out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left));
11199 out.width = Math.min(out.width, bounds.width - (bounds.left + bounds.width - (pageXOffset + innerWidth)));
11200 out.width = Math.min(innerWidth, out.width);
11201 out.width -= 2;
11202
11203 if (out.top < pageYOffset) {
11204 out.top = pageYOffset;
11205 }
11206 if (out.left < pageXOffset) {
11207 out.left = pageXOffset;
11208 }
11209
11210 return out;
11211 }
11212 } else if (this.targetModifier === 'scroll-handle') {
11213 var bounds = undefined;
11214 var target = this.target;
11215 if (target === document.body) {
11216 target = document.documentElement;
11217
11218 bounds = {
11219 left: pageXOffset,
11220 top: pageYOffset,
11221 height: innerHeight,
11222 width: innerWidth
11223 };
11224 } else {
11225 bounds = getBounds(target);
11226 }
11227
11228 var style = getComputedStyle(target);
11229
11230 var hasBottomScroll = target.scrollWidth > target.clientWidth || [style.overflow, style.overflowX].indexOf('scroll') >= 0 || this.target !== document.body;
11231
11232 var scrollBottom = 0;
11233 if (hasBottomScroll) {
11234 scrollBottom = 15;
11235 }
11236
11237 var height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;
11238
11239 var out = {
11240 width: 15,
11241 height: height * 0.975 * (height / target.scrollHeight),
11242 left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15
11243 };
11244
11245 var fitAdj = 0;
11246 if (height < 408 && this.target === document.body) {
11247 fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58;
11248 }
11249
11250 if (this.target !== document.body) {
11251 out.height = Math.max(out.height, 24);
11252 }
11253
11254 var scrollPercentage = this.target.scrollTop / (target.scrollHeight - height);
11255 out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth);
11256
11257 if (this.target === document.body) {
11258 out.height = Math.max(out.height, 24);
11259 }
11260
11261 return out;
11262 }
11263 } else {
11264 return getBounds(this.target);
11265 }
11266 }
11267 }, {
11268 key: 'clearCache',
11269 value: function clearCache() {
11270 this._cache = {};
11271 }
11272 }, {
11273 key: 'cache',
11274 value: function cache(k, getter) {
11275 // More than one module will often need the same DOM info, so
11276 // we keep a cache which is cleared on each position call
11277 if (typeof this._cache === 'undefined') {
11278 this._cache = {};
11279 }
11280
11281 if (typeof this._cache[k] === 'undefined') {
11282 this._cache[k] = getter.call(this);
11283 }
11284
11285 return this._cache[k];
11286 }
11287 }, {
11288 key: 'enable',
11289 value: function enable() {
11290 var _this3 = this;
11291
11292 var pos = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
11293
11294 if (!(this.options.addTargetClasses === false)) {
11295 addClass(this.target, this.getClass('enabled'));
11296 }
11297 addClass(this.element, this.getClass('enabled'));
11298 this.enabled = true;
11299
11300 this.scrollParents.forEach(function (parent) {
11301 if (parent !== _this3.target.ownerDocument) {
11302 parent.addEventListener('scroll', _this3.position);
11303 }
11304 });
11305
11306 if (pos) {
11307 this.position();
11308 }
11309 }
11310 }, {
11311 key: 'disable',
11312 value: function disable() {
11313 var _this4 = this;
11314
11315 removeClass(this.target, this.getClass('enabled'));
11316 removeClass(this.element, this.getClass('enabled'));
11317 this.enabled = false;
11318
11319 if (typeof this.scrollParents !== 'undefined') {
11320 this.scrollParents.forEach(function (parent) {
11321 parent.removeEventListener('scroll', _this4.position);
11322 });
11323 }
11324 }
11325 }, {
11326 key: 'destroy',
11327 value: function destroy() {
11328 var _this5 = this;
11329
11330 this.disable();
11331
11332 tethers.forEach(function (tether, i) {
11333 if (tether === _this5) {
11334 tethers.splice(i, 1);
11335 }
11336 });
11337
11338 // Remove any elements we were using for convenience from the DOM
11339 if (tethers.length === 0) {
11340 removeUtilElements();
11341 }
11342 }
11343 }, {
11344 key: 'updateAttachClasses',
11345 value: function updateAttachClasses(elementAttach, targetAttach) {
11346 var _this6 = this;
11347
11348 elementAttach = elementAttach || this.attachment;
11349 targetAttach = targetAttach || this.targetAttachment;
11350 var sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];
11351
11352 if (typeof this._addAttachClasses !== 'undefined' && this._addAttachClasses.length) {
11353 // updateAttachClasses can be called more than once in a position call, so
11354 // we need to clean up after ourselves such that when the last defer gets
11355 // ran it doesn't add any extra classes from previous calls.
11356 this._addAttachClasses.splice(0, this._addAttachClasses.length);
11357 }
11358
11359 if (typeof this._addAttachClasses === 'undefined') {
11360 this._addAttachClasses = [];
11361 }
11362 var add = this._addAttachClasses;
11363
11364 if (elementAttach.top) {
11365 add.push(this.getClass('element-attached') + '-' + elementAttach.top);
11366 }
11367 if (elementAttach.left) {
11368 add.push(this.getClass('element-attached') + '-' + elementAttach.left);
11369 }
11370 if (targetAttach.top) {
11371 add.push(this.getClass('target-attached') + '-' + targetAttach.top);
11372 }
11373 if (targetAttach.left) {
11374 add.push(this.getClass('target-attached') + '-' + targetAttach.left);
11375 }
11376
11377 var all = [];
11378 sides.forEach(function (side) {
11379 all.push(_this6.getClass('element-attached') + '-' + side);
11380 all.push(_this6.getClass('target-attached') + '-' + side);
11381 });
11382
11383 defer(function () {
11384 if (!(typeof _this6._addAttachClasses !== 'undefined')) {
11385 return;
11386 }
11387
11388 updateClasses(_this6.element, _this6._addAttachClasses, all);
11389 if (!(_this6.options.addTargetClasses === false)) {
11390 updateClasses(_this6.target, _this6._addAttachClasses, all);
11391 }
11392
11393 delete _this6._addAttachClasses;
11394 });
11395 }
11396 }, {
11397 key: 'position',
11398 value: function position() {
11399 var _this7 = this;
11400
11401 var flushChanges = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
11402
11403 // flushChanges commits the changes immediately, leave true unless you are positioning multiple
11404 // tethers (in which case call Tether.Utils.flush yourself when you're done)
11405
11406 if (!this.enabled) {
11407 return;
11408 }
11409
11410 this.clearCache();
11411
11412 // Turn 'auto' attachments into the appropriate corner or edge
11413 var targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);
11414
11415 this.updateAttachClasses(this.attachment, targetAttachment);
11416
11417 var elementPos = this.cache('element-bounds', function () {
11418 return getBounds(_this7.element);
11419 });
11420
11421 var width = elementPos.width;
11422 var height = elementPos.height;
11423
11424 if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') {
11425 var _lastSize = this.lastSize;
11426
11427 // We cache the height and width to make it possible to position elements that are
11428 // getting hidden.
11429 width = _lastSize.width;
11430 height = _lastSize.height;
11431 } else {
11432 this.lastSize = { width: width, height: height };
11433 }
11434
11435 var targetPos = this.cache('target-bounds', function () {
11436 return _this7.getTargetBounds();
11437 });
11438 var targetSize = targetPos;
11439
11440 // Get an actual px offset from the attachment
11441 var offset = offsetToPx(attachmentToOffset(this.attachment), { width: width, height: height });
11442 var targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);
11443
11444 var manualOffset = offsetToPx(this.offset, { width: width, height: height });
11445 var manualTargetOffset = offsetToPx(this.targetOffset, targetSize);
11446
11447 // Add the manually provided offset
11448 offset = addOffset(offset, manualOffset);
11449 targetOffset = addOffset(targetOffset, manualTargetOffset);
11450
11451 // It's now our goal to make (element position + offset) == (target position + target offset)
11452 var left = targetPos.left + targetOffset.left - offset.left;
11453 var top = targetPos.top + targetOffset.top - offset.top;
11454
11455 for (var i = 0; i < TetherBase.modules.length; ++i) {
11456 var _module2 = TetherBase.modules[i];
11457 var ret = _module2.position.call(this, {
11458 left: left,
11459 top: top,
11460 targetAttachment: targetAttachment,
11461 targetPos: targetPos,
11462 elementPos: elementPos,
11463 offset: offset,
11464 targetOffset: targetOffset,
11465 manualOffset: manualOffset,
11466 manualTargetOffset: manualTargetOffset,
11467 scrollbarSize: scrollbarSize,
11468 attachment: this.attachment
11469 });
11470
11471 if (ret === false) {
11472 return false;
11473 } else if (typeof ret === 'undefined' || (typeof ret === 'undefined' ? 'undefined' : _typeof(ret)) !== 'object') {
11474 continue;
11475 } else {
11476 top = ret.top;
11477 left = ret.left;
11478 }
11479 }
11480
11481 // We describe the position three different ways to give the optimizer
11482 // a chance to decide the best possible way to position the element
11483 // with the fewest repaints.
11484 var next = {
11485 // It's position relative to the page (absolute positioning when
11486 // the element is a child of the body)
11487 page: {
11488 top: top,
11489 left: left
11490 },
11491
11492 // It's position relative to the viewport (fixed positioning)
11493 viewport: {
11494 top: top - pageYOffset,
11495 bottom: pageYOffset - top - height + innerHeight,
11496 left: left - pageXOffset,
11497 right: pageXOffset - left - width + innerWidth
11498 }
11499 };
11500
11501 var doc = this.target.ownerDocument;
11502 var win = doc.defaultView;
11503
11504 var scrollbarSize = undefined;
11505 if (win.innerHeight > doc.documentElement.clientHeight) {
11506 scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
11507 next.viewport.bottom -= scrollbarSize.height;
11508 }
11509
11510 if (win.innerWidth > doc.documentElement.clientWidth) {
11511 scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
11512 next.viewport.right -= scrollbarSize.width;
11513 }
11514
11515 if (['', 'static'].indexOf(doc.body.style.position) === -1 || ['', 'static'].indexOf(doc.body.parentElement.style.position) === -1) {
11516 // Absolute positioning in the body will be relative to the page, not the 'initial containing block'
11517 next.page.bottom = doc.body.scrollHeight - top - height;
11518 next.page.right = doc.body.scrollWidth - left - width;
11519 }
11520
11521 if (typeof this.options.optimizations !== 'undefined' && this.options.optimizations.moveElement !== false && !(typeof this.targetModifier !== 'undefined')) {
11522 (function () {
11523 var offsetParent = _this7.cache('target-offsetparent', function () {
11524 return getOffsetParent(_this7.target);
11525 });
11526 var offsetPosition = _this7.cache('target-offsetparent-bounds', function () {
11527 return getBounds(offsetParent);
11528 });
11529 var offsetParentStyle = getComputedStyle(offsetParent);
11530 var offsetParentSize = offsetPosition;
11531
11532 var offsetBorder = {};
11533 ['Top', 'Left', 'Bottom', 'Right'].forEach(function (side) {
11534 offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle['border' + side + 'Width']);
11535 });
11536
11537 offsetPosition.right = doc.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right;
11538 offsetPosition.bottom = doc.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom;
11539
11540 if (next.page.top >= offsetPosition.top + offsetBorder.top && next.page.bottom >= offsetPosition.bottom) {
11541 if (next.page.left >= offsetPosition.left + offsetBorder.left && next.page.right >= offsetPosition.right) {
11542 // We're within the visible part of the target's scroll parent
11543 var scrollTop = offsetParent.scrollTop;
11544 var scrollLeft = offsetParent.scrollLeft;
11545
11546 // It's position relative to the target's offset parent (absolute positioning when
11547 // the element is moved to be a child of the target's offset parent).
11548 next.offset = {
11549 top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top,
11550 left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left
11551 };
11552 }
11553 }
11554 })();
11555 }
11556
11557 // We could also travel up the DOM and try each containing context, rather than only
11558 // looking at the body, but we're gonna get diminishing returns.
11559
11560 this.move(next);
11561
11562 this.history.unshift(next);
11563
11564 if (this.history.length > 3) {
11565 this.history.pop();
11566 }
11567
11568 if (flushChanges) {
11569 flush();
11570 }
11571
11572 return true;
11573 }
11574
11575 // THE ISSUE
11576 }, {
11577 key: 'move',
11578 value: function move(pos) {
11579 var _this8 = this;
11580
11581 if (!(typeof this.element.parentNode !== 'undefined')) {
11582 return;
11583 }
11584
11585 var same = {};
11586
11587 for (var type in pos) {
11588 same[type] = {};
11589
11590 for (var key in pos[type]) {
11591 var found = false;
11592
11593 for (var i = 0; i < this.history.length; ++i) {
11594 var point = this.history[i];
11595 if (typeof point[type] !== 'undefined' && !within(point[type][key], pos[type][key])) {
11596 found = true;
11597 break;
11598 }
11599 }
11600
11601 if (!found) {
11602 same[type][key] = true;
11603 }
11604 }
11605 }
11606
11607 var css = { top: '', left: '', right: '', bottom: '' };
11608
11609 var transcribe = function transcribe(_same, _pos) {
11610 var hasOptimizations = typeof _this8.options.optimizations !== 'undefined';
11611 var gpu = hasOptimizations ? _this8.options.optimizations.gpu : null;
11612 if (gpu !== false) {
11613 var yPos = undefined,
11614 xPos = undefined;
11615 if (_same.top) {
11616 css.top = 0;
11617 yPos = _pos.top;
11618 } else {
11619 css.bottom = 0;
11620 yPos = -_pos.bottom;
11621 }
11622
11623 if (_same.left) {
11624 css.left = 0;
11625 xPos = _pos.left;
11626 } else {
11627 css.right = 0;
11628 xPos = -_pos.right;
11629 }
11630
11631 if (window.matchMedia) {
11632 // HubSpot/tether#207
11633 var retina = window.matchMedia('only screen and (min-resolution: 1.3dppx)').matches || window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3)').matches;
11634 if (!retina) {
11635 xPos = Math.round(xPos);
11636 yPos = Math.round(yPos);
11637 }
11638 }
11639
11640 css[transformKey] = 'translateX(' + xPos + 'px) translateY(' + yPos + 'px)';
11641
11642 if (transformKey !== 'msTransform') {
11643 // The Z transform will keep this in the GPU (faster, and prevents artifacts),
11644 // but IE9 doesn't support 3d transforms and will choke.
11645 css[transformKey] += " translateZ(0)";
11646 }
11647 } else {
11648 if (_same.top) {
11649 css.top = _pos.top + 'px';
11650 } else {
11651 css.bottom = _pos.bottom + 'px';
11652 }
11653
11654 if (_same.left) {
11655 css.left = _pos.left + 'px';
11656 } else {
11657 css.right = _pos.right + 'px';
11658 }
11659 }
11660 };
11661
11662 var moved = false;
11663 if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) {
11664 css.position = 'absolute';
11665 transcribe(same.page, pos.page);
11666 } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) {
11667 css.position = 'fixed';
11668 transcribe(same.viewport, pos.viewport);
11669 } else if (typeof same.offset !== 'undefined' && same.offset.top && same.offset.left) {
11670 (function () {
11671 css.position = 'absolute';
11672 var offsetParent = _this8.cache('target-offsetparent', function () {
11673 return getOffsetParent(_this8.target);
11674 });
11675
11676 if (getOffsetParent(_this8.element) !== offsetParent) {
11677 defer(function () {
11678 _this8.element.parentNode.removeChild(_this8.element);
11679 offsetParent.appendChild(_this8.element);
11680 });
11681 }
11682
11683 transcribe(same.offset, pos.offset);
11684 moved = true;
11685 })();
11686 } else {
11687 css.position = 'absolute';
11688 transcribe({ top: true, left: true }, pos.page);
11689 }
11690
11691 if (!moved) {
11692 if (this.options.bodyElement) {
11693 this.options.bodyElement.appendChild(this.element);
11694 } else {
11695 var offsetParentIsBody = true;
11696 var currentNode = this.element.parentNode;
11697 while (currentNode && currentNode.nodeType === 1 && currentNode.tagName !== 'BODY') {
11698 if (getComputedStyle(currentNode).position !== 'static') {
11699 offsetParentIsBody = false;
11700 break;
11701 }
11702
11703 currentNode = currentNode.parentNode;
11704 }
11705
11706 if (!offsetParentIsBody) {
11707 this.element.parentNode.removeChild(this.element);
11708 this.element.ownerDocument.body.appendChild(this.element);
11709 }
11710 }
11711 }
11712
11713 // Any css change will trigger a repaint, so let's avoid one if nothing changed
11714 var writeCSS = {};
11715 var write = false;
11716 for (var key in css) {
11717 var val = css[key];
11718 var elVal = this.element.style[key];
11719
11720 if (elVal !== val) {
11721 write = true;
11722 writeCSS[key] = val;
11723 }
11724 }
11725
11726 if (write) {
11727 defer(function () {
11728 extend(_this8.element.style, writeCSS);
11729 _this8.trigger('repositioned');
11730 });
11731 }
11732 }
11733 }]);
11734
11735 return TetherClass;
11736 }(Evented);
11737
11738 TetherClass.modules = [];
11739
11740 TetherBase.position = position;
11741
11742 var Tether = extend(TetherClass, TetherBase);
11743 /* globals TetherBase */
11744
11745 'use strict';
11746
11747 var _slicedToArray = function () {
11748 function sliceIterator(arr, i) {
11749 var _arr = [];var _n = true;var _d = false;var _e = undefined;try {
11750 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
11751 _arr.push(_s.value);if (i && _arr.length === i) break;
11752 }
11753 } catch (err) {
11754 _d = true;_e = err;
11755 } finally {
11756 try {
11757 if (!_n && _i['return']) _i['return']();
11758 } finally {
11759 if (_d) throw _e;
11760 }
11761 }return _arr;
11762 }return function (arr, i) {
11763 if (Array.isArray(arr)) {
11764 return arr;
11765 } else if (Symbol.iterator in Object(arr)) {
11766 return sliceIterator(arr, i);
11767 } else {
11768 throw new TypeError('Invalid attempt to destructure non-iterable instance');
11769 }
11770 };
11771 }();
11772
11773 var _TetherBase$Utils = TetherBase.Utils;
11774 var getBounds = _TetherBase$Utils.getBounds;
11775 var extend = _TetherBase$Utils.extend;
11776 var updateClasses = _TetherBase$Utils.updateClasses;
11777 var defer = _TetherBase$Utils.defer;
11778
11779 var BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];
11780
11781 function getBoundingRect(tether, to) {
11782 if (to === 'scrollParent') {
11783 to = tether.scrollParents[0];
11784 } else if (to === 'window') {
11785 to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset];
11786 }
11787
11788 if (to === document) {
11789 to = to.documentElement;
11790 }
11791
11792 if (typeof to.nodeType !== 'undefined') {
11793 (function () {
11794 var node = to;
11795 var size = getBounds(to);
11796 var pos = size;
11797 var style = getComputedStyle(to);
11798
11799 to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top];
11800
11801 // Account any parent Frames scroll offset
11802 if (node.ownerDocument !== document) {
11803 var win = node.ownerDocument.defaultView;
11804 to[0] += win.pageXOffset;
11805 to[1] += win.pageYOffset;
11806 to[2] += win.pageXOffset;
11807 to[3] += win.pageYOffset;
11808 }
11809
11810 BOUNDS_FORMAT.forEach(function (side, i) {
11811 side = side[0].toUpperCase() + side.substr(1);
11812 if (side === 'Top' || side === 'Left') {
11813 to[i] += parseFloat(style['border' + side + 'Width']);
11814 } else {
11815 to[i] -= parseFloat(style['border' + side + 'Width']);
11816 }
11817 });
11818 })();
11819 }
11820
11821 return to;
11822 }
11823
11824 TetherBase.modules.push({
11825 position: function position(_ref) {
11826 var _this = this;
11827
11828 var top = _ref.top;
11829 var left = _ref.left;
11830 var targetAttachment = _ref.targetAttachment;
11831
11832 if (!this.options.constraints) {
11833 return true;
11834 }
11835
11836 var _cache = this.cache('element-bounds', function () {
11837 return getBounds(_this.element);
11838 });
11839
11840 var height = _cache.height;
11841 var width = _cache.width;
11842
11843 if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') {
11844 var _lastSize = this.lastSize;
11845
11846 // Handle the item getting hidden as a result of our positioning without glitching
11847 // the classes in and out
11848 width = _lastSize.width;
11849 height = _lastSize.height;
11850 }
11851
11852 var targetSize = this.cache('target-bounds', function () {
11853 return _this.getTargetBounds();
11854 });
11855
11856 var targetHeight = targetSize.height;
11857 var targetWidth = targetSize.width;
11858
11859 var allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')];
11860
11861 this.options.constraints.forEach(function (constraint) {
11862 var outOfBoundsClass = constraint.outOfBoundsClass;
11863 var pinnedClass = constraint.pinnedClass;
11864
11865 if (outOfBoundsClass) {
11866 allClasses.push(outOfBoundsClass);
11867 }
11868 if (pinnedClass) {
11869 allClasses.push(pinnedClass);
11870 }
11871 });
11872
11873 allClasses.forEach(function (cls) {
11874 ['left', 'top', 'right', 'bottom'].forEach(function (side) {
11875 allClasses.push(cls + '-' + side);
11876 });
11877 });
11878
11879 var addClasses = [];
11880
11881 var tAttachment = extend({}, targetAttachment);
11882 var eAttachment = extend({}, this.attachment);
11883
11884 this.options.constraints.forEach(function (constraint) {
11885 var to = constraint.to;
11886 var attachment = constraint.attachment;
11887 var pin = constraint.pin;
11888
11889 if (typeof attachment === 'undefined') {
11890 attachment = '';
11891 }
11892
11893 var changeAttachX = undefined,
11894 changeAttachY = undefined;
11895 if (attachment.indexOf(' ') >= 0) {
11896 var _attachment$split = attachment.split(' ');
11897
11898 var _attachment$split2 = _slicedToArray(_attachment$split, 2);
11899
11900 changeAttachY = _attachment$split2[0];
11901 changeAttachX = _attachment$split2[1];
11902 } else {
11903 changeAttachX = changeAttachY = attachment;
11904 }
11905
11906 var bounds = getBoundingRect(_this, to);
11907
11908 if (changeAttachY === 'target' || changeAttachY === 'both') {
11909 if (top < bounds[1] && tAttachment.top === 'top') {
11910 top += targetHeight;
11911 tAttachment.top = 'bottom';
11912 }
11913
11914 if (top + height > bounds[3] && tAttachment.top === 'bottom') {
11915 top -= targetHeight;
11916 tAttachment.top = 'top';
11917 }
11918 }
11919
11920 if (changeAttachY === 'together') {
11921 if (tAttachment.top === 'top') {
11922 if (eAttachment.top === 'bottom' && top < bounds[1]) {
11923 top += targetHeight;
11924 tAttachment.top = 'bottom';
11925
11926 top += height;
11927 eAttachment.top = 'top';
11928 } else if (eAttachment.top === 'top' && top + height > bounds[3] && top - (height - targetHeight) >= bounds[1]) {
11929 top -= height - targetHeight;
11930 tAttachment.top = 'bottom';
11931
11932 eAttachment.top = 'bottom';
11933 }
11934 }
11935
11936 if (tAttachment.top === 'bottom') {
11937 if (eAttachment.top === 'top' && top + height > bounds[3]) {
11938 top -= targetHeight;
11939 tAttachment.top = 'top';
11940
11941 top -= height;
11942 eAttachment.top = 'bottom';
11943 } else if (eAttachment.top === 'bottom' && top < bounds[1] && top + (height * 2 - targetHeight) <= bounds[3]) {
11944 top += height - targetHeight;
11945 tAttachment.top = 'top';
11946
11947 eAttachment.top = 'top';
11948 }
11949 }
11950
11951 if (tAttachment.top === 'middle') {
11952 if (top + height > bounds[3] && eAttachment.top === 'top') {
11953 top -= height;
11954 eAttachment.top = 'bottom';
11955 } else if (top < bounds[1] && eAttachment.top === 'bottom') {
11956 top += height;
11957 eAttachment.top = 'top';
11958 }
11959 }
11960 }
11961
11962 if (changeAttachX === 'target' || changeAttachX === 'both') {
11963 if (left < bounds[0] && tAttachment.left === 'left') {
11964 left += targetWidth;
11965 tAttachment.left = 'right';
11966 }
11967
11968 if (left + width > bounds[2] && tAttachment.left === 'right') {
11969 left -= targetWidth;
11970 tAttachment.left = 'left';
11971 }
11972 }
11973
11974 if (changeAttachX === 'together') {
11975 if (left < bounds[0] && tAttachment.left === 'left') {
11976 if (eAttachment.left === 'right') {
11977 left += targetWidth;
11978 tAttachment.left = 'right';
11979
11980 left += width;
11981 eAttachment.left = 'left';
11982 } else if (eAttachment.left === 'left') {
11983 left += targetWidth;
11984 tAttachment.left = 'right';
11985
11986 left -= width;
11987 eAttachment.left = 'right';
11988 }
11989 } else if (left + width > bounds[2] && tAttachment.left === 'right') {
11990 if (eAttachment.left === 'left') {
11991 left -= targetWidth;
11992 tAttachment.left = 'left';
11993
11994 left -= width;
11995 eAttachment.left = 'right';
11996 } else if (eAttachment.left === 'right') {
11997 left -= targetWidth;
11998 tAttachment.left = 'left';
11999
12000 left += width;
12001 eAttachment.left = 'left';
12002 }
12003 } else if (tAttachment.left === 'center') {
12004 if (left + width > bounds[2] && eAttachment.left === 'left') {
12005 left -= width;
12006 eAttachment.left = 'right';
12007 } else if (left < bounds[0] && eAttachment.left === 'right') {
12008 left += width;
12009 eAttachment.left = 'left';
12010 }
12011 }
12012 }
12013
12014 if (changeAttachY === 'element' || changeAttachY === 'both') {
12015 if (top < bounds[1] && eAttachment.top === 'bottom') {
12016 top += height;
12017 eAttachment.top = 'top';
12018 }
12019
12020 if (top + height > bounds[3] && eAttachment.top === 'top') {
12021 top -= height;
12022 eAttachment.top = 'bottom';
12023 }
12024 }
12025
12026 if (changeAttachX === 'element' || changeAttachX === 'both') {
12027 if (left < bounds[0]) {
12028 if (eAttachment.left === 'right') {
12029 left += width;
12030 eAttachment.left = 'left';
12031 } else if (eAttachment.left === 'center') {
12032 left += width / 2;
12033 eAttachment.left = 'left';
12034 }
12035 }
12036
12037 if (left + width > bounds[2]) {
12038 if (eAttachment.left === 'left') {
12039 left -= width;
12040 eAttachment.left = 'right';
12041 } else if (eAttachment.left === 'center') {
12042 left -= width / 2;
12043 eAttachment.left = 'right';
12044 }
12045 }
12046 }
12047
12048 if (typeof pin === 'string') {
12049 pin = pin.split(',').map(function (p) {
12050 return p.trim();
12051 });
12052 } else if (pin === true) {
12053 pin = ['top', 'left', 'right', 'bottom'];
12054 }
12055
12056 pin = pin || [];
12057
12058 var pinned = [];
12059 var oob = [];
12060
12061 if (top < bounds[1]) {
12062 if (pin.indexOf('top') >= 0) {
12063 top = bounds[1];
12064 pinned.push('top');
12065 } else {
12066 oob.push('top');
12067 }
12068 }
12069
12070 if (top + height > bounds[3]) {
12071 if (pin.indexOf('bottom') >= 0) {
12072 top = bounds[3] - height;
12073 pinned.push('bottom');
12074 } else {
12075 oob.push('bottom');
12076 }
12077 }
12078
12079 if (left < bounds[0]) {
12080 if (pin.indexOf('left') >= 0) {
12081 left = bounds[0];
12082 pinned.push('left');
12083 } else {
12084 oob.push('left');
12085 }
12086 }
12087
12088 if (left + width > bounds[2]) {
12089 if (pin.indexOf('right') >= 0) {
12090 left = bounds[2] - width;
12091 pinned.push('right');
12092 } else {
12093 oob.push('right');
12094 }
12095 }
12096
12097 if (pinned.length) {
12098 (function () {
12099 var pinnedClass = undefined;
12100 if (typeof _this.options.pinnedClass !== 'undefined') {
12101 pinnedClass = _this.options.pinnedClass;
12102 } else {
12103 pinnedClass = _this.getClass('pinned');
12104 }
12105
12106 addClasses.push(pinnedClass);
12107 pinned.forEach(function (side) {
12108 addClasses.push(pinnedClass + '-' + side);
12109 });
12110 })();
12111 }
12112
12113 if (oob.length) {
12114 (function () {
12115 var oobClass = undefined;
12116 if (typeof _this.options.outOfBoundsClass !== 'undefined') {
12117 oobClass = _this.options.outOfBoundsClass;
12118 } else {
12119 oobClass = _this.getClass('out-of-bounds');
12120 }
12121
12122 addClasses.push(oobClass);
12123 oob.forEach(function (side) {
12124 addClasses.push(oobClass + '-' + side);
12125 });
12126 })();
12127 }
12128
12129 if (pinned.indexOf('left') >= 0 || pinned.indexOf('right') >= 0) {
12130 eAttachment.left = tAttachment.left = false;
12131 }
12132 if (pinned.indexOf('top') >= 0 || pinned.indexOf('bottom') >= 0) {
12133 eAttachment.top = tAttachment.top = false;
12134 }
12135
12136 if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== _this.attachment.top || eAttachment.left !== _this.attachment.left) {
12137 _this.updateAttachClasses(eAttachment, tAttachment);
12138 _this.trigger('update', {
12139 attachment: eAttachment,
12140 targetAttachment: tAttachment
12141 });
12142 }
12143 });
12144
12145 defer(function () {
12146 if (!(_this.options.addTargetClasses === false)) {
12147 updateClasses(_this.target, addClasses, allClasses);
12148 }
12149 updateClasses(_this.element, addClasses, allClasses);
12150 });
12151
12152 return { top: top, left: left };
12153 }
12154 });
12155 /* globals TetherBase */
12156
12157 'use strict';
12158
12159 var _TetherBase$Utils = TetherBase.Utils;
12160 var getBounds = _TetherBase$Utils.getBounds;
12161 var updateClasses = _TetherBase$Utils.updateClasses;
12162 var defer = _TetherBase$Utils.defer;
12163
12164 TetherBase.modules.push({
12165 position: function position(_ref) {
12166 var _this = this;
12167
12168 var top = _ref.top;
12169 var left = _ref.left;
12170
12171 var _cache = this.cache('element-bounds', function () {
12172 return getBounds(_this.element);
12173 });
12174
12175 var height = _cache.height;
12176 var width = _cache.width;
12177
12178 var targetPos = this.getTargetBounds();
12179
12180 var bottom = top + height;
12181 var right = left + width;
12182
12183 var abutted = [];
12184 if (top <= targetPos.bottom && bottom >= targetPos.top) {
12185 ['left', 'right'].forEach(function (side) {
12186 var targetPosSide = targetPos[side];
12187 if (targetPosSide === left || targetPosSide === right) {
12188 abutted.push(side);
12189 }
12190 });
12191 }
12192
12193 if (left <= targetPos.right && right >= targetPos.left) {
12194 ['top', 'bottom'].forEach(function (side) {
12195 var targetPosSide = targetPos[side];
12196 if (targetPosSide === top || targetPosSide === bottom) {
12197 abutted.push(side);
12198 }
12199 });
12200 }
12201
12202 var allClasses = [];
12203 var addClasses = [];
12204
12205 var sides = ['left', 'top', 'right', 'bottom'];
12206 allClasses.push(this.getClass('abutted'));
12207 sides.forEach(function (side) {
12208 allClasses.push(_this.getClass('abutted') + '-' + side);
12209 });
12210
12211 if (abutted.length) {
12212 addClasses.push(this.getClass('abutted'));
12213 }
12214
12215 abutted.forEach(function (side) {
12216 addClasses.push(_this.getClass('abutted') + '-' + side);
12217 });
12218
12219 defer(function () {
12220 if (!(_this.options.addTargetClasses === false)) {
12221 updateClasses(_this.target, addClasses, allClasses);
12222 }
12223 updateClasses(_this.element, addClasses, allClasses);
12224 });
12225
12226 return true;
12227 }
12228 });
12229 /* globals TetherBase */
12230
12231 'use strict';
12232
12233 var _slicedToArray = function () {
12234 function sliceIterator(arr, i) {
12235 var _arr = [];var _n = true;var _d = false;var _e = undefined;try {
12236 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
12237 _arr.push(_s.value);if (i && _arr.length === i) break;
12238 }
12239 } catch (err) {
12240 _d = true;_e = err;
12241 } finally {
12242 try {
12243 if (!_n && _i['return']) _i['return']();
12244 } finally {
12245 if (_d) throw _e;
12246 }
12247 }return _arr;
12248 }return function (arr, i) {
12249 if (Array.isArray(arr)) {
12250 return arr;
12251 } else if (Symbol.iterator in Object(arr)) {
12252 return sliceIterator(arr, i);
12253 } else {
12254 throw new TypeError('Invalid attempt to destructure non-iterable instance');
12255 }
12256 };
12257 }();
12258
12259 TetherBase.modules.push({
12260 position: function position(_ref) {
12261 var top = _ref.top;
12262 var left = _ref.left;
12263
12264 if (!this.options.shift) {
12265 return;
12266 }
12267
12268 var shift = this.options.shift;
12269 if (typeof this.options.shift === 'function') {
12270 shift = this.options.shift.call(this, { top: top, left: left });
12271 }
12272
12273 var shiftTop = undefined,
12274 shiftLeft = undefined;
12275 if (typeof shift === 'string') {
12276 shift = shift.split(' ');
12277 shift[1] = shift[1] || shift[0];
12278
12279 var _shift = shift;
12280
12281 var _shift2 = _slicedToArray(_shift, 2);
12282
12283 shiftTop = _shift2[0];
12284 shiftLeft = _shift2[1];
12285
12286 shiftTop = parseFloat(shiftTop, 10);
12287 shiftLeft = parseFloat(shiftLeft, 10);
12288 } else {
12289 shiftTop = shift.top;
12290 shiftLeft = shift.left;
12291 }
12292
12293 top += shiftTop;
12294 left += shiftLeft;
12295
12296 return { top: top, left: left };
12297 }
12298 });
12299 return Tether;
12300});
12301
12302/***/ }),
12303/* 3 */
12304/***/ (function(module, exports, __webpack_require__) {
12305
12306"use strict";
12307
12308
12309var _scrollmagic = __webpack_require__(0);
12310
12311var _scrollmagic2 = _interopRequireDefault(_scrollmagic);
12312
12313function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12314
12315__webpack_require__(1);
12316__webpack_require__(2);
12317__webpack_require__(5);
12318__webpack_require__(0);
12319__webpack_require__(6);
12320
12321// import 'scrollmagic/scrollmagic/minified/plugins/animation.gsap.min';
12322// import 'scrollmagic/scrollmagic/minified/plugins/debug.addIndicators.min';
12323// import TweenMax from 'greensock/dist/TweenMax';
12324// import TimelineMax from 'greensock/dist/TimelineMax';
12325__webpack_require__(8);
12326
12327/***/ }),