Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 474.25 KB | None | 0 0
  1. /*! jQuery UI - v1.12.1 - 2017-08-09
  2. * http://jqueryui.com
  3. * Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/datepicker.js, widgets/mouse.js, widgets/slider.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js
  4. * Copyright jQuery Foundation and other contributors; Licensed MIT */
  5. (function(a) {
  6. if (typeof define === "function" && define.amd) {
  7. define(["jquery"], a)
  8. } else {
  9. a(jQuery)
  10. }
  11. }(function(K) {
  12. K.ui = K.ui || {};
  13. var Z = K.ui.version = "1.12.1";
  14. /*!
  15. * jQuery UI Widget 1.12.1
  16. * http://jqueryui.com
  17. *
  18. * Copyright jQuery Foundation and other contributors
  19. * Released under the MIT license.
  20. * http://jquery.org/license
  21. */
  22. var aa = 0;
  23. var M = Array.prototype.slice;
  24. K.cleanData = (function(ag) {
  25. return function(ah) {
  26. var aj, ak, ai;
  27. for (ai = 0; (ak = ah[ai]) != null; ai++) {
  28. try {
  29. aj = K._data(ak, "events");
  30. if (aj && aj.remove) {
  31. K(ak).triggerHandler("remove")
  32. }
  33. } catch (al) {}
  34. }
  35. ag(ah)
  36. }
  37. }
  38. )(K.cleanData);
  39. K.widget = function(ag, ah, ao) {
  40. var am, aj, an;
  41. var ai = {};
  42. var al = ag.split(".")[0];
  43. ag = ag.split(".")[1];
  44. var ak = al + "-" + ag;
  45. if (!ao) {
  46. ao = ah;
  47. ah = K.Widget
  48. }
  49. if (K.isArray(ao)) {
  50. ao = K.extend.apply(null, [{}].concat(ao))
  51. }
  52. K.expr[":"][ak.toLowerCase()] = function(ap) {
  53. return !!K.data(ap, ak)
  54. }
  55. ;
  56. K[al] = K[al] || {};
  57. am = K[al][ag];
  58. aj = K[al][ag] = function(ap, aq) {
  59. if (!this._createWidget) {
  60. return new aj(ap,aq)
  61. }
  62. if (arguments.length) {
  63. this._createWidget(ap, aq)
  64. }
  65. }
  66. ;
  67. K.extend(aj, am, {
  68. version: ao.version,
  69. _proto: K.extend({}, ao),
  70. _childConstructors: []
  71. });
  72. an = new ah();
  73. an.options = K.widget.extend({}, an.options);
  74. K.each(ao, function(aq, ap) {
  75. if (!K.isFunction(ap)) {
  76. ai[aq] = ap;
  77. return
  78. }
  79. ai[aq] = (function() {
  80. function ar() {
  81. return ah.prototype[aq].apply(this, arguments)
  82. }
  83. function at(au) {
  84. return ah.prototype[aq].apply(this, au)
  85. }
  86. return function() {
  87. var aw = this._super;
  88. var au = this._superApply;
  89. var av;
  90. this._super = ar;
  91. this._superApply = at;
  92. av = ap.apply(this, arguments);
  93. this._super = aw;
  94. this._superApply = au;
  95. return av
  96. }
  97. }
  98. )()
  99. });
  100. aj.prototype = K.widget.extend(an, {
  101. widgetEventPrefix: am ? (an.widgetEventPrefix || ag) : ag
  102. }, ai, {
  103. constructor: aj,
  104. namespace: al,
  105. widgetName: ag,
  106. widgetFullName: ak
  107. });
  108. if (am) {
  109. K.each(am._childConstructors, function(aq, ar) {
  110. var ap = ar.prototype;
  111. K.widget(ap.namespace + "." + ap.widgetName, aj, ar._proto)
  112. });
  113. delete am._childConstructors
  114. } else {
  115. ah._childConstructors.push(aj)
  116. }
  117. K.widget.bridge(ag, aj);
  118. return aj
  119. }
  120. ;
  121. K.widget.extend = function(al) {
  122. var ah = M.call(arguments, 1);
  123. var ak = 0;
  124. var ag = ah.length;
  125. var ai;
  126. var aj;
  127. for (; ak < ag; ak++) {
  128. for (ai in ah[ak]) {
  129. aj = ah[ak][ai];
  130. if (ah[ak].hasOwnProperty(ai) && aj !== undefined) {
  131. if (K.isPlainObject(aj)) {
  132. al[ai] = K.isPlainObject(al[ai]) ? K.widget.extend({}, al[ai], aj) : K.widget.extend({}, aj)
  133. } else {
  134. al[ai] = aj
  135. }
  136. }
  137. }
  138. }
  139. return al
  140. }
  141. ;
  142. K.widget.bridge = function(ah, ag) {
  143. var ai = ag.prototype.widgetFullName || ah;
  144. K.fn[ah] = function(al) {
  145. var aj = typeof al === "string";
  146. var ak = M.call(arguments, 1);
  147. var am = this;
  148. if (aj) {
  149. if (!this.length && al === "instance") {
  150. am = undefined
  151. } else {
  152. this.each(function() {
  153. var ao;
  154. var an = K.data(this, ai);
  155. if (al === "instance") {
  156. am = an;
  157. return false
  158. }
  159. if (!an) {
  160. return K.error("cannot call methods on " + ah + " prior to initialization; attempted to call method '" + al + "'")
  161. }
  162. if (!K.isFunction(an[al]) || al.charAt(0) === "_") {
  163. return K.error("no such method '" + al + "' for " + ah + " widget instance")
  164. }
  165. ao = an[al].apply(an, ak);
  166. if (ao !== an && ao !== undefined) {
  167. am = ao && ao.jquery ? am.pushStack(ao.get()) : ao;
  168. return false
  169. }
  170. })
  171. }
  172. } else {
  173. if (ak.length) {
  174. al = K.widget.extend.apply(null, [al].concat(ak))
  175. }
  176. this.each(function() {
  177. var an = K.data(this, ai);
  178. if (an) {
  179. an.option(al || {});
  180. if (an._init) {
  181. an._init()
  182. }
  183. } else {
  184. K.data(this, ai, new ag(al,this))
  185. }
  186. })
  187. }
  188. return am
  189. }
  190. }
  191. ;
  192. K.Widget = function() {}
  193. ;
  194. K.Widget._childConstructors = [];
  195. K.Widget.prototype = {
  196. widgetName: "widget",
  197. widgetEventPrefix: "",
  198. defaultElement: "<div>",
  199. options: {
  200. classes: {},
  201. disabled: false,
  202. create: null
  203. },
  204. _createWidget: function(ag, ah) {
  205. ah = K(ah || this.defaultElement || this)[0];
  206. this.element = K(ah);
  207. this.uuid = aa++;
  208. this.eventNamespace = "." + this.widgetName + this.uuid;
  209. this.bindings = K();
  210. this.hoverable = K();
  211. this.focusable = K();
  212. this.classesElementLookup = {};
  213. if (ah !== this) {
  214. K.data(ah, this.widgetFullName, this);
  215. this._on(true, this.element, {
  216. remove: function(ai) {
  217. if (ai.target === ah) {
  218. this.destroy()
  219. }
  220. }
  221. });
  222. this.document = K(ah.style ? ah.ownerDocument : ah.document || ah);
  223. this.window = K(this.document[0].defaultView || this.document[0].parentWindow)
  224. }
  225. this.options = K.widget.extend({}, this.options, this._getCreateOptions(), ag);
  226. this._create();
  227. if (this.options.disabled) {
  228. this._setOptionDisabled(this.options.disabled)
  229. }
  230. this._trigger("create", null, this._getCreateEventData());
  231. this._init()
  232. },
  233. _getCreateOptions: function() {
  234. return {}
  235. },
  236. _getCreateEventData: K.noop,
  237. _create: K.noop,
  238. _init: K.noop,
  239. destroy: function() {
  240. var ag = this;
  241. this._destroy();
  242. K.each(this.classesElementLookup, function(ah, ai) {
  243. ag._removeClass(ai, ah)
  244. });
  245. this.element.off(this.eventNamespace).removeData(this.widgetFullName);
  246. this.widget().off(this.eventNamespace).removeAttr("aria-disabled");
  247. this.bindings.off(this.eventNamespace)
  248. },
  249. _destroy: K.noop,
  250. widget: function() {
  251. return this.element
  252. },
  253. option: function(aj, ak) {
  254. var ag = aj;
  255. var al;
  256. var ai;
  257. var ah;
  258. if (arguments.length === 0) {
  259. return K.widget.extend({}, this.options)
  260. }
  261. if (typeof aj === "string") {
  262. ag = {};
  263. al = aj.split(".");
  264. aj = al.shift();
  265. if (al.length) {
  266. ai = ag[aj] = K.widget.extend({}, this.options[aj]);
  267. for (ah = 0; ah < al.length - 1; ah++) {
  268. ai[al[ah]] = ai[al[ah]] || {};
  269. ai = ai[al[ah]]
  270. }
  271. aj = al.pop();
  272. if (arguments.length === 1) {
  273. return ai[aj] === undefined ? null : ai[aj]
  274. }
  275. ai[aj] = ak
  276. } else {
  277. if (arguments.length === 1) {
  278. return this.options[aj] === undefined ? null : this.options[aj]
  279. }
  280. ag[aj] = ak
  281. }
  282. }
  283. this._setOptions(ag);
  284. return this
  285. },
  286. _setOptions: function(ag) {
  287. var ah;
  288. for (ah in ag) {
  289. this._setOption(ah, ag[ah])
  290. }
  291. return this
  292. },
  293. _setOption: function(ag, ah) {
  294. if (ag === "classes") {
  295. this._setOptionClasses(ah)
  296. }
  297. this.options[ag] = ah;
  298. if (ag === "disabled") {
  299. this._setOptionDisabled(ah)
  300. }
  301. return this
  302. },
  303. _setOptionClasses: function(aj) {
  304. var ag, ai, ah;
  305. for (ag in aj) {
  306. ah = this.classesElementLookup[ag];
  307. if (aj[ag] === this.options.classes[ag] || !ah || !ah.length) {
  308. continue
  309. }
  310. ai = K(ah.get());
  311. this._removeClass(ah, ag);
  312. ai.addClass(this._classes({
  313. element: ai,
  314. keys: ag,
  315. classes: aj,
  316. add: true
  317. }))
  318. }
  319. },
  320. _setOptionDisabled: function(ag) {
  321. this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, !!ag);
  322. if (ag) {
  323. this._removeClass(this.hoverable, null, "ui-state-hover");
  324. this._removeClass(this.focusable, null, "ui-state-focus")
  325. }
  326. },
  327. enable: function() {
  328. return this._setOptions({
  329. disabled: false
  330. })
  331. },
  332. disable: function() {
  333. return this._setOptions({
  334. disabled: true
  335. })
  336. },
  337. _classes: function(ag) {
  338. var ah = [];
  339. var ai = this;
  340. ag = K.extend({
  341. element: this.element,
  342. classes: this.options.classes || {}
  343. }, ag);
  344. function aj(al, an) {
  345. var am, ak;
  346. for (ak = 0; ak < al.length; ak++) {
  347. am = ai.classesElementLookup[al[ak]] || K();
  348. if (ag.add) {
  349. am = K(K.uniqueSort(am.get().concat(ag.element.get())))
  350. } else {
  351. am = K(am.not(ag.element).get())
  352. }
  353. ai.classesElementLookup[al[ak]] = am;
  354. ah.push(al[ak]);
  355. if (an && ag.classes[al[ak]]) {
  356. ah.push(ag.classes[al[ak]])
  357. }
  358. }
  359. }
  360. this._on(ag.element, {
  361. remove: "_untrackClassesElement"
  362. });
  363. if (ag.keys) {
  364. aj(ag.keys.match(/\S+/g) || [], true)
  365. }
  366. if (ag.extra) {
  367. aj(ag.extra.match(/\S+/g) || [])
  368. }
  369. return ah.join(" ")
  370. },
  371. _untrackClassesElement: function(ah) {
  372. var ag = this;
  373. K.each(ag.classesElementLookup, function(ai, aj) {
  374. if (K.inArray(ah.target, aj) !== -1) {
  375. ag.classesElementLookup[ai] = K(aj.not(ah.target).get())
  376. }
  377. })
  378. },
  379. _removeClass: function(ah, ai, ag) {
  380. return this._toggleClass(ah, ai, ag, false)
  381. },
  382. _addClass: function(ah, ai, ag) {
  383. return this._toggleClass(ah, ai, ag, true)
  384. },
  385. _toggleClass: function(aj, ak, ag, al) {
  386. al = (typeof al === "boolean") ? al : ag;
  387. var ah = (typeof aj === "string" || aj === null)
  388. , ai = {
  389. extra: ah ? ak : ag,
  390. keys: ah ? aj : ak,
  391. element: ah ? this.element : aj,
  392. add: al
  393. };
  394. ai.element.toggleClass(this._classes(ai), al);
  395. return this
  396. },
  397. _on: function(aj, ai, ah) {
  398. var ak;
  399. var ag = this;
  400. if (typeof aj !== "boolean") {
  401. ah = ai;
  402. ai = aj;
  403. aj = false
  404. }
  405. if (!ah) {
  406. ah = ai;
  407. ai = this.element;
  408. ak = this.widget()
  409. } else {
  410. ai = ak = K(ai);
  411. this.bindings = this.bindings.add(ai)
  412. }
  413. K.each(ah, function(aq, ap) {
  414. function an() {
  415. if (!aj && (ag.options.disabled === true || K(this).hasClass("ui-state-disabled"))) {
  416. return
  417. }
  418. return (typeof ap === "string" ? ag[ap] : ap).apply(ag, arguments)
  419. }
  420. if (typeof ap !== "string") {
  421. an.guid = ap.guid = ap.guid || an.guid || K.guid++
  422. }
  423. var ao = aq.match(/^([\w:-]*)\s*(.*)$/);
  424. var am = ao[1] + ag.eventNamespace;
  425. var al = ao[2];
  426. if (al) {
  427. ak.on(am, al, an)
  428. } else {
  429. ai.on(am, an)
  430. }
  431. })
  432. },
  433. _off: function(ah, ag) {
  434. ag = (ag || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace;
  435. ah.off(ag).off(ag);
  436. this.bindings = K(this.bindings.not(ah).get());
  437. this.focusable = K(this.focusable.not(ah).get());
  438. this.hoverable = K(this.hoverable.not(ah).get())
  439. },
  440. _delay: function(aj, ai) {
  441. function ah() {
  442. return (typeof aj === "string" ? ag[aj] : aj).apply(ag, arguments)
  443. }
  444. var ag = this;
  445. return setTimeout(ah, ai || 0)
  446. },
  447. _hoverable: function(ag) {
  448. this.hoverable = this.hoverable.add(ag);
  449. this._on(ag, {
  450. mouseenter: function(ah) {
  451. this._addClass(K(ah.currentTarget), null, "ui-state-hover")
  452. },
  453. mouseleave: function(ah) {
  454. this._removeClass(K(ah.currentTarget), null, "ui-state-hover")
  455. }
  456. })
  457. },
  458. _focusable: function(ag) {
  459. this.focusable = this.focusable.add(ag);
  460. this._on(ag, {
  461. focusin: function(ah) {
  462. this._addClass(K(ah.currentTarget), null, "ui-state-focus")
  463. },
  464. focusout: function(ah) {
  465. this._removeClass(K(ah.currentTarget), null, "ui-state-focus")
  466. }
  467. })
  468. },
  469. _trigger: function(ag, ah, ai) {
  470. var al, ak;
  471. var aj = this.options[ag];
  472. ai = ai || {};
  473. ah = K.Event(ah);
  474. ah.type = (ag === this.widgetEventPrefix ? ag : this.widgetEventPrefix + ag).toLowerCase();
  475. ah.target = this.element[0];
  476. ak = ah.originalEvent;
  477. if (ak) {
  478. for (al in ak) {
  479. if (!(al in ah)) {
  480. ah[al] = ak[al]
  481. }
  482. }
  483. }
  484. this.element.trigger(ah, ai);
  485. return !(K.isFunction(aj) && aj.apply(this.element[0], [ah].concat(ai)) === false || ah.isDefaultPrevented())
  486. }
  487. };
  488. K.each({
  489. show: "fadeIn",
  490. hide: "fadeOut"
  491. }, function(ah, ag) {
  492. K.Widget.prototype["_" + ah] = function(ak, aj, am) {
  493. if (typeof aj === "string") {
  494. aj = {
  495. effect: aj
  496. }
  497. }
  498. var al;
  499. var ai = !aj ? ah : aj === true || typeof aj === "number" ? ag : aj.effect || ag;
  500. aj = aj || {};
  501. if (typeof aj === "number") {
  502. aj = {
  503. duration: aj
  504. }
  505. }
  506. al = !K.isEmptyObject(aj);
  507. aj.complete = am;
  508. if (aj.delay) {
  509. ak.delay(aj.delay)
  510. }
  511. if (al && K.effects && K.effects.effect[ai]) {
  512. ak[ah](aj)
  513. } else {
  514. if (ai !== ah && ak[ai]) {
  515. ak[ai](aj.duration, aj.easing, am)
  516. } else {
  517. ak.queue(function(an) {
  518. K(this)[ah]();
  519. if (am) {
  520. am.call(ak[0])
  521. }
  522. an()
  523. })
  524. }
  525. }
  526. }
  527. });
  528. var L = K.widget;
  529. /*!
  530. * jQuery UI Position 1.12.1
  531. * http://jqueryui.com
  532. *
  533. * Copyright jQuery Foundation and other contributors
  534. * Released under the MIT license.
  535. * http://jquery.org/license
  536. *
  537. * http://api.jqueryui.com/position/
  538. */
  539. (function() {
  540. var an, ao = Math.max, ar = Math.abs, ai = /left|center|right/, al = /top|center|bottom/, ag = /[\+\-]\d+(\.[\d]+)?%?/, ap = /^\w+/, ah = /%$/, ak = K.fn.position;
  541. function aq(av, au, at) {
  542. return [parseFloat(av[0]) * (ah.test(av[0]) ? au / 100 : 1), parseFloat(av[1]) * (ah.test(av[1]) ? at / 100 : 1)]
  543. }
  544. function am(at, au) {
  545. return parseInt(K.css(at, au), 10) || 0
  546. }
  547. function aj(au) {
  548. var at = au[0];
  549. if (at.nodeType === 9) {
  550. return {
  551. width: au.width(),
  552. height: au.height(),
  553. offset: {
  554. top: 0,
  555. left: 0
  556. }
  557. }
  558. }
  559. if (K.isWindow(at)) {
  560. return {
  561. width: au.width(),
  562. height: au.height(),
  563. offset: {
  564. top: au.scrollTop(),
  565. left: au.scrollLeft()
  566. }
  567. }
  568. }
  569. if (at.preventDefault) {
  570. return {
  571. width: 0,
  572. height: 0,
  573. offset: {
  574. top: at.pageY,
  575. left: at.pageX
  576. }
  577. }
  578. }
  579. return {
  580. width: au.outerWidth(),
  581. height: au.outerHeight(),
  582. offset: au.offset()
  583. }
  584. }
  585. K.position = {
  586. scrollbarWidth: function() {
  587. if (an !== undefined) {
  588. return an
  589. }
  590. var au, at, aw = K("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"), av = aw.children()[0];
  591. K("body").append(aw);
  592. au = av.offsetWidth;
  593. aw.css("overflow", "scroll");
  594. at = av.offsetWidth;
  595. if (au === at) {
  596. at = aw[0].clientWidth
  597. }
  598. aw.remove();
  599. return (an = au - at)
  600. },
  601. getScrollInfo: function(ax) {
  602. var aw = ax.isWindow || ax.isDocument ? "" : ax.element.css("overflow-x")
  603. , av = ax.isWindow || ax.isDocument ? "" : ax.element.css("overflow-y")
  604. , au = aw === "scroll" || (aw === "auto" && ax.width < ax.element[0].scrollWidth)
  605. , at = av === "scroll" || (av === "auto" && ax.height < ax.element[0].scrollHeight);
  606. return {
  607. width: at ? K.position.scrollbarWidth() : 0,
  608. height: au ? K.position.scrollbarWidth() : 0
  609. }
  610. },
  611. getWithinInfo: function(av) {
  612. var aw = K(av || window)
  613. , at = K.isWindow(aw[0])
  614. , ax = !!aw[0] && aw[0].nodeType === 9
  615. , au = !at && !ax;
  616. return {
  617. element: aw,
  618. isWindow: at,
  619. isDocument: ax,
  620. offset: au ? K(av).offset() : {
  621. left: 0,
  622. top: 0
  623. },
  624. scrollLeft: aw.scrollLeft(),
  625. scrollTop: aw.scrollTop(),
  626. width: aw.outerWidth(),
  627. height: aw.outerHeight()
  628. }
  629. }
  630. };
  631. K.fn.position = function(aD) {
  632. if (!aD || !aD.of) {
  633. return ak.apply(this, arguments)
  634. }
  635. aD = K.extend({}, aD);
  636. var aE, aA, ay, aC, ax, at, az = K(aD.of), aw = K.position.getWithinInfo(aD.within), au = K.position.getScrollInfo(aw), aB = (aD.collision || "flip").split(" "), av = {};
  637. at = aj(az);
  638. if (az[0].preventDefault) {
  639. aD.at = "left top"
  640. }
  641. aA = at.width;
  642. ay = at.height;
  643. aC = at.offset;
  644. ax = K.extend({}, aC);
  645. K.each(["my", "at"], function() {
  646. var aH = (aD[this] || "").split(" "), aG, aF;
  647. if (aH.length === 1) {
  648. aH = ai.test(aH[0]) ? aH.concat(["center"]) : al.test(aH[0]) ? ["center"].concat(aH) : ["center", "center"]
  649. }
  650. aH[0] = ai.test(aH[0]) ? aH[0] : "center";
  651. aH[1] = al.test(aH[1]) ? aH[1] : "center";
  652. aG = ag.exec(aH[0]);
  653. aF = ag.exec(aH[1]);
  654. av[this] = [aG ? aG[0] : 0, aF ? aF[0] : 0];
  655. aD[this] = [ap.exec(aH[0])[0], ap.exec(aH[1])[0]]
  656. });
  657. if (aB.length === 1) {
  658. aB[1] = aB[0]
  659. }
  660. if (aD.at[0] === "right") {
  661. ax.left += aA
  662. } else {
  663. if (aD.at[0] === "center") {
  664. ax.left += aA / 2
  665. }
  666. }
  667. if (aD.at[1] === "bottom") {
  668. ax.top += ay
  669. } else {
  670. if (aD.at[1] === "center") {
  671. ax.top += ay / 2
  672. }
  673. }
  674. aE = aq(av.at, aA, ay);
  675. ax.left += aE[0];
  676. ax.top += aE[1];
  677. return this.each(function() {
  678. var aG, aP, aI = K(this), aK = aI.outerWidth(), aH = aI.outerHeight(), aJ = am(this, "marginLeft"), aF = am(this, "marginTop"), aO = aK + aJ + am(this, "marginRight") + au.width, aN = aH + aF + am(this, "marginBottom") + au.height, aL = K.extend({}, ax), aM = aq(av.my, aI.outerWidth(), aI.outerHeight());
  679. if (aD.my[0] === "right") {
  680. aL.left -= aK
  681. } else {
  682. if (aD.my[0] === "center") {
  683. aL.left -= aK / 2
  684. }
  685. }
  686. if (aD.my[1] === "bottom") {
  687. aL.top -= aH
  688. } else {
  689. if (aD.my[1] === "center") {
  690. aL.top -= aH / 2
  691. }
  692. }
  693. aL.left += aM[0];
  694. aL.top += aM[1];
  695. aG = {
  696. marginLeft: aJ,
  697. marginTop: aF
  698. };
  699. K.each(["left", "top"], function(aR, aQ) {
  700. if (K.ui.position[aB[aR]]) {
  701. K.ui.position[aB[aR]][aQ](aL, {
  702. targetWidth: aA,
  703. targetHeight: ay,
  704. elemWidth: aK,
  705. elemHeight: aH,
  706. collisionPosition: aG,
  707. collisionWidth: aO,
  708. collisionHeight: aN,
  709. offset: [aE[0] + aM[0], aE[1] + aM[1]],
  710. my: aD.my,
  711. at: aD.at,
  712. within: aw,
  713. elem: aI
  714. })
  715. }
  716. });
  717. if (aD.using) {
  718. aP = function(aT) {
  719. var aV = aC.left - aL.left
  720. , aS = aV + aA - aK
  721. , aU = aC.top - aL.top
  722. , aR = aU + ay - aH
  723. , aQ = {
  724. target: {
  725. element: az,
  726. left: aC.left,
  727. top: aC.top,
  728. width: aA,
  729. height: ay
  730. },
  731. element: {
  732. element: aI,
  733. left: aL.left,
  734. top: aL.top,
  735. width: aK,
  736. height: aH
  737. },
  738. horizontal: aS < 0 ? "left" : aV > 0 ? "right" : "center",
  739. vertical: aR < 0 ? "top" : aU > 0 ? "bottom" : "middle"
  740. };
  741. if (aA < aK && ar(aV + aS) < aA) {
  742. aQ.horizontal = "center"
  743. }
  744. if (ay < aH && ar(aU + aR) < ay) {
  745. aQ.vertical = "middle"
  746. }
  747. if (ao(ar(aV), ar(aS)) > ao(ar(aU), ar(aR))) {
  748. aQ.important = "horizontal"
  749. } else {
  750. aQ.important = "vertical"
  751. }
  752. aD.using.call(this, aT, aQ)
  753. }
  754. }
  755. aI.offset(K.extend(aL, {
  756. using: aP
  757. }))
  758. })
  759. }
  760. ;
  761. K.ui.position = {
  762. fit: {
  763. left: function(ax, aw) {
  764. var av = aw.within, az = av.isWindow ? av.scrollLeft : av.offset.left, aB = av.width, ay = ax.left - aw.collisionPosition.marginLeft, aA = az - ay, au = ay + aw.collisionWidth - aB - az, at;
  765. if (aw.collisionWidth > aB) {
  766. if (aA > 0 && au <= 0) {
  767. at = ax.left + aA + aw.collisionWidth - aB - az;
  768. ax.left += aA - at
  769. } else {
  770. if (au > 0 && aA <= 0) {
  771. ax.left = az
  772. } else {
  773. if (aA > au) {
  774. ax.left = az + aB - aw.collisionWidth
  775. } else {
  776. ax.left = az
  777. }
  778. }
  779. }
  780. } else {
  781. if (aA > 0) {
  782. ax.left += aA
  783. } else {
  784. if (au > 0) {
  785. ax.left -= au
  786. } else {
  787. ax.left = ao(ax.left - ay, ax.left)
  788. }
  789. }
  790. }
  791. },
  792. top: function(aw, av) {
  793. var au = av.within, aA = au.isWindow ? au.scrollTop : au.offset.top, aB = av.within.height, ay = aw.top - av.collisionPosition.marginTop, az = aA - ay, ax = ay + av.collisionHeight - aB - aA, at;
  794. if (av.collisionHeight > aB) {
  795. if (az > 0 && ax <= 0) {
  796. at = aw.top + az + av.collisionHeight - aB - aA;
  797. aw.top += az - at
  798. } else {
  799. if (ax > 0 && az <= 0) {
  800. aw.top = aA
  801. } else {
  802. if (az > ax) {
  803. aw.top = aA + aB - av.collisionHeight
  804. } else {
  805. aw.top = aA
  806. }
  807. }
  808. }
  809. } else {
  810. if (az > 0) {
  811. aw.top += az
  812. } else {
  813. if (ax > 0) {
  814. aw.top -= ax
  815. } else {
  816. aw.top = ao(aw.top - ay, aw.top)
  817. }
  818. }
  819. }
  820. }
  821. },
  822. flip: {
  823. left: function(az, ay) {
  824. var ax = ay.within, aD = ax.offset.left + ax.scrollLeft, aG = ax.width, av = ax.isWindow ? ax.scrollLeft : ax.offset.left, aA = az.left - ay.collisionPosition.marginLeft, aE = aA - av, au = aA + ay.collisionWidth - aG - av, aC = ay.my[0] === "left" ? -ay.elemWidth : ay.my[0] === "right" ? ay.elemWidth : 0, aF = ay.at[0] === "left" ? ay.targetWidth : ay.at[0] === "right" ? -ay.targetWidth : 0, aw = -2 * ay.offset[0], at, aB;
  825. if (aE < 0) {
  826. at = az.left + aC + aF + aw + ay.collisionWidth - aG - aD;
  827. if (at < 0 || at < ar(aE)) {
  828. az.left += aC + aF + aw
  829. }
  830. } else {
  831. if (au > 0) {
  832. aB = az.left - ay.collisionPosition.marginLeft + aC + aF + aw - av;
  833. if (aB > 0 || ar(aB) < au) {
  834. az.left += aC + aF + aw
  835. }
  836. }
  837. }
  838. },
  839. top: function(ay, ax) {
  840. var aw = ax.within, aF = aw.offset.top + aw.scrollTop, aG = aw.height, at = aw.isWindow ? aw.scrollTop : aw.offset.top, aA = ay.top - ax.collisionPosition.marginTop, aC = aA - at, az = aA + ax.collisionHeight - aG - at, aD = ax.my[1] === "top", aB = aD ? -ax.elemHeight : ax.my[1] === "bottom" ? ax.elemHeight : 0, aH = ax.at[1] === "top" ? ax.targetHeight : ax.at[1] === "bottom" ? -ax.targetHeight : 0, av = -2 * ax.offset[1], aE, au;
  841. if (aC < 0) {
  842. au = ay.top + aB + aH + av + ax.collisionHeight - aG - aF;
  843. if (au < 0 || au < ar(aC)) {
  844. ay.top += aB + aH + av
  845. }
  846. } else {
  847. if (az > 0) {
  848. aE = ay.top - ax.collisionPosition.marginTop + aB + aH + av - at;
  849. if (aE > 0 || ar(aE) < az) {
  850. ay.top += aB + aH + av
  851. }
  852. }
  853. }
  854. }
  855. },
  856. flipfit: {
  857. left: function() {
  858. K.ui.position.flip.left.apply(this, arguments);
  859. K.ui.position.fit.left.apply(this, arguments)
  860. },
  861. top: function() {
  862. K.ui.position.flip.top.apply(this, arguments);
  863. K.ui.position.fit.top.apply(this, arguments)
  864. }
  865. }
  866. }
  867. }
  868. )();
  869. var R = K.ui.position;
  870. /*!
  871. * jQuery UI :data 1.12.1
  872. * http://jqueryui.com
  873. *
  874. * Copyright jQuery Foundation and other contributors
  875. * Released under the MIT license.
  876. * http://jquery.org/license
  877. */
  878. var ad = K.extend(K.expr[":"], {
  879. data: K.expr.createPseudo ? K.expr.createPseudo(function(ag) {
  880. return function(ah) {
  881. return !!K.data(ah, ag)
  882. }
  883. }) : function(ai, ah, ag) {
  884. return !!K.data(ai, ag[3])
  885. }
  886. });
  887. /*!
  888. * jQuery UI Disable Selection 1.12.1
  889. * http://jqueryui.com
  890. *
  891. * Copyright jQuery Foundation and other contributors
  892. * Released under the MIT license.
  893. * http://jquery.org/license
  894. */
  895. var V = K.fn.extend({
  896. disableSelection: (function() {
  897. var ag = "onselectstart"in document.createElement("div") ? "selectstart" : "mousedown";
  898. return function() {
  899. return this.on(ag + ".ui-disableSelection", function(ah) {
  900. ah.preventDefault()
  901. })
  902. }
  903. }
  904. )(),
  905. enableSelection: function() {
  906. return this.off(".ui-disableSelection")
  907. }
  908. });
  909. /*!
  910. * jQuery UI Focusable 1.12.1
  911. * http://jqueryui.com
  912. *
  913. * Copyright jQuery Foundation and other contributors
  914. * Released under the MIT license.
  915. * http://jquery.org/license
  916. */
  917. K.ui.focusable = function(aj, ah) {
  918. var am, ak, ai, al, ag, an = aj.nodeName.toLowerCase();
  919. if ("area" === an) {
  920. am = aj.parentNode;
  921. ak = am.name;
  922. if (!aj.href || !ak || am.nodeName.toLowerCase() !== "map") {
  923. return false
  924. }
  925. ai = K("img[usemap='#" + ak + "']");
  926. return ai.length > 0 && ai.is(":visible")
  927. }
  928. if (/^(input|select|textarea|button|object)$/.test(an)) {
  929. al = !aj.disabled;
  930. if (al) {
  931. ag = K(aj).closest("fieldset")[0];
  932. if (ag) {
  933. al = !ag.disabled
  934. }
  935. }
  936. } else {
  937. if ("a" === an) {
  938. al = aj.href || ah
  939. } else {
  940. al = ah
  941. }
  942. }
  943. return al && K(aj).is(":visible") && E(K(aj))
  944. }
  945. ;
  946. function E(ah) {
  947. var ag = ah.css("visibility");
  948. while (ag === "inherit") {
  949. ah = ah.parent();
  950. ag = ah.css("visibility")
  951. }
  952. return ag !== "hidden"
  953. }
  954. K.extend(K.expr[":"], {
  955. focusable: function(ag) {
  956. return K.ui.focusable(ag, K.attr(ag, "tabindex") != null)
  957. }
  958. });
  959. var B = K.ui.focusable;
  960. var P = K.fn.form = function() {
  961. return typeof this[0].form === "string" ? this.closest("form") : K(this[0].form)
  962. }
  963. ;
  964. /*!
  965. * jQuery UI Form Reset Mixin 1.12.1
  966. * http://jqueryui.com
  967. *
  968. * Copyright jQuery Foundation and other contributors
  969. * Released under the MIT license.
  970. * http://jquery.org/license
  971. */
  972. var i = K.ui.formResetMixin = {
  973. _formResetHandler: function() {
  974. var ag = K(this);
  975. setTimeout(function() {
  976. var ah = ag.data("ui-form-reset-instances");
  977. K.each(ah, function() {
  978. this.refresh()
  979. })
  980. })
  981. },
  982. _bindFormResetHandler: function() {
  983. this.form = this.element.form();
  984. if (!this.form.length) {
  985. return
  986. }
  987. var ag = this.form.data("ui-form-reset-instances") || [];
  988. if (!ag.length) {
  989. this.form.on("reset.ui-form-reset", this._formResetHandler)
  990. }
  991. ag.push(this);
  992. this.form.data("ui-form-reset-instances", ag)
  993. },
  994. _unbindFormResetHandler: function() {
  995. if (!this.form.length) {
  996. return
  997. }
  998. var ag = this.form.data("ui-form-reset-instances");
  999. ag.splice(K.inArray(this, ag), 1);
  1000. if (ag.length) {
  1001. this.form.data("ui-form-reset-instances", ag)
  1002. } else {
  1003. this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")
  1004. }
  1005. }
  1006. };
  1007. /*!
  1008. * jQuery UI Keycode 1.12.1
  1009. * http://jqueryui.com
  1010. *
  1011. * Copyright jQuery Foundation and other contributors
  1012. * Released under the MIT license.
  1013. * http://jquery.org/license
  1014. */
  1015. var w = K.ui.keyCode = {
  1016. BACKSPACE: 8,
  1017. COMMA: 188,
  1018. DELETE: 46,
  1019. DOWN: 40,
  1020. END: 35,
  1021. ENTER: 13,
  1022. ESCAPE: 27,
  1023. HOME: 36,
  1024. LEFT: 37,
  1025. PAGE_DOWN: 34,
  1026. PAGE_UP: 33,
  1027. PERIOD: 190,
  1028. RIGHT: 39,
  1029. SPACE: 32,
  1030. TAB: 9,
  1031. UP: 38
  1032. };
  1033. var Y = K.ui.escapeSelector = (function() {
  1034. var ag = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
  1035. return function(ah) {
  1036. return ah.replace(ag, "\\$1")
  1037. }
  1038. }
  1039. )();
  1040. /*!
  1041. * jQuery UI Labels 1.12.1
  1042. * http://jqueryui.com
  1043. *
  1044. * Copyright jQuery Foundation and other contributors
  1045. * Released under the MIT license.
  1046. * http://jquery.org/license
  1047. */
  1048. var s = K.fn.labels = function() {
  1049. var ah, ag, ak, aj, ai;
  1050. if (this[0].labels && this[0].labels.length) {
  1051. return this.pushStack(this[0].labels)
  1052. }
  1053. aj = this.eq(0).parents("label");
  1054. ak = this.attr("id");
  1055. if (ak) {
  1056. ah = this.eq(0).parents().last();
  1057. ai = ah.add(ah.length ? ah.siblings() : this.siblings());
  1058. ag = "label[for='" + K.ui.escapeSelector(ak) + "']";
  1059. aj = aj.add(ai.find(ag).addBack(ag))
  1060. }
  1061. return this.pushStack(aj)
  1062. }
  1063. ;
  1064. /*!
  1065. * jQuery UI Scroll Parent 1.12.1
  1066. * http://jqueryui.com
  1067. *
  1068. * Copyright jQuery Foundation and other contributors
  1069. * Released under the MIT license.
  1070. * http://jquery.org/license
  1071. */
  1072. var J = K.fn.scrollParent = function(ai) {
  1073. var ah = this.css("position")
  1074. , ag = ah === "absolute"
  1075. , aj = ai ? /(auto|scroll|hidden)/ : /(auto|scroll)/
  1076. , ak = this.parents().filter(function() {
  1077. var al = K(this);
  1078. if (ag && al.css("position") === "static") {
  1079. return false
  1080. }
  1081. return aj.test(al.css("overflow") + al.css("overflow-y") + al.css("overflow-x"))
  1082. }).eq(0);
  1083. return ah === "fixed" || !ak.length ? K(this[0].ownerDocument || document) : ak
  1084. }
  1085. ;
  1086. /*!
  1087. * jQuery UI Tabbable 1.12.1
  1088. * http://jqueryui.com
  1089. *
  1090. * Copyright jQuery Foundation and other contributors
  1091. * Released under the MIT license.
  1092. * http://jquery.org/license
  1093. */
  1094. var r = K.extend(K.expr[":"], {
  1095. tabbable: function(ai) {
  1096. var ah = K.attr(ai, "tabindex")
  1097. , ag = ah != null;
  1098. return (!ag || ah >= 0) && K.ui.focusable(ai, ag)
  1099. }
  1100. });
  1101. /*!
  1102. * jQuery UI Unique ID 1.12.1
  1103. * http://jqueryui.com
  1104. *
  1105. * Copyright jQuery Foundation and other contributors
  1106. * Released under the MIT license.
  1107. * http://jquery.org/license
  1108. */
  1109. var k = K.fn.extend({
  1110. uniqueId: (function() {
  1111. var ag = 0;
  1112. return function() {
  1113. return this.each(function() {
  1114. if (!this.id) {
  1115. this.id = "ui-id-" + (++ag)
  1116. }
  1117. })
  1118. }
  1119. }
  1120. )(),
  1121. removeUniqueId: function() {
  1122. return this.each(function() {
  1123. if (/^ui-id-\d+$/.test(this.id)) {
  1124. K(this).removeAttr("id")
  1125. }
  1126. })
  1127. }
  1128. });
  1129. var N = K.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());
  1130. /*!
  1131. * jQuery UI Mouse 1.12.1
  1132. * http://jqueryui.com
  1133. *
  1134. * Copyright jQuery Foundation and other contributors
  1135. * Released under the MIT license.
  1136. * http://jquery.org/license
  1137. */
  1138. var e = false;
  1139. K(document).on("mouseup", function() {
  1140. e = false
  1141. });
  1142. var H = K.widget("ui.mouse", {
  1143. version: "1.12.1",
  1144. options: {
  1145. cancel: "input, textarea, button, select, option",
  1146. distance: 1,
  1147. delay: 0
  1148. },
  1149. _mouseInit: function() {
  1150. var ag = this;
  1151. this.element.on("mousedown." + this.widgetName, function(ah) {
  1152. return ag._mouseDown(ah)
  1153. }).on("click." + this.widgetName, function(ah) {
  1154. if (true === K.data(ah.target, ag.widgetName + ".preventClickEvent")) {
  1155. K.removeData(ah.target, ag.widgetName + ".preventClickEvent");
  1156. ah.stopImmediatePropagation();
  1157. return false
  1158. }
  1159. });
  1160. this.started = false
  1161. },
  1162. _mouseDestroy: function() {
  1163. this.element.off("." + this.widgetName);
  1164. if (this._mouseMoveDelegate) {
  1165. this.document.off("mousemove." + this.widgetName, this._mouseMoveDelegate).off("mouseup." + this.widgetName, this._mouseUpDelegate)
  1166. }
  1167. },
  1168. _mouseDown: function(ai) {
  1169. if (e) {
  1170. return
  1171. }
  1172. this._mouseMoved = false;
  1173. (this._mouseStarted && this._mouseUp(ai));
  1174. this._mouseDownEvent = ai;
  1175. var ah = this
  1176. , aj = (ai.which === 1)
  1177. , ag = (typeof this.options.cancel === "string" && ai.target.nodeName ? K(ai.target).closest(this.options.cancel).length : false);
  1178. if (!aj || ag || !this._mouseCapture(ai)) {
  1179. return true
  1180. }
  1181. this.mouseDelayMet = !this.options.delay;
  1182. if (!this.mouseDelayMet) {
  1183. this._mouseDelayTimer = setTimeout(function() {
  1184. ah.mouseDelayMet = true
  1185. }, this.options.delay)
  1186. }
  1187. if (this._mouseDistanceMet(ai) && this._mouseDelayMet(ai)) {
  1188. this._mouseStarted = (this._mouseStart(ai) !== false);
  1189. if (!this._mouseStarted) {
  1190. ai.preventDefault();
  1191. return true
  1192. }
  1193. }
  1194. if (true === K.data(ai.target, this.widgetName + ".preventClickEvent")) {
  1195. K.removeData(ai.target, this.widgetName + ".preventClickEvent")
  1196. }
  1197. this._mouseMoveDelegate = function(ak) {
  1198. return ah._mouseMove(ak)
  1199. }
  1200. ;
  1201. this._mouseUpDelegate = function(ak) {
  1202. return ah._mouseUp(ak)
  1203. }
  1204. ;
  1205. this.document.on("mousemove." + this.widgetName, this._mouseMoveDelegate).on("mouseup." + this.widgetName, this._mouseUpDelegate);
  1206. ai.preventDefault();
  1207. e = true;
  1208. return true
  1209. },
  1210. _mouseMove: function(ag) {
  1211. if (this._mouseMoved) {
  1212. if (K.ui.ie && (!document.documentMode || document.documentMode < 9) && !ag.button) {
  1213. return this._mouseUp(ag)
  1214. } else {
  1215. if (!ag.which) {
  1216. if (ag.originalEvent.altKey || ag.originalEvent.ctrlKey || ag.originalEvent.metaKey || ag.originalEvent.shiftKey) {
  1217. this.ignoreMissingWhich = true
  1218. } else {
  1219. if (!this.ignoreMissingWhich) {
  1220. return this._mouseUp(ag)
  1221. }
  1222. }
  1223. }
  1224. }
  1225. }
  1226. if (ag.which || ag.button) {
  1227. this._mouseMoved = true
  1228. }
  1229. if (this._mouseStarted) {
  1230. this._mouseDrag(ag);
  1231. return ag.preventDefault()
  1232. }
  1233. if (this._mouseDistanceMet(ag) && this._mouseDelayMet(ag)) {
  1234. this._mouseStarted = (this._mouseStart(this._mouseDownEvent, ag) !== false);
  1235. (this._mouseStarted ? this._mouseDrag(ag) : this._mouseUp(ag))
  1236. }
  1237. return !this._mouseStarted
  1238. },
  1239. _mouseUp: function(ag) {
  1240. this.document.off("mousemove." + this.widgetName, this._mouseMoveDelegate).off("mouseup." + this.widgetName, this._mouseUpDelegate);
  1241. if (this._mouseStarted) {
  1242. this._mouseStarted = false;
  1243. if (ag.target === this._mouseDownEvent.target) {
  1244. K.data(ag.target, this.widgetName + ".preventClickEvent", true)
  1245. }
  1246. this._mouseStop(ag)
  1247. }
  1248. if (this._mouseDelayTimer) {
  1249. clearTimeout(this._mouseDelayTimer);
  1250. delete this._mouseDelayTimer
  1251. }
  1252. this.ignoreMissingWhich = false;
  1253. e = false;
  1254. ag.preventDefault()
  1255. },
  1256. _mouseDistanceMet: function(ag) {
  1257. return (Math.max(Math.abs(this._mouseDownEvent.pageX - ag.pageX), Math.abs(this._mouseDownEvent.pageY - ag.pageY)) >= this.options.distance)
  1258. },
  1259. _mouseDelayMet: function() {
  1260. return this.mouseDelayMet
  1261. },
  1262. _mouseStart: function() {},
  1263. _mouseDrag: function() {},
  1264. _mouseStop: function() {},
  1265. _mouseCapture: function() {
  1266. return true
  1267. }
  1268. });
  1269. var ab = K.ui.plugin = {
  1270. add: function(ah, ai, ak) {
  1271. var ag, aj = K.ui[ah].prototype;
  1272. for (ag in ak) {
  1273. aj.plugins[ag] = aj.plugins[ag] || [];
  1274. aj.plugins[ag].push([ai, ak[ag]])
  1275. }
  1276. },
  1277. call: function(ag, aj, ai, ah) {
  1278. var ak, al = ag.plugins[aj];
  1279. if (!al) {
  1280. return
  1281. }
  1282. if (!ah && (!ag.element[0].parentNode || ag.element[0].parentNode.nodeType === 11)) {
  1283. return
  1284. }
  1285. for (ak = 0; ak < al.length; ak++) {
  1286. if (ag.options[al[ak][0]]) {
  1287. al[ak][1].apply(ag.element, ai)
  1288. }
  1289. }
  1290. }
  1291. };
  1292. var O = K.ui.safeActiveElement = function(ag) {
  1293. var ai;
  1294. try {
  1295. ai = ag.activeElement
  1296. } catch (ah) {
  1297. ai = ag.body
  1298. }
  1299. if (!ai) {
  1300. ai = ag.body
  1301. }
  1302. if (!ai.nodeName) {
  1303. ai = ag.body
  1304. }
  1305. return ai
  1306. }
  1307. ;
  1308. var z = K.ui.safeBlur = function(ag) {
  1309. if (ag && ag.nodeName.toLowerCase() !== "body") {
  1310. K(ag).trigger("blur")
  1311. }
  1312. }
  1313. ;
  1314. /*!
  1315. * jQuery UI Draggable 1.12.1
  1316. * http://jqueryui.com
  1317. *
  1318. * Copyright jQuery Foundation and other contributors
  1319. * Released under the MIT license.
  1320. * http://jquery.org/license
  1321. */
  1322. K.widget("ui.draggable", K.ui.mouse, {
  1323. version: "1.12.1",
  1324. widgetEventPrefix: "drag",
  1325. options: {
  1326. addClasses: true,
  1327. appendTo: "parent",
  1328. axis: false,
  1329. connectToSortable: false,
  1330. containment: false,
  1331. cursor: "auto",
  1332. cursorAt: false,
  1333. grid: false,
  1334. handle: false,
  1335. helper: "original",
  1336. iframeFix: false,
  1337. opacity: false,
  1338. refreshPositions: false,
  1339. revert: false,
  1340. revertDuration: 500,
  1341. scope: "default",
  1342. scroll: true,
  1343. scrollSensitivity: 20,
  1344. scrollSpeed: 20,
  1345. snap: false,
  1346. snapMode: "both",
  1347. snapTolerance: 20,
  1348. stack: false,
  1349. zIndex: false,
  1350. drag: null,
  1351. start: null,
  1352. stop: null
  1353. },
  1354. _create: function() {
  1355. if (this.options.helper === "original") {
  1356. this._setPositionRelative()
  1357. }
  1358. if (this.options.addClasses) {
  1359. this._addClass("ui-draggable")
  1360. }
  1361. this._setHandleClassName();
  1362. this._mouseInit()
  1363. },
  1364. _setOption: function(ag, ah) {
  1365. this._super(ag, ah);
  1366. if (ag === "handle") {
  1367. this._removeHandleClassName();
  1368. this._setHandleClassName()
  1369. }
  1370. },
  1371. _destroy: function() {
  1372. if ((this.helper || this.element).is(".ui-draggable-dragging")) {
  1373. this.destroyOnClear = true;
  1374. return
  1375. }
  1376. this._removeHandleClassName();
  1377. this._mouseDestroy()
  1378. },
  1379. _mouseCapture: function(ag) {
  1380. var ah = this.options;
  1381. if (this.helper || ah.disabled || K(ag.target).closest(".ui-resizable-handle").length > 0) {
  1382. return false
  1383. }
  1384. this.handle = this._getHandle(ag);
  1385. if (!this.handle) {
  1386. return false
  1387. }
  1388. this._blurActiveElement(ag);
  1389. this._blockFrames(ah.iframeFix === true ? "iframe" : ah.iframeFix);
  1390. return true
  1391. },
  1392. _blockFrames: function(ag) {
  1393. this.iframeBlocks = this.document.find(ag).map(function() {
  1394. var ah = K(this);
  1395. return K("<div>").css("position", "absolute").appendTo(ah.parent()).outerWidth(ah.outerWidth()).outerHeight(ah.outerHeight()).offset(ah.offset())[0]
  1396. })
  1397. },
  1398. _unblockFrames: function() {
  1399. if (this.iframeBlocks) {
  1400. this.iframeBlocks.remove();
  1401. delete this.iframeBlocks
  1402. }
  1403. },
  1404. _blurActiveElement: function(ah) {
  1405. var ag = K.ui.safeActiveElement(this.document[0])
  1406. , ai = K(ah.target);
  1407. if (ai.closest(ag).length) {
  1408. return
  1409. }
  1410. K.ui.safeBlur(ag)
  1411. },
  1412. _mouseStart: function(ag) {
  1413. var ah = this.options;
  1414. this.helper = this._createHelper(ag);
  1415. this._addClass(this.helper, "ui-draggable-dragging");
  1416. this._cacheHelperProportions();
  1417. if (K.ui.ddmanager) {
  1418. K.ui.ddmanager.current = this
  1419. }
  1420. this._cacheMargins();
  1421. this.cssPosition = this.helper.css("position");
  1422. this.scrollParent = this.helper.scrollParent(true);
  1423. this.offsetParent = this.helper.offsetParent();
  1424. this.hasFixedAncestor = this.helper.parents().filter(function() {
  1425. return K(this).css("position") === "fixed"
  1426. }).length > 0;
  1427. this.positionAbs = this.element.offset();
  1428. this._refreshOffsets(ag);
  1429. this.originalPosition = this.position = this._generatePosition(ag, false);
  1430. this.originalPageX = ag.pageX;
  1431. this.originalPageY = ag.pageY;
  1432. (ah.cursorAt && this._adjustOffsetFromHelper(ah.cursorAt));
  1433. this._setContainment();
  1434. if (this._trigger("start", ag) === false) {
  1435. this._clear();
  1436. return false
  1437. }
  1438. this._cacheHelperProportions();
  1439. if (K.ui.ddmanager && !ah.dropBehaviour) {
  1440. K.ui.ddmanager.prepareOffsets(this, ag)
  1441. }
  1442. this._mouseDrag(ag, true);
  1443. if (K.ui.ddmanager) {
  1444. K.ui.ddmanager.dragStart(this, ag)
  1445. }
  1446. return true
  1447. },
  1448. _refreshOffsets: function(ag) {
  1449. this.offset = {
  1450. top: this.positionAbs.top - this.margins.top,
  1451. left: this.positionAbs.left - this.margins.left,
  1452. scroll: false,
  1453. parent: this._getParentOffset(),
  1454. relative: this._getRelativeOffset()
  1455. };
  1456. this.offset.click = {
  1457. left: ag.pageX - this.offset.left,
  1458. top: ag.pageY - this.offset.top
  1459. }
  1460. },
  1461. _mouseDrag: function(ag, ai) {
  1462. if (this.hasFixedAncestor) {
  1463. this.offset.parent = this._getParentOffset()
  1464. }
  1465. this.position = this._generatePosition(ag, true);
  1466. this.positionAbs = this._convertPositionTo("absolute");
  1467. if (!ai) {
  1468. var ah = this._uiHash();
  1469. if (this._trigger("drag", ag, ah) === false) {
  1470. this._mouseUp(new K.Event("mouseup",ag));
  1471. return false
  1472. }
  1473. this.position = ah.position
  1474. }
  1475. this.helper[0].style.left = this.position.left + "px";
  1476. this.helper[0].style.top = this.position.top + "px";
  1477. if (K.ui.ddmanager) {
  1478. K.ui.ddmanager.drag(this, ag)
  1479. }
  1480. return false
  1481. },
  1482. _mouseStop: function(ah) {
  1483. var ag = this
  1484. , ai = false;
  1485. if (K.ui.ddmanager && !this.options.dropBehaviour) {
  1486. ai = K.ui.ddmanager.drop(this, ah)
  1487. }
  1488. if (this.dropped) {
  1489. ai = this.dropped;
  1490. this.dropped = false
  1491. }
  1492. if ((this.options.revert === "invalid" && !ai) || (this.options.revert === "valid" && ai) || this.options.revert === true || (K.isFunction(this.options.revert) && this.options.revert.call(this.element, ai))) {
  1493. K(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
  1494. if (ag._trigger("stop", ah) !== false) {
  1495. ag._clear()
  1496. }
  1497. })
  1498. } else {
  1499. if (this._trigger("stop", ah) !== false) {
  1500. this._clear()
  1501. }
  1502. }
  1503. return false
  1504. },
  1505. _mouseUp: function(ag) {
  1506. this._unblockFrames();
  1507. if (K.ui.ddmanager) {
  1508. K.ui.ddmanager.dragStop(this, ag)
  1509. }
  1510. if (this.handleElement.is(ag.target)) {
  1511. this.element.trigger("focus")
  1512. }
  1513. return K.ui.mouse.prototype._mouseUp.call(this, ag)
  1514. },
  1515. cancel: function() {
  1516. if (this.helper.is(".ui-draggable-dragging")) {
  1517. this._mouseUp(new K.Event("mouseup",{
  1518. target: this.element[0]
  1519. }))
  1520. } else {
  1521. this._clear()
  1522. }
  1523. return this
  1524. },
  1525. _getHandle: function(ag) {
  1526. return this.options.handle ? !!K(ag.target).closest(this.element.find(this.options.handle)).length : true
  1527. },
  1528. _setHandleClassName: function() {
  1529. this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element;
  1530. this._addClass(this.handleElement, "ui-draggable-handle")
  1531. },
  1532. _removeHandleClassName: function() {
  1533. this._removeClass(this.handleElement, "ui-draggable-handle")
  1534. },
  1535. _createHelper: function(ah) {
  1536. var aj = this.options
  1537. , ai = K.isFunction(aj.helper)
  1538. , ag = ai ? K(aj.helper.apply(this.element[0], [ah])) : (aj.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);
  1539. if (!ag.parents("body").length) {
  1540. ag.appendTo((aj.appendTo === "parent" ? this.element[0].parentNode : aj.appendTo))
  1541. }
  1542. if (ai && ag[0] === this.element[0]) {
  1543. this._setPositionRelative()
  1544. }
  1545. if (ag[0] !== this.element[0] && !(/(fixed|absolute)/).test(ag.css("position"))) {
  1546. ag.css("position", "absolute")
  1547. }
  1548. return ag
  1549. },
  1550. _setPositionRelative: function() {
  1551. if (!(/^(?:r|a|f)/).test(this.element.css("position"))) {
  1552. this.element[0].style.position = "relative"
  1553. }
  1554. },
  1555. _adjustOffsetFromHelper: function(ag) {
  1556. if (typeof ag === "string") {
  1557. ag = ag.split(" ")
  1558. }
  1559. if (K.isArray(ag)) {
  1560. ag = {
  1561. left: +ag[0],
  1562. top: +ag[1] || 0
  1563. }
  1564. }
  1565. if ("left"in ag) {
  1566. this.offset.click.left = ag.left + this.margins.left
  1567. }
  1568. if ("right"in ag) {
  1569. this.offset.click.left = this.helperProportions.width - ag.right + this.margins.left
  1570. }
  1571. if ("top"in ag) {
  1572. this.offset.click.top = ag.top + this.margins.top
  1573. }
  1574. if ("bottom"in ag) {
  1575. this.offset.click.top = this.helperProportions.height - ag.bottom + this.margins.top
  1576. }
  1577. },
  1578. _isRootNode: function(ag) {
  1579. return (/(html|body)/i).test(ag.tagName) || ag === this.document[0]
  1580. },
  1581. _getParentOffset: function() {
  1582. var ah = this.offsetParent.offset()
  1583. , ag = this.document[0];
  1584. if (this.cssPosition === "absolute" && this.scrollParent[0] !== ag && K.contains(this.scrollParent[0], this.offsetParent[0])) {
  1585. ah.left += this.scrollParent.scrollLeft();
  1586. ah.top += this.scrollParent.scrollTop()
  1587. }
  1588. if (this._isRootNode(this.offsetParent[0])) {
  1589. ah = {
  1590. top: 0,
  1591. left: 0
  1592. }
  1593. }
  1594. return {
  1595. top: ah.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
  1596. left: ah.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
  1597. }
  1598. },
  1599. _getRelativeOffset: function() {
  1600. if (this.cssPosition !== "relative") {
  1601. return {
  1602. top: 0,
  1603. left: 0
  1604. }
  1605. }
  1606. var ag = this.element.position()
  1607. , ah = this._isRootNode(this.scrollParent[0]);
  1608. return {
  1609. top: ag.top - (parseInt(this.helper.css("top"), 10) || 0) + (!ah ? this.scrollParent.scrollTop() : 0),
  1610. left: ag.left - (parseInt(this.helper.css("left"), 10) || 0) + (!ah ? this.scrollParent.scrollLeft() : 0)
  1611. }
  1612. },
  1613. _cacheMargins: function() {
  1614. this.margins = {
  1615. left: (parseInt(this.element.css("marginLeft"), 10) || 0),
  1616. top: (parseInt(this.element.css("marginTop"), 10) || 0),
  1617. right: (parseInt(this.element.css("marginRight"), 10) || 0),
  1618. bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
  1619. }
  1620. },
  1621. _cacheHelperProportions: function() {
  1622. this.helperProportions = {
  1623. width: this.helper.outerWidth(),
  1624. height: this.helper.outerHeight()
  1625. }
  1626. },
  1627. _setContainment: function() {
  1628. var ah, ak, ai, aj = this.options, ag = this.document[0];
  1629. this.relativeContainer = null;
  1630. if (!aj.containment) {
  1631. this.containment = null;
  1632. return
  1633. }
  1634. if (aj.containment === "window") {
  1635. this.containment = [K(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, K(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, K(window).scrollLeft() + K(window).width() - this.helperProportions.width - this.margins.left, K(window).scrollTop() + (K(window).height() || ag.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
  1636. return
  1637. }
  1638. if (aj.containment === "document") {
  1639. this.containment = [0, 0, K(ag).width() - this.helperProportions.width - this.margins.left, (K(ag).height() || ag.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
  1640. return
  1641. }
  1642. if (aj.containment.constructor === Array) {
  1643. this.containment = aj.containment;
  1644. return
  1645. }
  1646. if (aj.containment === "parent") {
  1647. aj.containment = this.helper[0].parentNode
  1648. }
  1649. ak = K(aj.containment);
  1650. ai = ak[0];
  1651. if (!ai) {
  1652. return
  1653. }
  1654. ah = /(scroll|auto)/.test(ak.css("overflow"));
  1655. this.containment = [(parseInt(ak.css("borderLeftWidth"), 10) || 0) + (parseInt(ak.css("paddingLeft"), 10) || 0), (parseInt(ak.css("borderTopWidth"), 10) || 0) + (parseInt(ak.css("paddingTop"), 10) || 0), (ah ? Math.max(ai.scrollWidth, ai.offsetWidth) : ai.offsetWidth) - (parseInt(ak.css("borderRightWidth"), 10) || 0) - (parseInt(ak.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (ah ? Math.max(ai.scrollHeight, ai.offsetHeight) : ai.offsetHeight) - (parseInt(ak.css("borderBottomWidth"), 10) || 0) - (parseInt(ak.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom];
  1656. this.relativeContainer = ak
  1657. },
  1658. _convertPositionTo: function(ah, aj) {
  1659. if (!aj) {
  1660. aj = this.position
  1661. }
  1662. var ag = ah === "absolute" ? 1 : -1
  1663. , ai = this._isRootNode(this.scrollParent[0]);
  1664. return {
  1665. top: (aj.top + this.offset.relative.top * ag + this.offset.parent.top * ag - ((this.cssPosition === "fixed" ? -this.offset.scroll.top : (ai ? 0 : this.offset.scroll.top)) * ag)),
  1666. left: (aj.left + this.offset.relative.left * ag + this.offset.parent.left * ag - ((this.cssPosition === "fixed" ? -this.offset.scroll.left : (ai ? 0 : this.offset.scroll.left)) * ag))
  1667. }
  1668. },
  1669. _generatePosition: function(ah, an) {
  1670. var ag, ao, ap, aj, ai = this.options, am = this._isRootNode(this.scrollParent[0]), al = ah.pageX, ak = ah.pageY;
  1671. if (!am || !this.offset.scroll) {
  1672. this.offset.scroll = {
  1673. top: this.scrollParent.scrollTop(),
  1674. left: this.scrollParent.scrollLeft()
  1675. }
  1676. }
  1677. if (an) {
  1678. if (this.containment) {
  1679. if (this.relativeContainer) {
  1680. ao = this.relativeContainer.offset();
  1681. ag = [this.containment[0] + ao.left, this.containment[1] + ao.top, this.containment[2] + ao.left, this.containment[3] + ao.top]
  1682. } else {
  1683. ag = this.containment
  1684. }
  1685. if (ah.pageX - this.offset.click.left < ag[0]) {
  1686. al = ag[0] + this.offset.click.left
  1687. }
  1688. if (ah.pageY - this.offset.click.top < ag[1]) {
  1689. ak = ag[1] + this.offset.click.top
  1690. }
  1691. if (ah.pageX - this.offset.click.left > ag[2]) {
  1692. al = ag[2] + this.offset.click.left
  1693. }
  1694. if (ah.pageY - this.offset.click.top > ag[3]) {
  1695. ak = ag[3] + this.offset.click.top
  1696. }
  1697. }
  1698. if (ai.grid) {
  1699. ap = ai.grid[1] ? this.originalPageY + Math.round((ak - this.originalPageY) / ai.grid[1]) * ai.grid[1] : this.originalPageY;
  1700. ak = ag ? ((ap - this.offset.click.top >= ag[1] || ap - this.offset.click.top > ag[3]) ? ap : ((ap - this.offset.click.top >= ag[1]) ? ap - ai.grid[1] : ap + ai.grid[1])) : ap;
  1701. aj = ai.grid[0] ? this.originalPageX + Math.round((al - this.originalPageX) / ai.grid[0]) * ai.grid[0] : this.originalPageX;
  1702. al = ag ? ((aj - this.offset.click.left >= ag[0] || aj - this.offset.click.left > ag[2]) ? aj : ((aj - this.offset.click.left >= ag[0]) ? aj - ai.grid[0] : aj + ai.grid[0])) : aj
  1703. }
  1704. if (ai.axis === "y") {
  1705. al = this.originalPageX
  1706. }
  1707. if (ai.axis === "x") {
  1708. ak = this.originalPageY
  1709. }
  1710. }
  1711. return {
  1712. top: (ak - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.offset.scroll.top : (am ? 0 : this.offset.scroll.top))),
  1713. left: (al - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.offset.scroll.left : (am ? 0 : this.offset.scroll.left)))
  1714. }
  1715. },
  1716. _clear: function() {
  1717. this._removeClass(this.helper, "ui-draggable-dragging");
  1718. if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
  1719. this.helper.remove()
  1720. }
  1721. this.helper = null;
  1722. this.cancelHelperRemoval = false;
  1723. if (this.destroyOnClear) {
  1724. this.destroy()
  1725. }
  1726. },
  1727. _trigger: function(ag, ah, ai) {
  1728. ai = ai || this._uiHash();
  1729. K.ui.plugin.call(this, ag, [ah, ai, this], true);
  1730. if (/^(drag|start|stop)/.test(ag)) {
  1731. this.positionAbs = this._convertPositionTo("absolute");
  1732. ai.offset = this.positionAbs
  1733. }
  1734. return K.Widget.prototype._trigger.call(this, ag, ah, ai)
  1735. },
  1736. plugins: {},
  1737. _uiHash: function() {
  1738. return {
  1739. helper: this.helper,
  1740. position: this.position,
  1741. originalPosition: this.originalPosition,
  1742. offset: this.positionAbs
  1743. }
  1744. }
  1745. });
  1746. K.ui.plugin.add("draggable", "connectToSortable", {
  1747. start: function(ai, aj, ag) {
  1748. var ah = K.extend({}, aj, {
  1749. item: ag.element
  1750. });
  1751. ag.sortables = [];
  1752. K(ag.options.connectToSortable).each(function() {
  1753. var ak = K(this).sortable("instance");
  1754. if (ak && !ak.options.disabled) {
  1755. ag.sortables.push(ak);
  1756. ak.refreshPositions();
  1757. ak._trigger("activate", ai, ah)
  1758. }
  1759. })
  1760. },
  1761. stop: function(ai, aj, ag) {
  1762. var ah = K.extend({}, aj, {
  1763. item: ag.element
  1764. });
  1765. ag.cancelHelperRemoval = false;
  1766. K.each(ag.sortables, function() {
  1767. var ak = this;
  1768. if (ak.isOver) {
  1769. ak.isOver = 0;
  1770. ag.cancelHelperRemoval = true;
  1771. ak.cancelHelperRemoval = false;
  1772. ak._storedCSS = {
  1773. position: ak.placeholder.css("position"),
  1774. top: ak.placeholder.css("top"),
  1775. left: ak.placeholder.css("left")
  1776. };
  1777. ak._mouseStop(ai);
  1778. ak.options.helper = ak.options._helper
  1779. } else {
  1780. ak.cancelHelperRemoval = true;
  1781. ak._trigger("deactivate", ai, ah)
  1782. }
  1783. })
  1784. },
  1785. drag: function(ah, ai, ag) {
  1786. K.each(ag.sortables, function() {
  1787. var aj = false
  1788. , ak = this;
  1789. ak.positionAbs = ag.positionAbs;
  1790. ak.helperProportions = ag.helperProportions;
  1791. ak.offset.click = ag.offset.click;
  1792. if (ak._intersectsWith(ak.containerCache)) {
  1793. aj = true;
  1794. K.each(ag.sortables, function() {
  1795. this.positionAbs = ag.positionAbs;
  1796. this.helperProportions = ag.helperProportions;
  1797. this.offset.click = ag.offset.click;
  1798. if (this !== ak && this._intersectsWith(this.containerCache) && K.contains(ak.element[0], this.element[0])) {
  1799. aj = false
  1800. }
  1801. return aj
  1802. })
  1803. }
  1804. if (aj) {
  1805. if (!ak.isOver) {
  1806. ak.isOver = 1;
  1807. ag._parent = ai.helper.parent();
  1808. ak.currentItem = ai.helper.appendTo(ak.element).data("ui-sortable-item", true);
  1809. ak.options._helper = ak.options.helper;
  1810. ak.options.helper = function() {
  1811. return ai.helper[0]
  1812. }
  1813. ;
  1814. ah.target = ak.currentItem[0];
  1815. ak._mouseCapture(ah, true);
  1816. ak._mouseStart(ah, true, true);
  1817. ak.offset.click.top = ag.offset.click.top;
  1818. ak.offset.click.left = ag.offset.click.left;
  1819. ak.offset.parent.left -= ag.offset.parent.left - ak.offset.parent.left;
  1820. ak.offset.parent.top -= ag.offset.parent.top - ak.offset.parent.top;
  1821. ag._trigger("toSortable", ah);
  1822. ag.dropped = ak.element;
  1823. K.each(ag.sortables, function() {
  1824. this.refreshPositions()
  1825. });
  1826. ag.currentItem = ag.element;
  1827. ak.fromOutside = ag
  1828. }
  1829. if (ak.currentItem) {
  1830. ak._mouseDrag(ah);
  1831. ai.position = ak.position
  1832. }
  1833. } else {
  1834. if (ak.isOver) {
  1835. ak.isOver = 0;
  1836. ak.cancelHelperRemoval = true;
  1837. ak.options._revert = ak.options.revert;
  1838. ak.options.revert = false;
  1839. ak._trigger("out", ah, ak._uiHash(ak));
  1840. ak._mouseStop(ah, true);
  1841. ak.options.revert = ak.options._revert;
  1842. ak.options.helper = ak.options._helper;
  1843. if (ak.placeholder) {
  1844. ak.placeholder.remove()
  1845. }
  1846. ai.helper.appendTo(ag._parent);
  1847. ag._refreshOffsets(ah);
  1848. ai.position = ag._generatePosition(ah, true);
  1849. ag._trigger("fromSortable", ah);
  1850. ag.dropped = false;
  1851. K.each(ag.sortables, function() {
  1852. this.refreshPositions()
  1853. })
  1854. }
  1855. }
  1856. })
  1857. }
  1858. });
  1859. K.ui.plugin.add("draggable", "cursor", {
  1860. start: function(ai, aj, ag) {
  1861. var ah = K("body")
  1862. , ak = ag.options;
  1863. if (ah.css("cursor")) {
  1864. ak._cursor = ah.css("cursor")
  1865. }
  1866. ah.css("cursor", ak.cursor)
  1867. },
  1868. stop: function(ah, ai, ag) {
  1869. var aj = ag.options;
  1870. if (aj._cursor) {
  1871. K("body").css("cursor", aj._cursor)
  1872. }
  1873. }
  1874. });
  1875. K.ui.plugin.add("draggable", "opacity", {
  1876. start: function(ai, aj, ag) {
  1877. var ah = K(aj.helper)
  1878. , ak = ag.options;
  1879. if (ah.css("opacity")) {
  1880. ak._opacity = ah.css("opacity")
  1881. }
  1882. ah.css("opacity", ak.opacity)
  1883. },
  1884. stop: function(ah, ai, ag) {
  1885. var aj = ag.options;
  1886. if (aj._opacity) {
  1887. K(ai.helper).css("opacity", aj._opacity)
  1888. }
  1889. }
  1890. });
  1891. K.ui.plugin.add("draggable", "scroll", {
  1892. start: function(ah, ai, ag) {
  1893. if (!ag.scrollParentNotHidden) {
  1894. ag.scrollParentNotHidden = ag.helper.scrollParent(false)
  1895. }
  1896. if (ag.scrollParentNotHidden[0] !== ag.document[0] && ag.scrollParentNotHidden[0].tagName !== "HTML") {
  1897. ag.overflowOffset = ag.scrollParentNotHidden.offset()
  1898. }
  1899. },
  1900. drag: function(aj, ak, ai) {
  1901. var al = ai.options
  1902. , ah = false
  1903. , am = ai.scrollParentNotHidden[0]
  1904. , ag = ai.document[0];
  1905. if (am !== ag && am.tagName !== "HTML") {
  1906. if (!al.axis || al.axis !== "x") {
  1907. if ((ai.overflowOffset.top + am.offsetHeight) - aj.pageY < al.scrollSensitivity) {
  1908. am.scrollTop = ah = am.scrollTop + al.scrollSpeed
  1909. } else {
  1910. if (aj.pageY - ai.overflowOffset.top < al.scrollSensitivity) {
  1911. am.scrollTop = ah = am.scrollTop - al.scrollSpeed
  1912. }
  1913. }
  1914. }
  1915. if (!al.axis || al.axis !== "y") {
  1916. if ((ai.overflowOffset.left + am.offsetWidth) - aj.pageX < al.scrollSensitivity) {
  1917. am.scrollLeft = ah = am.scrollLeft + al.scrollSpeed
  1918. } else {
  1919. if (aj.pageX - ai.overflowOffset.left < al.scrollSensitivity) {
  1920. am.scrollLeft = ah = am.scrollLeft - al.scrollSpeed
  1921. }
  1922. }
  1923. }
  1924. } else {
  1925. if (!al.axis || al.axis !== "x") {
  1926. if (aj.pageY - K(ag).scrollTop() < al.scrollSensitivity) {
  1927. ah = K(ag).scrollTop(K(ag).scrollTop() - al.scrollSpeed)
  1928. } else {
  1929. if (K(window).height() - (aj.pageY - K(ag).scrollTop()) < al.scrollSensitivity) {
  1930. ah = K(ag).scrollTop(K(ag).scrollTop() + al.scrollSpeed)
  1931. }
  1932. }
  1933. }
  1934. if (!al.axis || al.axis !== "y") {
  1935. if (aj.pageX - K(ag).scrollLeft() < al.scrollSensitivity) {
  1936. ah = K(ag).scrollLeft(K(ag).scrollLeft() - al.scrollSpeed)
  1937. } else {
  1938. if (K(window).width() - (aj.pageX - K(ag).scrollLeft()) < al.scrollSensitivity) {
  1939. ah = K(ag).scrollLeft(K(ag).scrollLeft() + al.scrollSpeed)
  1940. }
  1941. }
  1942. }
  1943. }
  1944. if (ah !== false && K.ui.ddmanager && !al.dropBehaviour) {
  1945. K.ui.ddmanager.prepareOffsets(ai, aj)
  1946. }
  1947. }
  1948. });
  1949. K.ui.plugin.add("draggable", "snap", {
  1950. start: function(ah, ai, ag) {
  1951. var aj = ag.options;
  1952. ag.snapElements = [];
  1953. K(aj.snap.constructor !== String ? (aj.snap.items || ":data(ui-draggable)") : aj.snap).each(function() {
  1954. var al = K(this)
  1955. , ak = al.offset();
  1956. if (this !== ag.element[0]) {
  1957. ag.snapElements.push({
  1958. item: this,
  1959. width: al.outerWidth(),
  1960. height: al.outerHeight(),
  1961. top: ak.top,
  1962. left: ak.left
  1963. })
  1964. }
  1965. })
  1966. },
  1967. drag: function(at, ap, aj) {
  1968. var ag, ay, al, am, ar, ao, an, az, au, ak, aq = aj.options, ax = aq.snapTolerance, aw = ap.offset.left, av = aw + aj.helperProportions.width, ai = ap.offset.top, ah = ai + aj.helperProportions.height;
  1969. for (au = aj.snapElements.length - 1; au >= 0; au--) {
  1970. ar = aj.snapElements[au].left - aj.margins.left;
  1971. ao = ar + aj.snapElements[au].width;
  1972. an = aj.snapElements[au].top - aj.margins.top;
  1973. az = an + aj.snapElements[au].height;
  1974. if (av < ar - ax || aw > ao + ax || ah < an - ax || ai > az + ax || !K.contains(aj.snapElements[au].item.ownerDocument, aj.snapElements[au].item)) {
  1975. if (aj.snapElements[au].snapping) {
  1976. (aj.options.snap.release && aj.options.snap.release.call(aj.element, at, K.extend(aj._uiHash(), {
  1977. snapItem: aj.snapElements[au].item
  1978. })))
  1979. }
  1980. aj.snapElements[au].snapping = false;
  1981. continue
  1982. }
  1983. if (aq.snapMode !== "inner") {
  1984. ag = Math.abs(an - ah) <= ax;
  1985. ay = Math.abs(az - ai) <= ax;
  1986. al = Math.abs(ar - av) <= ax;
  1987. am = Math.abs(ao - aw) <= ax;
  1988. if (ag) {
  1989. ap.position.top = aj._convertPositionTo("relative", {
  1990. top: an - aj.helperProportions.height,
  1991. left: 0
  1992. }).top
  1993. }
  1994. if (ay) {
  1995. ap.position.top = aj._convertPositionTo("relative", {
  1996. top: az,
  1997. left: 0
  1998. }).top
  1999. }
  2000. if (al) {
  2001. ap.position.left = aj._convertPositionTo("relative", {
  2002. top: 0,
  2003. left: ar - aj.helperProportions.width
  2004. }).left
  2005. }
  2006. if (am) {
  2007. ap.position.left = aj._convertPositionTo("relative", {
  2008. top: 0,
  2009. left: ao
  2010. }).left
  2011. }
  2012. }
  2013. ak = (ag || ay || al || am);
  2014. if (aq.snapMode !== "outer") {
  2015. ag = Math.abs(an - ai) <= ax;
  2016. ay = Math.abs(az - ah) <= ax;
  2017. al = Math.abs(ar - aw) <= ax;
  2018. am = Math.abs(ao - av) <= ax;
  2019. if (ag) {
  2020. ap.position.top = aj._convertPositionTo("relative", {
  2021. top: an,
  2022. left: 0
  2023. }).top
  2024. }
  2025. if (ay) {
  2026. ap.position.top = aj._convertPositionTo("relative", {
  2027. top: az - aj.helperProportions.height,
  2028. left: 0
  2029. }).top
  2030. }
  2031. if (al) {
  2032. ap.position.left = aj._convertPositionTo("relative", {
  2033. top: 0,
  2034. left: ar
  2035. }).left
  2036. }
  2037. if (am) {
  2038. ap.position.left = aj._convertPositionTo("relative", {
  2039. top: 0,
  2040. left: ao - aj.helperProportions.width
  2041. }).left
  2042. }
  2043. }
  2044. if (!aj.snapElements[au].snapping && (ag || ay || al || am || ak)) {
  2045. (aj.options.snap.snap && aj.options.snap.snap.call(aj.element, at, K.extend(aj._uiHash(), {
  2046. snapItem: aj.snapElements[au].item
  2047. })))
  2048. }
  2049. aj.snapElements[au].snapping = (ag || ay || al || am || ak)
  2050. }
  2051. }
  2052. });
  2053. K.ui.plugin.add("draggable", "stack", {
  2054. start: function(ai, aj, ag) {
  2055. var ah, al = ag.options, ak = K.makeArray(K(al.stack)).sort(function(an, am) {
  2056. return (parseInt(K(an).css("zIndex"), 10) || 0) - (parseInt(K(am).css("zIndex"), 10) || 0)
  2057. });
  2058. if (!ak.length) {
  2059. return
  2060. }
  2061. ah = parseInt(K(ak[0]).css("zIndex"), 10) || 0;
  2062. K(ak).each(function(am) {
  2063. K(this).css("zIndex", ah + am)
  2064. });
  2065. this.css("zIndex", (ah + ak.length))
  2066. }
  2067. });
  2068. K.ui.plugin.add("draggable", "zIndex", {
  2069. start: function(ai, aj, ag) {
  2070. var ah = K(aj.helper)
  2071. , ak = ag.options;
  2072. if (ah.css("zIndex")) {
  2073. ak._zIndex = ah.css("zIndex")
  2074. }
  2075. ah.css("zIndex", ak.zIndex)
  2076. },
  2077. stop: function(ah, ai, ag) {
  2078. var aj = ag.options;
  2079. if (aj._zIndex) {
  2080. K(ai.helper).css("zIndex", aj._zIndex)
  2081. }
  2082. }
  2083. });
  2084. var ae = K.ui.draggable;
  2085. /*!
  2086. * jQuery UI Droppable 1.12.1
  2087. * http://jqueryui.com
  2088. *
  2089. * Copyright jQuery Foundation and other contributors
  2090. * Released under the MIT license.
  2091. * http://jquery.org/license
  2092. */
  2093. K.widget("ui.droppable", {
  2094. version: "1.12.1",
  2095. widgetEventPrefix: "drop",
  2096. options: {
  2097. accept: "*",
  2098. addClasses: true,
  2099. greedy: false,
  2100. scope: "default",
  2101. tolerance: "intersect",
  2102. activate: null,
  2103. deactivate: null,
  2104. drop: null,
  2105. out: null,
  2106. over: null
  2107. },
  2108. _create: function() {
  2109. var ah, ai = this.options, ag = ai.accept;
  2110. this.isover = false;
  2111. this.isout = true;
  2112. this.accept = K.isFunction(ag) ? ag : function(aj) {
  2113. return aj.is(ag)
  2114. }
  2115. ;
  2116. this.proportions = function() {
  2117. if (arguments.length) {
  2118. ah = arguments[0]
  2119. } else {
  2120. return ah ? ah : ah = {
  2121. width: this.element[0].offsetWidth,
  2122. height: this.element[0].offsetHeight
  2123. }
  2124. }
  2125. }
  2126. ;
  2127. this._addToManager(ai.scope);
  2128. ai.addClasses && this._addClass("ui-droppable")
  2129. },
  2130. _addToManager: function(ag) {
  2131. K.ui.ddmanager.droppables[ag] = K.ui.ddmanager.droppables[ag] || [];
  2132. K.ui.ddmanager.droppables[ag].push(this)
  2133. },
  2134. _splice: function(ag) {
  2135. var ah = 0;
  2136. for (; ah < ag.length; ah++) {
  2137. if (ag[ah] === this) {
  2138. ag.splice(ah, 1)
  2139. }
  2140. }
  2141. },
  2142. _destroy: function() {
  2143. var ag = K.ui.ddmanager.droppables[this.options.scope];
  2144. this._splice(ag)
  2145. },
  2146. _setOption: function(ah, ai) {
  2147. if (ah === "accept") {
  2148. this.accept = K.isFunction(ai) ? ai : function(aj) {
  2149. return aj.is(ai)
  2150. }
  2151. } else {
  2152. if (ah === "scope") {
  2153. var ag = K.ui.ddmanager.droppables[this.options.scope];
  2154. this._splice(ag);
  2155. this._addToManager(ai)
  2156. }
  2157. }
  2158. this._super(ah, ai)
  2159. },
  2160. _activate: function(ah) {
  2161. var ag = K.ui.ddmanager.current;
  2162. this._addActiveClass();
  2163. if (ag) {
  2164. this._trigger("activate", ah, this.ui(ag))
  2165. }
  2166. },
  2167. _deactivate: function(ah) {
  2168. var ag = K.ui.ddmanager.current;
  2169. this._removeActiveClass();
  2170. if (ag) {
  2171. this._trigger("deactivate", ah, this.ui(ag))
  2172. }
  2173. },
  2174. _over: function(ah) {
  2175. var ag = K.ui.ddmanager.current;
  2176. if (!ag || (ag.currentItem || ag.element)[0] === this.element[0]) {
  2177. return
  2178. }
  2179. if (this.accept.call(this.element[0], (ag.currentItem || ag.element))) {
  2180. this._addHoverClass();
  2181. this._trigger("over", ah, this.ui(ag))
  2182. }
  2183. },
  2184. _out: function(ah) {
  2185. var ag = K.ui.ddmanager.current;
  2186. if (!ag || (ag.currentItem || ag.element)[0] === this.element[0]) {
  2187. return
  2188. }
  2189. if (this.accept.call(this.element[0], (ag.currentItem || ag.element))) {
  2190. this._removeHoverClass();
  2191. this._trigger("out", ah, this.ui(ag))
  2192. }
  2193. },
  2194. _drop: function(ah, ai) {
  2195. var ag = ai || K.ui.ddmanager.current
  2196. , aj = false;
  2197. if (!ag || (ag.currentItem || ag.element)[0] === this.element[0]) {
  2198. return false
  2199. }
  2200. this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() {
  2201. var ak = K(this).droppable("instance");
  2202. if (ak.options.greedy && !ak.options.disabled && ak.options.scope === ag.options.scope && ak.accept.call(ak.element[0], (ag.currentItem || ag.element)) && I(ag, K.extend(ak, {
  2203. offset: ak.element.offset()
  2204. }), ak.options.tolerance, ah)) {
  2205. aj = true;
  2206. return false
  2207. }
  2208. });
  2209. if (aj) {
  2210. return false
  2211. }
  2212. if (this.accept.call(this.element[0], (ag.currentItem || ag.element))) {
  2213. this._removeActiveClass();
  2214. this._removeHoverClass();
  2215. this._trigger("drop", ah, this.ui(ag));
  2216. return this.element
  2217. }
  2218. return false
  2219. },
  2220. ui: function(ag) {
  2221. return {
  2222. draggable: (ag.currentItem || ag.element),
  2223. helper: ag.helper,
  2224. position: ag.position,
  2225. offset: ag.positionAbs
  2226. }
  2227. },
  2228. _addHoverClass: function() {
  2229. this._addClass("ui-droppable-hover")
  2230. },
  2231. _removeHoverClass: function() {
  2232. this._removeClass("ui-droppable-hover")
  2233. },
  2234. _addActiveClass: function() {
  2235. this._addClass("ui-droppable-active")
  2236. },
  2237. _removeActiveClass: function() {
  2238. this._removeClass("ui-droppable-active")
  2239. }
  2240. });
  2241. var I = K.ui.intersect = (function() {
  2242. function ag(ai, ah, aj) {
  2243. return (ai >= ah) && (ai < (ah + aj))
  2244. }
  2245. return function(at, am, aq, ai) {
  2246. if (!am.offset) {
  2247. return false
  2248. }
  2249. var ak = (at.positionAbs || at.position.absolute).left + at.margins.left
  2250. , ap = (at.positionAbs || at.position.absolute).top + at.margins.top
  2251. , aj = ak + at.helperProportions.width
  2252. , ao = ap + at.helperProportions.height
  2253. , al = am.offset.left
  2254. , ar = am.offset.top
  2255. , ah = al + am.proportions().width
  2256. , an = ar + am.proportions().height;
  2257. switch (aq) {
  2258. case "fit":
  2259. return (al <= ak && aj <= ah && ar <= ap && ao <= an);
  2260. case "intersect":
  2261. return (al < ak + (at.helperProportions.width / 2) && aj - (at.helperProportions.width / 2) < ah && ar < ap + (at.helperProportions.height / 2) && ao - (at.helperProportions.height / 2) < an);
  2262. case "pointer":
  2263. return ag(ai.pageY, ar, am.proportions().height) && ag(ai.pageX, al, am.proportions().width);
  2264. case "touch":
  2265. return ((ap >= ar && ap <= an) || (ao >= ar && ao <= an) || (ap < ar && ao > an)) && ((ak >= al && ak <= ah) || (aj >= al && aj <= ah) || (ak < al && aj > ah));
  2266. default:
  2267. return false
  2268. }
  2269. }
  2270. }
  2271. )();
  2272. K.ui.ddmanager = {
  2273. current: null,
  2274. droppables: {
  2275. "default": []
  2276. },
  2277. prepareOffsets: function(aj, al) {
  2278. var ai, ah, ag = K.ui.ddmanager.droppables[aj.options.scope] || [], ak = al ? al.type : null, am = (aj.currentItem || aj.element).find(":data(ui-droppable)").addBack();
  2279. droppablesLoop: for (ai = 0; ai < ag.length; ai++) {
  2280. if (ag[ai].options.disabled || (aj && !ag[ai].accept.call(ag[ai].element[0], (aj.currentItem || aj.element)))) {
  2281. continue
  2282. }
  2283. for (ah = 0; ah < am.length; ah++) {
  2284. if (am[ah] === ag[ai].element[0]) {
  2285. ag[ai].proportions().height = 0;
  2286. continue droppablesLoop
  2287. }
  2288. }
  2289. ag[ai].visible = ag[ai].element.css("display") !== "none";
  2290. if (!ag[ai].visible) {
  2291. continue
  2292. }
  2293. if (ak === "mousedown") {
  2294. ag[ai]._activate.call(ag[ai], al)
  2295. }
  2296. ag[ai].offset = ag[ai].element.offset();
  2297. ag[ai].proportions({
  2298. width: ag[ai].element[0].offsetWidth,
  2299. height: ag[ai].element[0].offsetHeight
  2300. })
  2301. }
  2302. },
  2303. drop: function(ag, ah) {
  2304. var ai = false;
  2305. K.each((K.ui.ddmanager.droppables[ag.options.scope] || []).slice(), function() {
  2306. if (!this.options) {
  2307. return
  2308. }
  2309. if (!this.options.disabled && this.visible && I(ag, this, this.options.tolerance, ah)) {
  2310. ai = this._drop.call(this, ah) || ai
  2311. }
  2312. if (!this.options.disabled && this.visible && this.accept.call(this.element[0], (ag.currentItem || ag.element))) {
  2313. this.isout = true;
  2314. this.isover = false;
  2315. this._deactivate.call(this, ah)
  2316. }
  2317. });
  2318. return ai
  2319. },
  2320. dragStart: function(ag, ah) {
  2321. ag.element.parentsUntil("body").on("scroll.droppable", function() {
  2322. if (!ag.options.refreshPositions) {
  2323. K.ui.ddmanager.prepareOffsets(ag, ah)
  2324. }
  2325. })
  2326. },
  2327. drag: function(ag, ah) {
  2328. if (ag.options.refreshPositions) {
  2329. K.ui.ddmanager.prepareOffsets(ag, ah)
  2330. }
  2331. K.each(K.ui.ddmanager.droppables[ag.options.scope] || [], function() {
  2332. if (this.options.disabled || this.greedyChild || !this.visible) {
  2333. return
  2334. }
  2335. var al, aj, ai, ak = I(ag, this, this.options.tolerance, ah), am = !ak && this.isover ? "isout" : (ak && !this.isover ? "isover" : null);
  2336. if (!am) {
  2337. return
  2338. }
  2339. if (this.options.greedy) {
  2340. aj = this.options.scope;
  2341. ai = this.element.parents(":data(ui-droppable)").filter(function() {
  2342. return K(this).droppable("instance").options.scope === aj
  2343. });
  2344. if (ai.length) {
  2345. al = K(ai[0]).droppable("instance");
  2346. al.greedyChild = (am === "isover")
  2347. }
  2348. }
  2349. if (al && am === "isover") {
  2350. al.isover = false;
  2351. al.isout = true;
  2352. al._out.call(al, ah)
  2353. }
  2354. this[am] = true;
  2355. this[am === "isout" ? "isover" : "isout"] = false;
  2356. this[am === "isover" ? "_over" : "_out"].call(this, ah);
  2357. if (al && am === "isout") {
  2358. al.isout = false;
  2359. al.isover = true;
  2360. al._over.call(al, ah)
  2361. }
  2362. })
  2363. },
  2364. dragStop: function(ag, ah) {
  2365. ag.element.parentsUntil("body").off("scroll.droppable");
  2366. if (!ag.options.refreshPositions) {
  2367. K.ui.ddmanager.prepareOffsets(ag, ah)
  2368. }
  2369. }
  2370. };
  2371. if (K.uiBackCompat !== false) {
  2372. K.widget("ui.droppable", K.ui.droppable, {
  2373. options: {
  2374. hoverClass: false,
  2375. activeClass: false
  2376. },
  2377. _addActiveClass: function() {
  2378. this._super();
  2379. if (this.options.activeClass) {
  2380. this.element.addClass(this.options.activeClass)
  2381. }
  2382. },
  2383. _removeActiveClass: function() {
  2384. this._super();
  2385. if (this.options.activeClass) {
  2386. this.element.removeClass(this.options.activeClass)
  2387. }
  2388. },
  2389. _addHoverClass: function() {
  2390. this._super();
  2391. if (this.options.hoverClass) {
  2392. this.element.addClass(this.options.hoverClass)
  2393. }
  2394. },
  2395. _removeHoverClass: function() {
  2396. this._super();
  2397. if (this.options.hoverClass) {
  2398. this.element.removeClass(this.options.hoverClass)
  2399. }
  2400. }
  2401. })
  2402. }
  2403. var j = K.ui.droppable;
  2404. /*!
  2405. * jQuery UI Resizable 1.12.1
  2406. * http://jqueryui.com
  2407. *
  2408. * Copyright jQuery Foundation and other contributors
  2409. * Released under the MIT license.
  2410. * http://jquery.org/license
  2411. */
  2412. K.widget("ui.resizable", K.ui.mouse, {
  2413. version: "1.12.1",
  2414. widgetEventPrefix: "resize",
  2415. options: {
  2416. alsoResize: false,
  2417. animate: false,
  2418. animateDuration: "slow",
  2419. animateEasing: "swing",
  2420. aspectRatio: false,
  2421. autoHide: false,
  2422. classes: {
  2423. "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
  2424. },
  2425. containment: false,
  2426. ghost: false,
  2427. grid: false,
  2428. handles: "e,s,se",
  2429. helper: false,
  2430. maxHeight: null,
  2431. maxWidth: null,
  2432. minHeight: 10,
  2433. minWidth: 10,
  2434. zIndex: 90,
  2435. resize: null,
  2436. start: null,
  2437. stop: null
  2438. },
  2439. _num: function(ag) {
  2440. return parseFloat(ag) || 0
  2441. },
  2442. _isNumber: function(ag) {
  2443. return !isNaN(parseFloat(ag))
  2444. },
  2445. _hasScroll: function(aj, ah) {
  2446. if (K(aj).css("overflow") === "hidden") {
  2447. return false
  2448. }
  2449. var ag = (ah && ah === "left") ? "scrollLeft" : "scrollTop"
  2450. , ai = false;
  2451. if (aj[ag] > 0) {
  2452. return true
  2453. }
  2454. aj[ag] = 1;
  2455. ai = (aj[ag] > 0);
  2456. aj[ag] = 0;
  2457. return ai
  2458. },
  2459. _create: function() {
  2460. var ah, ai = this.options, ag = this;
  2461. this._addClass("ui-resizable");
  2462. K.extend(this, {
  2463. _aspectRatio: !!(ai.aspectRatio),
  2464. aspectRatio: ai.aspectRatio,
  2465. originalElement: this.element,
  2466. _proportionallyResizeElements: [],
  2467. _helper: ai.helper || ai.ghost || ai.animate ? ai.helper || "ui-resizable-helper" : null
  2468. });
  2469. if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
  2470. this.element.wrap(K("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
  2471. position: this.element.css("position"),
  2472. width: this.element.outerWidth(),
  2473. height: this.element.outerHeight(),
  2474. top: this.element.css("top"),
  2475. left: this.element.css("left")
  2476. }));
  2477. this.element = this.element.parent().data("ui-resizable", this.element.resizable("instance"));
  2478. this.elementIsWrapper = true;
  2479. ah = {
  2480. marginTop: this.originalElement.css("marginTop"),
  2481. marginRight: this.originalElement.css("marginRight"),
  2482. marginBottom: this.originalElement.css("marginBottom"),
  2483. marginLeft: this.originalElement.css("marginLeft")
  2484. };
  2485. this.element.css(ah);
  2486. this.originalElement.css("margin", 0);
  2487. this.originalResizeStyle = this.originalElement.css("resize");
  2488. this.originalElement.css("resize", "none");
  2489. this._proportionallyResizeElements.push(this.originalElement.css({
  2490. position: "static",
  2491. zoom: 1,
  2492. display: "block"
  2493. }));
  2494. this.originalElement.css(ah);
  2495. this._proportionallyResize()
  2496. }
  2497. this._setupHandles();
  2498. if (ai.autoHide) {
  2499. K(this.element).on("mouseenter", function() {
  2500. if (ai.disabled) {
  2501. return
  2502. }
  2503. ag._removeClass("ui-resizable-autohide");
  2504. ag._handles.show()
  2505. }).on("mouseleave", function() {
  2506. if (ai.disabled) {
  2507. return
  2508. }
  2509. if (!ag.resizing) {
  2510. ag._addClass("ui-resizable-autohide");
  2511. ag._handles.hide()
  2512. }
  2513. })
  2514. }
  2515. this._mouseInit()
  2516. },
  2517. _destroy: function() {
  2518. this._mouseDestroy();
  2519. var ah, ag = function(ai) {
  2520. K(ai).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()
  2521. };
  2522. if (this.elementIsWrapper) {
  2523. ag(this.element);
  2524. ah = this.element;
  2525. this.originalElement.css({
  2526. position: ah.css("position"),
  2527. width: ah.outerWidth(),
  2528. height: ah.outerHeight(),
  2529. top: ah.css("top"),
  2530. left: ah.css("left")
  2531. }).insertAfter(ah);
  2532. ah.remove()
  2533. }
  2534. this.originalElement.css("resize", this.originalResizeStyle);
  2535. ag(this.originalElement);
  2536. return this
  2537. },
  2538. _setOption: function(ag, ah) {
  2539. this._super(ag, ah);
  2540. switch (ag) {
  2541. case "handles":
  2542. this._removeHandles();
  2543. this._setupHandles();
  2544. break;
  2545. default:
  2546. break
  2547. }
  2548. },
  2549. _setupHandles: function() {
  2550. var al = this.options, ak, ah, am, ag, ai, aj = this;
  2551. this.handles = al.handles || (!K(".ui-resizable-handle", this.element).length ? "e,s,se" : {
  2552. n: ".ui-resizable-n",
  2553. e: ".ui-resizable-e",
  2554. s: ".ui-resizable-s",
  2555. w: ".ui-resizable-w",
  2556. se: ".ui-resizable-se",
  2557. sw: ".ui-resizable-sw",
  2558. ne: ".ui-resizable-ne",
  2559. nw: ".ui-resizable-nw"
  2560. });
  2561. this._handles = K();
  2562. if (this.handles.constructor === String) {
  2563. if (this.handles === "all") {
  2564. this.handles = "n,e,s,w,se,sw,ne,nw"
  2565. }
  2566. am = this.handles.split(",");
  2567. this.handles = {};
  2568. for (ah = 0; ah < am.length; ah++) {
  2569. ak = K.trim(am[ah]);
  2570. ag = "ui-resizable-" + ak;
  2571. ai = K("<div>");
  2572. this._addClass(ai, "ui-resizable-handle " + ag);
  2573. ai.css({
  2574. zIndex: al.zIndex
  2575. });
  2576. this.handles[ak] = ".ui-resizable-" + ak;
  2577. this.element.append(ai)
  2578. }
  2579. }
  2580. this._renderAxis = function(ar) {
  2581. var ao, ap, an, aq;
  2582. ar = ar || this.element;
  2583. for (ao in this.handles) {
  2584. if (this.handles[ao].constructor === String) {
  2585. this.handles[ao] = this.element.children(this.handles[ao]).first().show()
  2586. } else {
  2587. if (this.handles[ao].jquery || this.handles[ao].nodeType) {
  2588. this.handles[ao] = K(this.handles[ao]);
  2589. this._on(this.handles[ao], {
  2590. mousedown: aj._mouseDown
  2591. })
  2592. }
  2593. }
  2594. if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
  2595. ap = K(this.handles[ao], this.element);
  2596. aq = /sw|ne|nw|se|n|s/.test(ao) ? ap.outerHeight() : ap.outerWidth();
  2597. an = ["padding", /ne|nw|n/.test(ao) ? "Top" : /se|sw|s/.test(ao) ? "Bottom" : /^e$/.test(ao) ? "Right" : "Left"].join("");
  2598. ar.css(an, aq);
  2599. this._proportionallyResize()
  2600. }
  2601. this._handles = this._handles.add(this.handles[ao])
  2602. }
  2603. }
  2604. ;
  2605. this._renderAxis(this.element);
  2606. this._handles = this._handles.add(this.element.find(".ui-resizable-handle"));
  2607. this._handles.disableSelection();
  2608. this._handles.on("mouseover", function() {
  2609. if (!aj.resizing) {
  2610. if (this.className) {
  2611. ai = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)
  2612. }
  2613. aj.axis = ai && ai[1] ? ai[1] : "se"
  2614. }
  2615. });
  2616. if (al.autoHide) {
  2617. this._handles.hide();
  2618. this._addClass("ui-resizable-autohide")
  2619. }
  2620. },
  2621. _removeHandles: function() {
  2622. this._handles.remove()
  2623. },
  2624. _mouseCapture: function(ai) {
  2625. var ah, aj, ag = false;
  2626. for (ah in this.handles) {
  2627. aj = K(this.handles[ah])[0];
  2628. if (aj === ai.target || K.contains(aj, ai.target)) {
  2629. ag = true
  2630. }
  2631. }
  2632. return !this.options.disabled && ag
  2633. },
  2634. _mouseStart: function(ah) {
  2635. var al, ai, ak, aj = this.options, ag = this.element;
  2636. this.resizing = true;
  2637. this._renderProxy();
  2638. al = this._num(this.helper.css("left"));
  2639. ai = this._num(this.helper.css("top"));
  2640. if (aj.containment) {
  2641. al += K(aj.containment).scrollLeft() || 0;
  2642. ai += K(aj.containment).scrollTop() || 0
  2643. }
  2644. this.offset = this.helper.offset();
  2645. this.position = {
  2646. left: al,
  2647. top: ai
  2648. };
  2649. this.size = this._helper ? {
  2650. width: this.helper.width(),
  2651. height: this.helper.height()
  2652. } : {
  2653. width: ag.width(),
  2654. height: ag.height()
  2655. };
  2656. this.originalSize = this._helper ? {
  2657. width: ag.outerWidth(),
  2658. height: ag.outerHeight()
  2659. } : {
  2660. width: ag.width(),
  2661. height: ag.height()
  2662. };
  2663. this.sizeDiff = {
  2664. width: ag.outerWidth() - ag.width(),
  2665. height: ag.outerHeight() - ag.height()
  2666. };
  2667. this.originalPosition = {
  2668. left: al,
  2669. top: ai
  2670. };
  2671. this.originalMousePosition = {
  2672. left: ah.pageX,
  2673. top: ah.pageY
  2674. };
  2675. this.aspectRatio = (typeof aj.aspectRatio === "number") ? aj.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
  2676. ak = K(".ui-resizable-" + this.axis).css("cursor");
  2677. K("body").css("cursor", ak === "auto" ? this.axis + "-resize" : ak);
  2678. this._addClass("ui-resizable-resizing");
  2679. this._propagate("start", ah);
  2680. return true
  2681. },
  2682. _mouseDrag: function(al) {
  2683. var am, ak, an = this.originalMousePosition, ah = this.axis, ai = (al.pageX - an.left) || 0, ag = (al.pageY - an.top) || 0, aj = this._change[ah];
  2684. this._updatePrevProperties();
  2685. if (!aj) {
  2686. return false
  2687. }
  2688. am = aj.apply(this, [al, ai, ag]);
  2689. this._updateVirtualBoundaries(al.shiftKey);
  2690. if (this._aspectRatio || al.shiftKey) {
  2691. am = this._updateRatio(am, al)
  2692. }
  2693. am = this._respectSize(am, al);
  2694. this._updateCache(am);
  2695. this._propagate("resize", al);
  2696. ak = this._applyChanges();
  2697. if (!this._helper && this._proportionallyResizeElements.length) {
  2698. this._proportionallyResize()
  2699. }
  2700. if (!K.isEmptyObject(ak)) {
  2701. this._updatePrevProperties();
  2702. this._trigger("resize", al, this.ui());
  2703. this._applyChanges()
  2704. }
  2705. return false
  2706. },
  2707. _mouseStop: function(aj) {
  2708. this.resizing = false;
  2709. var ai, ag, ah, am, ap, al, ao, ak = this.options, an = this;
  2710. if (this._helper) {
  2711. ai = this._proportionallyResizeElements;
  2712. ag = ai.length && (/textarea/i).test(ai[0].nodeName);
  2713. ah = ag && this._hasScroll(ai[0], "left") ? 0 : an.sizeDiff.height;
  2714. am = ag ? 0 : an.sizeDiff.width;
  2715. ap = {
  2716. width: (an.helper.width() - am),
  2717. height: (an.helper.height() - ah)
  2718. };
  2719. al = (parseFloat(an.element.css("left")) + (an.position.left - an.originalPosition.left)) || null;
  2720. ao = (parseFloat(an.element.css("top")) + (an.position.top - an.originalPosition.top)) || null;
  2721. if (!ak.animate) {
  2722. this.element.css(K.extend(ap, {
  2723. top: ao,
  2724. left: al
  2725. }))
  2726. }
  2727. an.helper.height(an.size.height);
  2728. an.helper.width(an.size.width);
  2729. if (this._helper && !ak.animate) {
  2730. this._proportionallyResize()
  2731. }
  2732. }
  2733. K("body").css("cursor", "auto");
  2734. this._removeClass("ui-resizable-resizing");
  2735. this._propagate("stop", aj);
  2736. if (this._helper) {
  2737. this.helper.remove()
  2738. }
  2739. return false
  2740. },
  2741. _updatePrevProperties: function() {
  2742. this.prevPosition = {
  2743. top: this.position.top,
  2744. left: this.position.left
  2745. };
  2746. this.prevSize = {
  2747. width: this.size.width,
  2748. height: this.size.height
  2749. }
  2750. },
  2751. _applyChanges: function() {
  2752. var ag = {};
  2753. if (this.position.top !== this.prevPosition.top) {
  2754. ag.top = this.position.top + "px"
  2755. }
  2756. if (this.position.left !== this.prevPosition.left) {
  2757. ag.left = this.position.left + "px"
  2758. }
  2759. if (this.size.width !== this.prevSize.width) {
  2760. ag.width = this.size.width + "px"
  2761. }
  2762. if (this.size.height !== this.prevSize.height) {
  2763. ag.height = this.size.height + "px"
  2764. }
  2765. this.helper.css(ag);
  2766. return ag
  2767. },
  2768. _updateVirtualBoundaries: function(ai) {
  2769. var ak, aj, ah, am, ag, al = this.options;
  2770. ag = {
  2771. minWidth: this._isNumber(al.minWidth) ? al.minWidth : 0,
  2772. maxWidth: this._isNumber(al.maxWidth) ? al.maxWidth : Infinity,
  2773. minHeight: this._isNumber(al.minHeight) ? al.minHeight : 0,
  2774. maxHeight: this._isNumber(al.maxHeight) ? al.maxHeight : Infinity
  2775. };
  2776. if (this._aspectRatio || ai) {
  2777. ak = ag.minHeight * this.aspectRatio;
  2778. ah = ag.minWidth / this.aspectRatio;
  2779. aj = ag.maxHeight * this.aspectRatio;
  2780. am = ag.maxWidth / this.aspectRatio;
  2781. if (ak > ag.minWidth) {
  2782. ag.minWidth = ak
  2783. }
  2784. if (ah > ag.minHeight) {
  2785. ag.minHeight = ah
  2786. }
  2787. if (aj < ag.maxWidth) {
  2788. ag.maxWidth = aj
  2789. }
  2790. if (am < ag.maxHeight) {
  2791. ag.maxHeight = am
  2792. }
  2793. }
  2794. this._vBoundaries = ag
  2795. },
  2796. _updateCache: function(ag) {
  2797. this.offset = this.helper.offset();
  2798. if (this._isNumber(ag.left)) {
  2799. this.position.left = ag.left
  2800. }
  2801. if (this._isNumber(ag.top)) {
  2802. this.position.top = ag.top
  2803. }
  2804. if (this._isNumber(ag.height)) {
  2805. this.size.height = ag.height
  2806. }
  2807. if (this._isNumber(ag.width)) {
  2808. this.size.width = ag.width
  2809. }
  2810. },
  2811. _updateRatio: function(ai) {
  2812. var aj = this.position
  2813. , ah = this.size
  2814. , ag = this.axis;
  2815. if (this._isNumber(ai.height)) {
  2816. ai.width = (ai.height * this.aspectRatio)
  2817. } else {
  2818. if (this._isNumber(ai.width)) {
  2819. ai.height = (ai.width / this.aspectRatio)
  2820. }
  2821. }
  2822. if (ag === "sw") {
  2823. ai.left = aj.left + (ah.width - ai.width);
  2824. ai.top = null
  2825. }
  2826. if (ag === "nw") {
  2827. ai.top = aj.top + (ah.height - ai.height);
  2828. ai.left = aj.left + (ah.width - ai.width)
  2829. }
  2830. return ai
  2831. },
  2832. _respectSize: function(al) {
  2833. var ai = this._vBoundaries
  2834. , ao = this.axis
  2835. , aq = this._isNumber(al.width) && ai.maxWidth && (ai.maxWidth < al.width)
  2836. , am = this._isNumber(al.height) && ai.maxHeight && (ai.maxHeight < al.height)
  2837. , aj = this._isNumber(al.width) && ai.minWidth && (ai.minWidth > al.width)
  2838. , ap = this._isNumber(al.height) && ai.minHeight && (ai.minHeight > al.height)
  2839. , ah = this.originalPosition.left + this.originalSize.width
  2840. , an = this.originalPosition.top + this.originalSize.height
  2841. , ak = /sw|nw|w/.test(ao)
  2842. , ag = /nw|ne|n/.test(ao);
  2843. if (aj) {
  2844. al.width = ai.minWidth
  2845. }
  2846. if (ap) {
  2847. al.height = ai.minHeight
  2848. }
  2849. if (aq) {
  2850. al.width = ai.maxWidth
  2851. }
  2852. if (am) {
  2853. al.height = ai.maxHeight
  2854. }
  2855. if (aj && ak) {
  2856. al.left = ah - ai.minWidth
  2857. }
  2858. if (aq && ak) {
  2859. al.left = ah - ai.maxWidth
  2860. }
  2861. if (ap && ag) {
  2862. al.top = an - ai.minHeight
  2863. }
  2864. if (am && ag) {
  2865. al.top = an - ai.maxHeight
  2866. }
  2867. if (!al.width && !al.height && !al.left && al.top) {
  2868. al.top = null
  2869. } else {
  2870. if (!al.width && !al.height && !al.top && al.left) {
  2871. al.left = null
  2872. }
  2873. }
  2874. return al
  2875. },
  2876. _getPaddingPlusBorderDimensions: function(ai) {
  2877. var ah = 0
  2878. , aj = []
  2879. , ak = [ai.css("borderTopWidth"), ai.css("borderRightWidth"), ai.css("borderBottomWidth"), ai.css("borderLeftWidth")]
  2880. , ag = [ai.css("paddingTop"), ai.css("paddingRight"), ai.css("paddingBottom"), ai.css("paddingLeft")];
  2881. for (; ah < 4; ah++) {
  2882. aj[ah] = (parseFloat(ak[ah]) || 0);
  2883. aj[ah] += (parseFloat(ag[ah]) || 0)
  2884. }
  2885. return {
  2886. height: aj[0] + aj[2],
  2887. width: aj[1] + aj[3]
  2888. }
  2889. },
  2890. _proportionallyResize: function() {
  2891. if (!this._proportionallyResizeElements.length) {
  2892. return
  2893. }
  2894. var ai, ah = 0, ag = this.helper || this.element;
  2895. for (; ah < this._proportionallyResizeElements.length; ah++) {
  2896. ai = this._proportionallyResizeElements[ah];
  2897. if (!this.outerDimensions) {
  2898. this.outerDimensions = this._getPaddingPlusBorderDimensions(ai)
  2899. }
  2900. ai.css({
  2901. height: (ag.height() - this.outerDimensions.height) || 0,
  2902. width: (ag.width() - this.outerDimensions.width) || 0
  2903. })
  2904. }
  2905. },
  2906. _renderProxy: function() {
  2907. var ag = this.element
  2908. , ah = this.options;
  2909. this.elementOffset = ag.offset();
  2910. if (this._helper) {
  2911. this.helper = this.helper || K("<div style='overflow:hidden;'></div>");
  2912. this._addClass(this.helper, this._helper);
  2913. this.helper.css({
  2914. width: this.element.outerWidth(),
  2915. height: this.element.outerHeight(),
  2916. position: "absolute",
  2917. left: this.elementOffset.left + "px",
  2918. top: this.elementOffset.top + "px",
  2919. zIndex: ++ah.zIndex
  2920. });
  2921. this.helper.appendTo("body").disableSelection()
  2922. } else {
  2923. this.helper = this.element
  2924. }
  2925. },
  2926. _change: {
  2927. e: function(ah, ag) {
  2928. return {
  2929. width: this.originalSize.width + ag
  2930. }
  2931. },
  2932. w: function(ai, ag) {
  2933. var ah = this.originalSize
  2934. , aj = this.originalPosition;
  2935. return {
  2936. left: aj.left + ag,
  2937. width: ah.width - ag
  2938. }
  2939. },
  2940. n: function(aj, ah, ag) {
  2941. var ai = this.originalSize
  2942. , ak = this.originalPosition;
  2943. return {
  2944. top: ak.top + ag,
  2945. height: ai.height - ag
  2946. }
  2947. },
  2948. s: function(ai, ah, ag) {
  2949. return {
  2950. height: this.originalSize.height + ag
  2951. }
  2952. },
  2953. se: function(ai, ah, ag) {
  2954. return K.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [ai, ah, ag]))
  2955. },
  2956. sw: function(ai, ah, ag) {
  2957. return K.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [ai, ah, ag]))
  2958. },
  2959. ne: function(ai, ah, ag) {
  2960. return K.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [ai, ah, ag]))
  2961. },
  2962. nw: function(ai, ah, ag) {
  2963. return K.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [ai, ah, ag]))
  2964. }
  2965. },
  2966. _propagate: function(ah, ag) {
  2967. K.ui.plugin.call(this, ah, [ag, this.ui()]);
  2968. (ah !== "resize" && this._trigger(ah, ag, this.ui()))
  2969. },
  2970. plugins: {},
  2971. ui: function() {
  2972. return {
  2973. originalElement: this.originalElement,
  2974. element: this.element,
  2975. helper: this.helper,
  2976. position: this.position,
  2977. size: this.size,
  2978. originalSize: this.originalSize,
  2979. originalPosition: this.originalPosition
  2980. }
  2981. }
  2982. });
  2983. K.ui.plugin.add("resizable", "animate", {
  2984. stop: function(aj) {
  2985. var ao = K(this).resizable("instance")
  2986. , al = ao.options
  2987. , ai = ao._proportionallyResizeElements
  2988. , ag = ai.length && (/textarea/i).test(ai[0].nodeName)
  2989. , ah = ag && ao._hasScroll(ai[0], "left") ? 0 : ao.sizeDiff.height
  2990. , an = ag ? 0 : ao.sizeDiff.width
  2991. , ak = {
  2992. width: (ao.size.width - an),
  2993. height: (ao.size.height - ah)
  2994. }
  2995. , am = (parseFloat(ao.element.css("left")) + (ao.position.left - ao.originalPosition.left)) || null
  2996. , ap = (parseFloat(ao.element.css("top")) + (ao.position.top - ao.originalPosition.top)) || null;
  2997. ao.element.animate(K.extend(ak, ap && am ? {
  2998. top: ap,
  2999. left: am
  3000. } : {}), {
  3001. duration: al.animateDuration,
  3002. easing: al.animateEasing,
  3003. step: function() {
  3004. var aq = {
  3005. width: parseFloat(ao.element.css("width")),
  3006. height: parseFloat(ao.element.css("height")),
  3007. top: parseFloat(ao.element.css("top")),
  3008. left: parseFloat(ao.element.css("left"))
  3009. };
  3010. if (ai && ai.length) {
  3011. K(ai[0]).css({
  3012. width: aq.width,
  3013. height: aq.height
  3014. })
  3015. }
  3016. ao._updateCache(aq);
  3017. ao._propagate("resize", aj)
  3018. }
  3019. })
  3020. }
  3021. });
  3022. K.ui.plugin.add("resizable", "containment", {
  3023. start: function() {
  3024. var ao, ai, aq, ag, an, aj, ar, ap = K(this).resizable("instance"), am = ap.options, al = ap.element, ah = am.containment, ak = (ah instanceof K) ? ah.get(0) : (/parent/.test(ah)) ? al.parent().get(0) : ah;
  3025. if (!ak) {
  3026. return
  3027. }
  3028. ap.containerElement = K(ak);
  3029. if (/document/.test(ah) || ah === document) {
  3030. ap.containerOffset = {
  3031. left: 0,
  3032. top: 0
  3033. };
  3034. ap.containerPosition = {
  3035. left: 0,
  3036. top: 0
  3037. };
  3038. ap.parentData = {
  3039. element: K(document),
  3040. left: 0,
  3041. top: 0,
  3042. width: K(document).width(),
  3043. height: K(document).height() || document.body.parentNode.scrollHeight
  3044. }
  3045. } else {
  3046. ao = K(ak);
  3047. ai = [];
  3048. K(["Top", "Right", "Left", "Bottom"]).each(function(au, at) {
  3049. ai[au] = ap._num(ao.css("padding" + at))
  3050. });
  3051. ap.containerOffset = ao.offset();
  3052. ap.containerPosition = ao.position();
  3053. ap.containerSize = {
  3054. height: (ao.innerHeight() - ai[3]),
  3055. width: (ao.innerWidth() - ai[1])
  3056. };
  3057. aq = ap.containerOffset;
  3058. ag = ap.containerSize.height;
  3059. an = ap.containerSize.width;
  3060. aj = (ap._hasScroll(ak, "left") ? ak.scrollWidth : an);
  3061. ar = (ap._hasScroll(ak) ? ak.scrollHeight : ag);
  3062. ap.parentData = {
  3063. element: ak,
  3064. left: aq.left,
  3065. top: aq.top,
  3066. width: aj,
  3067. height: ar
  3068. }
  3069. }
  3070. },
  3071. resize: function(ah) {
  3072. var an, at, am, ak, ao = K(this).resizable("instance"), aj = ao.options, aq = ao.containerOffset, ap = ao.position, ar = ao._aspectRatio || ah.shiftKey, ag = {
  3073. top: 0,
  3074. left: 0
  3075. }, ai = ao.containerElement, al = true;
  3076. if (ai[0] !== document && (/static/).test(ai.css("position"))) {
  3077. ag = aq
  3078. }
  3079. if (ap.left < (ao._helper ? aq.left : 0)) {
  3080. ao.size.width = ao.size.width + (ao._helper ? (ao.position.left - aq.left) : (ao.position.left - ag.left));
  3081. if (ar) {
  3082. ao.size.height = ao.size.width / ao.aspectRatio;
  3083. al = false
  3084. }
  3085. ao.position.left = aj.helper ? aq.left : 0
  3086. }
  3087. if (ap.top < (ao._helper ? aq.top : 0)) {
  3088. ao.size.height = ao.size.height + (ao._helper ? (ao.position.top - aq.top) : ao.position.top);
  3089. if (ar) {
  3090. ao.size.width = ao.size.height * ao.aspectRatio;
  3091. al = false
  3092. }
  3093. ao.position.top = ao._helper ? aq.top : 0
  3094. }
  3095. am = ao.containerElement.get(0) === ao.element.parent().get(0);
  3096. ak = /relative|absolute/.test(ao.containerElement.css("position"));
  3097. if (am && ak) {
  3098. ao.offset.left = ao.parentData.left + ao.position.left;
  3099. ao.offset.top = ao.parentData.top + ao.position.top
  3100. } else {
  3101. ao.offset.left = ao.element.offset().left;
  3102. ao.offset.top = ao.element.offset().top
  3103. }
  3104. an = Math.abs(ao.sizeDiff.width + (ao._helper ? ao.offset.left - ag.left : (ao.offset.left - aq.left)));
  3105. at = Math.abs(ao.sizeDiff.height + (ao._helper ? ao.offset.top - ag.top : (ao.offset.top - aq.top)));
  3106. if (an + ao.size.width >= ao.parentData.width) {
  3107. ao.size.width = ao.parentData.width - an;
  3108. if (ar) {
  3109. ao.size.height = ao.size.width / ao.aspectRatio;
  3110. al = false
  3111. }
  3112. }
  3113. if (at + ao.size.height >= ao.parentData.height) {
  3114. ao.size.height = ao.parentData.height - at;
  3115. if (ar) {
  3116. ao.size.width = ao.size.height * ao.aspectRatio;
  3117. al = false
  3118. }
  3119. }
  3120. if (!al) {
  3121. ao.position.left = ao.prevPosition.left;
  3122. ao.position.top = ao.prevPosition.top;
  3123. ao.size.width = ao.prevSize.width;
  3124. ao.size.height = ao.prevSize.height
  3125. }
  3126. },
  3127. stop: function() {
  3128. var al = K(this).resizable("instance")
  3129. , ah = al.options
  3130. , am = al.containerOffset
  3131. , ag = al.containerPosition
  3132. , ai = al.containerElement
  3133. , aj = K(al.helper)
  3134. , ao = aj.offset()
  3135. , an = aj.outerWidth() - al.sizeDiff.width
  3136. , ak = aj.outerHeight() - al.sizeDiff.height;
  3137. if (al._helper && !ah.animate && (/relative/).test(ai.css("position"))) {
  3138. K(this).css({
  3139. left: ao.left - ag.left - am.left,
  3140. width: an,
  3141. height: ak
  3142. })
  3143. }
  3144. if (al._helper && !ah.animate && (/static/).test(ai.css("position"))) {
  3145. K(this).css({
  3146. left: ao.left - ag.left - am.left,
  3147. width: an,
  3148. height: ak
  3149. })
  3150. }
  3151. }
  3152. });
  3153. K.ui.plugin.add("resizable", "alsoResize", {
  3154. start: function() {
  3155. var ag = K(this).resizable("instance")
  3156. , ah = ag.options;
  3157. K(ah.alsoResize).each(function() {
  3158. var ai = K(this);
  3159. ai.data("ui-resizable-alsoresize", {
  3160. width: parseFloat(ai.width()),
  3161. height: parseFloat(ai.height()),
  3162. left: parseFloat(ai.css("left")),
  3163. top: parseFloat(ai.css("top"))
  3164. })
  3165. })
  3166. },
  3167. resize: function(ah, aj) {
  3168. var ag = K(this).resizable("instance")
  3169. , ak = ag.options
  3170. , ai = ag.originalSize
  3171. , am = ag.originalPosition
  3172. , al = {
  3173. height: (ag.size.height - ai.height) || 0,
  3174. width: (ag.size.width - ai.width) || 0,
  3175. top: (ag.position.top - am.top) || 0,
  3176. left: (ag.position.left - am.left) || 0
  3177. };
  3178. K(ak.alsoResize).each(function() {
  3179. var ap = K(this)
  3180. , aq = K(this).data("ui-resizable-alsoresize")
  3181. , ao = {}
  3182. , an = ap.parents(aj.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
  3183. K.each(an, function(ar, au) {
  3184. var at = (aq[au] || 0) + (al[au] || 0);
  3185. if (at && at >= 0) {
  3186. ao[au] = at || null
  3187. }
  3188. });
  3189. ap.css(ao)
  3190. })
  3191. },
  3192. stop: function() {
  3193. K(this).removeData("ui-resizable-alsoresize")
  3194. }
  3195. });
  3196. K.ui.plugin.add("resizable", "ghost", {
  3197. start: function() {
  3198. var ah = K(this).resizable("instance")
  3199. , ag = ah.size;
  3200. ah.ghost = ah.originalElement.clone();
  3201. ah.ghost.css({
  3202. opacity: 0.25,
  3203. display: "block",
  3204. position: "relative",
  3205. height: ag.height,
  3206. width: ag.width,
  3207. margin: 0,
  3208. left: 0,
  3209. top: 0
  3210. });
  3211. ah._addClass(ah.ghost, "ui-resizable-ghost");
  3212. if (K.uiBackCompat !== false && typeof ah.options.ghost === "string") {
  3213. ah.ghost.addClass(this.options.ghost)
  3214. }
  3215. ah.ghost.appendTo(ah.helper)
  3216. },
  3217. resize: function() {
  3218. var ag = K(this).resizable("instance");
  3219. if (ag.ghost) {
  3220. ag.ghost.css({
  3221. position: "relative",
  3222. height: ag.size.height,
  3223. width: ag.size.width
  3224. })
  3225. }
  3226. },
  3227. stop: function() {
  3228. var ag = K(this).resizable("instance");
  3229. if (ag.ghost && ag.helper) {
  3230. ag.helper.get(0).removeChild(ag.ghost.get(0))
  3231. }
  3232. }
  3233. });
  3234. K.ui.plugin.add("resizable", "grid", {
  3235. resize: function() {
  3236. var aj, ao = K(this).resizable("instance"), at = ao.options, am = ao.size, an = ao.originalSize, ap = ao.originalPosition, ay = ao.axis, ag = typeof at.grid === "number" ? [at.grid, at.grid] : at.grid, aw = (ag[0] || 1), av = (ag[1] || 1), al = Math.round((am.width - an.width) / aw) * aw, ak = Math.round((am.height - an.height) / av) * av, aq = an.width + al, au = an.height + ak, ai = at.maxWidth && (at.maxWidth < aq), ar = at.maxHeight && (at.maxHeight < au), ax = at.minWidth && (at.minWidth > aq), ah = at.minHeight && (at.minHeight > au);
  3237. at.grid = ag;
  3238. if (ax) {
  3239. aq += aw
  3240. }
  3241. if (ah) {
  3242. au += av
  3243. }
  3244. if (ai) {
  3245. aq -= aw
  3246. }
  3247. if (ar) {
  3248. au -= av
  3249. }
  3250. if (/^(se|s|e)$/.test(ay)) {
  3251. ao.size.width = aq;
  3252. ao.size.height = au
  3253. } else {
  3254. if (/^(ne)$/.test(ay)) {
  3255. ao.size.width = aq;
  3256. ao.size.height = au;
  3257. ao.position.top = ap.top - ak
  3258. } else {
  3259. if (/^(sw)$/.test(ay)) {
  3260. ao.size.width = aq;
  3261. ao.size.height = au;
  3262. ao.position.left = ap.left - al
  3263. } else {
  3264. if (au - av <= 0 || aq - aw <= 0) {
  3265. aj = ao._getPaddingPlusBorderDimensions(this)
  3266. }
  3267. if (au - av > 0) {
  3268. ao.size.height = au;
  3269. ao.position.top = ap.top - ak
  3270. } else {
  3271. au = av - aj.height;
  3272. ao.size.height = au;
  3273. ao.position.top = ap.top + an.height - au
  3274. }
  3275. if (aq - aw > 0) {
  3276. ao.size.width = aq;
  3277. ao.position.left = ap.left - al
  3278. } else {
  3279. aq = aw - aj.width;
  3280. ao.size.width = aq;
  3281. ao.position.left = ap.left + an.width - aq
  3282. }
  3283. }
  3284. }
  3285. }
  3286. }
  3287. });
  3288. var U = K.ui.resizable;
  3289. /*!
  3290. * jQuery UI Selectable 1.12.1
  3291. * http://jqueryui.com
  3292. *
  3293. * Copyright jQuery Foundation and other contributors
  3294. * Released under the MIT license.
  3295. * http://jquery.org/license
  3296. */
  3297. var a = K.widget("ui.selectable", K.ui.mouse, {
  3298. version: "1.12.1",
  3299. options: {
  3300. appendTo: "body",
  3301. autoRefresh: true,
  3302. distance: 0,
  3303. filter: "*",
  3304. tolerance: "touch",
  3305. selected: null,
  3306. selecting: null,
  3307. start: null,
  3308. stop: null,
  3309. unselected: null,
  3310. unselecting: null
  3311. },
  3312. _create: function() {
  3313. var ag = this;
  3314. this._addClass("ui-selectable");
  3315. this.dragged = false;
  3316. this.refresh = function() {
  3317. ag.elementPos = K(ag.element[0]).offset();
  3318. ag.selectees = K(ag.options.filter, ag.element[0]);
  3319. ag._addClass(ag.selectees, "ui-selectee");
  3320. ag.selectees.each(function() {
  3321. var ai = K(this)
  3322. , ah = ai.offset()
  3323. , aj = {
  3324. left: ah.left - ag.elementPos.left,
  3325. top: ah.top - ag.elementPos.top
  3326. };
  3327. K.data(this, "selectable-item", {
  3328. element: this,
  3329. $element: ai,
  3330. left: aj.left,
  3331. top: aj.top,
  3332. right: aj.left + ai.outerWidth(),
  3333. bottom: aj.top + ai.outerHeight(),
  3334. startselected: false,
  3335. selected: ai.hasClass("ui-selected"),
  3336. selecting: ai.hasClass("ui-selecting"),
  3337. unselecting: ai.hasClass("ui-unselecting")
  3338. })
  3339. })
  3340. }
  3341. ;
  3342. this.refresh();
  3343. this._mouseInit();
  3344. this.helper = K("<div>");
  3345. this._addClass(this.helper, "ui-selectable-helper")
  3346. },
  3347. _destroy: function() {
  3348. this.selectees.removeData("selectable-item");
  3349. this._mouseDestroy()
  3350. },
  3351. _mouseStart: function(ai) {
  3352. var ah = this
  3353. , ag = this.options;
  3354. this.opos = [ai.pageX, ai.pageY];
  3355. this.elementPos = K(this.element[0]).offset();
  3356. if (this.options.disabled) {
  3357. return
  3358. }
  3359. this.selectees = K(ag.filter, this.element[0]);
  3360. this._trigger("start", ai);
  3361. K(ag.appendTo).append(this.helper);
  3362. this.helper.css({
  3363. left: ai.pageX,
  3364. top: ai.pageY,
  3365. width: 0,
  3366. height: 0
  3367. });
  3368. if (ag.autoRefresh) {
  3369. this.refresh()
  3370. }
  3371. this.selectees.filter(".ui-selected").each(function() {
  3372. var aj = K.data(this, "selectable-item");
  3373. aj.startselected = true;
  3374. if (!ai.metaKey && !ai.ctrlKey) {
  3375. ah._removeClass(aj.$element, "ui-selected");
  3376. aj.selected = false;
  3377. ah._addClass(aj.$element, "ui-unselecting");
  3378. aj.unselecting = true;
  3379. ah._trigger("unselecting", ai, {
  3380. unselecting: aj.element
  3381. })
  3382. }
  3383. });
  3384. K(ai.target).parents().addBack().each(function() {
  3385. var aj, ak = K.data(this, "selectable-item");
  3386. if (ak) {
  3387. aj = (!ai.metaKey && !ai.ctrlKey) || !ak.$element.hasClass("ui-selected");
  3388. ah._removeClass(ak.$element, aj ? "ui-unselecting" : "ui-selected")._addClass(ak.$element, aj ? "ui-selecting" : "ui-unselecting");
  3389. ak.unselecting = !aj;
  3390. ak.selecting = aj;
  3391. ak.selected = aj;
  3392. if (aj) {
  3393. ah._trigger("selecting", ai, {
  3394. selecting: ak.element
  3395. })
  3396. } else {
  3397. ah._trigger("unselecting", ai, {
  3398. unselecting: ak.element
  3399. })
  3400. }
  3401. return false
  3402. }
  3403. })
  3404. },
  3405. _mouseDrag: function(an) {
  3406. this.dragged = true;
  3407. if (this.options.disabled) {
  3408. return
  3409. }
  3410. var ak, am = this, ai = this.options, ah = this.opos[0], al = this.opos[1], ag = an.pageX, aj = an.pageY;
  3411. if (ah > ag) {
  3412. ak = ag;
  3413. ag = ah;
  3414. ah = ak
  3415. }
  3416. if (al > aj) {
  3417. ak = aj;
  3418. aj = al;
  3419. al = ak
  3420. }
  3421. this.helper.css({
  3422. left: ah,
  3423. top: al,
  3424. width: ag - ah,
  3425. height: aj - al
  3426. });
  3427. this.selectees.each(function() {
  3428. var ao = K.data(this, "selectable-item")
  3429. , ap = false
  3430. , aq = {};
  3431. if (!ao || ao.element === am.element[0]) {
  3432. return
  3433. }
  3434. aq.left = ao.left + am.elementPos.left;
  3435. aq.right = ao.right + am.elementPos.left;
  3436. aq.top = ao.top + am.elementPos.top;
  3437. aq.bottom = ao.bottom + am.elementPos.top;
  3438. if (ai.tolerance === "touch") {
  3439. ap = (!(aq.left > ag || aq.right < ah || aq.top > aj || aq.bottom < al))
  3440. } else {
  3441. if (ai.tolerance === "fit") {
  3442. ap = (aq.left > ah && aq.right < ag && aq.top > al && aq.bottom < aj)
  3443. }
  3444. }
  3445. if (ap) {
  3446. if (ao.selected) {
  3447. am._removeClass(ao.$element, "ui-selected");
  3448. ao.selected = false
  3449. }
  3450. if (ao.unselecting) {
  3451. am._removeClass(ao.$element, "ui-unselecting");
  3452. ao.unselecting = false
  3453. }
  3454. if (!ao.selecting) {
  3455. am._addClass(ao.$element, "ui-selecting");
  3456. ao.selecting = true;
  3457. am._trigger("selecting", an, {
  3458. selecting: ao.element
  3459. })
  3460. }
  3461. } else {
  3462. if (ao.selecting) {
  3463. if ((an.metaKey || an.ctrlKey) && ao.startselected) {
  3464. am._removeClass(ao.$element, "ui-selecting");
  3465. ao.selecting = false;
  3466. am._addClass(ao.$element, "ui-selected");
  3467. ao.selected = true
  3468. } else {
  3469. am._removeClass(ao.$element, "ui-selecting");
  3470. ao.selecting = false;
  3471. if (ao.startselected) {
  3472. am._addClass(ao.$element, "ui-unselecting");
  3473. ao.unselecting = true
  3474. }
  3475. am._trigger("unselecting", an, {
  3476. unselecting: ao.element
  3477. })
  3478. }
  3479. }
  3480. if (ao.selected) {
  3481. if (!an.metaKey && !an.ctrlKey && !ao.startselected) {
  3482. am._removeClass(ao.$element, "ui-selected");
  3483. ao.selected = false;
  3484. am._addClass(ao.$element, "ui-unselecting");
  3485. ao.unselecting = true;
  3486. am._trigger("unselecting", an, {
  3487. unselecting: ao.element
  3488. })
  3489. }
  3490. }
  3491. }
  3492. });
  3493. return false
  3494. },
  3495. _mouseStop: function(ah) {
  3496. var ag = this;
  3497. this.dragged = false;
  3498. K(".ui-unselecting", this.element[0]).each(function() {
  3499. var ai = K.data(this, "selectable-item");
  3500. ag._removeClass(ai.$element, "ui-unselecting");
  3501. ai.unselecting = false;
  3502. ai.startselected = false;
  3503. ag._trigger("unselected", ah, {
  3504. unselected: ai.element
  3505. })
  3506. });
  3507. K(".ui-selecting", this.element[0]).each(function() {
  3508. var ai = K.data(this, "selectable-item");
  3509. ag._removeClass(ai.$element, "ui-selecting")._addClass(ai.$element, "ui-selected");
  3510. ai.selecting = false;
  3511. ai.selected = true;
  3512. ai.startselected = true;
  3513. ag._trigger("selected", ah, {
  3514. selected: ai.element
  3515. })
  3516. });
  3517. this._trigger("stop", ah);
  3518. this.helper.remove();
  3519. return false
  3520. }
  3521. });
  3522. /*!
  3523. * jQuery UI Sortable 1.12.1
  3524. * http://jqueryui.com
  3525. *
  3526. * Copyright jQuery Foundation and other contributors
  3527. * Released under the MIT license.
  3528. * http://jquery.org/license
  3529. */
  3530. var m = K.widget("ui.sortable", K.ui.mouse, {
  3531. version: "1.12.1",
  3532. widgetEventPrefix: "sort",
  3533. ready: false,
  3534. options: {
  3535. appendTo: "parent",
  3536. axis: false,
  3537. connectWith: false,
  3538. containment: false,
  3539. cursor: "auto",
  3540. cursorAt: false,
  3541. dropOnEmpty: true,
  3542. forcePlaceholderSize: false,
  3543. forceHelperSize: false,
  3544. grid: false,
  3545. handle: false,
  3546. helper: "original",
  3547. items: "> *",
  3548. opacity: false,
  3549. placeholder: false,
  3550. revert: false,
  3551. scroll: true,
  3552. scrollSensitivity: 20,
  3553. scrollSpeed: 20,
  3554. scope: "default",
  3555. tolerance: "intersect",
  3556. zIndex: 1000,
  3557. activate: null,
  3558. beforeStop: null,
  3559. change: null,
  3560. deactivate: null,
  3561. out: null,
  3562. over: null,
  3563. receive: null,
  3564. remove: null,
  3565. sort: null,
  3566. start: null,
  3567. stop: null,
  3568. update: null
  3569. },
  3570. _isOverAxis: function(ah, ag, ai) {
  3571. return (ah >= ag) && (ah < (ag + ai))
  3572. },
  3573. _isFloating: function(ag) {
  3574. return (/left|right/).test(ag.css("float")) || (/inline|table-cell/).test(ag.css("display"))
  3575. },
  3576. _create: function() {
  3577. this.containerCache = {};
  3578. this._addClass("ui-sortable");
  3579. this.refresh();
  3580. this.offset = this.element.offset();
  3581. this._mouseInit();
  3582. this._setHandleClassName();
  3583. this.ready = true
  3584. },
  3585. _setOption: function(ag, ah) {
  3586. this._super(ag, ah);
  3587. if (ag === "handle") {
  3588. this._setHandleClassName()
  3589. }
  3590. },
  3591. _setHandleClassName: function() {
  3592. var ag = this;
  3593. this._removeClass(this.element.find(".ui-sortable-handle"), "ui-sortable-handle");
  3594. K.each(this.items, function() {
  3595. ag._addClass(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, "ui-sortable-handle")
  3596. })
  3597. },
  3598. _destroy: function() {
  3599. this._mouseDestroy();
  3600. for (var ag = this.items.length - 1; ag >= 0; ag--) {
  3601. this.items[ag].item.removeData(this.widgetName + "-item")
  3602. }
  3603. return this
  3604. },
  3605. _mouseCapture: function(ai, aj) {
  3606. var ag = null
  3607. , ak = false
  3608. , ah = this;
  3609. if (this.reverting) {
  3610. return false
  3611. }
  3612. if (this.options.disabled || this.options.type === "static") {
  3613. return false
  3614. }
  3615. this._refreshItems(ai);
  3616. K(ai.target).parents().each(function() {
  3617. if (K.data(this, ah.widgetName + "-item") === ah) {
  3618. ag = K(this);
  3619. return false
  3620. }
  3621. });
  3622. if (K.data(ai.target, ah.widgetName + "-item") === ah) {
  3623. ag = K(ai.target)
  3624. }
  3625. if (!ag) {
  3626. return false
  3627. }
  3628. if (this.options.handle && !aj) {
  3629. K(this.options.handle, ag).find("*").addBack().each(function() {
  3630. if (this === ai.target) {
  3631. ak = true
  3632. }
  3633. });
  3634. if (!ak) {
  3635. return false
  3636. }
  3637. }
  3638. this.currentItem = ag;
  3639. this._removeCurrentsFromItems();
  3640. return true
  3641. },
  3642. _mouseStart: function(aj, ak, ah) {
  3643. var ai, ag, al = this.options;
  3644. this.currentContainer = this;
  3645. this.refreshPositions();
  3646. this.helper = this._createHelper(aj);
  3647. this._cacheHelperProportions();
  3648. this._cacheMargins();
  3649. this.scrollParent = this.helper.scrollParent();
  3650. this.offset = this.currentItem.offset();
  3651. this.offset = {
  3652. top: this.offset.top - this.margins.top,
  3653. left: this.offset.left - this.margins.left
  3654. };
  3655. K.extend(this.offset, {
  3656. click: {
  3657. left: aj.pageX - this.offset.left,
  3658. top: aj.pageY - this.offset.top
  3659. },
  3660. parent: this._getParentOffset(),
  3661. relative: this._getRelativeOffset()
  3662. });
  3663. this.helper.css("position", "absolute");
  3664. this.cssPosition = this.helper.css("position");
  3665. this.originalPosition = this._generatePosition(aj);
  3666. this.originalPageX = aj.pageX;
  3667. this.originalPageY = aj.pageY;
  3668. (al.cursorAt && this._adjustOffsetFromHelper(al.cursorAt));
  3669. this.domPosition = {
  3670. prev: this.currentItem.prev()[0],
  3671. parent: this.currentItem.parent()[0]
  3672. };
  3673. if (this.helper[0] !== this.currentItem[0]) {
  3674. this.currentItem.hide()
  3675. }
  3676. this._createPlaceholder();
  3677. if (al.containment) {
  3678. this._setContainment()
  3679. }
  3680. if (al.cursor && al.cursor !== "auto") {
  3681. ag = this.document.find("body");
  3682. this.storedCursor = ag.css("cursor");
  3683. ag.css("cursor", al.cursor);
  3684. this.storedStylesheet = K("<style>*{ cursor: " + al.cursor + " !important; }</style>").appendTo(ag)
  3685. }
  3686. if (al.opacity) {
  3687. if (this.helper.css("opacity")) {
  3688. this._storedOpacity = this.helper.css("opacity")
  3689. }
  3690. this.helper.css("opacity", al.opacity)
  3691. }
  3692. if (al.zIndex) {
  3693. if (this.helper.css("zIndex")) {
  3694. this._storedZIndex = this.helper.css("zIndex")
  3695. }
  3696. this.helper.css("zIndex", al.zIndex)
  3697. }
  3698. if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
  3699. this.overflowOffset = this.scrollParent.offset()
  3700. }
  3701. this._trigger("start", aj, this._uiHash());
  3702. if (!this._preserveHelperProportions) {
  3703. this._cacheHelperProportions()
  3704. }
  3705. if (!ah) {
  3706. for (ai = this.containers.length - 1; ai >= 0; ai--) {
  3707. this.containers[ai]._trigger("activate", aj, this._uiHash(this))
  3708. }
  3709. }
  3710. if (K.ui.ddmanager) {
  3711. K.ui.ddmanager.current = this
  3712. }
  3713. if (K.ui.ddmanager && !al.dropBehaviour) {
  3714. K.ui.ddmanager.prepareOffsets(this, aj)
  3715. }
  3716. this.dragging = true;
  3717. this._addClass(this.helper, "ui-sortable-helper");
  3718. this._mouseDrag(aj);
  3719. return true
  3720. },
  3721. _mouseDrag: function(ak) {
  3722. var ai, aj, ah, am, al = this.options, ag = false;
  3723. this.position = this._generatePosition(ak);
  3724. this.positionAbs = this._convertPositionTo("absolute");
  3725. if (!this.lastPositionAbs) {
  3726. this.lastPositionAbs = this.positionAbs
  3727. }
  3728. if (this.options.scroll) {
  3729. if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
  3730. if ((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - ak.pageY < al.scrollSensitivity) {
  3731. this.scrollParent[0].scrollTop = ag = this.scrollParent[0].scrollTop + al.scrollSpeed
  3732. } else {
  3733. if (ak.pageY - this.overflowOffset.top < al.scrollSensitivity) {
  3734. this.scrollParent[0].scrollTop = ag = this.scrollParent[0].scrollTop - al.scrollSpeed
  3735. }
  3736. }
  3737. if ((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - ak.pageX < al.scrollSensitivity) {
  3738. this.scrollParent[0].scrollLeft = ag = this.scrollParent[0].scrollLeft + al.scrollSpeed
  3739. } else {
  3740. if (ak.pageX - this.overflowOffset.left < al.scrollSensitivity) {
  3741. this.scrollParent[0].scrollLeft = ag = this.scrollParent[0].scrollLeft - al.scrollSpeed
  3742. }
  3743. }
  3744. } else {
  3745. if (ak.pageY - this.document.scrollTop() < al.scrollSensitivity) {
  3746. ag = this.document.scrollTop(this.document.scrollTop() - al.scrollSpeed)
  3747. } else {
  3748. if (this.window.height() - (ak.pageY - this.document.scrollTop()) < al.scrollSensitivity) {
  3749. ag = this.document.scrollTop(this.document.scrollTop() + al.scrollSpeed)
  3750. }
  3751. }
  3752. if (ak.pageX - this.document.scrollLeft() < al.scrollSensitivity) {
  3753. ag = this.document.scrollLeft(this.document.scrollLeft() - al.scrollSpeed)
  3754. } else {
  3755. if (this.window.width() - (ak.pageX - this.document.scrollLeft()) < al.scrollSensitivity) {
  3756. ag = this.document.scrollLeft(this.document.scrollLeft() + al.scrollSpeed)
  3757. }
  3758. }
  3759. }
  3760. if (ag !== false && K.ui.ddmanager && !al.dropBehaviour) {
  3761. K.ui.ddmanager.prepareOffsets(this, ak)
  3762. }
  3763. }
  3764. this.positionAbs = this._convertPositionTo("absolute");
  3765. if (!this.options.axis || this.options.axis !== "y") {
  3766. this.helper[0].style.left = this.position.left + "px"
  3767. }
  3768. if (!this.options.axis || this.options.axis !== "x") {
  3769. this.helper[0].style.top = this.position.top + "px"
  3770. }
  3771. for (ai = this.items.length - 1; ai >= 0; ai--) {
  3772. aj = this.items[ai];
  3773. ah = aj.item[0];
  3774. am = this._intersectsWithPointer(aj);
  3775. if (!am) {
  3776. continue
  3777. }
  3778. if (aj.instance !== this.currentContainer) {
  3779. continue
  3780. }
  3781. if (ah !== this.currentItem[0] && this.placeholder[am === 1 ? "next" : "prev"]()[0] !== ah && !K.contains(this.placeholder[0], ah) && (this.options.type === "semi-dynamic" ? !K.contains(this.element[0], ah) : true)) {
  3782. this.direction = am === 1 ? "down" : "up";
  3783. if (this.options.tolerance === "pointer" || this._intersectsWithSides(aj)) {
  3784. this._rearrange(ak, aj)
  3785. } else {
  3786. break
  3787. }
  3788. this._trigger("change", ak, this._uiHash());
  3789. break
  3790. }
  3791. }
  3792. this._contactContainers(ak);
  3793. if (K.ui.ddmanager) {
  3794. K.ui.ddmanager.drag(this, ak)
  3795. }
  3796. this._trigger("sort", ak, this._uiHash());
  3797. this.lastPositionAbs = this.positionAbs;
  3798. return false
  3799. },
  3800. _mouseStop: function(ai, ak) {
  3801. if (!ai) {
  3802. return
  3803. }
  3804. if (K.ui.ddmanager && !this.options.dropBehaviour) {
  3805. K.ui.ddmanager.drop(this, ai)
  3806. }
  3807. if (this.options.revert) {
  3808. var ah = this
  3809. , al = this.placeholder.offset()
  3810. , ag = this.options.axis
  3811. , aj = {};
  3812. if (!ag || ag === "x") {
  3813. aj.left = al.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft)
  3814. }
  3815. if (!ag || ag === "y") {
  3816. aj.top = al.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop)
  3817. }
  3818. this.reverting = true;
  3819. K(this.helper).animate(aj, parseInt(this.options.revert, 10) || 500, function() {
  3820. ah._clear(ai)
  3821. })
  3822. } else {
  3823. this._clear(ai, ak)
  3824. }
  3825. return false
  3826. },
  3827. cancel: function() {
  3828. if (this.dragging) {
  3829. this._mouseUp(new K.Event("mouseup",{
  3830. target: null
  3831. }));
  3832. if (this.options.helper === "original") {
  3833. this.currentItem.css(this._storedCSS);
  3834. this._removeClass(this.currentItem, "ui-sortable-helper")
  3835. } else {
  3836. this.currentItem.show()
  3837. }
  3838. for (var ag = this.containers.length - 1; ag >= 0; ag--) {
  3839. this.containers[ag]._trigger("deactivate", null, this._uiHash(this));
  3840. if (this.containers[ag].containerCache.over) {
  3841. this.containers[ag]._trigger("out", null, this._uiHash(this));
  3842. this.containers[ag].containerCache.over = 0
  3843. }
  3844. }
  3845. }
  3846. if (this.placeholder) {
  3847. if (this.placeholder[0].parentNode) {
  3848. this.placeholder[0].parentNode.removeChild(this.placeholder[0])
  3849. }
  3850. if (this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
  3851. this.helper.remove()
  3852. }
  3853. K.extend(this, {
  3854. helper: null,
  3855. dragging: false,
  3856. reverting: false,
  3857. _noFinalSort: null
  3858. });
  3859. if (this.domPosition.prev) {
  3860. K(this.domPosition.prev).after(this.currentItem)
  3861. } else {
  3862. K(this.domPosition.parent).prepend(this.currentItem)
  3863. }
  3864. }
  3865. return this
  3866. },
  3867. serialize: function(ai) {
  3868. var ag = this._getItemsAsjQuery(ai && ai.connected)
  3869. , ah = [];
  3870. ai = ai || {};
  3871. K(ag).each(function() {
  3872. var aj = (K(ai.item || this).attr(ai.attribute || "id") || "").match(ai.expression || (/(.+)[\-=_](.+)/));
  3873. if (aj) {
  3874. ah.push((ai.key || aj[1] + "[]") + "=" + (ai.key && ai.expression ? aj[1] : aj[2]))
  3875. }
  3876. });
  3877. if (!ah.length && ai.key) {
  3878. ah.push(ai.key + "=")
  3879. }
  3880. return ah.join("&")
  3881. },
  3882. toArray: function(ai) {
  3883. var ag = this._getItemsAsjQuery(ai && ai.connected)
  3884. , ah = [];
  3885. ai = ai || {};
  3886. ag.each(function() {
  3887. ah.push(K(ai.item || this).attr(ai.attribute || "id") || "")
  3888. });
  3889. return ah
  3890. },
  3891. _intersectsWith: function(ar) {
  3892. var ai = this.positionAbs.left
  3893. , ah = ai + this.helperProportions.width
  3894. , ap = this.positionAbs.top
  3895. , ao = ap + this.helperProportions.height
  3896. , aj = ar.left
  3897. , ag = aj + ar.width
  3898. , at = ar.top
  3899. , an = at + ar.height
  3900. , au = this.offset.click.top
  3901. , am = this.offset.click.left
  3902. , al = (this.options.axis === "x") || ((ap + au) > at && (ap + au) < an)
  3903. , aq = (this.options.axis === "y") || ((ai + am) > aj && (ai + am) < ag)
  3904. , ak = al && aq;
  3905. if (this.options.tolerance === "pointer" || this.options.forcePointerForContainers || (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > ar[this.floating ? "width" : "height"])) {
  3906. return ak
  3907. } else {
  3908. return (aj < ai + (this.helperProportions.width / 2) && ah - (this.helperProportions.width / 2) < ag && at < ap + (this.helperProportions.height / 2) && ao - (this.helperProportions.height / 2) < an)
  3909. }
  3910. },
  3911. _intersectsWithPointer: function(ai) {
  3912. var ah, al, aj = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, ai.top, ai.height), ag = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, ai.left, ai.width), ak = aj && ag;
  3913. if (!ak) {
  3914. return false
  3915. }
  3916. ah = this._getDragVerticalDirection();
  3917. al = this._getDragHorizontalDirection();
  3918. return this.floating ? ((al === "right" || ah === "down") ? 2 : 1) : (ah && (ah === "down" ? 2 : 1))
  3919. },
  3920. _intersectsWithSides: function(aj) {
  3921. var ah = this._isOverAxis(this.positionAbs.top + this.offset.click.top, aj.top + (aj.height / 2), aj.height)
  3922. , ai = this._isOverAxis(this.positionAbs.left + this.offset.click.left, aj.left + (aj.width / 2), aj.width)
  3923. , ag = this._getDragVerticalDirection()
  3924. , ak = this._getDragHorizontalDirection();
  3925. if (this.floating && ak) {
  3926. return ((ak === "right" && ai) || (ak === "left" && !ai))
  3927. } else {
  3928. return ag && ((ag === "down" && ah) || (ag === "up" && !ah))
  3929. }
  3930. },
  3931. _getDragVerticalDirection: function() {
  3932. var ag = this.positionAbs.top - this.lastPositionAbs.top;
  3933. return ag !== 0 && (ag > 0 ? "down" : "up")
  3934. },
  3935. _getDragHorizontalDirection: function() {
  3936. var ag = this.positionAbs.left - this.lastPositionAbs.left;
  3937. return ag !== 0 && (ag > 0 ? "right" : "left")
  3938. },
  3939. refresh: function(ag) {
  3940. this._refreshItems(ag);
  3941. this._setHandleClassName();
  3942. this.refreshPositions();
  3943. return this
  3944. },
  3945. _connectWith: function() {
  3946. var ag = this.options;
  3947. return ag.connectWith.constructor === String ? [ag.connectWith] : ag.connectWith
  3948. },
  3949. _getItemsAsjQuery: function(ag) {
  3950. var ai, ah, an, ak, al = [], aj = [], am = this._connectWith();
  3951. if (am && ag) {
  3952. for (ai = am.length - 1; ai >= 0; ai--) {
  3953. an = K(am[ai], this.document[0]);
  3954. for (ah = an.length - 1; ah >= 0; ah--) {
  3955. ak = K.data(an[ah], this.widgetFullName);
  3956. if (ak && ak !== this && !ak.options.disabled) {
  3957. aj.push([K.isFunction(ak.options.items) ? ak.options.items.call(ak.element) : K(ak.options.items, ak.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), ak])
  3958. }
  3959. }
  3960. }
  3961. }
  3962. aj.push([K.isFunction(this.options.items) ? this.options.items.call(this.element, null, {
  3963. options: this.options,
  3964. item: this.currentItem
  3965. }) : K(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
  3966. function ao() {
  3967. al.push(this)
  3968. }
  3969. for (ai = aj.length - 1; ai >= 0; ai--) {
  3970. aj[ai][0].each(ao)
  3971. }
  3972. return K(al)
  3973. },
  3974. _removeCurrentsFromItems: function() {
  3975. var ag = this.currentItem.find(":data(" + this.widgetName + "-item)");
  3976. this.items = K.grep(this.items, function(ai) {
  3977. for (var ah = 0; ah < ag.length; ah++) {
  3978. if (ag[ah] === ai.item[0]) {
  3979. return false
  3980. }
  3981. }
  3982. return true
  3983. })
  3984. },
  3985. _refreshItems: function(ag) {
  3986. this.items = [];
  3987. this.containers = [this];
  3988. var ak, ai, ap, al, ao, ah, ar, aq, am = this.items, aj = [[K.isFunction(this.options.items) ? this.options.items.call(this.element[0], ag, {
  3989. item: this.currentItem
  3990. }) : K(this.options.items, this.element), this]], an = this._connectWith();
  3991. if (an && this.ready) {
  3992. for (ak = an.length - 1; ak >= 0; ak--) {
  3993. ap = K(an[ak], this.document[0]);
  3994. for (ai = ap.length - 1; ai >= 0; ai--) {
  3995. al = K.data(ap[ai], this.widgetFullName);
  3996. if (al && al !== this && !al.options.disabled) {
  3997. aj.push([K.isFunction(al.options.items) ? al.options.items.call(al.element[0], ag, {
  3998. item: this.currentItem
  3999. }) : K(al.options.items, al.element), al]);
  4000. this.containers.push(al)
  4001. }
  4002. }
  4003. }
  4004. }
  4005. for (ak = aj.length - 1; ak >= 0; ak--) {
  4006. ao = aj[ak][1];
  4007. ah = aj[ak][0];
  4008. for (ai = 0,
  4009. aq = ah.length; ai < aq; ai++) {
  4010. ar = K(ah[ai]);
  4011. ar.data(this.widgetName + "-item", ao);
  4012. am.push({
  4013. item: ar,
  4014. instance: ao,
  4015. width: 0,
  4016. height: 0,
  4017. left: 0,
  4018. top: 0
  4019. })
  4020. }
  4021. }
  4022. },
  4023. refreshPositions: function(ag) {
  4024. this.floating = this.items.length ? this.options.axis === "x" || this._isFloating(this.items[0].item) : false;
  4025. if (this.offsetParent && this.helper) {
  4026. this.offset.parent = this._getParentOffset()
  4027. }
  4028. var ai, aj, ah, ak;
  4029. for (ai = this.items.length - 1; ai >= 0; ai--) {
  4030. aj = this.items[ai];
  4031. if (aj.instance !== this.currentContainer && this.currentContainer && aj.item[0] !== this.currentItem[0]) {
  4032. continue
  4033. }
  4034. ah = this.options.toleranceElement ? K(this.options.toleranceElement, aj.item) : aj.item;
  4035. if (!ag) {
  4036. aj.width = ah.outerWidth();
  4037. aj.height = ah.outerHeight()
  4038. }
  4039. ak = ah.offset();
  4040. aj.left = ak.left;
  4041. aj.top = ak.top
  4042. }
  4043. if (this.options.custom && this.options.custom.refreshContainers) {
  4044. this.options.custom.refreshContainers.call(this)
  4045. } else {
  4046. for (ai = this.containers.length - 1; ai >= 0; ai--) {
  4047. ak = this.containers[ai].element.offset();
  4048. this.containers[ai].containerCache.left = ak.left;
  4049. this.containers[ai].containerCache.top = ak.top;
  4050. this.containers[ai].containerCache.width = this.containers[ai].element.outerWidth();
  4051. this.containers[ai].containerCache.height = this.containers[ai].element.outerHeight()
  4052. }
  4053. }
  4054. return this
  4055. },
  4056. _createPlaceholder: function(ah) {
  4057. ah = ah || this;
  4058. var ag, ai = ah.options;
  4059. if (!ai.placeholder || ai.placeholder.constructor === String) {
  4060. ag = ai.placeholder;
  4061. ai.placeholder = {
  4062. element: function() {
  4063. var ak = ah.currentItem[0].nodeName.toLowerCase()
  4064. , aj = K("<" + ak + ">", ah.document[0]);
  4065. ah._addClass(aj, "ui-sortable-placeholder", ag || ah.currentItem[0].className)._removeClass(aj, "ui-sortable-helper");
  4066. if (ak === "tbody") {
  4067. ah._createTrPlaceholder(ah.currentItem.find("tr").eq(0), K("<tr>", ah.document[0]).appendTo(aj))
  4068. } else {
  4069. if (ak === "tr") {
  4070. ah._createTrPlaceholder(ah.currentItem, aj)
  4071. } else {
  4072. if (ak === "img") {
  4073. aj.attr("src", ah.currentItem.attr("src"))
  4074. }
  4075. }
  4076. }
  4077. if (!ag) {
  4078. aj.css("visibility", "hidden")
  4079. }
  4080. return aj
  4081. },
  4082. update: function(aj, ak) {
  4083. if (ag && !ai.forcePlaceholderSize) {
  4084. return
  4085. }
  4086. if (!ak.height()) {
  4087. ak.height(ah.currentItem.innerHeight() - parseInt(ah.currentItem.css("paddingTop") || 0, 10) - parseInt(ah.currentItem.css("paddingBottom") || 0, 10))
  4088. }
  4089. if (!ak.width()) {
  4090. ak.width(ah.currentItem.innerWidth() - parseInt(ah.currentItem.css("paddingLeft") || 0, 10) - parseInt(ah.currentItem.css("paddingRight") || 0, 10))
  4091. }
  4092. }
  4093. }
  4094. }
  4095. ah.placeholder = K(ai.placeholder.element.call(ah.element, ah.currentItem));
  4096. ah.currentItem.after(ah.placeholder);
  4097. ai.placeholder.update(ah, ah.placeholder)
  4098. },
  4099. _createTrPlaceholder: function(ah, ag) {
  4100. var ai = this;
  4101. ah.children().each(function() {
  4102. K("<td>&#160;</td>", ai.document[0]).attr("colspan", K(this).attr("colspan") || 1).appendTo(ag)
  4103. })
  4104. },
  4105. _contactContainers: function(ag) {
  4106. var al, aj, ap, am, an, ar, at, ak, ao, ai, ah = null, aq = null;
  4107. for (al = this.containers.length - 1; al >= 0; al--) {
  4108. if (K.contains(this.currentItem[0], this.containers[al].element[0])) {
  4109. continue
  4110. }
  4111. if (this._intersectsWith(this.containers[al].containerCache)) {
  4112. if (ah && K.contains(this.containers[al].element[0], ah.element[0])) {
  4113. continue
  4114. }
  4115. ah = this.containers[al];
  4116. aq = al
  4117. } else {
  4118. if (this.containers[al].containerCache.over) {
  4119. this.containers[al]._trigger("out", ag, this._uiHash(this));
  4120. this.containers[al].containerCache.over = 0
  4121. }
  4122. }
  4123. }
  4124. if (!ah) {
  4125. return
  4126. }
  4127. if (this.containers.length === 1) {
  4128. if (!this.containers[aq].containerCache.over) {
  4129. this.containers[aq]._trigger("over", ag, this._uiHash(this));
  4130. this.containers[aq].containerCache.over = 1
  4131. }
  4132. } else {
  4133. ap = 10000;
  4134. am = null;
  4135. ao = ah.floating || this._isFloating(this.currentItem);
  4136. an = ao ? "left" : "top";
  4137. ar = ao ? "width" : "height";
  4138. ai = ao ? "pageX" : "pageY";
  4139. for (aj = this.items.length - 1; aj >= 0; aj--) {
  4140. if (!K.contains(this.containers[aq].element[0], this.items[aj].item[0])) {
  4141. continue
  4142. }
  4143. if (this.items[aj].item[0] === this.currentItem[0]) {
  4144. continue
  4145. }
  4146. at = this.items[aj].item.offset()[an];
  4147. ak = false;
  4148. if (ag[ai] - at > this.items[aj][ar] / 2) {
  4149. ak = true
  4150. }
  4151. if (Math.abs(ag[ai] - at) < ap) {
  4152. ap = Math.abs(ag[ai] - at);
  4153. am = this.items[aj];
  4154. this.direction = ak ? "up" : "down"
  4155. }
  4156. }
  4157. if (!am && !this.options.dropOnEmpty) {
  4158. return
  4159. }
  4160. if (this.currentContainer === this.containers[aq]) {
  4161. if (!this.currentContainer.containerCache.over) {
  4162. this.containers[aq]._trigger("over", ag, this._uiHash());
  4163. this.currentContainer.containerCache.over = 1
  4164. }
  4165. return
  4166. }
  4167. am ? this._rearrange(ag, am, null, true) : this._rearrange(ag, null, this.containers[aq].element, true);
  4168. this._trigger("change", ag, this._uiHash());
  4169. this.containers[aq]._trigger("change", ag, this._uiHash(this));
  4170. this.currentContainer = this.containers[aq];
  4171. this.options.placeholder.update(this.currentContainer, this.placeholder);
  4172. this.containers[aq]._trigger("over", ag, this._uiHash(this));
  4173. this.containers[aq].containerCache.over = 1
  4174. }
  4175. },
  4176. _createHelper: function(ah) {
  4177. var ai = this.options
  4178. , ag = K.isFunction(ai.helper) ? K(ai.helper.apply(this.element[0], [ah, this.currentItem])) : (ai.helper === "clone" ? this.currentItem.clone() : this.currentItem);
  4179. if (!ag.parents("body").length) {
  4180. K(ai.appendTo !== "parent" ? ai.appendTo : this.currentItem[0].parentNode)[0].appendChild(ag[0])
  4181. }
  4182. if (ag[0] === this.currentItem[0]) {
  4183. this._storedCSS = {
  4184. width: this.currentItem[0].style.width,
  4185. height: this.currentItem[0].style.height,
  4186. position: this.currentItem.css("position"),
  4187. top: this.currentItem.css("top"),
  4188. left: this.currentItem.css("left")
  4189. }
  4190. }
  4191. if (!ag[0].style.width || ai.forceHelperSize) {
  4192. ag.width(this.currentItem.width())
  4193. }
  4194. if (!ag[0].style.height || ai.forceHelperSize) {
  4195. ag.height(this.currentItem.height())
  4196. }
  4197. return ag
  4198. },
  4199. _adjustOffsetFromHelper: function(ag) {
  4200. if (typeof ag === "string") {
  4201. ag = ag.split(" ")
  4202. }
  4203. if (K.isArray(ag)) {
  4204. ag = {
  4205. left: +ag[0],
  4206. top: +ag[1] || 0
  4207. }
  4208. }
  4209. if ("left"in ag) {
  4210. this.offset.click.left = ag.left + this.margins.left
  4211. }
  4212. if ("right"in ag) {
  4213. this.offset.click.left = this.helperProportions.width - ag.right + this.margins.left
  4214. }
  4215. if ("top"in ag) {
  4216. this.offset.click.top = ag.top + this.margins.top
  4217. }
  4218. if ("bottom"in ag) {
  4219. this.offset.click.top = this.helperProportions.height - ag.bottom + this.margins.top
  4220. }
  4221. },
  4222. _getParentOffset: function() {
  4223. this.offsetParent = this.helper.offsetParent();
  4224. var ag = this.offsetParent.offset();
  4225. if (this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && K.contains(this.scrollParent[0], this.offsetParent[0])) {
  4226. ag.left += this.scrollParent.scrollLeft();
  4227. ag.top += this.scrollParent.scrollTop()
  4228. }
  4229. if (this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && K.ui.ie)) {
  4230. ag = {
  4231. top: 0,
  4232. left: 0
  4233. }
  4234. }
  4235. return {
  4236. top: ag.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
  4237. left: ag.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
  4238. }
  4239. },
  4240. _getRelativeOffset: function() {
  4241. if (this.cssPosition === "relative") {
  4242. var ag = this.currentItem.position();
  4243. return {
  4244. top: ag.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
  4245. left: ag.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
  4246. }
  4247. } else {
  4248. return {
  4249. top: 0,
  4250. left: 0
  4251. }
  4252. }
  4253. },
  4254. _cacheMargins: function() {
  4255. this.margins = {
  4256. left: (parseInt(this.currentItem.css("marginLeft"), 10) || 0),
  4257. top: (parseInt(this.currentItem.css("marginTop"), 10) || 0)
  4258. }
  4259. },
  4260. _cacheHelperProportions: function() {
  4261. this.helperProportions = {
  4262. width: this.helper.outerWidth(),
  4263. height: this.helper.outerHeight()
  4264. }
  4265. },
  4266. _setContainment: function() {
  4267. var ah, aj, ag, ai = this.options;
  4268. if (ai.containment === "parent") {
  4269. ai.containment = this.helper[0].parentNode
  4270. }
  4271. if (ai.containment === "document" || ai.containment === "window") {
  4272. this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, ai.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, (ai.containment === "document" ? (this.document.height() || document.body.parentNode.scrollHeight) : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]
  4273. }
  4274. if (!(/^(document|window|parent)$/).test(ai.containment)) {
  4275. ah = K(ai.containment)[0];
  4276. aj = K(ai.containment).offset();
  4277. ag = (K(ah).css("overflow") !== "hidden");
  4278. this.containment = [aj.left + (parseInt(K(ah).css("borderLeftWidth"), 10) || 0) + (parseInt(K(ah).css("paddingLeft"), 10) || 0) - this.margins.left, aj.top + (parseInt(K(ah).css("borderTopWidth"), 10) || 0) + (parseInt(K(ah).css("paddingTop"), 10) || 0) - this.margins.top, aj.left + (ag ? Math.max(ah.scrollWidth, ah.offsetWidth) : ah.offsetWidth) - (parseInt(K(ah).css("borderLeftWidth"), 10) || 0) - (parseInt(K(ah).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, aj.top + (ag ? Math.max(ah.scrollHeight, ah.offsetHeight) : ah.offsetHeight) - (parseInt(K(ah).css("borderTopWidth"), 10) || 0) - (parseInt(K(ah).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top]
  4279. }
  4280. },
  4281. _convertPositionTo: function(ai, ak) {
  4282. if (!ak) {
  4283. ak = this.position
  4284. }
  4285. var ah = ai === "absolute" ? 1 : -1
  4286. , ag = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && K.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent
  4287. , aj = (/(html|body)/i).test(ag[0].tagName);
  4288. return {
  4289. top: (ak.top + this.offset.relative.top * ah + this.offset.parent.top * ah - ((this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : (aj ? 0 : ag.scrollTop())) * ah)),
  4290. left: (ak.left + this.offset.relative.left * ah + this.offset.parent.left * ah - ((this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : aj ? 0 : ag.scrollLeft()) * ah))
  4291. }
  4292. },
  4293. _generatePosition: function(aj) {
  4294. var al, ak, am = this.options, ai = aj.pageX, ah = aj.pageY, ag = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && K.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, an = (/(html|body)/i).test(ag[0].tagName);
  4295. if (this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
  4296. this.offset.relative = this._getRelativeOffset()
  4297. }
  4298. if (this.originalPosition) {
  4299. if (this.containment) {
  4300. if (aj.pageX - this.offset.click.left < this.containment[0]) {
  4301. ai = this.containment[0] + this.offset.click.left
  4302. }
  4303. if (aj.pageY - this.offset.click.top < this.containment[1]) {
  4304. ah = this.containment[1] + this.offset.click.top
  4305. }
  4306. if (aj.pageX - this.offset.click.left > this.containment[2]) {
  4307. ai = this.containment[2] + this.offset.click.left
  4308. }
  4309. if (aj.pageY - this.offset.click.top > this.containment[3]) {
  4310. ah = this.containment[3] + this.offset.click.top
  4311. }
  4312. }
  4313. if (am.grid) {
  4314. al = this.originalPageY + Math.round((ah - this.originalPageY) / am.grid[1]) * am.grid[1];
  4315. ah = this.containment ? ((al - this.offset.click.top >= this.containment[1] && al - this.offset.click.top <= this.containment[3]) ? al : ((al - this.offset.click.top >= this.containment[1]) ? al - am.grid[1] : al + am.grid[1])) : al;
  4316. ak = this.originalPageX + Math.round((ai - this.originalPageX) / am.grid[0]) * am.grid[0];
  4317. ai = this.containment ? ((ak - this.offset.click.left >= this.containment[0] && ak - this.offset.click.left <= this.containment[2]) ? ak : ((ak - this.offset.click.left >= this.containment[0]) ? ak - am.grid[0] : ak + am.grid[0])) : ak
  4318. }
  4319. }
  4320. return {
  4321. top: (ah - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ((this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : (an ? 0 : ag.scrollTop())))),
  4322. left: (ai - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ((this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : an ? 0 : ag.scrollLeft())))
  4323. }
  4324. },
  4325. _rearrange: function(ak, aj, ah, ai) {
  4326. ah ? ah[0].appendChild(this.placeholder[0]) : aj.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? aj.item[0] : aj.item[0].nextSibling));
  4327. this.counter = this.counter ? ++this.counter : 1;
  4328. var ag = this.counter;
  4329. this._delay(function() {
  4330. if (ag === this.counter) {
  4331. this.refreshPositions(!ai)
  4332. }
  4333. })
  4334. },
  4335. _clear: function(ah, aj) {
  4336. this.reverting = false;
  4337. var ag, ak = [];
  4338. if (!this._noFinalSort && this.currentItem.parent().length) {
  4339. this.placeholder.before(this.currentItem)
  4340. }
  4341. this._noFinalSort = null;
  4342. if (this.helper[0] === this.currentItem[0]) {
  4343. for (ag in this._storedCSS) {
  4344. if (this._storedCSS[ag] === "auto" || this._storedCSS[ag] === "static") {
  4345. this._storedCSS[ag] = ""
  4346. }
  4347. }
  4348. this.currentItem.css(this._storedCSS);
  4349. this._removeClass(this.currentItem, "ui-sortable-helper")
  4350. } else {
  4351. this.currentItem.show()
  4352. }
  4353. if (this.fromOutside && !aj) {
  4354. ak.push(function(al) {
  4355. this._trigger("receive", al, this._uiHash(this.fromOutside))
  4356. })
  4357. }
  4358. if ((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !aj) {
  4359. ak.push(function(al) {
  4360. this._trigger("update", al, this._uiHash())
  4361. })
  4362. }
  4363. if (this !== this.currentContainer) {
  4364. if (!aj) {
  4365. ak.push(function(al) {
  4366. this._trigger("remove", al, this._uiHash())
  4367. });
  4368. ak.push((function(al) {
  4369. return function(am) {
  4370. al._trigger("receive", am, this._uiHash(this))
  4371. }
  4372. }
  4373. ).call(this, this.currentContainer));
  4374. ak.push((function(al) {
  4375. return function(am) {
  4376. al._trigger("update", am, this._uiHash(this))
  4377. }
  4378. }
  4379. ).call(this, this.currentContainer))
  4380. }
  4381. }
  4382. function ai(an, al, am) {
  4383. return function(ao) {
  4384. am._trigger(an, ao, al._uiHash(al))
  4385. }
  4386. }
  4387. for (ag = this.containers.length - 1; ag >= 0; ag--) {
  4388. if (!aj) {
  4389. ak.push(ai("deactivate", this, this.containers[ag]))
  4390. }
  4391. if (this.containers[ag].containerCache.over) {
  4392. ak.push(ai("out", this, this.containers[ag]));
  4393. this.containers[ag].containerCache.over = 0
  4394. }
  4395. }
  4396. if (this.storedCursor) {
  4397. this.document.find("body").css("cursor", this.storedCursor);
  4398. this.storedStylesheet.remove()
  4399. }
  4400. if (this._storedOpacity) {
  4401. this.helper.css("opacity", this._storedOpacity)
  4402. }
  4403. if (this._storedZIndex) {
  4404. this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex)
  4405. }
  4406. this.dragging = false;
  4407. if (!aj) {
  4408. this._trigger("beforeStop", ah, this._uiHash())
  4409. }
  4410. this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
  4411. if (!this.cancelHelperRemoval) {
  4412. if (this.helper[0] !== this.currentItem[0]) {
  4413. this.helper.remove()
  4414. }
  4415. this.helper = null
  4416. }
  4417. if (!aj) {
  4418. for (ag = 0; ag < ak.length; ag++) {
  4419. ak[ag].call(this, ah)
  4420. }
  4421. this._trigger("stop", ah, this._uiHash())
  4422. }
  4423. this.fromOutside = false;
  4424. return !this.cancelHelperRemoval
  4425. },
  4426. _trigger: function() {
  4427. if (K.Widget.prototype._trigger.apply(this, arguments) === false) {
  4428. this.cancel()
  4429. }
  4430. },
  4431. _uiHash: function(ag) {
  4432. var ah = ag || this;
  4433. return {
  4434. helper: ah.helper,
  4435. placeholder: ah.placeholder || K([]),
  4436. position: ah.position,
  4437. originalPosition: ah.originalPosition,
  4438. offset: ah.positionAbs,
  4439. item: ah.currentItem,
  4440. sender: ag ? ag.element : null
  4441. }
  4442. }
  4443. });
  4444. /*!
  4445. * jQuery UI Datepicker 1.12.1
  4446. * http://jqueryui.com
  4447. *
  4448. * Copyright jQuery Foundation and other contributors
  4449. * Released under the MIT license.
  4450. * http://jquery.org/license
  4451. */
  4452. K.extend(K.ui, {
  4453. datepicker: {
  4454. version: "1.12.1"
  4455. }
  4456. });
  4457. var q;
  4458. function y(ah) {
  4459. var ag, ai;
  4460. while (ah.length && ah[0] !== document) {
  4461. ag = ah.css("position");
  4462. if (ag === "absolute" || ag === "relative" || ag === "fixed") {
  4463. ai = parseInt(ah.css("zIndex"), 10);
  4464. if (!isNaN(ai) && ai !== 0) {
  4465. return ai
  4466. }
  4467. }
  4468. ah = ah.parent()
  4469. }
  4470. return 0
  4471. }
  4472. function ac() {
  4473. this._curInst = null;
  4474. this._keyEvent = false;
  4475. this._disabledInputs = [];
  4476. this._datepickerShowing = false;
  4477. this._inDialog = false;
  4478. this._mainDivId = "ui-datepicker-div";
  4479. this._inlineClass = "ui-datepicker-inline";
  4480. this._appendClass = "ui-datepicker-append";
  4481. this._triggerClass = "ui-datepicker-trigger";
  4482. this._dialogClass = "ui-datepicker-dialog";
  4483. this._disableClass = "ui-datepicker-disabled";
  4484. this._unselectableClass = "ui-datepicker-unselectable";
  4485. this._currentClass = "ui-datepicker-current-day";
  4486. this._dayOverClass = "ui-datepicker-days-cell-over";
  4487. this.regional = [];
  4488. this.regional[""] = {
  4489. closeText: "Done",
  4490. prevText: "Prev",
  4491. nextText: "Next",
  4492. currentText: "Today",
  4493. monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  4494. monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  4495. dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  4496. dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  4497. dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  4498. weekHeader: "Wk",
  4499. dateFormat: "mm/dd/yy",
  4500. firstDay: 0,
  4501. isRTL: false,
  4502. showMonthAfterYear: false,
  4503. yearSuffix: ""
  4504. };
  4505. this._defaults = {
  4506. showOn: "focus",
  4507. showAnim: "fadeIn",
  4508. showOptions: {},
  4509. defaultDate: null,
  4510. appendText: "",
  4511. buttonText: "...",
  4512. buttonImage: "",
  4513. buttonImageOnly: false,
  4514. hideIfNoPrevNext: false,
  4515. navigationAsDateFormat: false,
  4516. gotoCurrent: false,
  4517. changeMonth: false,
  4518. changeYear: false,
  4519. yearRange: "c-10:c+10",
  4520. showOtherMonths: false,
  4521. selectOtherMonths: false,
  4522. showWeek: false,
  4523. calculateWeek: this.iso8601Week,
  4524. shortYearCutoff: "+10",
  4525. minDate: null,
  4526. maxDate: null,
  4527. duration: "fast",
  4528. beforeShowDay: null,
  4529. beforeShow: null,
  4530. onSelect: null,
  4531. onChangeMonthYear: null,
  4532. onClose: null,
  4533. numberOfMonths: 1,
  4534. showCurrentAtPos: 0,
  4535. stepMonths: 1,
  4536. stepBigMonths: 12,
  4537. altField: "",
  4538. altFormat: "",
  4539. constrainInput: true,
  4540. showButtonPanel: false,
  4541. autoSize: false,
  4542. disabled: false
  4543. };
  4544. K.extend(this._defaults, this.regional[""]);
  4545. this.regional.en = K.extend(true, {}, this.regional[""]);
  4546. this.regional["en-US"] = K.extend(true, {}, this.regional.en);
  4547. this.dpDiv = l(K("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))
  4548. }
  4549. K.extend(ac.prototype, {
  4550. markerClassName: "hasDatepicker",
  4551. maxRows: 4,
  4552. _widgetDatepicker: function() {
  4553. return this.dpDiv
  4554. },
  4555. setDefaults: function(ag) {
  4556. F(this._defaults, ag || {});
  4557. return this
  4558. },
  4559. _attachDatepicker: function(aj, ag) {
  4560. var ak, ai, ah;
  4561. ak = aj.nodeName.toLowerCase();
  4562. ai = (ak === "div" || ak === "span");
  4563. if (!aj.id) {
  4564. this.uuid += 1;
  4565. aj.id = "dp" + this.uuid
  4566. }
  4567. ah = this._newInst(K(aj), ai);
  4568. ah.settings = K.extend({}, ag || {});
  4569. if (ak === "input") {
  4570. this._connectDatepicker(aj, ah)
  4571. } else {
  4572. if (ai) {
  4573. this._inlineDatepicker(aj, ah)
  4574. }
  4575. }
  4576. },
  4577. _newInst: function(ah, ag) {
  4578. var ai = ah[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1");
  4579. return {
  4580. id: ai,
  4581. input: ah,
  4582. selectedDay: 0,
  4583. selectedMonth: 0,
  4584. selectedYear: 0,
  4585. drawMonth: 0,
  4586. drawYear: 0,
  4587. inline: ag,
  4588. dpDiv: (!ag ? this.dpDiv : l(K("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))
  4589. }
  4590. },
  4591. _connectDatepicker: function(ai, ah) {
  4592. var ag = K(ai);
  4593. ah.append = K([]);
  4594. ah.trigger = K([]);
  4595. if (ag.hasClass(this.markerClassName)) {
  4596. return
  4597. }
  4598. this._attachments(ag, ah);
  4599. ag.addClass(this.markerClassName).on("keydown", this._doKeyDown).on("keypress", this._doKeyPress).on("keyup", this._doKeyUp);
  4600. this._autoSize(ah);
  4601. K.data(ai, "datepicker", ah);
  4602. if (ah.settings.disabled) {
  4603. this._disableDatepicker(ai)
  4604. }
  4605. },
  4606. _attachments: function(ai, al) {
  4607. var ah, ak, ag, am = this._get(al, "appendText"), aj = this._get(al, "isRTL");
  4608. if (al.append) {
  4609. al.append.remove()
  4610. }
  4611. if (am) {
  4612. al.append = K("<span class='" + this._appendClass + "'>" + am + "</span>");
  4613. ai[aj ? "before" : "after"](al.append)
  4614. }
  4615. ai.off("focus", this._showDatepicker);
  4616. if (al.trigger) {
  4617. al.trigger.remove()
  4618. }
  4619. ah = this._get(al, "showOn");
  4620. if (ah === "focus" || ah === "both") {
  4621. ai.on("focus", this._showDatepicker)
  4622. }
  4623. if (ah === "button" || ah === "both") {
  4624. ak = this._get(al, "buttonText");
  4625. ag = this._get(al, "buttonImage");
  4626. al.trigger = K(this._get(al, "buttonImageOnly") ? K("<img/>").addClass(this._triggerClass).attr({
  4627. src: ag,
  4628. alt: ak,
  4629. title: ak
  4630. }) : K("<button type='button'></button>").addClass(this._triggerClass).html(!ag ? ak : K("<img/>").attr({
  4631. src: ag,
  4632. alt: ak,
  4633. title: ak
  4634. })));
  4635. ai[aj ? "before" : "after"](al.trigger);
  4636. al.trigger.on("click", function() {
  4637. if (K.datepicker._datepickerShowing && K.datepicker._lastInput === ai[0]) {
  4638. K.datepicker._hideDatepicker()
  4639. } else {
  4640. if (K.datepicker._datepickerShowing && K.datepicker._lastInput !== ai[0]) {
  4641. K.datepicker._hideDatepicker();
  4642. K.datepicker._showDatepicker(ai[0])
  4643. } else {
  4644. K.datepicker._showDatepicker(ai[0])
  4645. }
  4646. }
  4647. return false
  4648. })
  4649. }
  4650. },
  4651. _autoSize: function(am) {
  4652. if (this._get(am, "autoSize") && !am.inline) {
  4653. var aj, ah, ai, al, ak = new Date(2009,12 - 1,20), ag = this._get(am, "dateFormat");
  4654. if (ag.match(/[DM]/)) {
  4655. aj = function(an) {
  4656. ah = 0;
  4657. ai = 0;
  4658. for (al = 0; al < an.length; al++) {
  4659. if (an[al].length > ah) {
  4660. ah = an[al].length;
  4661. ai = al
  4662. }
  4663. }
  4664. return ai
  4665. }
  4666. ;
  4667. ak.setMonth(aj(this._get(am, (ag.match(/MM/) ? "monthNames" : "monthNamesShort"))));
  4668. ak.setDate(aj(this._get(am, (ag.match(/DD/) ? "dayNames" : "dayNamesShort"))) + 20 - ak.getDay())
  4669. }
  4670. am.input.attr("size", this._formatDate(am, ak).length)
  4671. }
  4672. },
  4673. _inlineDatepicker: function(ah, ag) {
  4674. var ai = K(ah);
  4675. if (ai.hasClass(this.markerClassName)) {
  4676. return
  4677. }
  4678. ai.addClass(this.markerClassName).append(ag.dpDiv);
  4679. K.data(ah, "datepicker", ag);
  4680. this._setDate(ag, this._getDefaultDate(ag), true);
  4681. this._updateDatepicker(ag);
  4682. this._updateAlternate(ag);
  4683. if (ag.settings.disabled) {
  4684. this._disableDatepicker(ah)
  4685. }
  4686. ag.dpDiv.css("display", "block")
  4687. },
  4688. _dialogDatepicker: function(an, ah, al, ai, am) {
  4689. var ag, aq, ak, ap, ao, aj = this._dialogInst;
  4690. if (!aj) {
  4691. this.uuid += 1;
  4692. ag = "dp" + this.uuid;
  4693. this._dialogInput = K("<input type='text' id='" + ag + "' style='position: absolute; top: -100px; width: 0px;'/>");
  4694. this._dialogInput.on("keydown", this._doKeyDown);
  4695. K("body").append(this._dialogInput);
  4696. aj = this._dialogInst = this._newInst(this._dialogInput, false);
  4697. aj.settings = {};
  4698. K.data(this._dialogInput[0], "datepicker", aj)
  4699. }
  4700. F(aj.settings, ai || {});
  4701. ah = (ah && ah.constructor === Date ? this._formatDate(aj, ah) : ah);
  4702. this._dialogInput.val(ah);
  4703. this._pos = (am ? (am.length ? am : [am.pageX, am.pageY]) : null);
  4704. if (!this._pos) {
  4705. aq = document.documentElement.clientWidth;
  4706. ak = document.documentElement.clientHeight;
  4707. ap = document.documentElement.scrollLeft || document.body.scrollLeft;
  4708. ao = document.documentElement.scrollTop || document.body.scrollTop;
  4709. this._pos = [(aq / 2) - 100 + ap, (ak / 2) - 150 + ao]
  4710. }
  4711. this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
  4712. aj.settings.onSelect = al;
  4713. this._inDialog = true;
  4714. this.dpDiv.addClass(this._dialogClass);
  4715. this._showDatepicker(this._dialogInput[0]);
  4716. if (K.blockUI) {
  4717. K.blockUI(this.dpDiv)
  4718. }
  4719. K.data(this._dialogInput[0], "datepicker", aj);
  4720. return this
  4721. },
  4722. _destroyDatepicker: function(ai) {
  4723. var aj, ag = K(ai), ah = K.data(ai, "datepicker");
  4724. if (!ag.hasClass(this.markerClassName)) {
  4725. return
  4726. }
  4727. aj = ai.nodeName.toLowerCase();
  4728. K.removeData(ai, "datepicker");
  4729. if (aj === "input") {
  4730. ah.append.remove();
  4731. ah.trigger.remove();
  4732. ag.removeClass(this.markerClassName).off("focus", this._showDatepicker).off("keydown", this._doKeyDown).off("keypress", this._doKeyPress).off("keyup", this._doKeyUp)
  4733. } else {
  4734. if (aj === "div" || aj === "span") {
  4735. ag.removeClass(this.markerClassName).empty()
  4736. }
  4737. }
  4738. if (q === ah) {
  4739. q = null
  4740. }
  4741. },
  4742. _enableDatepicker: function(aj) {
  4743. var ak, ai, ag = K(aj), ah = K.data(aj, "datepicker");
  4744. if (!ag.hasClass(this.markerClassName)) {
  4745. return
  4746. }
  4747. ak = aj.nodeName.toLowerCase();
  4748. if (ak === "input") {
  4749. aj.disabled = false;
  4750. ah.trigger.filter("button").each(function() {
  4751. this.disabled = false
  4752. }).end().filter("img").css({
  4753. opacity: "1.0",
  4754. cursor: ""
  4755. })
  4756. } else {
  4757. if (ak === "div" || ak === "span") {
  4758. ai = ag.children("." + this._inlineClass);
  4759. ai.children().removeClass("ui-state-disabled");
  4760. ai.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", false)
  4761. }
  4762. }
  4763. this._disabledInputs = K.map(this._disabledInputs, function(al) {
  4764. return (al === aj ? null : al)
  4765. })
  4766. },
  4767. _disableDatepicker: function(aj) {
  4768. var ak, ai, ag = K(aj), ah = K.data(aj, "datepicker");
  4769. if (!ag.hasClass(this.markerClassName)) {
  4770. return
  4771. }
  4772. ak = aj.nodeName.toLowerCase();
  4773. if (ak === "input") {
  4774. aj.disabled = true;
  4775. ah.trigger.filter("button").each(function() {
  4776. this.disabled = true
  4777. }).end().filter("img").css({
  4778. opacity: "0.5",
  4779. cursor: "default"
  4780. })
  4781. } else {
  4782. if (ak === "div" || ak === "span") {
  4783. ai = ag.children("." + this._inlineClass);
  4784. ai.children().addClass("ui-state-disabled");
  4785. ai.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", true)
  4786. }
  4787. }
  4788. this._disabledInputs = K.map(this._disabledInputs, function(al) {
  4789. return (al === aj ? null : al)
  4790. });
  4791. this._disabledInputs[this._disabledInputs.length] = aj
  4792. },
  4793. _isDisabledDatepicker: function(ah) {
  4794. if (!ah) {
  4795. return false
  4796. }
  4797. for (var ag = 0; ag < this._disabledInputs.length; ag++) {
  4798. if (this._disabledInputs[ag] === ah) {
  4799. return true
  4800. }
  4801. }
  4802. return false
  4803. },
  4804. _getInst: function(ah) {
  4805. try {
  4806. return K.data(ah, "datepicker")
  4807. } catch (ag) {
  4808. throw "Missing instance data for this datepicker"
  4809. }
  4810. },
  4811. _optionDatepicker: function(am, ah, al) {
  4812. var ai, ag, ak, an, aj = this._getInst(am);
  4813. if (arguments.length === 2 && typeof ah === "string") {
  4814. return (ah === "defaults" ? K.extend({}, K.datepicker._defaults) : (aj ? (ah === "all" ? K.extend({}, aj.settings) : this._get(aj, ah)) : null))
  4815. }
  4816. ai = ah || {};
  4817. if (typeof ah === "string") {
  4818. ai = {};
  4819. ai[ah] = al
  4820. }
  4821. if (aj) {
  4822. if (this._curInst === aj) {
  4823. this._hideDatepicker()
  4824. }
  4825. ag = this._getDateDatepicker(am, true);
  4826. ak = this._getMinMaxDate(aj, "min");
  4827. an = this._getMinMaxDate(aj, "max");
  4828. F(aj.settings, ai);
  4829. if (ak !== null && ai.dateFormat !== undefined && ai.minDate === undefined) {
  4830. aj.settings.minDate = this._formatDate(aj, ak)
  4831. }
  4832. if (an !== null && ai.dateFormat !== undefined && ai.maxDate === undefined) {
  4833. aj.settings.maxDate = this._formatDate(aj, an)
  4834. }
  4835. if ("disabled"in ai) {
  4836. if (ai.disabled) {
  4837. this._disableDatepicker(am)
  4838. } else {
  4839. this._enableDatepicker(am)
  4840. }
  4841. }
  4842. this._attachments(K(am), aj);
  4843. this._autoSize(aj);
  4844. this._setDate(aj, ag);
  4845. this._updateAlternate(aj);
  4846. this._updateDatepicker(aj)
  4847. }
  4848. },
  4849. _changeDatepicker: function(ai, ag, ah) {
  4850. this._optionDatepicker(ai, ag, ah)
  4851. },
  4852. _refreshDatepicker: function(ah) {
  4853. var ag = this._getInst(ah);
  4854. if (ag) {
  4855. this._updateDatepicker(ag)
  4856. }
  4857. },
  4858. _setDateDatepicker: function(ai, ag) {
  4859. var ah = this._getInst(ai);
  4860. if (ah) {
  4861. this._setDate(ah, ag);
  4862. this._updateDatepicker(ah);
  4863. this._updateAlternate(ah)
  4864. }
  4865. },
  4866. _getDateDatepicker: function(ai, ag) {
  4867. var ah = this._getInst(ai);
  4868. if (ah && !ah.inline) {
  4869. this._setDateFromField(ah, ag)
  4870. }
  4871. return (ah ? this._getDate(ah) : null)
  4872. },
  4873. _doKeyDown: function(aj) {
  4874. var ah, ag, al, ak = K.datepicker._getInst(aj.target), am = true, ai = ak.dpDiv.is(".ui-datepicker-rtl");
  4875. ak._keyEvent = true;
  4876. if (K.datepicker._datepickerShowing) {
  4877. switch (aj.keyCode) {
  4878. case 9:
  4879. K.datepicker._hideDatepicker();
  4880. am = false;
  4881. break;
  4882. case 13:
  4883. al = K("td." + K.datepicker._dayOverClass + ":not(." + K.datepicker._currentClass + ")", ak.dpDiv);
  4884. if (al[0]) {
  4885. K.datepicker._selectDay(aj.target, ak.selectedMonth, ak.selectedYear, al[0])
  4886. }
  4887. ah = K.datepicker._get(ak, "onSelect");
  4888. if (ah) {
  4889. ag = K.datepicker._formatDate(ak);
  4890. ah.apply((ak.input ? ak.input[0] : null), [ag, ak])
  4891. } else {
  4892. K.datepicker._hideDatepicker()
  4893. }
  4894. return false;
  4895. case 27:
  4896. K.datepicker._hideDatepicker();
  4897. break;
  4898. case 33:
  4899. K.datepicker._adjustDate(aj.target, (aj.ctrlKey ? -K.datepicker._get(ak, "stepBigMonths") : -K.datepicker._get(ak, "stepMonths")), "M");
  4900. break;
  4901. case 34:
  4902. K.datepicker._adjustDate(aj.target, (aj.ctrlKey ? +K.datepicker._get(ak, "stepBigMonths") : +K.datepicker._get(ak, "stepMonths")), "M");
  4903. break;
  4904. case 35:
  4905. if (aj.ctrlKey || aj.metaKey) {
  4906. K.datepicker._clearDate(aj.target)
  4907. }
  4908. am = aj.ctrlKey || aj.metaKey;
  4909. break;
  4910. case 36:
  4911. if (aj.ctrlKey || aj.metaKey) {
  4912. K.datepicker._gotoToday(aj.target)
  4913. }
  4914. am = aj.ctrlKey || aj.metaKey;
  4915. break;
  4916. case 37:
  4917. if (aj.ctrlKey || aj.metaKey) {
  4918. K.datepicker._adjustDate(aj.target, (ai ? +1 : -1), "D")
  4919. }
  4920. am = aj.ctrlKey || aj.metaKey;
  4921. if (aj.originalEvent.altKey) {
  4922. K.datepicker._adjustDate(aj.target, (aj.ctrlKey ? -K.datepicker._get(ak, "stepBigMonths") : -K.datepicker._get(ak, "stepMonths")), "M")
  4923. }
  4924. break;
  4925. case 38:
  4926. if (aj.ctrlKey || aj.metaKey) {
  4927. K.datepicker._adjustDate(aj.target, -7, "D")
  4928. }
  4929. am = aj.ctrlKey || aj.metaKey;
  4930. break;
  4931. case 39:
  4932. if (aj.ctrlKey || aj.metaKey) {
  4933. K.datepicker._adjustDate(aj.target, (ai ? -1 : +1), "D")
  4934. }
  4935. am = aj.ctrlKey || aj.metaKey;
  4936. if (aj.originalEvent.altKey) {
  4937. K.datepicker._adjustDate(aj.target, (aj.ctrlKey ? +K.datepicker._get(ak, "stepBigMonths") : +K.datepicker._get(ak, "stepMonths")), "M")
  4938. }
  4939. break;
  4940. case 40:
  4941. if (aj.ctrlKey || aj.metaKey) {
  4942. K.datepicker._adjustDate(aj.target, +7, "D")
  4943. }
  4944. am = aj.ctrlKey || aj.metaKey;
  4945. break;
  4946. default:
  4947. am = false
  4948. }
  4949. } else {
  4950. if (aj.keyCode === 36 && aj.ctrlKey) {
  4951. K.datepicker._showDatepicker(this)
  4952. } else {
  4953. am = false
  4954. }
  4955. }
  4956. if (am) {
  4957. aj.preventDefault();
  4958. aj.stopPropagation()
  4959. }
  4960. },
  4961. _doKeyPress: function(ai) {
  4962. var ah, ag, aj = K.datepicker._getInst(ai.target);
  4963. if (K.datepicker._get(aj, "constrainInput")) {
  4964. ah = K.datepicker._possibleChars(K.datepicker._get(aj, "dateFormat"));
  4965. ag = String.fromCharCode(ai.charCode == null ? ai.keyCode : ai.charCode);
  4966. return ai.ctrlKey || ai.metaKey || (ag < " " || !ah || ah.indexOf(ag) > -1)
  4967. }
  4968. },
  4969. _doKeyUp: function(ai) {
  4970. var ag, aj = K.datepicker._getInst(ai.target);
  4971. if (aj.input.val() !== aj.lastVal) {
  4972. try {
  4973. ag = K.datepicker.parseDate(K.datepicker._get(aj, "dateFormat"), (aj.input ? aj.input.val() : null), K.datepicker._getFormatConfig(aj));
  4974. if (ag) {
  4975. K.datepicker._setDateFromField(aj);
  4976. K.datepicker._updateAlternate(aj);
  4977. K.datepicker._updateDatepicker(aj)
  4978. }
  4979. } catch (ah) {}
  4980. }
  4981. return true
  4982. },
  4983. _showDatepicker: function(ah) {
  4984. ah = ah.target || ah;
  4985. if (ah.nodeName.toLowerCase() !== "input") {
  4986. ah = K("input", ah.parentNode)[0]
  4987. }
  4988. if (K.datepicker._isDisabledDatepicker(ah) || K.datepicker._lastInput === ah) {
  4989. return
  4990. }
  4991. var aj, an, ai, al, am, ag, ak;
  4992. aj = K.datepicker._getInst(ah);
  4993. if (K.datepicker._curInst && K.datepicker._curInst !== aj) {
  4994. K.datepicker._curInst.dpDiv.stop(true, true);
  4995. if (aj && K.datepicker._datepickerShowing) {
  4996. K.datepicker._hideDatepicker(K.datepicker._curInst.input[0])
  4997. }
  4998. }
  4999. an = K.datepicker._get(aj, "beforeShow");
  5000. ai = an ? an.apply(ah, [ah, aj]) : {};
  5001. if (ai === false) {
  5002. return
  5003. }
  5004. F(aj.settings, ai);
  5005. aj.lastVal = null;
  5006. K.datepicker._lastInput = ah;
  5007. K.datepicker._setDateFromField(aj);
  5008. if (K.datepicker._inDialog) {
  5009. ah.value = ""
  5010. }
  5011. if (!K.datepicker._pos) {
  5012. K.datepicker._pos = K.datepicker._findPos(ah);
  5013. K.datepicker._pos[1] += ah.offsetHeight
  5014. }
  5015. al = false;
  5016. K(ah).parents().each(function() {
  5017. al |= K(this).css("position") === "fixed";
  5018. return !al
  5019. });
  5020. am = {
  5021. left: K.datepicker._pos[0],
  5022. top: K.datepicker._pos[1]
  5023. };
  5024. K.datepicker._pos = null;
  5025. aj.dpDiv.empty();
  5026. aj.dpDiv.css({
  5027. position: "absolute",
  5028. display: "block",
  5029. top: "-1000px"
  5030. });
  5031. K.datepicker._updateDatepicker(aj);
  5032. am = K.datepicker._checkOffset(aj, am, al);
  5033. aj.dpDiv.css({
  5034. position: (K.datepicker._inDialog && K.blockUI ? "static" : (al ? "fixed" : "absolute")),
  5035. display: "none",
  5036. left: am.left + "px",
  5037. top: am.top + "px"
  5038. });
  5039. if (!aj.inline) {
  5040. ag = K.datepicker._get(aj, "showAnim");
  5041. ak = K.datepicker._get(aj, "duration");
  5042. aj.dpDiv.css("z-index", y(K(ah)) + 1);
  5043. K.datepicker._datepickerShowing = true;
  5044. if (K.effects && K.effects.effect[ag]) {
  5045. aj.dpDiv.show(ag, K.datepicker._get(aj, "showOptions"), ak)
  5046. } else {
  5047. aj.dpDiv[ag || "show"](ag ? ak : null)
  5048. }
  5049. if (K.datepicker._shouldFocusInput(aj)) {
  5050. aj.input.trigger("focus")
  5051. }
  5052. K.datepicker._curInst = aj
  5053. }
  5054. },
  5055. _updateDatepicker: function(aj) {
  5056. this.maxRows = 4;
  5057. q = aj;
  5058. aj.dpDiv.empty().append(this._generateHTML(aj));
  5059. this._attachHandlers(aj);
  5060. var al, ag = this._getNumberOfMonths(aj), ak = ag[1], ai = 17, ah = aj.dpDiv.find("." + this._dayOverClass + " a");
  5061. if (ah.length > 0) {
  5062. v.apply(ah.get(0))
  5063. }
  5064. aj.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
  5065. if (ak > 1) {
  5066. aj.dpDiv.addClass("ui-datepicker-multi-" + ak).css("width", (ai * ak) + "em")
  5067. }
  5068. aj.dpDiv[(ag[0] !== 1 || ag[1] !== 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi");
  5069. aj.dpDiv[(this._get(aj, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl");
  5070. if (aj === K.datepicker._curInst && K.datepicker._datepickerShowing && K.datepicker._shouldFocusInput(aj)) {
  5071. aj.input.trigger("focus")
  5072. }
  5073. if (aj.yearshtml) {
  5074. al = aj.yearshtml;
  5075. setTimeout(function() {
  5076. if (al === aj.yearshtml && aj.yearshtml) {
  5077. aj.dpDiv.find("select.ui-datepicker-year:first").replaceWith(aj.yearshtml)
  5078. }
  5079. al = aj.yearshtml = null
  5080. }, 0)
  5081. }
  5082. },
  5083. _shouldFocusInput: function(ag) {
  5084. return ag.input && ag.input.is(":visible") && !ag.input.is(":disabled") && !ag.input.is(":focus")
  5085. },
  5086. _checkOffset: function(al, aj, ai) {
  5087. var ak = al.dpDiv.outerWidth()
  5088. , ao = al.dpDiv.outerHeight()
  5089. , an = al.input ? al.input.outerWidth() : 0
  5090. , ag = al.input ? al.input.outerHeight() : 0
  5091. , am = document.documentElement.clientWidth + (ai ? 0 : K(document).scrollLeft())
  5092. , ah = document.documentElement.clientHeight + (ai ? 0 : K(document).scrollTop());
  5093. aj.left -= (this._get(al, "isRTL") ? (ak - an) : 0);
  5094. aj.left -= (ai && aj.left === al.input.offset().left) ? K(document).scrollLeft() : 0;
  5095. aj.top -= (ai && aj.top === (al.input.offset().top + ag)) ? K(document).scrollTop() : 0;
  5096. aj.left -= Math.min(aj.left, (aj.left + ak > am && am > ak) ? Math.abs(aj.left + ak - am) : 0);
  5097. aj.top -= Math.min(aj.top, (aj.top + ao > ah && ah > ao) ? Math.abs(ao + ag) : 0);
  5098. return aj
  5099. },
  5100. _findPos: function(aj) {
  5101. var ag, ai = this._getInst(aj), ah = this._get(ai, "isRTL");
  5102. while (aj && (aj.type === "hidden" || aj.nodeType !== 1 || K.expr.filters.hidden(aj))) {
  5103. aj = aj[ah ? "previousSibling" : "nextSibling"]
  5104. }
  5105. ag = K(aj).offset();
  5106. return [ag.left, ag.top]
  5107. },
  5108. _hideDatepicker: function(ai) {
  5109. var ah, al, ak, ag, aj = this._curInst;
  5110. if (!aj || (ai && aj !== K.data(ai, "datepicker"))) {
  5111. return
  5112. }
  5113. if (this._datepickerShowing) {
  5114. ah = this._get(aj, "showAnim");
  5115. al = this._get(aj, "duration");
  5116. ak = function() {
  5117. K.datepicker._tidyDialog(aj)
  5118. }
  5119. ;
  5120. if (K.effects && (K.effects.effect[ah] || K.effects[ah])) {
  5121. aj.dpDiv.hide(ah, K.datepicker._get(aj, "showOptions"), al, ak)
  5122. } else {
  5123. aj.dpDiv[(ah === "slideDown" ? "slideUp" : (ah === "fadeIn" ? "fadeOut" : "hide"))]((ah ? al : null), ak)
  5124. }
  5125. if (!ah) {
  5126. ak()
  5127. }
  5128. this._datepickerShowing = false;
  5129. ag = this._get(aj, "onClose");
  5130. if (ag) {
  5131. ag.apply((aj.input ? aj.input[0] : null), [(aj.input ? aj.input.val() : ""), aj])
  5132. }
  5133. this._lastInput = null;
  5134. if (this._inDialog) {
  5135. this._dialogInput.css({
  5136. position: "absolute",
  5137. left: "0",
  5138. top: "-100px"
  5139. });
  5140. if (K.blockUI) {
  5141. K.unblockUI();
  5142. K("body").append(this.dpDiv)
  5143. }
  5144. }
  5145. this._inDialog = false
  5146. }
  5147. },
  5148. _tidyDialog: function(ag) {
  5149. ag.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")
  5150. },
  5151. _checkExternalClick: function(ah) {
  5152. if (!K.datepicker._curInst) {
  5153. return
  5154. }
  5155. var ag = K(ah.target)
  5156. , ai = K.datepicker._getInst(ag[0]);
  5157. if (((ag[0].id !== K.datepicker._mainDivId && ag.parents("#" + K.datepicker._mainDivId).length === 0 && !ag.hasClass(K.datepicker.markerClassName) && !ag.closest("." + K.datepicker._triggerClass).length && K.datepicker._datepickerShowing && !(K.datepicker._inDialog && K.blockUI))) || (ag.hasClass(K.datepicker.markerClassName) && K.datepicker._curInst !== ai)) {
  5158. K.datepicker._hideDatepicker()
  5159. }
  5160. },
  5161. _adjustDate: function(ak, aj, ai) {
  5162. var ah = K(ak)
  5163. , ag = this._getInst(ah[0]);
  5164. if (this._isDisabledDatepicker(ah[0])) {
  5165. return
  5166. }
  5167. this._adjustInstDate(ag, aj + (ai === "M" ? this._get(ag, "showCurrentAtPos") : 0), ai);
  5168. this._updateDatepicker(ag)
  5169. },
  5170. _gotoToday: function(aj) {
  5171. var ag, ai = K(aj), ah = this._getInst(ai[0]);
  5172. if (this._get(ah, "gotoCurrent") && ah.currentDay) {
  5173. ah.selectedDay = ah.currentDay;
  5174. ah.drawMonth = ah.selectedMonth = ah.currentMonth;
  5175. ah.drawYear = ah.selectedYear = ah.currentYear
  5176. } else {
  5177. ag = new Date();
  5178. ah.selectedDay = ag.getDate();
  5179. ah.drawMonth = ah.selectedMonth = ag.getMonth();
  5180. ah.drawYear = ah.selectedYear = ag.getFullYear()
  5181. }
  5182. this._notifyChange(ah);
  5183. this._adjustDate(ai)
  5184. },
  5185. _selectMonthYear: function(ak, ag, aj) {
  5186. var ai = K(ak)
  5187. , ah = this._getInst(ai[0]);
  5188. ah["selected" + (aj === "M" ? "Month" : "Year")] = ah["draw" + (aj === "M" ? "Month" : "Year")] = parseInt(ag.options[ag.selectedIndex].value, 10);
  5189. this._notifyChange(ah);
  5190. this._adjustDate(ai)
  5191. },
  5192. _selectDay: function(al, aj, ag, ak) {
  5193. var ah, ai = K(al);
  5194. if (K(ak).hasClass(this._unselectableClass) || this._isDisabledDatepicker(ai[0])) {
  5195. return
  5196. }
  5197. ah = this._getInst(ai[0]);
  5198. ah.selectedDay = ah.currentDay = K("a", ak).html();
  5199. ah.selectedMonth = ah.currentMonth = aj;
  5200. ah.selectedYear = ah.currentYear = ag;
  5201. this._selectDate(al, this._formatDate(ah, ah.currentDay, ah.currentMonth, ah.currentYear))
  5202. },
  5203. _clearDate: function(ah) {
  5204. var ag = K(ah);
  5205. this._selectDate(ag, "")
  5206. },
  5207. _selectDate: function(ak, ag) {
  5208. var ah, aj = K(ak), ai = this._getInst(aj[0]);
  5209. ag = (ag != null ? ag : this._formatDate(ai));
  5210. if (ai.input) {
  5211. ai.input.val(ag)
  5212. }
  5213. this._updateAlternate(ai);
  5214. ah = this._get(ai, "onSelect");
  5215. if (ah) {
  5216. ah.apply((ai.input ? ai.input[0] : null), [ag, ai])
  5217. } else {
  5218. if (ai.input) {
  5219. ai.input.trigger("change")
  5220. }
  5221. }
  5222. if (ai.inline) {
  5223. this._updateDatepicker(ai)
  5224. } else {
  5225. this._hideDatepicker();
  5226. this._lastInput = ai.input[0];
  5227. if (typeof (ai.input[0]) !== "object") {
  5228. ai.input.trigger("focus")
  5229. }
  5230. this._lastInput = null
  5231. }
  5232. },
  5233. _updateAlternate: function(ak) {
  5234. var aj, ai, ag, ah = this._get(ak, "altField");
  5235. if (ah) {
  5236. aj = this._get(ak, "altFormat") || this._get(ak, "dateFormat");
  5237. ai = this._getDate(ak);
  5238. ag = this.formatDate(aj, ai, this._getFormatConfig(ak));
  5239. K(ah).val(ag)
  5240. }
  5241. },
  5242. noWeekends: function(ah) {
  5243. var ag = ah.getDay();
  5244. return [(ag > 0 && ag < 6), ""]
  5245. },
  5246. iso8601Week: function(ag) {
  5247. var ah, ai = new Date(ag.getTime());
  5248. ai.setDate(ai.getDate() + 4 - (ai.getDay() || 7));
  5249. ah = ai.getTime();
  5250. ai.setMonth(0);
  5251. ai.setDate(1);
  5252. return Math.floor(Math.round((ah - ai) / 86400000) / 7) + 1
  5253. },
  5254. parseDate: function(ax, ar, az) {
  5255. if (ax == null || ar == null) {
  5256. throw "Invalid arguments"
  5257. }
  5258. ar = (typeof ar === "object" ? ar.toString() : ar + "");
  5259. if (ar === "") {
  5260. return null
  5261. }
  5262. var aj, au, ah, ay = 0, am = (az ? az.shortYearCutoff : null) || this._defaults.shortYearCutoff, ai = (typeof am !== "string" ? am : new Date().getFullYear() % 100 + parseInt(am, 10)), ap = (az ? az.dayNamesShort : null) || this._defaults.dayNamesShort, aB = (az ? az.dayNames : null) || this._defaults.dayNames, ag = (az ? az.monthNamesShort : null) || this._defaults.monthNamesShort, ak = (az ? az.monthNames : null) || this._defaults.monthNames, al = -1, aC = -1, aw = -1, ao = -1, av = false, aA, aq = function(aE) {
  5263. var aF = (aj + 1 < ax.length && ax.charAt(aj + 1) === aE);
  5264. if (aF) {
  5265. aj++
  5266. }
  5267. return aF
  5268. }, aD = function(aG) {
  5269. var aE = aq(aG)
  5270. , aH = (aG === "@" ? 14 : (aG === "!" ? 20 : (aG === "y" && aE ? 4 : (aG === "o" ? 3 : 2))))
  5271. , aJ = (aG === "y" ? aH : 1)
  5272. , aI = new RegExp("^\\d{" + aJ + "," + aH + "}")
  5273. , aF = ar.substring(ay).match(aI);
  5274. if (!aF) {
  5275. throw "Missing number at position " + ay
  5276. }
  5277. ay += aF[0].length;
  5278. return parseInt(aF[0], 10)
  5279. }, an = function(aF, aG, aI) {
  5280. var aE = -1
  5281. , aH = K.map(aq(aF) ? aI : aG, function(aK, aJ) {
  5282. return [[aJ, aK]]
  5283. }).sort(function(aK, aJ) {
  5284. return -(aK[1].length - aJ[1].length)
  5285. });
  5286. K.each(aH, function(aK, aL) {
  5287. var aJ = aL[1];
  5288. if (ar.substr(ay, aJ.length).toLowerCase() === aJ.toLowerCase()) {
  5289. aE = aL[0];
  5290. ay += aJ.length;
  5291. return false
  5292. }
  5293. });
  5294. if (aE !== -1) {
  5295. return aE + 1
  5296. } else {
  5297. throw "Unknown name at position " + ay
  5298. }
  5299. }, at = function() {
  5300. if (ar.charAt(ay) !== ax.charAt(aj)) {
  5301. throw "Unexpected literal at position " + ay
  5302. }
  5303. ay++
  5304. };
  5305. for (aj = 0; aj < ax.length; aj++) {
  5306. if (av) {
  5307. if (ax.charAt(aj) === "'" && !aq("'")) {
  5308. av = false
  5309. } else {
  5310. at()
  5311. }
  5312. } else {
  5313. switch (ax.charAt(aj)) {
  5314. case "d":
  5315. aw = aD("d");
  5316. break;
  5317. case "D":
  5318. an("D", ap, aB);
  5319. break;
  5320. case "o":
  5321. ao = aD("o");
  5322. break;
  5323. case "m":
  5324. aC = aD("m");
  5325. break;
  5326. case "M":
  5327. aC = an("M", ag, ak);
  5328. break;
  5329. case "y":
  5330. al = aD("y");
  5331. break;
  5332. case "@":
  5333. aA = new Date(aD("@"));
  5334. al = aA.getFullYear();
  5335. aC = aA.getMonth() + 1;
  5336. aw = aA.getDate();
  5337. break;
  5338. case "!":
  5339. aA = new Date((aD("!") - this._ticksTo1970) / 10000);
  5340. al = aA.getFullYear();
  5341. aC = aA.getMonth() + 1;
  5342. aw = aA.getDate();
  5343. break;
  5344. case "'":
  5345. if (aq("'")) {
  5346. at()
  5347. } else {
  5348. av = true
  5349. }
  5350. break;
  5351. default:
  5352. at()
  5353. }
  5354. }
  5355. }
  5356. if (ay < ar.length) {
  5357. ah = ar.substr(ay);
  5358. if (!/^\s+/.test(ah)) {
  5359. throw "Extra/unparsed characters found in date: " + ah
  5360. }
  5361. }
  5362. if (al === -1) {
  5363. al = new Date().getFullYear()
  5364. } else {
  5365. if (al < 100) {
  5366. al += new Date().getFullYear() - new Date().getFullYear() % 100 + (al <= ai ? 0 : -100)
  5367. }
  5368. }
  5369. if (ao > -1) {
  5370. aC = 1;
  5371. aw = ao;
  5372. do {
  5373. au = this._getDaysInMonth(al, aC - 1);
  5374. if (aw <= au) {
  5375. break
  5376. }
  5377. aC++;
  5378. aw -= au
  5379. } while (true)
  5380. }
  5381. aA = this._daylightSavingAdjust(new Date(al,aC - 1,aw));
  5382. if (aA.getFullYear() !== al || aA.getMonth() + 1 !== aC || aA.getDate() !== aw) {
  5383. throw "Invalid date"
  5384. }
  5385. return aA
  5386. },
  5387. ATOM: "yy-mm-dd",
  5388. COOKIE: "D, dd M yy",
  5389. ISO_8601: "yy-mm-dd",
  5390. RFC_822: "D, d M y",
  5391. RFC_850: "DD, dd-M-y",
  5392. RFC_1036: "D, d M y",
  5393. RFC_1123: "D, d M yy",
  5394. RFC_2822: "D, d M yy",
  5395. RSS: "D, d M y",
  5396. TICKS: "!",
  5397. TIMESTAMP: "@",
  5398. W3C: "yy-mm-dd",
  5399. _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
  5400. formatDate: function(ap, aj, ak) {
  5401. if (!aj) {
  5402. return ""
  5403. }
  5404. var ar, at = (ak ? ak.dayNamesShort : null) || this._defaults.dayNamesShort, ah = (ak ? ak.dayNames : null) || this._defaults.dayNames, an = (ak ? ak.monthNamesShort : null) || this._defaults.monthNamesShort, al = (ak ? ak.monthNames : null) || this._defaults.monthNames, aq = function(au) {
  5405. var av = (ar + 1 < ap.length && ap.charAt(ar + 1) === au);
  5406. if (av) {
  5407. ar++
  5408. }
  5409. return av
  5410. }, ag = function(aw, ax, au) {
  5411. var av = "" + ax;
  5412. if (aq(aw)) {
  5413. while (av.length < au) {
  5414. av = "0" + av
  5415. }
  5416. }
  5417. return av
  5418. }, am = function(au, aw, av, ax) {
  5419. return (aq(au) ? ax[aw] : av[aw])
  5420. }, ai = "", ao = false;
  5421. if (aj) {
  5422. for (ar = 0; ar < ap.length; ar++) {
  5423. if (ao) {
  5424. if (ap.charAt(ar) === "'" && !aq("'")) {
  5425. ao = false
  5426. } else {
  5427. ai += ap.charAt(ar)
  5428. }
  5429. } else {
  5430. switch (ap.charAt(ar)) {
  5431. case "d":
  5432. ai += ag("d", aj.getDate(), 2);
  5433. break;
  5434. case "D":
  5435. ai += am("D", aj.getDay(), at, ah);
  5436. break;
  5437. case "o":
  5438. ai += ag("o", Math.round((new Date(aj.getFullYear(),aj.getMonth(),aj.getDate()).getTime() - new Date(aj.getFullYear(),0,0).getTime()) / 86400000), 3);
  5439. break;
  5440. case "m":
  5441. ai += ag("m", aj.getMonth() + 1, 2);
  5442. break;
  5443. case "M":
  5444. ai += am("M", aj.getMonth(), an, al);
  5445. break;
  5446. case "y":
  5447. ai += (aq("y") ? aj.getFullYear() : (aj.getFullYear() % 100 < 10 ? "0" : "") + aj.getFullYear() % 100);
  5448. break;
  5449. case "@":
  5450. ai += aj.getTime();
  5451. break;
  5452. case "!":
  5453. ai += aj.getTime() * 10000 + this._ticksTo1970;
  5454. break;
  5455. case "'":
  5456. if (aq("'")) {
  5457. ai += "'"
  5458. } else {
  5459. ao = true
  5460. }
  5461. break;
  5462. default:
  5463. ai += ap.charAt(ar)
  5464. }
  5465. }
  5466. }
  5467. }
  5468. return ai
  5469. },
  5470. _possibleChars: function(ak) {
  5471. var aj, ai = "", ah = false, ag = function(al) {
  5472. var am = (aj + 1 < ak.length && ak.charAt(aj + 1) === al);
  5473. if (am) {
  5474. aj++
  5475. }
  5476. return am
  5477. };
  5478. for (aj = 0; aj < ak.length; aj++) {
  5479. if (ah) {
  5480. if (ak.charAt(aj) === "'" && !ag("'")) {
  5481. ah = false
  5482. } else {
  5483. ai += ak.charAt(aj)
  5484. }
  5485. } else {
  5486. switch (ak.charAt(aj)) {
  5487. case "d":
  5488. case "m":
  5489. case "y":
  5490. case "@":
  5491. ai += "0123456789";
  5492. break;
  5493. case "D":
  5494. case "M":
  5495. return null;
  5496. case "'":
  5497. if (ag("'")) {
  5498. ai += "'"
  5499. } else {
  5500. ah = true
  5501. }
  5502. break;
  5503. default:
  5504. ai += ak.charAt(aj)
  5505. }
  5506. }
  5507. }
  5508. return ai
  5509. },
  5510. _get: function(ah, ag) {
  5511. return ah.settings[ag] !== undefined ? ah.settings[ag] : this._defaults[ag]
  5512. },
  5513. _setDateFromField: function(al, ai) {
  5514. if (al.input.val() === al.lastVal) {
  5515. return
  5516. }
  5517. var ag = this._get(al, "dateFormat")
  5518. , an = al.lastVal = al.input ? al.input.val() : null
  5519. , am = this._getDefaultDate(al)
  5520. , ah = am
  5521. , aj = this._getFormatConfig(al);
  5522. try {
  5523. ah = this.parseDate(ag, an, aj) || am
  5524. } catch (ak) {
  5525. an = (ai ? "" : an)
  5526. }
  5527. al.selectedDay = ah.getDate();
  5528. al.drawMonth = al.selectedMonth = ah.getMonth();
  5529. al.drawYear = al.selectedYear = ah.getFullYear();
  5530. al.currentDay = (an ? ah.getDate() : 0);
  5531. al.currentMonth = (an ? ah.getMonth() : 0);
  5532. al.currentYear = (an ? ah.getFullYear() : 0);
  5533. this._adjustInstDate(al)
  5534. },
  5535. _getDefaultDate: function(ag) {
  5536. return this._restrictMinMax(ag, this._determineDate(ag, this._get(ag, "defaultDate"), new Date()))
  5537. },
  5538. _determineDate: function(ak, ah, al) {
  5539. var aj = function(an) {
  5540. var am = new Date();
  5541. am.setDate(am.getDate() + an);
  5542. return am
  5543. }
  5544. , ai = function(au) {
  5545. try {
  5546. return K.datepicker.parseDate(K.datepicker._get(ak, "dateFormat"), au, K.datepicker._getFormatConfig(ak))
  5547. } catch (at) {}
  5548. var an = (au.toLowerCase().match(/^c/) ? K.datepicker._getDate(ak) : null) || new Date()
  5549. , ao = an.getFullYear()
  5550. , ar = an.getMonth()
  5551. , am = an.getDate()
  5552. , aq = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g
  5553. , ap = aq.exec(au);
  5554. while (ap) {
  5555. switch (ap[2] || "d") {
  5556. case "d":
  5557. case "D":
  5558. am += parseInt(ap[1], 10);
  5559. break;
  5560. case "w":
  5561. case "W":
  5562. am += parseInt(ap[1], 10) * 7;
  5563. break;
  5564. case "m":
  5565. case "M":
  5566. ar += parseInt(ap[1], 10);
  5567. am = Math.min(am, K.datepicker._getDaysInMonth(ao, ar));
  5568. break;
  5569. case "y":
  5570. case "Y":
  5571. ao += parseInt(ap[1], 10);
  5572. am = Math.min(am, K.datepicker._getDaysInMonth(ao, ar));
  5573. break
  5574. }
  5575. ap = aq.exec(au)
  5576. }
  5577. return new Date(ao,ar,am)
  5578. }
  5579. , ag = (ah == null || ah === "" ? al : (typeof ah === "string" ? ai(ah) : (typeof ah === "number" ? (isNaN(ah) ? al : aj(ah)) : new Date(ah.getTime()))));
  5580. ag = (ag && ag.toString() === "Invalid Date" ? al : ag);
  5581. if (ag) {
  5582. ag.setHours(0);
  5583. ag.setMinutes(0);
  5584. ag.setSeconds(0);
  5585. ag.setMilliseconds(0)
  5586. }
  5587. return this._daylightSavingAdjust(ag)
  5588. },
  5589. _daylightSavingAdjust: function(ag) {
  5590. if (!ag) {
  5591. return null
  5592. }
  5593. ag.setHours(ag.getHours() > 12 ? ag.getHours() + 2 : 0);
  5594. return ag
  5595. },
  5596. _setDate: function(am, aj, al) {
  5597. var ag = !aj
  5598. , ai = am.selectedMonth
  5599. , ak = am.selectedYear
  5600. , ah = this._restrictMinMax(am, this._determineDate(am, aj, new Date()));
  5601. am.selectedDay = am.currentDay = ah.getDate();
  5602. am.drawMonth = am.selectedMonth = am.currentMonth = ah.getMonth();
  5603. am.drawYear = am.selectedYear = am.currentYear = ah.getFullYear();
  5604. if ((ai !== am.selectedMonth || ak !== am.selectedYear) && !al) {
  5605. this._notifyChange(am)
  5606. }
  5607. this._adjustInstDate(am);
  5608. if (am.input) {
  5609. am.input.val(ag ? "" : this._formatDate(am))
  5610. }
  5611. },
  5612. _getDate: function(ah) {
  5613. var ag = (!ah.currentYear || (ah.input && ah.input.val() === "") ? null : this._daylightSavingAdjust(new Date(ah.currentYear,ah.currentMonth,ah.currentDay)));
  5614. return ag
  5615. },
  5616. _attachHandlers: function(ah) {
  5617. var ag = this._get(ah, "stepMonths")
  5618. , ai = "#" + ah.id.replace(/\\\\/g, "\\");
  5619. ah.dpDiv.find("[data-handler]").map(function() {
  5620. var aj = {
  5621. prev: function() {
  5622. K.datepicker._adjustDate(ai, -ag, "M")
  5623. },
  5624. next: function() {
  5625. K.datepicker._adjustDate(ai, +ag, "M")
  5626. },
  5627. hide: function() {
  5628. K.datepicker._hideDatepicker()
  5629. },
  5630. today: function() {
  5631. K.datepicker._gotoToday(ai)
  5632. },
  5633. selectDay: function() {
  5634. K.datepicker._selectDay(ai, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
  5635. return false
  5636. },
  5637. selectMonth: function() {
  5638. K.datepicker._selectMonthYear(ai, this, "M");
  5639. return false
  5640. },
  5641. selectYear: function() {
  5642. K.datepicker._selectMonthYear(ai, this, "Y");
  5643. return false
  5644. }
  5645. };
  5646. K(this).on(this.getAttribute("data-event"), aj[this.getAttribute("data-handler")])
  5647. })
  5648. },
  5649. _generateHTML: function(aX) {
  5650. var aA, az, aS, aK, ak, a1, aV, aO, a4, aI, a8, ar, au, at, ah, a0, ap, aD, a3, aQ, a9, aC, aH, aq, al, aT, aM, aP, aN, ao, aF, av, aW, aZ, aj, a2, a6, aL, aw, aY = new Date(), aB = this._daylightSavingAdjust(new Date(aY.getFullYear(),aY.getMonth(),aY.getDate())), a5 = this._get(aX, "isRTL"), a7 = this._get(aX, "showButtonPanel"), aR = this._get(aX, "hideIfNoPrevNext"), aG = this._get(aX, "navigationAsDateFormat"), ax = this._getNumberOfMonths(aX), an = this._get(aX, "showCurrentAtPos"), aJ = this._get(aX, "stepMonths"), aE = (ax[0] !== 1 || ax[1] !== 1), ai = this._daylightSavingAdjust((!aX.currentDay ? new Date(9999,9,9) : new Date(aX.currentYear,aX.currentMonth,aX.currentDay))), am = this._getMinMaxDate(aX, "min"), ay = this._getMinMaxDate(aX, "max"), ag = aX.drawMonth - an, aU = aX.drawYear;
  5651. if (ag < 0) {
  5652. ag += 12;
  5653. aU--
  5654. }
  5655. if (ay) {
  5656. aA = this._daylightSavingAdjust(new Date(ay.getFullYear(),ay.getMonth() - (ax[0] * ax[1]) + 1,ay.getDate()));
  5657. aA = (am && aA < am ? am : aA);
  5658. while (this._daylightSavingAdjust(new Date(aU,ag,1)) > aA) {
  5659. ag--;
  5660. if (ag < 0) {
  5661. ag = 11;
  5662. aU--
  5663. }
  5664. }
  5665. }
  5666. aX.drawMonth = ag;
  5667. aX.drawYear = aU;
  5668. az = this._get(aX, "prevText");
  5669. az = (!aG ? az : this.formatDate(az, this._daylightSavingAdjust(new Date(aU,ag - aJ,1)), this._getFormatConfig(aX)));
  5670. aS = (this._canAdjustMonth(aX, -1, aU, ag) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='" + az + "'><span class='ui-icon ui-icon-circle-triangle-" + (a5 ? "e" : "w") + "'>" + az + "</span></a>" : (aR ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + az + "'><span class='ui-icon ui-icon-circle-triangle-" + (a5 ? "e" : "w") + "'>" + az + "</span></a>"));
  5671. aK = this._get(aX, "nextText");
  5672. aK = (!aG ? aK : this.formatDate(aK, this._daylightSavingAdjust(new Date(aU,ag + aJ,1)), this._getFormatConfig(aX)));
  5673. ak = (this._canAdjustMonth(aX, +1, aU, ag) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='" + aK + "'><span class='ui-icon ui-icon-circle-triangle-" + (a5 ? "w" : "e") + "'>" + aK + "</span></a>" : (aR ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + aK + "'><span class='ui-icon ui-icon-circle-triangle-" + (a5 ? "w" : "e") + "'>" + aK + "</span></a>"));
  5674. a1 = this._get(aX, "currentText");
  5675. aV = (this._get(aX, "gotoCurrent") && aX.currentDay ? ai : aB);
  5676. a1 = (!aG ? a1 : this.formatDate(a1, aV, this._getFormatConfig(aX)));
  5677. aO = (!aX.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(aX, "closeText") + "</button>" : "");
  5678. a4 = (a7) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (a5 ? aO : "") + (this._isInRange(aX, aV) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>" + a1 + "</button>" : "") + (a5 ? "" : aO) + "</div>" : "";
  5679. aI = parseInt(this._get(aX, "firstDay"), 10);
  5680. aI = (isNaN(aI) ? 0 : aI);
  5681. a8 = this._get(aX, "showWeek");
  5682. ar = this._get(aX, "dayNames");
  5683. au = this._get(aX, "dayNamesMin");
  5684. at = this._get(aX, "monthNames");
  5685. ah = this._get(aX, "monthNamesShort");
  5686. a0 = this._get(aX, "beforeShowDay");
  5687. ap = this._get(aX, "showOtherMonths");
  5688. aD = this._get(aX, "selectOtherMonths");
  5689. a3 = this._getDefaultDate(aX);
  5690. aQ = "";
  5691. for (aC = 0; aC < ax[0]; aC++) {
  5692. aH = "";
  5693. this.maxRows = 4;
  5694. for (aq = 0; aq < ax[1]; aq++) {
  5695. al = this._daylightSavingAdjust(new Date(aU,ag,aX.selectedDay));
  5696. aT = " ui-corner-all";
  5697. aM = "";
  5698. if (aE) {
  5699. aM += "<div class='ui-datepicker-group";
  5700. if (ax[1] > 1) {
  5701. switch (aq) {
  5702. case 0:
  5703. aM += " ui-datepicker-group-first";
  5704. aT = " ui-corner-" + (a5 ? "right" : "left");
  5705. break;
  5706. case ax[1] - 1:
  5707. aM += " ui-datepicker-group-last";
  5708. aT = " ui-corner-" + (a5 ? "left" : "right");
  5709. break;
  5710. default:
  5711. aM += " ui-datepicker-group-middle";
  5712. aT = "";
  5713. break
  5714. }
  5715. }
  5716. aM += "'>"
  5717. }
  5718. aM += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + aT + "'>" + (/all|left/.test(aT) && aC === 0 ? (a5 ? ak : aS) : "") + (/all|right/.test(aT) && aC === 0 ? (a5 ? aS : ak) : "") + this._generateMonthYearHeader(aX, ag, aU, am, ay, aC > 0 || aq > 0, at, ah) + "</div><table class='ui-datepicker-calendar'><thead><tr>";
  5719. aP = (a8 ? "<th class='ui-datepicker-week-col'>" + this._get(aX, "weekHeader") + "</th>" : "");
  5720. for (a9 = 0; a9 < 7; a9++) {
  5721. aN = (a9 + aI) % 7;
  5722. aP += "<th scope='col'" + ((a9 + aI + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + "><span title='" + ar[aN] + "'>" + au[aN] + "</span></th>"
  5723. }
  5724. aM += aP + "</tr></thead><tbody>";
  5725. ao = this._getDaysInMonth(aU, ag);
  5726. if (aU === aX.selectedYear && ag === aX.selectedMonth) {
  5727. aX.selectedDay = Math.min(aX.selectedDay, ao)
  5728. }
  5729. aF = (this._getFirstDayOfMonth(aU, ag) - aI + 7) % 7;
  5730. av = Math.ceil((aF + ao) / 7);
  5731. aW = (aE ? this.maxRows > av ? this.maxRows : av : av);
  5732. this.maxRows = aW;
  5733. aZ = this._daylightSavingAdjust(new Date(aU,ag,1 - aF));
  5734. for (aj = 0; aj < aW; aj++) {
  5735. aM += "<tr>";
  5736. a2 = (!a8 ? "" : "<td class='ui-datepicker-week-col'>" + this._get(aX, "calculateWeek")(aZ) + "</td>");
  5737. for (a9 = 0; a9 < 7; a9++) {
  5738. a6 = (a0 ? a0.apply((aX.input ? aX.input[0] : null), [aZ]) : [true, ""]);
  5739. aL = (aZ.getMonth() !== ag);
  5740. aw = (aL && !aD) || !a6[0] || (am && aZ < am) || (ay && aZ > ay);
  5741. a2 += "<td class='" + ((a9 + aI + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (aL ? " ui-datepicker-other-month" : "") + ((aZ.getTime() === al.getTime() && ag === aX.selectedMonth && aX._keyEvent) || (a3.getTime() === aZ.getTime() && a3.getTime() === al.getTime()) ? " " + this._dayOverClass : "") + (aw ? " " + this._unselectableClass + " ui-state-disabled" : "") + (aL && !ap ? "" : " " + a6[1] + (aZ.getTime() === ai.getTime() ? " " + this._currentClass : "") + (aZ.getTime() === aB.getTime() ? " ui-datepicker-today" : "")) + "'" + ((!aL || ap) && a6[2] ? " title='" + a6[2].replace(/'/g, "&#39;") + "'" : "") + (aw ? "" : " data-handler='selectDay' data-event='click' data-month='" + aZ.getMonth() + "' data-year='" + aZ.getFullYear() + "'") + ">" + (aL && !ap ? "&#xa0;" : (aw ? "<span class='ui-state-default'>" + aZ.getDate() + "</span>" : "<a class='ui-state-default" + (aZ.getTime() === aB.getTime() ? " ui-state-highlight" : "") + (aZ.getTime() === ai.getTime() ? " ui-state-active" : "") + (aL ? " ui-priority-secondary" : "") + "' href='#'>" + aZ.getDate() + "</a>")) + "</td>";
  5742. aZ.setDate(aZ.getDate() + 1);
  5743. aZ = this._daylightSavingAdjust(aZ)
  5744. }
  5745. aM += a2 + "</tr>"
  5746. }
  5747. ag++;
  5748. if (ag > 11) {
  5749. ag = 0;
  5750. aU++
  5751. }
  5752. aM += "</tbody></table>" + (aE ? "</div>" + ((ax[0] > 0 && aq === ax[1] - 1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
  5753. aH += aM
  5754. }
  5755. aQ += aH
  5756. }
  5757. aQ += a4;
  5758. aX._keyEvent = false;
  5759. return aQ
  5760. },
  5761. _generateMonthYearHeader: function(ak, ai, at, am, aq, au, ao, ag) {
  5762. var ay, ah, az, aw, al, av, ar, an, aj = this._get(ak, "changeMonth"), aA = this._get(ak, "changeYear"), aB = this._get(ak, "showMonthAfterYear"), ap = "<div class='ui-datepicker-title'>", ax = "";
  5763. if (au || !aj) {
  5764. ax += "<span class='ui-datepicker-month'>" + ao[ai] + "</span>"
  5765. } else {
  5766. ay = (am && am.getFullYear() === at);
  5767. ah = (aq && aq.getFullYear() === at);
  5768. ax += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
  5769. for (az = 0; az < 12; az++) {
  5770. if ((!ay || az >= am.getMonth()) && (!ah || az <= aq.getMonth())) {
  5771. ax += "<option value='" + az + "'" + (az === ai ? " selected='selected'" : "") + ">" + ag[az] + "</option>"
  5772. }
  5773. }
  5774. ax += "</select>"
  5775. }
  5776. if (!aB) {
  5777. ap += ax + (au || !(aj && aA) ? "&#xa0;" : "")
  5778. }
  5779. if (!ak.yearshtml) {
  5780. ak.yearshtml = "";
  5781. if (au || !aA) {
  5782. ap += "<span class='ui-datepicker-year'>" + at + "</span>"
  5783. } else {
  5784. aw = this._get(ak, "yearRange").split(":");
  5785. al = new Date().getFullYear();
  5786. av = function(aD) {
  5787. var aC = (aD.match(/c[+\-].*/) ? at + parseInt(aD.substring(1), 10) : (aD.match(/[+\-].*/) ? al + parseInt(aD, 10) : parseInt(aD, 10)));
  5788. return (isNaN(aC) ? al : aC)
  5789. }
  5790. ;
  5791. ar = av(aw[0]);
  5792. an = Math.max(ar, av(aw[1] || ""));
  5793. ar = (am ? Math.max(ar, am.getFullYear()) : ar);
  5794. an = (aq ? Math.min(an, aq.getFullYear()) : an);
  5795. ak.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
  5796. for (; ar <= an; ar++) {
  5797. ak.yearshtml += "<option value='" + ar + "'" + (ar === at ? " selected='selected'" : "") + ">" + ar + "</option>"
  5798. }
  5799. ak.yearshtml += "</select>";
  5800. ap += ak.yearshtml;
  5801. ak.yearshtml = null
  5802. }
  5803. }
  5804. ap += this._get(ak, "yearSuffix");
  5805. if (aB) {
  5806. ap += (au || !(aj && aA) ? "&#xa0;" : "") + ax
  5807. }
  5808. ap += "</div>";
  5809. return ap
  5810. },
  5811. _adjustInstDate: function(aj, am, al) {
  5812. var ai = aj.selectedYear + (al === "Y" ? am : 0)
  5813. , ak = aj.selectedMonth + (al === "M" ? am : 0)
  5814. , ag = Math.min(aj.selectedDay, this._getDaysInMonth(ai, ak)) + (al === "D" ? am : 0)
  5815. , ah = this._restrictMinMax(aj, this._daylightSavingAdjust(new Date(ai,ak,ag)));
  5816. aj.selectedDay = ah.getDate();
  5817. aj.drawMonth = aj.selectedMonth = ah.getMonth();
  5818. aj.drawYear = aj.selectedYear = ah.getFullYear();
  5819. if (al === "M" || al === "Y") {
  5820. this._notifyChange(aj)
  5821. }
  5822. },
  5823. _restrictMinMax: function(aj, ah) {
  5824. var ai = this._getMinMaxDate(aj, "min")
  5825. , ak = this._getMinMaxDate(aj, "max")
  5826. , ag = (ai && ah < ai ? ai : ah);
  5827. return (ak && ag > ak ? ak : ag)
  5828. },
  5829. _notifyChange: function(ah) {
  5830. var ag = this._get(ah, "onChangeMonthYear");
  5831. if (ag) {
  5832. ag.apply((ah.input ? ah.input[0] : null), [ah.selectedYear, ah.selectedMonth + 1, ah])
  5833. }
  5834. },
  5835. _getNumberOfMonths: function(ah) {
  5836. var ag = this._get(ah, "numberOfMonths");
  5837. return (ag == null ? [1, 1] : (typeof ag === "number" ? [1, ag] : ag))
  5838. },
  5839. _getMinMaxDate: function(ah, ag) {
  5840. return this._determineDate(ah, this._get(ah, ag + "Date"), null)
  5841. },
  5842. _getDaysInMonth: function(ag, ah) {
  5843. return 32 - this._daylightSavingAdjust(new Date(ag,ah,32)).getDate()
  5844. },
  5845. _getFirstDayOfMonth: function(ag, ah) {
  5846. return new Date(ag,ah,1).getDay()
  5847. },
  5848. _canAdjustMonth: function(aj, al, ai, ak) {
  5849. var ag = this._getNumberOfMonths(aj)
  5850. , ah = this._daylightSavingAdjust(new Date(ai,ak + (al < 0 ? al : ag[0] * ag[1]),1));
  5851. if (al < 0) {
  5852. ah.setDate(this._getDaysInMonth(ah.getFullYear(), ah.getMonth()))
  5853. }
  5854. return this._isInRange(aj, ah)
  5855. },
  5856. _isInRange: function(ak, ai) {
  5857. var ah, an, aj = this._getMinMaxDate(ak, "min"), ag = this._getMinMaxDate(ak, "max"), ao = null, al = null, am = this._get(ak, "yearRange");
  5858. if (am) {
  5859. ah = am.split(":");
  5860. an = new Date().getFullYear();
  5861. ao = parseInt(ah[0], 10);
  5862. al = parseInt(ah[1], 10);
  5863. if (ah[0].match(/[+\-].*/)) {
  5864. ao += an
  5865. }
  5866. if (ah[1].match(/[+\-].*/)) {
  5867. al += an
  5868. }
  5869. }
  5870. return ((!aj || ai.getTime() >= aj.getTime()) && (!ag || ai.getTime() <= ag.getTime()) && (!ao || ai.getFullYear() >= ao) && (!al || ai.getFullYear() <= al))
  5871. },
  5872. _getFormatConfig: function(ag) {
  5873. var ah = this._get(ag, "shortYearCutoff");
  5874. ah = (typeof ah !== "string" ? ah : new Date().getFullYear() % 100 + parseInt(ah, 10));
  5875. return {
  5876. shortYearCutoff: ah,
  5877. dayNamesShort: this._get(ag, "dayNamesShort"),
  5878. dayNames: this._get(ag, "dayNames"),
  5879. monthNamesShort: this._get(ag, "monthNamesShort"),
  5880. monthNames: this._get(ag, "monthNames")
  5881. }
  5882. },
  5883. _formatDate: function(aj, ag, ak, ai) {
  5884. if (!ag) {
  5885. aj.currentDay = aj.selectedDay;
  5886. aj.currentMonth = aj.selectedMonth;
  5887. aj.currentYear = aj.selectedYear
  5888. }
  5889. var ah = (ag ? (typeof ag === "object" ? ag : this._daylightSavingAdjust(new Date(ai,ak,ag))) : this._daylightSavingAdjust(new Date(aj.currentYear,aj.currentMonth,aj.currentDay)));
  5890. return this.formatDate(this._get(aj, "dateFormat"), ah, this._getFormatConfig(aj))
  5891. }
  5892. });
  5893. function l(ah) {
  5894. var ag = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
  5895. return ah.on("mouseout", ag, function() {
  5896. K(this).removeClass("ui-state-hover");
  5897. if (this.className.indexOf("ui-datepicker-prev") !== -1) {
  5898. K(this).removeClass("ui-datepicker-prev-hover")
  5899. }
  5900. if (this.className.indexOf("ui-datepicker-next") !== -1) {
  5901. K(this).removeClass("ui-datepicker-next-hover")
  5902. }
  5903. }).on("mouseover", ag, v)
  5904. }
  5905. function v() {
  5906. if (!K.datepicker._isDisabledDatepicker(q.inline ? q.dpDiv.parent()[0] : q.input[0])) {
  5907. K(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
  5908. K(this).addClass("ui-state-hover");
  5909. if (this.className.indexOf("ui-datepicker-prev") !== -1) {
  5910. K(this).addClass("ui-datepicker-prev-hover")
  5911. }
  5912. if (this.className.indexOf("ui-datepicker-next") !== -1) {
  5913. K(this).addClass("ui-datepicker-next-hover")
  5914. }
  5915. }
  5916. }
  5917. function F(ai, ah) {
  5918. K.extend(ai, ah);
  5919. for (var ag in ah) {
  5920. if (ah[ag] == null) {
  5921. ai[ag] = ah[ag]
  5922. }
  5923. }
  5924. return ai
  5925. }
  5926. K.fn.datepicker = function(ah) {
  5927. if (!this.length) {
  5928. return this
  5929. }
  5930. if (!K.datepicker.initialized) {
  5931. K(document).on("mousedown", K.datepicker._checkExternalClick);
  5932. K.datepicker.initialized = true
  5933. }
  5934. if (K("#" + K.datepicker._mainDivId).length === 0) {
  5935. K("body").append(K.datepicker.dpDiv)
  5936. }
  5937. var ag = Array.prototype.slice.call(arguments, 1);
  5938. if (typeof ah === "string" && (ah === "isDisabled" || ah === "getDate" || ah === "widget")) {
  5939. return K.datepicker["_" + ah + "Datepicker"].apply(K.datepicker, [this[0]].concat(ag))
  5940. }
  5941. if (ah === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
  5942. return K.datepicker["_" + ah + "Datepicker"].apply(K.datepicker, [this[0]].concat(ag))
  5943. }
  5944. return this.each(function() {
  5945. typeof ah === "string" ? K.datepicker["_" + ah + "Datepicker"].apply(K.datepicker, [this].concat(ag)) : K.datepicker._attachDatepicker(this, ah)
  5946. })
  5947. }
  5948. ;
  5949. K.datepicker = new ac();
  5950. K.datepicker.initialized = false;
  5951. K.datepicker.uuid = new Date().getTime();
  5952. K.datepicker.version = "1.12.1";
  5953. var A = K.datepicker;
  5954. /*!
  5955. * jQuery UI Slider 1.12.1
  5956. * http://jqueryui.com
  5957. *
  5958. * Copyright jQuery Foundation and other contributors
  5959. * Released under the MIT license.
  5960. * http://jquery.org/license
  5961. */
  5962. var d = K.widget("ui.slider", K.ui.mouse, {
  5963. version: "1.12.1",
  5964. widgetEventPrefix: "slide",
  5965. options: {
  5966. animate: false,
  5967. classes: {
  5968. "ui-slider": "ui-corner-all",
  5969. "ui-slider-handle": "ui-corner-all",
  5970. "ui-slider-range": "ui-corner-all ui-widget-header"
  5971. },
  5972. distance: 0,
  5973. max: 100,
  5974. min: 0,
  5975. orientation: "horizontal",
  5976. range: false,
  5977. step: 1,
  5978. value: 0,
  5979. values: null,
  5980. change: null,
  5981. slide: null,
  5982. start: null,
  5983. stop: null
  5984. },
  5985. numPages: 5,
  5986. _create: function() {
  5987. this._keySliding = false;
  5988. this._mouseSliding = false;
  5989. this._animateOff = true;
  5990. this._handleIndex = null;
  5991. this._detectOrientation();
  5992. this._mouseInit();
  5993. this._calculateNewMax();
  5994. this._addClass("ui-slider ui-slider-" + this.orientation, "ui-widget ui-widget-content");
  5995. this._refresh();
  5996. this._animateOff = false
  5997. },
  5998. _refresh: function() {
  5999. this._createRange();
  6000. this._createHandles();
  6001. this._setupEvents();
  6002. this._refreshValue()
  6003. },
  6004. _createHandles: function() {
  6005. var aj, ag, ah = this.options, al = this.element.find(".ui-slider-handle"), ak = "<span tabindex='0'></span>", ai = [];
  6006. ag = (ah.values && ah.values.length) || 1;
  6007. if (al.length > ag) {
  6008. al.slice(ag).remove();
  6009. al = al.slice(0, ag)
  6010. }
  6011. for (aj = al.length; aj < ag; aj++) {
  6012. ai.push(ak)
  6013. }
  6014. this.handles = al.add(K(ai.join("")).appendTo(this.element));
  6015. this._addClass(this.handles, "ui-slider-handle", "ui-state-default");
  6016. this.handle = this.handles.eq(0);
  6017. this.handles.each(function(am) {
  6018. K(this).data("ui-slider-handle-index", am).attr("tabIndex", 0)
  6019. })
  6020. },
  6021. _createRange: function() {
  6022. var ag = this.options;
  6023. if (ag.range) {
  6024. if (ag.range === true) {
  6025. if (!ag.values) {
  6026. ag.values = [this._valueMin(), this._valueMin()]
  6027. } else {
  6028. if (ag.values.length && ag.values.length !== 2) {
  6029. ag.values = [ag.values[0], ag.values[0]]
  6030. } else {
  6031. if (K.isArray(ag.values)) {
  6032. ag.values = ag.values.slice(0)
  6033. }
  6034. }
  6035. }
  6036. }
  6037. if (!this.range || !this.range.length) {
  6038. this.range = K("<div>").appendTo(this.element);
  6039. this._addClass(this.range, "ui-slider-range")
  6040. } else {
  6041. this._removeClass(this.range, "ui-slider-range-min ui-slider-range-max");
  6042. this.range.css({
  6043. left: "",
  6044. bottom: ""
  6045. })
  6046. }
  6047. if (ag.range === "min" || ag.range === "max") {
  6048. this._addClass(this.range, "ui-slider-range-" + ag.range)
  6049. }
  6050. } else {
  6051. if (this.range) {
  6052. this.range.remove()
  6053. }
  6054. this.range = null
  6055. }
  6056. },
  6057. _setupEvents: function() {
  6058. this._off(this.handles);
  6059. this._on(this.handles, this._handleEvents);
  6060. this._hoverable(this.handles);
  6061. this._focusable(this.handles)
  6062. },
  6063. _destroy: function() {
  6064. this.handles.remove();
  6065. if (this.range) {
  6066. this.range.remove()
  6067. }
  6068. this._mouseDestroy()
  6069. },
  6070. _mouseCapture: function(ai) {
  6071. var am, ap, ah, ak, ao, aq, al, ag, an = this, aj = this.options;
  6072. if (aj.disabled) {
  6073. return false
  6074. }
  6075. this.elementSize = {
  6076. width: this.element.outerWidth(),
  6077. height: this.element.outerHeight()
  6078. };
  6079. this.elementOffset = this.element.offset();
  6080. am = {
  6081. x: ai.pageX,
  6082. y: ai.pageY
  6083. };
  6084. ap = this._normValueFromMouse(am);
  6085. ah = this._valueMax() - this._valueMin() + 1;
  6086. this.handles.each(function(ar) {
  6087. var at = Math.abs(ap - an.values(ar));
  6088. if ((ah > at) || (ah === at && (ar === an._lastChangedValue || an.values(ar) === aj.min))) {
  6089. ah = at;
  6090. ak = K(this);
  6091. ao = ar
  6092. }
  6093. });
  6094. aq = this._start(ai, ao);
  6095. if (aq === false) {
  6096. return false
  6097. }
  6098. this._mouseSliding = true;
  6099. this._handleIndex = ao;
  6100. this._addClass(ak, null, "ui-state-active");
  6101. ak.trigger("focus");
  6102. al = ak.offset();
  6103. ag = !K(ai.target).parents().addBack().is(".ui-slider-handle");
  6104. this._clickOffset = ag ? {
  6105. left: 0,
  6106. top: 0
  6107. } : {
  6108. left: ai.pageX - al.left - (ak.width() / 2),
  6109. top: ai.pageY - al.top - (ak.height() / 2) - (parseInt(ak.css("borderTopWidth"), 10) || 0) - (parseInt(ak.css("borderBottomWidth"), 10) || 0) + (parseInt(ak.css("marginTop"), 10) || 0)
  6110. };
  6111. if (!this.handles.hasClass("ui-state-hover")) {
  6112. this._slide(ai, ao, ap)
  6113. }
  6114. this._animateOff = true;
  6115. return true
  6116. },
  6117. _mouseStart: function() {
  6118. return true
  6119. },
  6120. _mouseDrag: function(ai) {
  6121. var ag = {
  6122. x: ai.pageX,
  6123. y: ai.pageY
  6124. }
  6125. , ah = this._normValueFromMouse(ag);
  6126. this._slide(ai, this._handleIndex, ah);
  6127. return false
  6128. },
  6129. _mouseStop: function(ag) {
  6130. this._removeClass(this.handles, null, "ui-state-active");
  6131. this._mouseSliding = false;
  6132. this._stop(ag, this._handleIndex);
  6133. this._change(ag, this._handleIndex);
  6134. this._handleIndex = null;
  6135. this._clickOffset = null;
  6136. this._animateOff = false;
  6137. return false
  6138. },
  6139. _detectOrientation: function() {
  6140. this.orientation = (this.options.orientation === "vertical") ? "vertical" : "horizontal"
  6141. },
  6142. _normValueFromMouse: function(ah) {
  6143. var ag, ak, aj, ai, al;
  6144. if (this.orientation === "horizontal") {
  6145. ag = this.elementSize.width;
  6146. ak = ah.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)
  6147. } else {
  6148. ag = this.elementSize.height;
  6149. ak = ah.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)
  6150. }
  6151. aj = (ak / ag);
  6152. if (aj > 1) {
  6153. aj = 1
  6154. }
  6155. if (aj < 0) {
  6156. aj = 0
  6157. }
  6158. if (this.orientation === "vertical") {
  6159. aj = 1 - aj
  6160. }
  6161. ai = this._valueMax() - this._valueMin();
  6162. al = this._valueMin() + aj * ai;
  6163. return this._trimAlignValue(al)
  6164. },
  6165. _uiHash: function(ai, aj, ag) {
  6166. var ah = {
  6167. handle: this.handles[ai],
  6168. handleIndex: ai,
  6169. value: aj !== undefined ? aj : this.value()
  6170. };
  6171. if (this._hasMultipleValues()) {
  6172. ah.value = aj !== undefined ? aj : this.values(ai);
  6173. ah.values = ag || this.values()
  6174. }
  6175. return ah
  6176. },
  6177. _hasMultipleValues: function() {
  6178. return this.options.values && this.options.values.length
  6179. },
  6180. _start: function(ah, ag) {
  6181. return this._trigger("start", ah, this._uiHash(ag))
  6182. },
  6183. _slide: function(al, aj, ai) {
  6184. var am, ag, ak = this.value(), ah = this.values();
  6185. if (this._hasMultipleValues()) {
  6186. ag = this.values(aj ? 0 : 1);
  6187. ak = this.values(aj);
  6188. if (this.options.values.length === 2 && this.options.range === true) {
  6189. ai = aj === 0 ? Math.min(ag, ai) : Math.max(ag, ai)
  6190. }
  6191. ah[aj] = ai
  6192. }
  6193. if (ai === ak) {
  6194. return
  6195. }
  6196. am = this._trigger("slide", al, this._uiHash(aj, ai, ah));
  6197. if (am === false) {
  6198. return
  6199. }
  6200. if (this._hasMultipleValues()) {
  6201. this.values(aj, ai)
  6202. } else {
  6203. this.value(ai)
  6204. }
  6205. },
  6206. _stop: function(ah, ag) {
  6207. this._trigger("stop", ah, this._uiHash(ag))
  6208. },
  6209. _change: function(ah, ag) {
  6210. if (!this._keySliding && !this._mouseSliding) {
  6211. this._lastChangedValue = ag;
  6212. this._trigger("change", ah, this._uiHash(ag))
  6213. }
  6214. },
  6215. value: function(ag) {
  6216. if (arguments.length) {
  6217. this.options.value = this._trimAlignValue(ag);
  6218. this._refreshValue();
  6219. this._change(null, 0);
  6220. return
  6221. }
  6222. return this._value()
  6223. },
  6224. values: function(ah, ak) {
  6225. var aj, ag, ai;
  6226. if (arguments.length > 1) {
  6227. this.options.values[ah] = this._trimAlignValue(ak);
  6228. this._refreshValue();
  6229. this._change(null, ah);
  6230. return
  6231. }
  6232. if (arguments.length) {
  6233. if (K.isArray(arguments[0])) {
  6234. aj = this.options.values;
  6235. ag = arguments[0];
  6236. for (ai = 0; ai < aj.length; ai += 1) {
  6237. aj[ai] = this._trimAlignValue(ag[ai]);
  6238. this._change(null, ai)
  6239. }
  6240. this._refreshValue()
  6241. } else {
  6242. if (this._hasMultipleValues()) {
  6243. return this._values(ah)
  6244. } else {
  6245. return this.value()
  6246. }
  6247. }
  6248. } else {
  6249. return this._values()
  6250. }
  6251. },
  6252. _setOption: function(ah, ai) {
  6253. var ag, aj = 0;
  6254. if (ah === "range" && this.options.range === true) {
  6255. if (ai === "min") {
  6256. this.options.value = this._values(0);
  6257. this.options.values = null
  6258. } else {
  6259. if (ai === "max") {
  6260. this.options.value = this._values(this.options.values.length - 1);
  6261. this.options.values = null
  6262. }
  6263. }
  6264. }
  6265. if (K.isArray(this.options.values)) {
  6266. aj = this.options.values.length
  6267. }
  6268. this._super(ah, ai);
  6269. switch (ah) {
  6270. case "orientation":
  6271. this._detectOrientation();
  6272. this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-" + this.orientation);
  6273. this._refreshValue();
  6274. if (this.options.range) {
  6275. this._refreshRange(ai)
  6276. }
  6277. this.handles.css(ai === "horizontal" ? "bottom" : "left", "");
  6278. break;
  6279. case "value":
  6280. this._animateOff = true;
  6281. this._refreshValue();
  6282. this._change(null, 0);
  6283. this._animateOff = false;
  6284. break;
  6285. case "values":
  6286. this._animateOff = true;
  6287. this._refreshValue();
  6288. for (ag = aj - 1; ag >= 0; ag--) {
  6289. this._change(null, ag)
  6290. }
  6291. this._animateOff = false;
  6292. break;
  6293. case "step":
  6294. case "min":
  6295. case "max":
  6296. this._animateOff = true;
  6297. this._calculateNewMax();
  6298. this._refreshValue();
  6299. this._animateOff = false;
  6300. break;
  6301. case "range":
  6302. this._animateOff = true;
  6303. this._refresh();
  6304. this._animateOff = false;
  6305. break
  6306. }
  6307. },
  6308. _setOptionDisabled: function(ag) {
  6309. this._super(ag);
  6310. this._toggleClass(null, "ui-state-disabled", !!ag)
  6311. },
  6312. _value: function() {
  6313. var ag = this.options.value;
  6314. ag = this._trimAlignValue(ag);
  6315. return ag
  6316. },
  6317. _values: function(ag) {
  6318. var aj, ai, ah;
  6319. if (arguments.length) {
  6320. aj = this.options.values[ag];
  6321. aj = this._trimAlignValue(aj);
  6322. return aj
  6323. } else {
  6324. if (this._hasMultipleValues()) {
  6325. ai = this.options.values.slice();
  6326. for (ah = 0; ah < ai.length; ah += 1) {
  6327. ai[ah] = this._trimAlignValue(ai[ah])
  6328. }
  6329. return ai
  6330. } else {
  6331. return []
  6332. }
  6333. }
  6334. },
  6335. _trimAlignValue: function(aj) {
  6336. if (aj <= this._valueMin()) {
  6337. return this._valueMin()
  6338. }
  6339. if (aj >= this._valueMax()) {
  6340. return this._valueMax()
  6341. }
  6342. var ag = (this.options.step > 0) ? this.options.step : 1
  6343. , ai = (aj - this._valueMin()) % ag
  6344. , ah = aj - ai;
  6345. if (Math.abs(ai) * 2 >= ag) {
  6346. ah += (ai > 0) ? ag : (-ag)
  6347. }
  6348. return parseFloat(ah.toFixed(5))
  6349. },
  6350. _calculateNewMax: function() {
  6351. var ag = this.options.max
  6352. , ah = this._valueMin()
  6353. , ai = this.options.step
  6354. , aj = Math.round((ag - ah) / ai) * ai;
  6355. ag = aj + ah;
  6356. if (ag > this.options.max) {
  6357. ag -= ai
  6358. }
  6359. this.max = parseFloat(ag.toFixed(this._precision()))
  6360. },
  6361. _precision: function() {
  6362. var ag = this._precisionOf(this.options.step);
  6363. if (this.options.min !== null) {
  6364. ag = Math.max(ag, this._precisionOf(this.options.min))
  6365. }
  6366. return ag
  6367. },
  6368. _precisionOf: function(ah) {
  6369. var ai = ah.toString()
  6370. , ag = ai.indexOf(".");
  6371. return ag === -1 ? 0 : ai.length - ag - 1
  6372. },
  6373. _valueMin: function() {
  6374. return this.options.min
  6375. },
  6376. _valueMax: function() {
  6377. return this.max
  6378. },
  6379. _refreshRange: function(ag) {
  6380. if (ag === "vertical") {
  6381. this.range.css({
  6382. width: "",
  6383. left: ""
  6384. })
  6385. }
  6386. if (ag === "horizontal") {
  6387. this.range.css({
  6388. height: "",
  6389. bottom: ""
  6390. })
  6391. }
  6392. },
  6393. _refreshValue: function() {
  6394. var al, ak, ao, am, ap, aj = this.options.range, ai = this.options, an = this, ah = (!this._animateOff) ? ai.animate : false, ag = {};
  6395. if (this._hasMultipleValues()) {
  6396. this.handles.each(function(aq) {
  6397. ak = (an.values(aq) - an._valueMin()) / (an._valueMax() - an._valueMin()) * 100;
  6398. ag[an.orientation === "horizontal" ? "left" : "bottom"] = ak + "%";
  6399. K(this).stop(1, 1)[ah ? "animate" : "css"](ag, ai.animate);
  6400. if (an.options.range === true) {
  6401. if (an.orientation === "horizontal") {
  6402. if (aq === 0) {
  6403. an.range.stop(1, 1)[ah ? "animate" : "css"]({
  6404. left: ak + "%"
  6405. }, ai.animate)
  6406. }
  6407. if (aq === 1) {
  6408. an.range[ah ? "animate" : "css"]({
  6409. width: (ak - al) + "%"
  6410. }, {
  6411. queue: false,
  6412. duration: ai.animate
  6413. })
  6414. }
  6415. } else {
  6416. if (aq === 0) {
  6417. an.range.stop(1, 1)[ah ? "animate" : "css"]({
  6418. bottom: (ak) + "%"
  6419. }, ai.animate)
  6420. }
  6421. if (aq === 1) {
  6422. an.range[ah ? "animate" : "css"]({
  6423. height: (ak - al) + "%"
  6424. }, {
  6425. queue: false,
  6426. duration: ai.animate
  6427. })
  6428. }
  6429. }
  6430. }
  6431. al = ak
  6432. })
  6433. } else {
  6434. ao = this.value();
  6435. am = this._valueMin();
  6436. ap = this._valueMax();
  6437. ak = (ap !== am) ? (ao - am) / (ap - am) * 100 : 0;
  6438. ag[this.orientation === "horizontal" ? "left" : "bottom"] = ak + "%";
  6439. this.handle.stop(1, 1)[ah ? "animate" : "css"](ag, ai.animate);
  6440. if (aj === "min" && this.orientation === "horizontal") {
  6441. this.range.stop(1, 1)[ah ? "animate" : "css"]({
  6442. width: ak + "%"
  6443. }, ai.animate)
  6444. }
  6445. if (aj === "max" && this.orientation === "horizontal") {
  6446. this.range.stop(1, 1)[ah ? "animate" : "css"]({
  6447. width: (100 - ak) + "%"
  6448. }, ai.animate)
  6449. }
  6450. if (aj === "min" && this.orientation === "vertical") {
  6451. this.range.stop(1, 1)[ah ? "animate" : "css"]({
  6452. height: ak + "%"
  6453. }, ai.animate)
  6454. }
  6455. if (aj === "max" && this.orientation === "vertical") {
  6456. this.range.stop(1, 1)[ah ? "animate" : "css"]({
  6457. height: (100 - ak) + "%"
  6458. }, ai.animate)
  6459. }
  6460. }
  6461. },
  6462. _handleEvents: {
  6463. keydown: function(ak) {
  6464. var al, ai, ah, aj, ag = K(ak.target).data("ui-slider-handle-index");
  6465. switch (ak.keyCode) {
  6466. case K.ui.keyCode.HOME:
  6467. case K.ui.keyCode.END:
  6468. case K.ui.keyCode.PAGE_UP:
  6469. case K.ui.keyCode.PAGE_DOWN:
  6470. case K.ui.keyCode.UP:
  6471. case K.ui.keyCode.RIGHT:
  6472. case K.ui.keyCode.DOWN:
  6473. case K.ui.keyCode.LEFT:
  6474. ak.preventDefault();
  6475. if (!this._keySliding) {
  6476. this._keySliding = true;
  6477. this._addClass(K(ak.target), null, "ui-state-active");
  6478. al = this._start(ak, ag);
  6479. if (al === false) {
  6480. return
  6481. }
  6482. }
  6483. break
  6484. }
  6485. aj = this.options.step;
  6486. if (this._hasMultipleValues()) {
  6487. ai = ah = this.values(ag)
  6488. } else {
  6489. ai = ah = this.value()
  6490. }
  6491. switch (ak.keyCode) {
  6492. case K.ui.keyCode.HOME:
  6493. ah = this._valueMin();
  6494. break;
  6495. case K.ui.keyCode.END:
  6496. ah = this._valueMax();
  6497. break;
  6498. case K.ui.keyCode.PAGE_UP:
  6499. ah = this._trimAlignValue(ai + ((this._valueMax() - this._valueMin()) / this.numPages));
  6500. break;
  6501. case K.ui.keyCode.PAGE_DOWN:
  6502. ah = this._trimAlignValue(ai - ((this._valueMax() - this._valueMin()) / this.numPages));
  6503. break;
  6504. case K.ui.keyCode.UP:
  6505. case K.ui.keyCode.RIGHT:
  6506. if (ai === this._valueMax()) {
  6507. return
  6508. }
  6509. ah = this._trimAlignValue(ai + aj);
  6510. break;
  6511. case K.ui.keyCode.DOWN:
  6512. case K.ui.keyCode.LEFT:
  6513. if (ai === this._valueMin()) {
  6514. return
  6515. }
  6516. ah = this._trimAlignValue(ai - aj);
  6517. break
  6518. }
  6519. this._slide(ak, ag, ah)
  6520. },
  6521. keyup: function(ah) {
  6522. var ag = K(ah.target).data("ui-slider-handle-index");
  6523. if (this._keySliding) {
  6524. this._keySliding = false;
  6525. this._stop(ah, ag);
  6526. this._change(ah, ag);
  6527. this._removeClass(K(ah.target), null, "ui-state-active")
  6528. }
  6529. }
  6530. }
  6531. });
  6532. /*!
  6533. * jQuery UI Effects 1.12.1
  6534. * http://jqueryui.com
  6535. *
  6536. * Copyright jQuery Foundation and other contributors
  6537. * Released under the MIT license.
  6538. * http://jquery.org/license
  6539. */
  6540. var o = "ui-effects-"
  6541. , t = "ui-effects-style"
  6542. , u = "ui-effects-animated"
  6543. , x = K;
  6544. K.effects = {
  6545. effect: {}
  6546. };
  6547. /*!
  6548. * jQuery Color Animations v2.1.2
  6549. * https://github.com/jquery/jquery-color
  6550. *
  6551. * Copyright 2014 jQuery Foundation and other contributors
  6552. * Released under the MIT license.
  6553. * http://jquery.org/license
  6554. *
  6555. * Date: Wed Jan 16 08:47:09 2013 -0600
  6556. */
  6557. (function(av, aj) {
  6558. var aq = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", an = /^([\-+])=\s*(\d+\.?\d*)/, am = [{
  6559. re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  6560. parse: function(aw) {
  6561. return [aw[1], aw[2], aw[3], aw[4]]
  6562. }
  6563. }, {
  6564. re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  6565. parse: function(aw) {
  6566. return [aw[1] * 2.55, aw[2] * 2.55, aw[3] * 2.55, aw[4]]
  6567. }
  6568. }, {
  6569. re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
  6570. parse: function(aw) {
  6571. return [parseInt(aw[1], 16), parseInt(aw[2], 16), parseInt(aw[3], 16)]
  6572. }
  6573. }, {
  6574. re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
  6575. parse: function(aw) {
  6576. return [parseInt(aw[1] + aw[1], 16), parseInt(aw[2] + aw[2], 16), parseInt(aw[3] + aw[3], 16)]
  6577. }
  6578. }, {
  6579. re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  6580. space: "hsla",
  6581. parse: function(aw) {
  6582. return [aw[1], aw[2] / 100, aw[3] / 100, aw[4]]
  6583. }
  6584. }], ak = av.Color = function(ax, ay, aw, az) {
  6585. return new av.Color.fn.parse(ax,ay,aw,az)
  6586. }
  6587. , ap = {
  6588. rgba: {
  6589. props: {
  6590. red: {
  6591. idx: 0,
  6592. type: "byte"
  6593. },
  6594. green: {
  6595. idx: 1,
  6596. type: "byte"
  6597. },
  6598. blue: {
  6599. idx: 2,
  6600. type: "byte"
  6601. }
  6602. }
  6603. },
  6604. hsla: {
  6605. props: {
  6606. hue: {
  6607. idx: 0,
  6608. type: "degrees"
  6609. },
  6610. saturation: {
  6611. idx: 1,
  6612. type: "percent"
  6613. },
  6614. lightness: {
  6615. idx: 2,
  6616. type: "percent"
  6617. }
  6618. }
  6619. }
  6620. }, au = {
  6621. "byte": {
  6622. floor: true,
  6623. max: 255
  6624. },
  6625. percent: {
  6626. max: 1
  6627. },
  6628. degrees: {
  6629. mod: 360,
  6630. floor: true
  6631. }
  6632. }, at = ak.support = {}, ah = av("<p>")[0], ag, ar = av.each;
  6633. ah.style.cssText = "background-color:rgba(1,1,1,.5)";
  6634. at.rgba = ah.style.backgroundColor.indexOf("rgba") > -1;
  6635. ar(ap, function(aw, ax) {
  6636. ax.cache = "_" + aw;
  6637. ax.props.alpha = {
  6638. idx: 3,
  6639. type: "percent",
  6640. def: 1
  6641. }
  6642. });
  6643. function ao(ax, az, ay) {
  6644. var aw = au[az.type] || {};
  6645. if (ax == null) {
  6646. return (ay || !az.def) ? null : az.def
  6647. }
  6648. ax = aw.floor ? ~~ax : parseFloat(ax);
  6649. if (isNaN(ax)) {
  6650. return az.def
  6651. }
  6652. if (aw.mod) {
  6653. return (ax + aw.mod) % aw.mod
  6654. }
  6655. return 0 > ax ? 0 : aw.max < ax ? aw.max : ax
  6656. }
  6657. function al(aw) {
  6658. var ay = ak()
  6659. , ax = ay._rgba = [];
  6660. aw = aw.toLowerCase();
  6661. ar(am, function(aD, aE) {
  6662. var aB, aC = aE.re.exec(aw), aA = aC && aE.parse(aC), az = aE.space || "rgba";
  6663. if (aA) {
  6664. aB = ay[az](aA);
  6665. ay[ap[az].cache] = aB[ap[az].cache];
  6666. ax = ay._rgba = aB._rgba;
  6667. return false
  6668. }
  6669. });
  6670. if (ax.length) {
  6671. if (ax.join() === "0,0,0,0") {
  6672. av.extend(ax, ag.transparent)
  6673. }
  6674. return ay
  6675. }
  6676. return ag[aw]
  6677. }
  6678. ak.fn = av.extend(ak.prototype, {
  6679. parse: function(aC, aA, aw, aB) {
  6680. if (aC === aj) {
  6681. this._rgba = [null, null, null, null];
  6682. return this
  6683. }
  6684. if (aC.jquery || aC.nodeType) {
  6685. aC = av(aC).css(aA);
  6686. aA = aj
  6687. }
  6688. var az = this
  6689. , ay = av.type(aC)
  6690. , ax = this._rgba = [];
  6691. if (aA !== aj) {
  6692. aC = [aC, aA, aw, aB];
  6693. ay = "array"
  6694. }
  6695. if (ay === "string") {
  6696. return this.parse(al(aC) || ag._default)
  6697. }
  6698. if (ay === "array") {
  6699. ar(ap.rgba.props, function(aD, aE) {
  6700. ax[aE.idx] = ao(aC[aE.idx], aE)
  6701. });
  6702. return this
  6703. }
  6704. if (ay === "object") {
  6705. if (aC instanceof ak) {
  6706. ar(ap, function(aD, aE) {
  6707. if (aC[aE.cache]) {
  6708. az[aE.cache] = aC[aE.cache].slice()
  6709. }
  6710. })
  6711. } else {
  6712. ar(ap, function(aE, aF) {
  6713. var aD = aF.cache;
  6714. ar(aF.props, function(aG, aH) {
  6715. if (!az[aD] && aF.to) {
  6716. if (aG === "alpha" || aC[aG] == null) {
  6717. return
  6718. }
  6719. az[aD] = aF.to(az._rgba)
  6720. }
  6721. az[aD][aH.idx] = ao(aC[aG], aH, true)
  6722. });
  6723. if (az[aD] && av.inArray(null, az[aD].slice(0, 3)) < 0) {
  6724. az[aD][3] = 1;
  6725. if (aF.from) {
  6726. az._rgba = aF.from(az[aD])
  6727. }
  6728. }
  6729. })
  6730. }
  6731. return this
  6732. }
  6733. },
  6734. is: function(ay) {
  6735. var aw = ak(ay)
  6736. , az = true
  6737. , ax = this;
  6738. ar(ap, function(aA, aC) {
  6739. var aD, aB = aw[aC.cache];
  6740. if (aB) {
  6741. aD = ax[aC.cache] || aC.to && aC.to(ax._rgba) || [];
  6742. ar(aC.props, function(aE, aF) {
  6743. if (aB[aF.idx] != null) {
  6744. az = (aB[aF.idx] === aD[aF.idx]);
  6745. return az
  6746. }
  6747. })
  6748. }
  6749. return az
  6750. });
  6751. return az
  6752. },
  6753. _space: function() {
  6754. var aw = []
  6755. , ax = this;
  6756. ar(ap, function(ay, az) {
  6757. if (ax[az.cache]) {
  6758. aw.push(ay)
  6759. }
  6760. });
  6761. return aw.pop()
  6762. },
  6763. transition: function(ax, aD) {
  6764. var ay = ak(ax)
  6765. , az = ay._space()
  6766. , aA = ap[az]
  6767. , aB = this.alpha() === 0 ? ak("transparent") : this
  6768. , aC = aB[aA.cache] || aA.to(aB._rgba)
  6769. , aw = aC.slice();
  6770. ay = ay[aA.cache];
  6771. ar(aA.props, function(aH, aJ) {
  6772. var aG = aJ.idx
  6773. , aF = aC[aG]
  6774. , aE = ay[aG]
  6775. , aI = au[aJ.type] || {};
  6776. if (aE === null) {
  6777. return
  6778. }
  6779. if (aF === null) {
  6780. aw[aG] = aE
  6781. } else {
  6782. if (aI.mod) {
  6783. if (aE - aF > aI.mod / 2) {
  6784. aF += aI.mod
  6785. } else {
  6786. if (aF - aE > aI.mod / 2) {
  6787. aF -= aI.mod
  6788. }
  6789. }
  6790. }
  6791. aw[aG] = ao((aE - aF) * aD + aF, aJ)
  6792. }
  6793. });
  6794. return this[az](aw)
  6795. },
  6796. blend: function(az) {
  6797. if (this._rgba[3] === 1) {
  6798. return this
  6799. }
  6800. var ay = this._rgba.slice()
  6801. , ax = ay.pop()
  6802. , aw = ak(az)._rgba;
  6803. return ak(av.map(ay, function(aA, aB) {
  6804. return (1 - ax) * aw[aB] + ax * aA
  6805. }))
  6806. },
  6807. toRgbaString: function() {
  6808. var ax = "rgba("
  6809. , aw = av.map(this._rgba, function(ay, az) {
  6810. return ay == null ? (az > 2 ? 1 : 0) : ay
  6811. });
  6812. if (aw[3] === 1) {
  6813. aw.pop();
  6814. ax = "rgb("
  6815. }
  6816. return ax + aw.join() + ")"
  6817. },
  6818. toHslaString: function() {
  6819. var ax = "hsla("
  6820. , aw = av.map(this.hsla(), function(ay, az) {
  6821. if (ay == null) {
  6822. ay = az > 2 ? 1 : 0
  6823. }
  6824. if (az && az < 3) {
  6825. ay = Math.round(ay * 100) + "%"
  6826. }
  6827. return ay
  6828. });
  6829. if (aw[3] === 1) {
  6830. aw.pop();
  6831. ax = "hsl("
  6832. }
  6833. return ax + aw.join() + ")"
  6834. },
  6835. toHexString: function(aw) {
  6836. var ax = this._rgba.slice()
  6837. , ay = ax.pop();
  6838. if (aw) {
  6839. ax.push(~~(ay * 255))
  6840. }
  6841. return "#" + av.map(ax, function(az) {
  6842. az = (az || 0).toString(16);
  6843. return az.length === 1 ? "0" + az : az
  6844. }).join("")
  6845. },
  6846. toString: function() {
  6847. return this._rgba[3] === 0 ? "transparent" : this.toRgbaString()
  6848. }
  6849. });
  6850. ak.fn.parse.prototype = ak.fn;
  6851. function ai(ay, ax, aw) {
  6852. aw = (aw + 1) % 1;
  6853. if (aw * 6 < 1) {
  6854. return ay + (ax - ay) * aw * 6
  6855. }
  6856. if (aw * 2 < 1) {
  6857. return ax
  6858. }
  6859. if (aw * 3 < 2) {
  6860. return ay + (ax - ay) * ((2 / 3) - aw) * 6
  6861. }
  6862. return ay
  6863. }
  6864. ap.hsla.to = function(ay) {
  6865. if (ay[0] == null || ay[1] == null || ay[2] == null) {
  6866. return [null, null, null, ay[3]]
  6867. }
  6868. var aw = ay[0] / 255, aB = ay[1] / 255, aC = ay[2] / 255, aE = ay[3], aD = Math.max(aw, aB, aC), az = Math.min(aw, aB, aC), aF = aD - az, aG = aD + az, ax = aG * 0.5, aA, aH;
  6869. if (az === aD) {
  6870. aA = 0
  6871. } else {
  6872. if (aw === aD) {
  6873. aA = (60 * (aB - aC) / aF) + 360
  6874. } else {
  6875. if (aB === aD) {
  6876. aA = (60 * (aC - aw) / aF) + 120
  6877. } else {
  6878. aA = (60 * (aw - aB) / aF) + 240
  6879. }
  6880. }
  6881. }
  6882. if (aF === 0) {
  6883. aH = 0
  6884. } else {
  6885. if (ax <= 0.5) {
  6886. aH = aF / aG
  6887. } else {
  6888. aH = aF / (2 - aG)
  6889. }
  6890. }
  6891. return [Math.round(aA) % 360, aH, ax, aE == null ? 1 : aE]
  6892. }
  6893. ;
  6894. ap.hsla.from = function(aA) {
  6895. if (aA[0] == null || aA[1] == null || aA[2] == null) {
  6896. return [null, null, null, aA[3]]
  6897. }
  6898. var az = aA[0] / 360
  6899. , ay = aA[1]
  6900. , ax = aA[2]
  6901. , aw = aA[3]
  6902. , aB = ax <= 0.5 ? ax * (1 + ay) : ax + ay - ax * ay
  6903. , aC = 2 * ax - aB;
  6904. return [Math.round(ai(aC, aB, az + (1 / 3)) * 255), Math.round(ai(aC, aB, az) * 255), Math.round(ai(aC, aB, az - (1 / 3)) * 255), aw]
  6905. }
  6906. ;
  6907. ar(ap, function(ax, az) {
  6908. var ay = az.props
  6909. , aw = az.cache
  6910. , aB = az.to
  6911. , aA = az.from;
  6912. ak.fn[ax] = function(aG) {
  6913. if (aB && !this[aw]) {
  6914. this[aw] = aB(this._rgba)
  6915. }
  6916. if (aG === aj) {
  6917. return this[aw].slice()
  6918. }
  6919. var aD, aF = av.type(aG), aC = (aF === "array" || aF === "object") ? aG : arguments, aE = this[aw].slice();
  6920. ar(ay, function(aH, aJ) {
  6921. var aI = aC[aF === "object" ? aH : aJ.idx];
  6922. if (aI == null) {
  6923. aI = aE[aJ.idx]
  6924. }
  6925. aE[aJ.idx] = ao(aI, aJ)
  6926. });
  6927. if (aA) {
  6928. aD = ak(aA(aE));
  6929. aD[aw] = aE;
  6930. return aD
  6931. } else {
  6932. return ak(aE)
  6933. }
  6934. }
  6935. ;
  6936. ar(ay, function(aC, aD) {
  6937. if (ak.fn[aC]) {
  6938. return
  6939. }
  6940. ak.fn[aC] = function(aH) {
  6941. var aJ = av.type(aH), aG = (aC === "alpha" ? (this._hsla ? "hsla" : "rgba") : ax), aF = this[aG](), aI = aF[aD.idx], aE;
  6942. if (aJ === "undefined") {
  6943. return aI
  6944. }
  6945. if (aJ === "function") {
  6946. aH = aH.call(this, aI);
  6947. aJ = av.type(aH)
  6948. }
  6949. if (aH == null && aD.empty) {
  6950. return this
  6951. }
  6952. if (aJ === "string") {
  6953. aE = an.exec(aH);
  6954. if (aE) {
  6955. aH = aI + parseFloat(aE[2]) * (aE[1] === "+" ? 1 : -1)
  6956. }
  6957. }
  6958. aF[aD.idx] = aH;
  6959. return this[aG](aF)
  6960. }
  6961. })
  6962. });
  6963. ak.hook = function(ax) {
  6964. var aw = ax.split(" ");
  6965. ar(aw, function(ay, az) {
  6966. av.cssHooks[az] = {
  6967. set: function(aD, aE) {
  6968. var aB, aC, aA = "";
  6969. if (aE !== "transparent" && (av.type(aE) !== "string" || (aB = al(aE)))) {
  6970. aE = ak(aB || aE);
  6971. if (!at.rgba && aE._rgba[3] !== 1) {
  6972. aC = az === "backgroundColor" ? aD.parentNode : aD;
  6973. while ((aA === "" || aA === "transparent") && aC && aC.style) {
  6974. try {
  6975. aA = av.css(aC, "backgroundColor");
  6976. aC = aC.parentNode
  6977. } catch (aF) {}
  6978. }
  6979. aE = aE.blend(aA && aA !== "transparent" ? aA : "_default")
  6980. }
  6981. aE = aE.toRgbaString()
  6982. }
  6983. try {
  6984. aD.style[az] = aE
  6985. } catch (aF) {}
  6986. }
  6987. };
  6988. av.fx.step[az] = function(aA) {
  6989. if (!aA.colorInit) {
  6990. aA.start = ak(aA.elem, az);
  6991. aA.end = ak(aA.end);
  6992. aA.colorInit = true
  6993. }
  6994. av.cssHooks[az].set(aA.elem, aA.start.transition(aA.end, aA.pos))
  6995. }
  6996. })
  6997. }
  6998. ;
  6999. ak.hook(aq);
  7000. av.cssHooks.borderColor = {
  7001. expand: function(ax) {
  7002. var aw = {};
  7003. ar(["Top", "Right", "Bottom", "Left"], function(az, ay) {
  7004. aw["border" + ay + "Color"] = ax
  7005. });
  7006. return aw
  7007. }
  7008. };
  7009. ag = av.Color.names = {
  7010. aqua: "#00ffff",
  7011. black: "#000000",
  7012. blue: "#0000ff",
  7013. fuchsia: "#ff00ff",
  7014. gray: "#808080",
  7015. green: "#008000",
  7016. lime: "#00ff00",
  7017. maroon: "#800000",
  7018. navy: "#000080",
  7019. olive: "#808000",
  7020. purple: "#800080",
  7021. red: "#ff0000",
  7022. silver: "#c0c0c0",
  7023. teal: "#008080",
  7024. white: "#ffffff",
  7025. yellow: "#ffff00",
  7026. transparent: [null, null, null, 0],
  7027. _default: "#ffffff"
  7028. }
  7029. }
  7030. )(x);
  7031. (function() {
  7032. var ah = ["add", "remove", "toggle"]
  7033. , ai = {
  7034. border: 1,
  7035. borderBottom: 1,
  7036. borderColor: 1,
  7037. borderLeft: 1,
  7038. borderRight: 1,
  7039. borderTop: 1,
  7040. borderWidth: 1,
  7041. margin: 1,
  7042. padding: 1
  7043. };
  7044. K.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function(ak, al) {
  7045. K.fx.step[al] = function(am) {
  7046. if (am.end !== "none" && !am.setAttr || am.pos === 1 && !am.setAttr) {
  7047. x.style(am.elem, al, am.end);
  7048. am.setAttr = true
  7049. }
  7050. }
  7051. });
  7052. function aj(ao) {
  7053. var al, ak, am = ao.ownerDocument.defaultView ? ao.ownerDocument.defaultView.getComputedStyle(ao, null) : ao.currentStyle, an = {};
  7054. if (am && am.length && am[0] && am[am[0]]) {
  7055. ak = am.length;
  7056. while (ak--) {
  7057. al = am[ak];
  7058. if (typeof am[al] === "string") {
  7059. an[K.camelCase(al)] = am[al]
  7060. }
  7061. }
  7062. } else {
  7063. for (al in am) {
  7064. if (typeof am[al] === "string") {
  7065. an[al] = am[al]
  7066. }
  7067. }
  7068. }
  7069. return an
  7070. }
  7071. function ag(ak, am) {
  7072. var ao = {}, al, an;
  7073. for (al in am) {
  7074. an = am[al];
  7075. if (ak[al] !== an) {
  7076. if (!ai[al]) {
  7077. if (K.fx.step[al] || !isNaN(parseFloat(an))) {
  7078. ao[al] = an
  7079. }
  7080. }
  7081. }
  7082. }
  7083. return ao
  7084. }
  7085. if (!K.fn.addBack) {
  7086. K.fn.addBack = function(ak) {
  7087. return this.add(ak == null ? this.prevObject : this.prevObject.filter(ak))
  7088. }
  7089. }
  7090. K.effects.animateClass = function(ak, al, ao, an) {
  7091. var am = K.speed(al, ao, an);
  7092. return this.queue(function() {
  7093. var ar = K(this), ap = ar.attr("class") || "", aq, at = am.children ? ar.find("*").addBack() : ar;
  7094. at = at.map(function() {
  7095. var au = K(this);
  7096. return {
  7097. el: au,
  7098. start: aj(this)
  7099. }
  7100. });
  7101. aq = function() {
  7102. K.each(ah, function(au, av) {
  7103. if (ak[av]) {
  7104. ar[av + "Class"](ak[av])
  7105. }
  7106. })
  7107. }
  7108. ;
  7109. aq();
  7110. at = at.map(function() {
  7111. this.end = aj(this.el[0]);
  7112. this.diff = ag(this.start, this.end);
  7113. return this
  7114. });
  7115. ar.attr("class", ap);
  7116. at = at.map(function() {
  7117. var aw = this
  7118. , au = K.Deferred()
  7119. , av = K.extend({}, am, {
  7120. queue: false,
  7121. complete: function() {
  7122. au.resolve(aw)
  7123. }
  7124. });
  7125. this.el.animate(this.diff, av);
  7126. return au.promise()
  7127. });
  7128. K.when.apply(K, at.get()).done(function() {
  7129. aq();
  7130. K.each(arguments, function() {
  7131. var au = this.el;
  7132. K.each(this.diff, function(av) {
  7133. au.css(av, "")
  7134. })
  7135. });
  7136. am.complete.call(ar[0])
  7137. })
  7138. })
  7139. }
  7140. ;
  7141. K.fn.extend({
  7142. addClass: (function(ak) {
  7143. return function(am, al, ao, an) {
  7144. return al ? K.effects.animateClass.call(this, {
  7145. add: am
  7146. }, al, ao, an) : ak.apply(this, arguments)
  7147. }
  7148. }
  7149. )(K.fn.addClass),
  7150. removeClass: (function(ak) {
  7151. return function(am, al, ao, an) {
  7152. return arguments.length > 1 ? K.effects.animateClass.call(this, {
  7153. remove: am
  7154. }, al, ao, an) : ak.apply(this, arguments)
  7155. }
  7156. }
  7157. )(K.fn.removeClass),
  7158. toggleClass: (function(ak) {
  7159. return function(an, am, al, ap, ao) {
  7160. if (typeof am === "boolean" || am === undefined) {
  7161. if (!al) {
  7162. return ak.apply(this, arguments)
  7163. } else {
  7164. return K.effects.animateClass.call(this, (am ? {
  7165. add: an
  7166. } : {
  7167. remove: an
  7168. }), al, ap, ao)
  7169. }
  7170. } else {
  7171. return K.effects.animateClass.call(this, {
  7172. toggle: an
  7173. }, am, al, ap)
  7174. }
  7175. }
  7176. }
  7177. )(K.fn.toggleClass),
  7178. switchClass: function(ak, am, al, ao, an) {
  7179. return K.effects.animateClass.call(this, {
  7180. add: am,
  7181. remove: ak
  7182. }, al, ao, an)
  7183. }
  7184. })
  7185. }
  7186. )();
  7187. (function() {
  7188. if (K.expr && K.expr.filters && K.expr.filters.animated) {
  7189. K.expr.filters.animated = (function(aj) {
  7190. return function(ak) {
  7191. return !!K(ak).data(u) || aj(ak)
  7192. }
  7193. }
  7194. )(K.expr.filters.animated)
  7195. }
  7196. if (K.uiBackCompat !== false) {
  7197. K.extend(K.effects, {
  7198. save: function(ak, am) {
  7199. var aj = 0
  7200. , al = am.length;
  7201. for (; aj < al; aj++) {
  7202. if (am[aj] !== null) {
  7203. ak.data(o + am[aj], ak[0].style[am[aj]])
  7204. }
  7205. }
  7206. },
  7207. restore: function(ak, an) {
  7208. var am, aj = 0, al = an.length;
  7209. for (; aj < al; aj++) {
  7210. if (an[aj] !== null) {
  7211. am = ak.data(o + an[aj]);
  7212. ak.css(an[aj], am)
  7213. }
  7214. }
  7215. },
  7216. setMode: function(aj, ak) {
  7217. if (ak === "toggle") {
  7218. ak = aj.is(":hidden") ? "show" : "hide"
  7219. }
  7220. return ak
  7221. },
  7222. createWrapper: function(ak) {
  7223. if (ak.parent().is(".ui-effects-wrapper")) {
  7224. return ak.parent()
  7225. }
  7226. var al = {
  7227. width: ak.outerWidth(true),
  7228. height: ak.outerHeight(true),
  7229. "float": ak.css("float")
  7230. }
  7231. , ao = K("<div></div>").addClass("ui-effects-wrapper").css({
  7232. fontSize: "100%",
  7233. background: "transparent",
  7234. border: "none",
  7235. margin: 0,
  7236. padding: 0
  7237. })
  7238. , aj = {
  7239. width: ak.width(),
  7240. height: ak.height()
  7241. }
  7242. , an = document.activeElement;
  7243. try {
  7244. an.id
  7245. } catch (am) {
  7246. an = document.body
  7247. }
  7248. ak.wrap(ao);
  7249. if (ak[0] === an || K.contains(ak[0], an)) {
  7250. K(an).trigger("focus")
  7251. }
  7252. ao = ak.parent();
  7253. if (ak.css("position") === "static") {
  7254. ao.css({
  7255. position: "relative"
  7256. });
  7257. ak.css({
  7258. position: "relative"
  7259. })
  7260. } else {
  7261. K.extend(al, {
  7262. position: ak.css("position"),
  7263. zIndex: ak.css("z-index")
  7264. });
  7265. K.each(["top", "left", "bottom", "right"], function(ap, aq) {
  7266. al[aq] = ak.css(aq);
  7267. if (isNaN(parseInt(al[aq], 10))) {
  7268. al[aq] = "auto"
  7269. }
  7270. });
  7271. ak.css({
  7272. position: "relative",
  7273. top: 0,
  7274. left: 0,
  7275. right: "auto",
  7276. bottom: "auto"
  7277. })
  7278. }
  7279. ak.css(aj);
  7280. return ao.css(al).show()
  7281. },
  7282. removeWrapper: function(aj) {
  7283. var ak = document.activeElement;
  7284. if (aj.parent().is(".ui-effects-wrapper")) {
  7285. aj.parent().replaceWith(aj);
  7286. if (aj[0] === ak || K.contains(aj[0], ak)) {
  7287. K(ak).trigger("focus")
  7288. }
  7289. }
  7290. return aj
  7291. }
  7292. })
  7293. }
  7294. K.extend(K.effects, {
  7295. version: "1.12.1",
  7296. define: function(aj, al, ak) {
  7297. if (!ak) {
  7298. ak = al;
  7299. al = "effect"
  7300. }
  7301. K.effects.effect[aj] = ak;
  7302. K.effects.effect[aj].mode = al;
  7303. return ak
  7304. },
  7305. scaledDimensions: function(ak, al, am) {
  7306. if (al === 0) {
  7307. return {
  7308. height: 0,
  7309. width: 0,
  7310. outerHeight: 0,
  7311. outerWidth: 0
  7312. }
  7313. }
  7314. var aj = am !== "horizontal" ? ((al || 100) / 100) : 1
  7315. , an = am !== "vertical" ? ((al || 100) / 100) : 1;
  7316. return {
  7317. height: ak.height() * an,
  7318. width: ak.width() * aj,
  7319. outerHeight: ak.outerHeight() * an,
  7320. outerWidth: ak.outerWidth() * aj
  7321. }
  7322. },
  7323. clipToBox: function(aj) {
  7324. return {
  7325. width: aj.clip.right - aj.clip.left,
  7326. height: aj.clip.bottom - aj.clip.top,
  7327. left: aj.clip.left,
  7328. top: aj.clip.top
  7329. }
  7330. },
  7331. unshift: function(ak, am, al) {
  7332. var aj = ak.queue();
  7333. if (am > 1) {
  7334. aj.splice.apply(aj, [1, 0].concat(aj.splice(am, al)))
  7335. }
  7336. ak.dequeue()
  7337. },
  7338. saveStyle: function(aj) {
  7339. aj.data(t, aj[0].style.cssText)
  7340. },
  7341. restoreStyle: function(aj) {
  7342. aj[0].style.cssText = aj.data(t) || "";
  7343. aj.removeData(t)
  7344. },
  7345. mode: function(aj, al) {
  7346. var ak = aj.is(":hidden");
  7347. if (al === "toggle") {
  7348. al = ak ? "show" : "hide"
  7349. }
  7350. if (ak ? al === "hide" : al === "show") {
  7351. al = "none"
  7352. }
  7353. return al
  7354. },
  7355. getBaseline: function(ak, al) {
  7356. var am, aj;
  7357. switch (ak[0]) {
  7358. case "top":
  7359. am = 0;
  7360. break;
  7361. case "middle":
  7362. am = 0.5;
  7363. break;
  7364. case "bottom":
  7365. am = 1;
  7366. break;
  7367. default:
  7368. am = ak[0] / al.height
  7369. }
  7370. switch (ak[1]) {
  7371. case "left":
  7372. aj = 0;
  7373. break;
  7374. case "center":
  7375. aj = 0.5;
  7376. break;
  7377. case "right":
  7378. aj = 1;
  7379. break;
  7380. default:
  7381. aj = ak[1] / al.width
  7382. }
  7383. return {
  7384. x: aj,
  7385. y: am
  7386. }
  7387. },
  7388. createPlaceholder: function(ak) {
  7389. var am, al = ak.css("position"), aj = ak.position();
  7390. ak.css({
  7391. marginTop: ak.css("marginTop"),
  7392. marginBottom: ak.css("marginBottom"),
  7393. marginLeft: ak.css("marginLeft"),
  7394. marginRight: ak.css("marginRight")
  7395. }).outerWidth(ak.outerWidth()).outerHeight(ak.outerHeight());
  7396. if (/^(static|relative)/.test(al)) {
  7397. al = "absolute";
  7398. am = K("<" + ak[0].nodeName + ">").insertAfter(ak).css({
  7399. display: /^(inline|ruby)/.test(ak.css("display")) ? "inline-block" : "block",
  7400. visibility: "hidden",
  7401. marginTop: ak.css("marginTop"),
  7402. marginBottom: ak.css("marginBottom"),
  7403. marginLeft: ak.css("marginLeft"),
  7404. marginRight: ak.css("marginRight"),
  7405. "float": ak.css("float")
  7406. }).outerWidth(ak.outerWidth()).outerHeight(ak.outerHeight()).addClass("ui-effects-placeholder");
  7407. ak.data(o + "placeholder", am)
  7408. }
  7409. ak.css({
  7410. position: al,
  7411. left: aj.left,
  7412. top: aj.top
  7413. });
  7414. return am
  7415. },
  7416. removePlaceholder: function(aj) {
  7417. var al = o + "placeholder"
  7418. , ak = aj.data(al);
  7419. if (ak) {
  7420. ak.remove();
  7421. aj.removeData(al)
  7422. }
  7423. },
  7424. cleanUp: function(aj) {
  7425. K.effects.restoreStyle(aj);
  7426. K.effects.removePlaceholder(aj)
  7427. },
  7428. setTransition: function(ak, am, aj, al) {
  7429. al = al || {};
  7430. K.each(am, function(ao, an) {
  7431. var ap = ak.cssUnit(an);
  7432. if (ap[0] > 0) {
  7433. al[an] = ap[0] * aj + ap[1]
  7434. }
  7435. });
  7436. return al
  7437. }
  7438. });
  7439. function ah(ak, aj, al, am) {
  7440. if (K.isPlainObject(ak)) {
  7441. aj = ak;
  7442. ak = ak.effect
  7443. }
  7444. ak = {
  7445. effect: ak
  7446. };
  7447. if (aj == null) {
  7448. aj = {}
  7449. }
  7450. if (K.isFunction(aj)) {
  7451. am = aj;
  7452. al = null;
  7453. aj = {}
  7454. }
  7455. if (typeof aj === "number" || K.fx.speeds[aj]) {
  7456. am = al;
  7457. al = aj;
  7458. aj = {}
  7459. }
  7460. if (K.isFunction(al)) {
  7461. am = al;
  7462. al = null
  7463. }
  7464. if (aj) {
  7465. K.extend(ak, aj)
  7466. }
  7467. al = al || aj.duration;
  7468. ak.duration = K.fx.off ? 0 : typeof al === "number" ? al : al in K.fx.speeds ? K.fx.speeds[al] : K.fx.speeds._default;
  7469. ak.complete = am || aj.complete;
  7470. return ak
  7471. }
  7472. function ai(aj) {
  7473. if (!aj || typeof aj === "number" || K.fx.speeds[aj]) {
  7474. return true
  7475. }
  7476. if (typeof aj === "string" && !K.effects.effect[aj]) {
  7477. return true
  7478. }
  7479. if (K.isFunction(aj)) {
  7480. return true
  7481. }
  7482. if (typeof aj === "object" && !aj.effect) {
  7483. return true
  7484. }
  7485. return false
  7486. }
  7487. K.fn.extend({
  7488. effect: function() {
  7489. var ar = ah.apply(this, arguments)
  7490. , aq = K.effects.effect[ar.effect]
  7491. , an = aq.mode
  7492. , ap = ar.queue
  7493. , am = ap || "fx"
  7494. , aj = ar.complete
  7495. , ao = ar.mode
  7496. , ak = []
  7497. , at = function(aw) {
  7498. var av = K(this)
  7499. , au = K.effects.mode(av, ao) || an;
  7500. av.data(u, true);
  7501. ak.push(au);
  7502. if (an && (au === "show" || (au === an && au === "hide"))) {
  7503. av.show()
  7504. }
  7505. if (!an || au !== "none") {
  7506. K.effects.saveStyle(av)
  7507. }
  7508. if (K.isFunction(aw)) {
  7509. aw()
  7510. }
  7511. };
  7512. if (K.fx.off || !aq) {
  7513. if (ao) {
  7514. return this[ao](ar.duration, aj)
  7515. } else {
  7516. return this.each(function() {
  7517. if (aj) {
  7518. aj.call(this)
  7519. }
  7520. })
  7521. }
  7522. }
  7523. function al(aw) {
  7524. var ax = K(this);
  7525. function av() {
  7526. ax.removeData(u);
  7527. K.effects.cleanUp(ax);
  7528. if (ar.mode === "hide") {
  7529. ax.hide()
  7530. }
  7531. au()
  7532. }
  7533. function au() {
  7534. if (K.isFunction(aj)) {
  7535. aj.call(ax[0])
  7536. }
  7537. if (K.isFunction(aw)) {
  7538. aw()
  7539. }
  7540. }
  7541. ar.mode = ak.shift();
  7542. if (K.uiBackCompat !== false && !an) {
  7543. if (ax.is(":hidden") ? ao === "hide" : ao === "show") {
  7544. ax[ao]();
  7545. au()
  7546. } else {
  7547. aq.call(ax[0], ar, au)
  7548. }
  7549. } else {
  7550. if (ar.mode === "none") {
  7551. ax[ao]();
  7552. au()
  7553. } else {
  7554. aq.call(ax[0], ar, av)
  7555. }
  7556. }
  7557. }
  7558. return ap === false ? this.each(at).each(al) : this.queue(am, at).queue(am, al)
  7559. },
  7560. show: (function(aj) {
  7561. return function(al) {
  7562. if (ai(al)) {
  7563. return aj.apply(this, arguments)
  7564. } else {
  7565. var ak = ah.apply(this, arguments);
  7566. ak.mode = "show";
  7567. return this.effect.call(this, ak)
  7568. }
  7569. }
  7570. }
  7571. )(K.fn.show),
  7572. hide: (function(aj) {
  7573. return function(al) {
  7574. if (ai(al)) {
  7575. return aj.apply(this, arguments)
  7576. } else {
  7577. var ak = ah.apply(this, arguments);
  7578. ak.mode = "hide";
  7579. return this.effect.call(this, ak)
  7580. }
  7581. }
  7582. }
  7583. )(K.fn.hide),
  7584. toggle: (function(aj) {
  7585. return function(al) {
  7586. if (ai(al) || typeof al === "boolean") {
  7587. return aj.apply(this, arguments)
  7588. } else {
  7589. var ak = ah.apply(this, arguments);
  7590. ak.mode = "toggle";
  7591. return this.effect.call(this, ak)
  7592. }
  7593. }
  7594. }
  7595. )(K.fn.toggle),
  7596. cssUnit: function(aj) {
  7597. var ak = this.css(aj)
  7598. , al = [];
  7599. K.each(["em", "px", "%", "pt"], function(am, an) {
  7600. if (ak.indexOf(an) > 0) {
  7601. al = [parseFloat(ak), an]
  7602. }
  7603. });
  7604. return al
  7605. },
  7606. cssClip: function(aj) {
  7607. if (aj) {
  7608. return this.css("clip", "rect(" + aj.top + "px " + aj.right + "px " + aj.bottom + "px " + aj.left + "px)")
  7609. }
  7610. return ag(this.css("clip"), this)
  7611. },
  7612. transfer: function(av, am) {
  7613. var ao = K(this)
  7614. , aq = K(av.to)
  7615. , au = aq.css("position") === "fixed"
  7616. , ap = K("body")
  7617. , ar = au ? ap.scrollTop() : 0
  7618. , at = au ? ap.scrollLeft() : 0
  7619. , aj = aq.offset()
  7620. , al = {
  7621. top: aj.top - ar,
  7622. left: aj.left - at,
  7623. height: aq.innerHeight(),
  7624. width: aq.innerWidth()
  7625. }
  7626. , an = ao.offset()
  7627. , ak = K("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(av.className).css({
  7628. top: an.top - ar,
  7629. left: an.left - at,
  7630. height: ao.innerHeight(),
  7631. width: ao.innerWidth(),
  7632. position: au ? "fixed" : "absolute"
  7633. }).animate(al, av.duration, av.easing, function() {
  7634. ak.remove();
  7635. if (K.isFunction(am)) {
  7636. am()
  7637. }
  7638. })
  7639. }
  7640. });
  7641. function ag(ao, al) {
  7642. var an = al.outerWidth()
  7643. , am = al.outerHeight()
  7644. , ak = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/
  7645. , aj = ak.exec(ao) || ["", 0, an, am, 0];
  7646. return {
  7647. top: parseFloat(aj[1]) || 0,
  7648. right: aj[2] === "auto" ? an : parseFloat(aj[2]),
  7649. bottom: aj[3] === "auto" ? am : parseFloat(aj[3]),
  7650. left: parseFloat(aj[4]) || 0
  7651. }
  7652. }
  7653. K.fx.step.clip = function(aj) {
  7654. if (!aj.clipInit) {
  7655. aj.start = K(aj.elem).cssClip();
  7656. if (typeof aj.end === "string") {
  7657. aj.end = ag(aj.end, aj.elem)
  7658. }
  7659. aj.clipInit = true
  7660. }
  7661. K(aj.elem).cssClip({
  7662. top: aj.pos * (aj.end.top - aj.start.top) + aj.start.top,
  7663. right: aj.pos * (aj.end.right - aj.start.right) + aj.start.right,
  7664. bottom: aj.pos * (aj.end.bottom - aj.start.bottom) + aj.start.bottom,
  7665. left: aj.pos * (aj.end.left - aj.start.left) + aj.start.left
  7666. })
  7667. }
  7668. }
  7669. )();
  7670. (function() {
  7671. var ag = {};
  7672. K.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function(ai, ah) {
  7673. ag[ah] = function(aj) {
  7674. return Math.pow(aj, ai + 2)
  7675. }
  7676. });
  7677. K.extend(ag, {
  7678. Sine: function(ah) {
  7679. return 1 - Math.cos(ah * Math.PI / 2)
  7680. },
  7681. Circ: function(ah) {
  7682. return 1 - Math.sqrt(1 - ah * ah)
  7683. },
  7684. Elastic: function(ah) {
  7685. return ah === 0 || ah === 1 ? ah : -Math.pow(2, 8 * (ah - 1)) * Math.sin(((ah - 1) * 80 - 7.5) * Math.PI / 15)
  7686. },
  7687. Back: function(ah) {
  7688. return ah * ah * (3 * ah - 2)
  7689. },
  7690. Bounce: function(aj) {
  7691. var ah, ai = 4;
  7692. while (aj < ((ah = Math.pow(2, --ai)) - 1) / 11) {}
  7693. return 1 / Math.pow(4, 3 - ai) - 7.5625 * Math.pow((ah * 3 - 2) / 22 - aj, 2)
  7694. }
  7695. });
  7696. K.each(ag, function(ai, ah) {
  7697. K.easing["easeIn" + ai] = ah;
  7698. K.easing["easeOut" + ai] = function(aj) {
  7699. return 1 - ah(1 - aj)
  7700. }
  7701. ;
  7702. K.easing["easeInOut" + ai] = function(aj) {
  7703. return aj < 0.5 ? ah(aj * 2) / 2 : 1 - ah(aj * -2 + 2) / 2
  7704. }
  7705. })
  7706. }
  7707. )();
  7708. var W = K.effects;
  7709. /*!
  7710. * jQuery UI Effects Blind 1.12.1
  7711. * http://jqueryui.com
  7712. *
  7713. * Copyright jQuery Foundation and other contributors
  7714. * Released under the MIT license.
  7715. * http://jquery.org/license
  7716. */
  7717. var X = K.effects.define("blind", "hide", function(ai, ag) {
  7718. var al = {
  7719. up: ["bottom", "top"],
  7720. vertical: ["bottom", "top"],
  7721. down: ["top", "bottom"],
  7722. left: ["right", "left"],
  7723. horizontal: ["right", "left"],
  7724. right: ["left", "right"]
  7725. }
  7726. , aj = K(this)
  7727. , ak = ai.direction || "up"
  7728. , an = aj.cssClip()
  7729. , ah = {
  7730. clip: K.extend({}, an)
  7731. }
  7732. , am = K.effects.createPlaceholder(aj);
  7733. ah.clip[al[ak][0]] = ah.clip[al[ak][1]];
  7734. if (ai.mode === "show") {
  7735. aj.cssClip(ah.clip);
  7736. if (am) {
  7737. am.css(K.effects.clipToBox(ah))
  7738. }
  7739. ah.clip = an
  7740. }
  7741. if (am) {
  7742. am.animate(K.effects.clipToBox(ah), ai.duration, ai.easing)
  7743. }
  7744. aj.animate(ah, {
  7745. queue: false,
  7746. duration: ai.duration,
  7747. easing: ai.easing,
  7748. complete: ag
  7749. })
  7750. });
  7751. /*!
  7752. * jQuery UI Effects Bounce 1.12.1
  7753. * http://jqueryui.com
  7754. *
  7755. * Copyright jQuery Foundation and other contributors
  7756. * Released under the MIT license.
  7757. * http://jquery.org/license
  7758. */
  7759. var T = K.effects.define("bounce", function(ah, ao) {
  7760. var ak, at, aw, ag = K(this), an = ah.mode, am = an === "hide", ax = an === "show", ay = ah.direction || "up", ai = ah.distance, al = ah.times || 5, az = al * 2 + (ax || am ? 1 : 0), av = ah.duration / az, aq = ah.easing, aj = (ay === "up" || ay === "down") ? "top" : "left", ap = (ay === "up" || ay === "left"), au = 0, ar = ag.queue().length;
  7761. K.effects.createPlaceholder(ag);
  7762. aw = ag.css(aj);
  7763. if (!ai) {
  7764. ai = ag[aj === "top" ? "outerHeight" : "outerWidth"]() / 3
  7765. }
  7766. if (ax) {
  7767. at = {
  7768. opacity: 1
  7769. };
  7770. at[aj] = aw;
  7771. ag.css("opacity", 0).css(aj, ap ? -ai * 2 : ai * 2).animate(at, av, aq)
  7772. }
  7773. if (am) {
  7774. ai = ai / Math.pow(2, al - 1)
  7775. }
  7776. at = {};
  7777. at[aj] = aw;
  7778. for (; au < al; au++) {
  7779. ak = {};
  7780. ak[aj] = (ap ? "-=" : "+=") + ai;
  7781. ag.animate(ak, av, aq).animate(at, av, aq);
  7782. ai = am ? ai * 2 : ai / 2
  7783. }
  7784. if (am) {
  7785. ak = {
  7786. opacity: 0
  7787. };
  7788. ak[aj] = (ap ? "-=" : "+=") + ai;
  7789. ag.animate(ak, av, aq)
  7790. }
  7791. ag.queue(ao);
  7792. K.effects.unshift(ag, ar, az + 1)
  7793. });
  7794. /*!
  7795. * jQuery UI Effects Clip 1.12.1
  7796. * http://jqueryui.com
  7797. *
  7798. * Copyright jQuery Foundation and other contributors
  7799. * Released under the MIT license.
  7800. * http://jquery.org/license
  7801. */
  7802. var Q = K.effects.define("clip", "hide", function(ao, ak) {
  7803. var ah, ai = {}, al = K(this), an = ao.direction || "vertical", am = an === "both", ag = am || an === "horizontal", aj = am || an === "vertical";
  7804. ah = al.cssClip();
  7805. ai.clip = {
  7806. top: aj ? (ah.bottom - ah.top) / 2 : ah.top,
  7807. right: ag ? (ah.right - ah.left) / 2 : ah.right,
  7808. bottom: aj ? (ah.bottom - ah.top) / 2 : ah.bottom,
  7809. left: ag ? (ah.right - ah.left) / 2 : ah.left
  7810. };
  7811. K.effects.createPlaceholder(al);
  7812. if (ao.mode === "show") {
  7813. al.cssClip(ai.clip);
  7814. ai.clip = ah
  7815. }
  7816. al.animate(ai, {
  7817. queue: false,
  7818. duration: ao.duration,
  7819. easing: ao.easing,
  7820. complete: ak
  7821. })
  7822. });
  7823. /*!
  7824. * jQuery UI Effects Drop 1.12.1
  7825. * http://jqueryui.com
  7826. *
  7827. * Copyright jQuery Foundation and other contributors
  7828. * Released under the MIT license.
  7829. * http://jquery.org/license
  7830. */
  7831. var G = K.effects.define("drop", "hide", function(aq, aj) {
  7832. var ag, ak = K(this), am = aq.mode, ao = am === "show", an = aq.direction || "left", ah = (an === "up" || an === "down") ? "top" : "left", ap = (an === "up" || an === "left") ? "-=" : "+=", al = (ap === "+=") ? "-=" : "+=", ai = {
  7833. opacity: 0
  7834. };
  7835. K.effects.createPlaceholder(ak);
  7836. ag = aq.distance || ak[ah === "top" ? "outerHeight" : "outerWidth"](true) / 2;
  7837. ai[ah] = ap + ag;
  7838. if (ao) {
  7839. ak.css(ai);
  7840. ai[ah] = al + ag;
  7841. ai.opacity = 1
  7842. }
  7843. ak.animate(ai, {
  7844. queue: false,
  7845. duration: aq.duration,
  7846. easing: aq.easing,
  7847. complete: aj
  7848. })
  7849. });
  7850. /*!
  7851. * jQuery UI Effects Explode 1.12.1
  7852. * http://jqueryui.com
  7853. *
  7854. * Copyright jQuery Foundation and other contributors
  7855. * Released under the MIT license.
  7856. * http://jquery.org/license
  7857. */
  7858. var n = K.effects.define("explode", "hide", function(ah, au) {
  7859. var ax, aw, aj, ar, aq, ao, an = ah.pieces ? Math.round(Math.sqrt(ah.pieces)) : 3, ai = an, ag = K(this), ap = ah.mode, ay = ap === "show", al = ag.show().css("visibility", "hidden").offset(), av = Math.ceil(ag.outerWidth() / ai), at = Math.ceil(ag.outerHeight() / an), am = [];
  7860. function az() {
  7861. am.push(this);
  7862. if (am.length === an * ai) {
  7863. ak()
  7864. }
  7865. }
  7866. for (ax = 0; ax < an; ax++) {
  7867. ar = al.top + ax * at;
  7868. ao = ax - (an - 1) / 2;
  7869. for (aw = 0; aw < ai; aw++) {
  7870. aj = al.left + aw * av;
  7871. aq = aw - (ai - 1) / 2;
  7872. ag.clone().appendTo("body").wrap("<div></div>").css({
  7873. position: "absolute",
  7874. visibility: "visible",
  7875. left: -aw * av,
  7876. top: -ax * at
  7877. }).parent().addClass("ui-effects-explode").css({
  7878. position: "absolute",
  7879. overflow: "hidden",
  7880. width: av,
  7881. height: at,
  7882. left: aj + (ay ? aq * av : 0),
  7883. top: ar + (ay ? ao * at : 0),
  7884. opacity: ay ? 0 : 1
  7885. }).animate({
  7886. left: aj + (ay ? 0 : aq * av),
  7887. top: ar + (ay ? 0 : ao * at),
  7888. opacity: ay ? 1 : 0
  7889. }, ah.duration || 500, ah.easing, az)
  7890. }
  7891. }
  7892. function ak() {
  7893. ag.css({
  7894. visibility: "visible"
  7895. });
  7896. K(am).remove();
  7897. au()
  7898. }
  7899. });
  7900. /*!
  7901. * jQuery UI Effects Fade 1.12.1
  7902. * http://jqueryui.com
  7903. *
  7904. * Copyright jQuery Foundation and other contributors
  7905. * Released under the MIT license.
  7906. * http://jquery.org/license
  7907. */
  7908. var af = K.effects.define("fade", "toggle", function(ai, ah) {
  7909. var ag = ai.mode === "show";
  7910. K(this).css("opacity", ag ? 0 : 1).animate({
  7911. opacity: ag ? 1 : 0
  7912. }, {
  7913. queue: false,
  7914. duration: ai.duration,
  7915. easing: ai.easing,
  7916. complete: ah
  7917. })
  7918. });
  7919. /*!
  7920. * jQuery UI Effects Fold 1.12.1
  7921. * http://jqueryui.com
  7922. *
  7923. * Copyright jQuery Foundation and other contributors
  7924. * Released under the MIT license.
  7925. * http://jquery.org/license
  7926. */
  7927. var S = K.effects.define("fold", "hide", function(ax, al) {
  7928. var am = K(this)
  7929. , an = ax.mode
  7930. , au = an === "show"
  7931. , ao = an === "hide"
  7932. , aw = ax.size || 15
  7933. , ap = /([0-9]+)%/.exec(aw)
  7934. , av = !!ax.horizFirst
  7935. , aj = av ? ["right", "bottom"] : ["bottom", "right"]
  7936. , ak = ax.duration / 2
  7937. , at = K.effects.createPlaceholder(am)
  7938. , ah = am.cssClip()
  7939. , ar = {
  7940. clip: K.extend({}, ah)
  7941. }
  7942. , aq = {
  7943. clip: K.extend({}, ah)
  7944. }
  7945. , ag = [ah[aj[0]], ah[aj[1]]]
  7946. , ai = am.queue().length;
  7947. if (ap) {
  7948. aw = parseInt(ap[1], 10) / 100 * ag[ao ? 0 : 1]
  7949. }
  7950. ar.clip[aj[0]] = aw;
  7951. aq.clip[aj[0]] = aw;
  7952. aq.clip[aj[1]] = 0;
  7953. if (au) {
  7954. am.cssClip(aq.clip);
  7955. if (at) {
  7956. at.css(K.effects.clipToBox(aq))
  7957. }
  7958. aq.clip = ah
  7959. }
  7960. am.queue(function(ay) {
  7961. if (at) {
  7962. at.animate(K.effects.clipToBox(ar), ak, ax.easing).animate(K.effects.clipToBox(aq), ak, ax.easing)
  7963. }
  7964. ay()
  7965. }).animate(ar, ak, ax.easing).animate(aq, ak, ax.easing).queue(al);
  7966. K.effects.unshift(am, ai, 4)
  7967. });
  7968. /*!
  7969. * jQuery UI Effects Highlight 1.12.1
  7970. * http://jqueryui.com
  7971. *
  7972. * Copyright jQuery Foundation and other contributors
  7973. * Released under the MIT license.
  7974. * http://jquery.org/license
  7975. */
  7976. var b = K.effects.define("highlight", "show", function(ah, ag) {
  7977. var ai = K(this)
  7978. , aj = {
  7979. backgroundColor: ai.css("backgroundColor")
  7980. };
  7981. if (ah.mode === "hide") {
  7982. aj.opacity = 0
  7983. }
  7984. K.effects.saveStyle(ai);
  7985. ai.css({
  7986. backgroundImage: "none",
  7987. backgroundColor: ah.color || "#ffff99"
  7988. }).animate(aj, {
  7989. queue: false,
  7990. duration: ah.duration,
  7991. easing: ah.easing,
  7992. complete: ag
  7993. })
  7994. });
  7995. /*!
  7996. * jQuery UI Effects Size 1.12.1
  7997. * http://jqueryui.com
  7998. *
  7999. * Copyright jQuery Foundation and other contributors
  8000. * Released under the MIT license.
  8001. * http://jquery.org/license
  8002. */
  8003. var p = K.effects.define("size", function(aj, ap) {
  8004. var an, ao, au, ag = K(this), al = ["fontSize"], av = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], ai = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"], am = aj.mode, at = am !== "effect", ay = aj.scale || "both", aw = aj.origin || ["middle", "center"], ax = ag.css("position"), ak = ag.position(), aq = K.effects.scaledDimensions(ag), ar = aj.from || aq, ah = aj.to || K.effects.scaledDimensions(ag, 0);
  8005. K.effects.createPlaceholder(ag);
  8006. if (am === "show") {
  8007. au = ar;
  8008. ar = ah;
  8009. ah = au
  8010. }
  8011. ao = {
  8012. from: {
  8013. y: ar.height / aq.height,
  8014. x: ar.width / aq.width
  8015. },
  8016. to: {
  8017. y: ah.height / aq.height,
  8018. x: ah.width / aq.width
  8019. }
  8020. };
  8021. if (ay === "box" || ay === "both") {
  8022. if (ao.from.y !== ao.to.y) {
  8023. ar = K.effects.setTransition(ag, av, ao.from.y, ar);
  8024. ah = K.effects.setTransition(ag, av, ao.to.y, ah)
  8025. }
  8026. if (ao.from.x !== ao.to.x) {
  8027. ar = K.effects.setTransition(ag, ai, ao.from.x, ar);
  8028. ah = K.effects.setTransition(ag, ai, ao.to.x, ah)
  8029. }
  8030. }
  8031. if (ay === "content" || ay === "both") {
  8032. if (ao.from.y !== ao.to.y) {
  8033. ar = K.effects.setTransition(ag, al, ao.from.y, ar);
  8034. ah = K.effects.setTransition(ag, al, ao.to.y, ah)
  8035. }
  8036. }
  8037. if (aw) {
  8038. an = K.effects.getBaseline(aw, aq);
  8039. ar.top = (aq.outerHeight - ar.outerHeight) * an.y + ak.top;
  8040. ar.left = (aq.outerWidth - ar.outerWidth) * an.x + ak.left;
  8041. ah.top = (aq.outerHeight - ah.outerHeight) * an.y + ak.top;
  8042. ah.left = (aq.outerWidth - ah.outerWidth) * an.x + ak.left
  8043. }
  8044. ag.css(ar);
  8045. if (ay === "content" || ay === "both") {
  8046. av = av.concat(["marginTop", "marginBottom"]).concat(al);
  8047. ai = ai.concat(["marginLeft", "marginRight"]);
  8048. ag.find("*[width]").each(function() {
  8049. var aC = K(this)
  8050. , az = K.effects.scaledDimensions(aC)
  8051. , aB = {
  8052. height: az.height * ao.from.y,
  8053. width: az.width * ao.from.x,
  8054. outerHeight: az.outerHeight * ao.from.y,
  8055. outerWidth: az.outerWidth * ao.from.x
  8056. }
  8057. , aA = {
  8058. height: az.height * ao.to.y,
  8059. width: az.width * ao.to.x,
  8060. outerHeight: az.height * ao.to.y,
  8061. outerWidth: az.width * ao.to.x
  8062. };
  8063. if (ao.from.y !== ao.to.y) {
  8064. aB = K.effects.setTransition(aC, av, ao.from.y, aB);
  8065. aA = K.effects.setTransition(aC, av, ao.to.y, aA)
  8066. }
  8067. if (ao.from.x !== ao.to.x) {
  8068. aB = K.effects.setTransition(aC, ai, ao.from.x, aB);
  8069. aA = K.effects.setTransition(aC, ai, ao.to.x, aA)
  8070. }
  8071. if (at) {
  8072. K.effects.saveStyle(aC)
  8073. }
  8074. aC.css(aB);
  8075. aC.animate(aA, aj.duration, aj.easing, function() {
  8076. if (at) {
  8077. K.effects.restoreStyle(aC)
  8078. }
  8079. })
  8080. })
  8081. }
  8082. ag.animate(ah, {
  8083. queue: false,
  8084. duration: aj.duration,
  8085. easing: aj.easing,
  8086. complete: function() {
  8087. var az = ag.offset();
  8088. if (ah.opacity === 0) {
  8089. ag.css("opacity", ar.opacity)
  8090. }
  8091. if (!at) {
  8092. ag.css("position", ax === "static" ? "relative" : ax).offset(az);
  8093. K.effects.saveStyle(ag)
  8094. }
  8095. ap()
  8096. }
  8097. })
  8098. });
  8099. /*!
  8100. * jQuery UI Effects Scale 1.12.1
  8101. * http://jqueryui.com
  8102. *
  8103. * Copyright jQuery Foundation and other contributors
  8104. * Released under the MIT license.
  8105. * http://jquery.org/license
  8106. */
  8107. var f = K.effects.define("scale", function(ah, ag) {
  8108. var ai = K(this)
  8109. , al = ah.mode
  8110. , aj = parseInt(ah.percent, 10) || (parseInt(ah.percent, 10) === 0 ? 0 : (al !== "effect" ? 0 : 100))
  8111. , ak = K.extend(true, {
  8112. from: K.effects.scaledDimensions(ai),
  8113. to: K.effects.scaledDimensions(ai, aj, ah.direction || "both"),
  8114. origin: ah.origin || ["middle", "center"]
  8115. }, ah);
  8116. if (ah.fade) {
  8117. ak.from.opacity = 1;
  8118. ak.to.opacity = 0
  8119. }
  8120. K.effects.effect.size.call(this, ak, ag)
  8121. });
  8122. /*!
  8123. * jQuery UI Effects Puff 1.12.1
  8124. * http://jqueryui.com
  8125. *
  8126. * Copyright jQuery Foundation and other contributors
  8127. * Released under the MIT license.
  8128. * http://jquery.org/license
  8129. */
  8130. var h = K.effects.define("puff", "hide", function(ah, ag) {
  8131. var ai = K.extend(true, {}, ah, {
  8132. fade: true,
  8133. percent: parseInt(ah.percent, 10) || 150
  8134. });
  8135. K.effects.effect.scale.call(this, ai, ag)
  8136. });
  8137. /*!
  8138. * jQuery UI Effects Pulsate 1.12.1
  8139. * http://jqueryui.com
  8140. *
  8141. * Copyright jQuery Foundation and other contributors
  8142. * Released under the MIT license.
  8143. * http://jquery.org/license
  8144. */
  8145. var c = K.effects.define("pulsate", "show", function(ar, ai) {
  8146. var ak = K(this)
  8147. , al = ar.mode
  8148. , ap = al === "show"
  8149. , am = al === "hide"
  8150. , aq = ap || am
  8151. , an = ((ar.times || 5) * 2) + (aq ? 1 : 0)
  8152. , ah = ar.duration / an
  8153. , ao = 0
  8154. , aj = 1
  8155. , ag = ak.queue().length;
  8156. if (ap || !ak.is(":visible")) {
  8157. ak.css("opacity", 0).show();
  8158. ao = 1
  8159. }
  8160. for (; aj < an; aj++) {
  8161. ak.animate({
  8162. opacity: ao
  8163. }, ah, ar.easing);
  8164. ao = 1 - ao
  8165. }
  8166. ak.animate({
  8167. opacity: ao
  8168. }, ah, ar.easing);
  8169. ak.queue(ai);
  8170. K.effects.unshift(ak, ag, an + 1)
  8171. });
  8172. /*!
  8173. * jQuery UI Effects Shake 1.12.1
  8174. * http://jqueryui.com
  8175. *
  8176. * Copyright jQuery Foundation and other contributors
  8177. * Released under the MIT license.
  8178. * http://jquery.org/license
  8179. */
  8180. var D = K.effects.define("shake", function(av, an) {
  8181. var ao = 1
  8182. , ap = K(this)
  8183. , ar = av.direction || "left"
  8184. , ag = av.distance || 20
  8185. , ah = av.times || 3
  8186. , at = ah * 2 + 1
  8187. , al = Math.round(av.duration / at)
  8188. , ak = (ar === "up" || ar === "down") ? "top" : "left"
  8189. , ai = (ar === "up" || ar === "left")
  8190. , am = {}
  8191. , au = {}
  8192. , aq = {}
  8193. , aj = ap.queue().length;
  8194. K.effects.createPlaceholder(ap);
  8195. am[ak] = (ai ? "-=" : "+=") + ag;
  8196. au[ak] = (ai ? "+=" : "-=") + ag * 2;
  8197. aq[ak] = (ai ? "-=" : "+=") + ag * 2;
  8198. ap.animate(am, al, av.easing);
  8199. for (; ao < ah; ao++) {
  8200. ap.animate(au, al, av.easing).animate(aq, al, av.easing)
  8201. }
  8202. ap.animate(au, al, av.easing).animate(am, al / 2, av.easing).queue(an);
  8203. K.effects.unshift(ap, aj, at + 1)
  8204. });
  8205. /*!
  8206. * jQuery UI Effects Slide 1.12.1
  8207. * http://jqueryui.com
  8208. *
  8209. * Copyright jQuery Foundation and other contributors
  8210. * Released under the MIT license.
  8211. * http://jquery.org/license
  8212. */
  8213. var C = K.effects.define("slide", "show", function(ar, an) {
  8214. var ak, ah, ao = K(this), ai = {
  8215. up: ["bottom", "top"],
  8216. down: ["top", "bottom"],
  8217. left: ["right", "left"],
  8218. right: ["left", "right"]
  8219. }, ap = ar.mode, aq = ar.direction || "left", al = (aq === "up" || aq === "down") ? "top" : "left", aj = (aq === "up" || aq === "left"), ag = ar.distance || ao[al === "top" ? "outerHeight" : "outerWidth"](true), am = {};
  8220. K.effects.createPlaceholder(ao);
  8221. ak = ao.cssClip();
  8222. ah = ao.position()[al];
  8223. am[al] = (aj ? -1 : 1) * ag + ah;
  8224. am.clip = ao.cssClip();
  8225. am.clip[ai[aq][1]] = am.clip[ai[aq][0]];
  8226. if (ap === "show") {
  8227. ao.cssClip(am.clip);
  8228. ao.css(al, am[al]);
  8229. am.clip = ak;
  8230. am[al] = ah
  8231. }
  8232. ao.animate(am, {
  8233. queue: false,
  8234. duration: ar.duration,
  8235. easing: ar.easing,
  8236. complete: an
  8237. })
  8238. });
  8239. /*!
  8240. * jQuery UI Effects Transfer 1.12.1
  8241. * http://jqueryui.com
  8242. *
  8243. * Copyright jQuery Foundation and other contributors
  8244. * Released under the MIT license.
  8245. * http://jquery.org/license
  8246. */
  8247. var W;
  8248. if (K.uiBackCompat !== false) {
  8249. W = K.effects.define("transfer", function(ah, ag) {
  8250. K(this).transfer(ah, ag)
  8251. })
  8252. }
  8253. var g = W
  8254. }));
  8255. /*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
  8256. * http://trentrichardson.com/examples/timepicker
  8257. * Copyright (c) 2016 Trent Richardson; Licensed MIT */
  8258. (function(a) {
  8259. if (typeof define === "function" && define.amd) {
  8260. define(["jquery", "jquery-ui"], a)
  8261. } else {
  8262. a(jQuery)
  8263. }
  8264. }(function($) {
  8265. $.ui.timepicker = $.ui.timepicker || {};
  8266. if ($.ui.timepicker.version) {
  8267. return
  8268. }
  8269. $.extend($.ui, {
  8270. timepicker: {
  8271. version: "1.6.3"
  8272. }
  8273. });
  8274. var Timepicker = function() {
  8275. this.regional = [];
  8276. this.regional[""] = {
  8277. currentText: "Now",
  8278. closeText: "Done",
  8279. amNames: ["AM", "A"],
  8280. pmNames: ["PM", "P"],
  8281. timeFormat: "HH:mm",
  8282. timeSuffix: "",
  8283. timeOnlyTitle: "Choose Time",
  8284. timeText: "Time",
  8285. hourText: "Hour",
  8286. minuteText: "Minute",
  8287. secondText: "Second",
  8288. millisecText: "Millisecond",
  8289. microsecText: "Microsecond",
  8290. timezoneText: "Time Zone",
  8291. isRTL: false
  8292. };
  8293. this._defaults = {
  8294. showButtonPanel: true,
  8295. timeOnly: false,
  8296. timeOnlyShowDate: false,
  8297. showHour: null,
  8298. showMinute: null,
  8299. showSecond: null,
  8300. showMillisec: null,
  8301. showMicrosec: null,
  8302. showTimezone: null,
  8303. showTime: true,
  8304. stepHour: 1,
  8305. stepMinute: 1,
  8306. stepSecond: 1,
  8307. stepMillisec: 1,
  8308. stepMicrosec: 1,
  8309. hour: 0,
  8310. minute: 0,
  8311. second: 0,
  8312. millisec: 0,
  8313. microsec: 0,
  8314. timezone: null,
  8315. hourMin: 0,
  8316. minuteMin: 0,
  8317. secondMin: 0,
  8318. millisecMin: 0,
  8319. microsecMin: 0,
  8320. hourMax: 23,
  8321. minuteMax: 59,
  8322. secondMax: 59,
  8323. millisecMax: 999,
  8324. microsecMax: 999,
  8325. minDateTime: null,
  8326. maxDateTime: null,
  8327. maxTime: null,
  8328. minTime: null,
  8329. onSelect: null,
  8330. hourGrid: 0,
  8331. minuteGrid: 0,
  8332. secondGrid: 0,
  8333. millisecGrid: 0,
  8334. microsecGrid: 0,
  8335. alwaysSetTime: true,
  8336. separator: " ",
  8337. altFieldTimeOnly: true,
  8338. altTimeFormat: null,
  8339. altSeparator: null,
  8340. altTimeSuffix: null,
  8341. altRedirectFocus: true,
  8342. pickerTimeFormat: null,
  8343. pickerTimeSuffix: null,
  8344. showTimepicker: true,
  8345. timezoneList: null,
  8346. addSliderAccess: false,
  8347. sliderAccessArgs: null,
  8348. controlType: "slider",
  8349. oneLine: false,
  8350. defaultValue: null,
  8351. parse: "strict",
  8352. afterInject: null
  8353. };
  8354. $.extend(this._defaults, this.regional[""])
  8355. };
  8356. $.extend(Timepicker.prototype, {
  8357. $input: null,
  8358. $altInput: null,
  8359. $timeObj: null,
  8360. inst: null,
  8361. hour_slider: null,
  8362. minute_slider: null,
  8363. second_slider: null,
  8364. millisec_slider: null,
  8365. microsec_slider: null,
  8366. timezone_select: null,
  8367. maxTime: null,
  8368. minTime: null,
  8369. hour: 0,
  8370. minute: 0,
  8371. second: 0,
  8372. millisec: 0,
  8373. microsec: 0,
  8374. timezone: null,
  8375. hourMinOriginal: null,
  8376. minuteMinOriginal: null,
  8377. secondMinOriginal: null,
  8378. millisecMinOriginal: null,
  8379. microsecMinOriginal: null,
  8380. hourMaxOriginal: null,
  8381. minuteMaxOriginal: null,
  8382. secondMaxOriginal: null,
  8383. millisecMaxOriginal: null,
  8384. microsecMaxOriginal: null,
  8385. ampm: "",
  8386. formattedDate: "",
  8387. formattedTime: "",
  8388. formattedDateTime: "",
  8389. timezoneList: null,
  8390. units: ["hour", "minute", "second", "millisec", "microsec"],
  8391. support: {},
  8392. control: null,
  8393. setDefaults: function(settings) {
  8394. extendRemove(this._defaults, settings || {});
  8395. return this
  8396. },
  8397. _newInst: function($input, opts) {
  8398. var tp_inst = new Timepicker(), inlineSettings = {}, fns = {}, overrides, i;
  8399. for (var attrName in this._defaults) {
  8400. if (this._defaults.hasOwnProperty(attrName)) {
  8401. var attrValue = $input.attr("time:" + attrName);
  8402. if (attrValue) {
  8403. try {
  8404. inlineSettings[attrName] = eval(attrValue)
  8405. } catch (err) {
  8406. inlineSettings[attrName] = attrValue
  8407. }
  8408. }
  8409. }
  8410. }
  8411. overrides = {
  8412. beforeShow: function(input, dp_inst) {
  8413. if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
  8414. return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst)
  8415. }
  8416. },
  8417. onChangeMonthYear: function(year, month, dp_inst) {
  8418. if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
  8419. tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst)
  8420. }
  8421. },
  8422. onClose: function(dateText, dp_inst) {
  8423. if (tp_inst.timeDefined === true && $input.val() !== "") {
  8424. tp_inst._updateDateTime(dp_inst)
  8425. }
  8426. if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
  8427. tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst)
  8428. }
  8429. }
  8430. };
  8431. for (i in overrides) {
  8432. if (overrides.hasOwnProperty(i)) {
  8433. fns[i] = opts[i] || this._defaults[i] || null
  8434. }
  8435. }
  8436. tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
  8437. evnts: fns,
  8438. timepicker: tp_inst
  8439. });
  8440. tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) {
  8441. return val.toUpperCase()
  8442. });
  8443. tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) {
  8444. return val.toUpperCase()
  8445. });
  8446. tp_inst.support = detectSupport(tp_inst._defaults.timeFormat + (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : "") + (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ""));
  8447. if (typeof (tp_inst._defaults.controlType) === "string") {
  8448. if (tp_inst._defaults.controlType === "slider" && typeof ($.ui.slider) === "undefined") {
  8449. tp_inst._defaults.controlType = "select"
  8450. }
  8451. tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType]
  8452. } else {
  8453. tp_inst.control = tp_inst._defaults.controlType
  8454. }
  8455. var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60, 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
  8456. if (tp_inst._defaults.timezoneList !== null) {
  8457. timezoneList = tp_inst._defaults.timezoneList
  8458. }
  8459. var tzl = timezoneList.length
  8460. , tzi = 0
  8461. , tzv = null;
  8462. if (tzl > 0 && typeof timezoneList[0] !== "object") {
  8463. for (; tzi < tzl; tzi++) {
  8464. tzv = timezoneList[tzi];
  8465. timezoneList[tzi] = {
  8466. value: tzv,
  8467. label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601)
  8468. }
  8469. }
  8470. }
  8471. tp_inst._defaults.timezoneList = timezoneList;
  8472. tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) : ((new Date()).getTimezoneOffset() * -1);
  8473. tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
  8474. tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
  8475. tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
  8476. tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
  8477. tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin : tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
  8478. tp_inst.ampm = "";
  8479. tp_inst.$input = $input;
  8480. if (tp_inst._defaults.altField) {
  8481. tp_inst.$altInput = $(tp_inst._defaults.altField);
  8482. if (tp_inst._defaults.altRedirectFocus === true) {
  8483. tp_inst.$altInput.css({
  8484. cursor: "pointer"
  8485. }).focus(function() {
  8486. $input.trigger("focus")
  8487. })
  8488. }
  8489. }
  8490. if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
  8491. tp_inst._defaults.minDate = new Date()
  8492. }
  8493. if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
  8494. tp_inst._defaults.maxDate = new Date()
  8495. }
  8496. if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
  8497. tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime())
  8498. }
  8499. if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
  8500. tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime())
  8501. }
  8502. if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
  8503. tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime())
  8504. }
  8505. if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
  8506. tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime())
  8507. }
  8508. tp_inst.$input.bind("focus", function() {
  8509. tp_inst._onFocus()
  8510. });
  8511. return tp_inst
  8512. },
  8513. _addTimePicker: function(dp_inst) {
  8514. var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + " " + this.$altInput.val() : this.$input.val());
  8515. this.timeDefined = this._parseTime(currDT);
  8516. this._limitMinMaxDateTime(dp_inst, false);
  8517. this._injectTimePicker();
  8518. this._afterInject()
  8519. },
  8520. _parseTime: function(timeString, withDate) {
  8521. if (!this.inst) {
  8522. this.inst = $.datepicker._getInst(this.$input[0])
  8523. }
  8524. if (withDate || !this._defaults.timeOnly) {
  8525. var dp_dateFormat = $.datepicker._get(this.inst, "dateFormat");
  8526. try {
  8527. var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
  8528. if (!parseRes.timeObj) {
  8529. return false
  8530. }
  8531. $.extend(this, parseRes.timeObj)
  8532. } catch (err) {
  8533. $.timepicker.log("Error parsing the date/time string: " + err + "\ndate/time string = " + timeString + "\ntimeFormat = " + this._defaults.timeFormat + "\ndateFormat = " + dp_dateFormat);
  8534. return false
  8535. }
  8536. return true
  8537. } else {
  8538. var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
  8539. if (!timeObj) {
  8540. return false
  8541. }
  8542. $.extend(this, timeObj);
  8543. return true
  8544. }
  8545. },
  8546. _afterInject: function() {
  8547. var o = this.inst.settings;
  8548. if ($.isFunction(o.afterInject)) {
  8549. o.afterInject.call(this)
  8550. }
  8551. },
  8552. _injectTimePicker: function() {
  8553. var $dp = this.inst.dpDiv
  8554. , o = this.inst.settings
  8555. , tp_inst = this
  8556. , litem = ""
  8557. , uitem = ""
  8558. , show = null
  8559. , max = {}
  8560. , gridSize = {}
  8561. , size = null
  8562. , i = 0
  8563. , l = 0;
  8564. if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
  8565. var noDisplay = " ui_tpicker_unit_hide"
  8566. , html = '<div class="ui-timepicker-div' + (o.isRTL ? " ui-timepicker-rtl" : "") + (o.oneLine && o.controlType === "select" ? " ui-timepicker-oneLine" : "") + '"><dl><dt class="ui_tpicker_time_label' + ((o.showTime) ? "" : noDisplay) + '">' + o.timeText + '</dt><dd class="ui_tpicker_time ' + ((o.showTime) ? "" : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? "" : "disabled") + "/></dd>";
  8567. for (i = 0,
  8568. l = this.units.length; i < l; i++) {
  8569. litem = this.units[i];
  8570. uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
  8571. show = o["show" + uitem] !== null ? o["show" + uitem] : this.support[litem];
  8572. max[litem] = parseInt((o[litem + "Max"] - ((o[litem + "Max"] - o[litem + "Min"]) % o["step" + uitem])), 10);
  8573. gridSize[litem] = 0;
  8574. html += '<dt class="ui_tpicker_' + litem + "_label" + (show ? "" : noDisplay) + '">' + o[litem + "Text"] + '</dt><dd class="ui_tpicker_' + litem + (show ? "" : noDisplay) + '"><div class="ui_tpicker_' + litem + "_slider" + (show ? "" : noDisplay) + '"></div>';
  8575. if (show && o[litem + "Grid"] > 0) {
  8576. html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
  8577. if (litem === "hour") {
  8578. for (var h = o[litem + "Min"]; h <= max[litem]; h += parseInt(o[litem + "Grid"], 10)) {
  8579. gridSize[litem]++;
  8580. var tmph = $.datepicker.formatTime(this.support.ampm ? "hht" : "HH", {
  8581. hour: h
  8582. }, o);
  8583. html += '<td data-for="' + litem + '">' + tmph + "</td>"
  8584. }
  8585. } else {
  8586. for (var m = o[litem + "Min"]; m <= max[litem]; m += parseInt(o[litem + "Grid"], 10)) {
  8587. gridSize[litem]++;
  8588. html += '<td data-for="' + litem + '">' + ((m < 10) ? "0" : "") + m + "</td>"
  8589. }
  8590. }
  8591. html += "</tr></table></div>"
  8592. }
  8593. html += "</dd>"
  8594. }
  8595. var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
  8596. html += '<dt class="ui_tpicker_timezone_label' + (showTz ? "" : noDisplay) + '">' + o.timezoneText + "</dt>";
  8597. html += '<dd class="ui_tpicker_timezone' + (showTz ? "" : noDisplay) + '"></dd>';
  8598. html += "</dl></div>";
  8599. var $tp = $(html);
  8600. if (o.timeOnly === true) {
  8601. $tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">' + o.timeOnlyTitle + "</div></div>");
  8602. $dp.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()
  8603. }
  8604. for (i = 0,
  8605. l = tp_inst.units.length; i < l; i++) {
  8606. litem = tp_inst.units[i];
  8607. uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
  8608. show = o["show" + uitem] !== null ? o["show" + uitem] : this.support[litem];
  8609. tp_inst[litem + "_slider"] = tp_inst.control.create(tp_inst, $tp.find(".ui_tpicker_" + litem + "_slider"), litem, tp_inst[litem], o[litem + "Min"], max[litem], o["step" + uitem]);
  8610. if (show && o[litem + "Grid"] > 0) {
  8611. size = 100 * gridSize[litem] * o[litem + "Grid"] / (max[litem] - o[litem + "Min"]);
  8612. $tp.find(".ui_tpicker_" + litem + " table").css({
  8613. width: size + "%",
  8614. marginLeft: o.isRTL ? "0" : ((size / (-2 * gridSize[litem])) + "%"),
  8615. marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : "0",
  8616. borderCollapse: "collapse"
  8617. }).find("td").click(function(e) {
  8618. var $t = $(this)
  8619. , h = $t.html()
  8620. , n = parseInt(h.replace(/[^0-9]/g), 10)
  8621. , ap = h.replace(/[^apm]/ig)
  8622. , f = $t.data("for");
  8623. if (f === "hour") {
  8624. if (ap.indexOf("p") !== -1 && n < 12) {
  8625. n += 12
  8626. } else {
  8627. if (ap.indexOf("a") !== -1 && n === 12) {
  8628. n = 0
  8629. }
  8630. }
  8631. }
  8632. tp_inst.control.value(tp_inst, tp_inst[f + "_slider"], litem, n);
  8633. tp_inst._onTimeChange();
  8634. tp_inst._onSelectHandler()
  8635. }).css({
  8636. cursor: "pointer",
  8637. width: (100 / gridSize[litem]) + "%",
  8638. textAlign: "center",
  8639. overflow: "hidden"
  8640. })
  8641. }
  8642. }
  8643. this.timezone_select = $tp.find(".ui_tpicker_timezone").append("<select></select>").find("select");
  8644. $.fn.append.apply(this.timezone_select, $.map(o.timezoneList, function(val, idx) {
  8645. return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val)
  8646. }));
  8647. if (typeof (this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") {
  8648. var local_timezone = (new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12)).getTimezoneOffset() * -1;
  8649. if (local_timezone === this.timezone) {
  8650. selectLocalTimezone(tp_inst)
  8651. } else {
  8652. this.timezone_select.val(this.timezone)
  8653. }
  8654. } else {
  8655. if (typeof (this.hour) !== "undefined" && this.hour !== null && this.hour !== "") {
  8656. this.timezone_select.val(o.timezone)
  8657. } else {
  8658. selectLocalTimezone(tp_inst)
  8659. }
  8660. }
  8661. this.timezone_select.change(function() {
  8662. tp_inst._onTimeChange();
  8663. tp_inst._onSelectHandler();
  8664. tp_inst._afterInject()
  8665. });
  8666. var $buttonPanel = $dp.find(".ui-datepicker-buttonpane");
  8667. if ($buttonPanel.length) {
  8668. $buttonPanel.before($tp)
  8669. } else {
  8670. $dp.append($tp)
  8671. }
  8672. this.$timeObj = $tp.find(".ui_tpicker_time_input");
  8673. this.$timeObj.change(function() {
  8674. var timeFormat = tp_inst.inst.settings.timeFormat;
  8675. var parsedTime = $.datepicker.parseTime(timeFormat, this.value);
  8676. var update = new Date();
  8677. if (parsedTime) {
  8678. update.setHours(parsedTime.hour);
  8679. update.setMinutes(parsedTime.minute);
  8680. update.setSeconds(parsedTime.second);
  8681. $.datepicker._setTime(tp_inst.inst, update)
  8682. } else {
  8683. this.value = tp_inst.formattedTime;
  8684. this.blur()
  8685. }
  8686. });
  8687. if (this.inst !== null) {
  8688. var timeDefined = this.timeDefined;
  8689. this._onTimeChange();
  8690. this.timeDefined = timeDefined
  8691. }
  8692. if (this._defaults.addSliderAccess) {
  8693. var sliderAccessArgs = this._defaults.sliderAccessArgs
  8694. , rtl = this._defaults.isRTL;
  8695. sliderAccessArgs.isRTL = rtl;
  8696. setTimeout(function() {
  8697. if ($tp.find(".ui-slider-access").length === 0) {
  8698. $tp.find(".ui-slider:visible").sliderAccess(sliderAccessArgs);
  8699. var sliderAccessWidth = $tp.find(".ui-slider-access:eq(0)").outerWidth(true);
  8700. if (sliderAccessWidth) {
  8701. $tp.find("table:visible").each(function() {
  8702. var $g = $(this)
  8703. , oldWidth = $g.outerWidth()
  8704. , oldMarginLeft = $g.css(rtl ? "marginRight" : "marginLeft").toString().replace("%", "")
  8705. , newWidth = oldWidth - sliderAccessWidth
  8706. , newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + "%"
  8707. , css = {
  8708. width: newWidth,
  8709. marginRight: 0,
  8710. marginLeft: 0
  8711. };
  8712. css[rtl ? "marginRight" : "marginLeft"] = newMarginLeft;
  8713. $g.css(css)
  8714. })
  8715. }
  8716. }
  8717. }, 10)
  8718. }
  8719. tp_inst._limitMinMaxDateTime(this.inst, true)
  8720. }
  8721. },
  8722. _limitMinMaxDateTime: function(dp_inst, adjustSliders) {
  8723. var o = this._defaults
  8724. , dp_date = new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay);
  8725. if (!this._defaults.showTimepicker) {
  8726. return
  8727. }
  8728. if ($.datepicker._get(dp_inst, "minDateTime") !== null && $.datepicker._get(dp_inst, "minDateTime") !== undefined && dp_date) {
  8729. var minDateTime = $.datepicker._get(dp_inst, "minDateTime")
  8730. , minDateTimeDate = new Date(minDateTime.getFullYear(),minDateTime.getMonth(),minDateTime.getDate(),0,0,0,0);
  8731. if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {
  8732. this.hourMinOriginal = o.hourMin;
  8733. this.minuteMinOriginal = o.minuteMin;
  8734. this.secondMinOriginal = o.secondMin;
  8735. this.millisecMinOriginal = o.millisecMin;
  8736. this.microsecMinOriginal = o.microsecMin
  8737. }
  8738. if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {
  8739. this._defaults.hourMin = minDateTime.getHours();
  8740. if (this.hour <= this._defaults.hourMin) {
  8741. this.hour = this._defaults.hourMin;
  8742. this._defaults.minuteMin = minDateTime.getMinutes();
  8743. if (this.minute <= this._defaults.minuteMin) {
  8744. this.minute = this._defaults.minuteMin;
  8745. this._defaults.secondMin = minDateTime.getSeconds();
  8746. if (this.second <= this._defaults.secondMin) {
  8747. this.second = this._defaults.secondMin;
  8748. this._defaults.millisecMin = minDateTime.getMilliseconds();
  8749. if (this.millisec <= this._defaults.millisecMin) {
  8750. this.millisec = this._defaults.millisecMin;
  8751. this._defaults.microsecMin = minDateTime.getMicroseconds()
  8752. } else {
  8753. if (this.microsec < this._defaults.microsecMin) {
  8754. this.microsec = this._defaults.microsecMin
  8755. }
  8756. this._defaults.microsecMin = this.microsecMinOriginal
  8757. }
  8758. } else {
  8759. this._defaults.millisecMin = this.millisecMinOriginal;
  8760. this._defaults.microsecMin = this.microsecMinOriginal
  8761. }
  8762. } else {
  8763. this._defaults.secondMin = this.secondMinOriginal;
  8764. this._defaults.millisecMin = this.millisecMinOriginal;
  8765. this._defaults.microsecMin = this.microsecMinOriginal
  8766. }
  8767. } else {
  8768. this._defaults.minuteMin = this.minuteMinOriginal;
  8769. this._defaults.secondMin = this.secondMinOriginal;
  8770. this._defaults.millisecMin = this.millisecMinOriginal;
  8771. this._defaults.microsecMin = this.microsecMinOriginal
  8772. }
  8773. } else {
  8774. this._defaults.hourMin = this.hourMinOriginal;
  8775. this._defaults.minuteMin = this.minuteMinOriginal;
  8776. this._defaults.secondMin = this.secondMinOriginal;
  8777. this._defaults.millisecMin = this.millisecMinOriginal;
  8778. this._defaults.microsecMin = this.microsecMinOriginal
  8779. }
  8780. }
  8781. if ($.datepicker._get(dp_inst, "maxDateTime") !== null && $.datepicker._get(dp_inst, "maxDateTime") !== undefined && dp_date) {
  8782. var maxDateTime = $.datepicker._get(dp_inst, "maxDateTime")
  8783. , maxDateTimeDate = new Date(maxDateTime.getFullYear(),maxDateTime.getMonth(),maxDateTime.getDate(),0,0,0,0);
  8784. if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {
  8785. this.hourMaxOriginal = o.hourMax;
  8786. this.minuteMaxOriginal = o.minuteMax;
  8787. this.secondMaxOriginal = o.secondMax;
  8788. this.millisecMaxOriginal = o.millisecMax;
  8789. this.microsecMaxOriginal = o.microsecMax
  8790. }
  8791. if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {
  8792. this._defaults.hourMax = maxDateTime.getHours();
  8793. if (this.hour >= this._defaults.hourMax) {
  8794. this.hour = this._defaults.hourMax;
  8795. this._defaults.minuteMax = maxDateTime.getMinutes();
  8796. if (this.minute >= this._defaults.minuteMax) {
  8797. this.minute = this._defaults.minuteMax;
  8798. this._defaults.secondMax = maxDateTime.getSeconds();
  8799. if (this.second >= this._defaults.secondMax) {
  8800. this.second = this._defaults.secondMax;
  8801. this._defaults.millisecMax = maxDateTime.getMilliseconds();
  8802. if (this.millisec >= this._defaults.millisecMax) {
  8803. this.millisec = this._defaults.millisecMax;
  8804. this._defaults.microsecMax = maxDateTime.getMicroseconds()
  8805. } else {
  8806. if (this.microsec > this._defaults.microsecMax) {
  8807. this.microsec = this._defaults.microsecMax
  8808. }
  8809. this._defaults.microsecMax = this.microsecMaxOriginal
  8810. }
  8811. } else {
  8812. this._defaults.millisecMax = this.millisecMaxOriginal;
  8813. this._defaults.microsecMax = this.microsecMaxOriginal
  8814. }
  8815. } else {
  8816. this._defaults.secondMax = this.secondMaxOriginal;
  8817. this._defaults.millisecMax = this.millisecMaxOriginal;
  8818. this._defaults.microsecMax = this.microsecMaxOriginal
  8819. }
  8820. } else {
  8821. this._defaults.minuteMax = this.minuteMaxOriginal;
  8822. this._defaults.secondMax = this.secondMaxOriginal;
  8823. this._defaults.millisecMax = this.millisecMaxOriginal;
  8824. this._defaults.microsecMax = this.microsecMaxOriginal
  8825. }
  8826. } else {
  8827. this._defaults.hourMax = this.hourMaxOriginal;
  8828. this._defaults.minuteMax = this.minuteMaxOriginal;
  8829. this._defaults.secondMax = this.secondMaxOriginal;
  8830. this._defaults.millisecMax = this.millisecMaxOriginal;
  8831. this._defaults.microsecMax = this.microsecMaxOriginal
  8832. }
  8833. }
  8834. if (dp_inst.settings.minTime !== null) {
  8835. var tempMinTime = new Date("01/01/1970 " + dp_inst.settings.minTime);
  8836. if (this.hour < tempMinTime.getHours()) {
  8837. this.hour = this._defaults.hourMin = tempMinTime.getHours();
  8838. this.minute = this._defaults.minuteMin = tempMinTime.getMinutes()
  8839. } else {
  8840. if (this.hour === tempMinTime.getHours() && this.minute < tempMinTime.getMinutes()) {
  8841. this.minute = this._defaults.minuteMin = tempMinTime.getMinutes()
  8842. } else {
  8843. if (this._defaults.hourMin < tempMinTime.getHours()) {
  8844. this._defaults.hourMin = tempMinTime.getHours();
  8845. this._defaults.minuteMin = tempMinTime.getMinutes()
  8846. } else {
  8847. if (this._defaults.hourMin === tempMinTime.getHours() === this.hour && this._defaults.minuteMin < tempMinTime.getMinutes()) {
  8848. this._defaults.minuteMin = tempMinTime.getMinutes()
  8849. } else {
  8850. this._defaults.minuteMin = 0
  8851. }
  8852. }
  8853. }
  8854. }
  8855. }
  8856. if (dp_inst.settings.maxTime !== null) {
  8857. var tempMaxTime = new Date("01/01/1970 " + dp_inst.settings.maxTime);
  8858. if (this.hour > tempMaxTime.getHours()) {
  8859. this.hour = this._defaults.hourMax = tempMaxTime.getHours();
  8860. this.minute = this._defaults.minuteMax = tempMaxTime.getMinutes()
  8861. } else {
  8862. if (this.hour === tempMaxTime.getHours() && this.minute > tempMaxTime.getMinutes()) {
  8863. this.minute = this._defaults.minuteMax = tempMaxTime.getMinutes()
  8864. } else {
  8865. if (this._defaults.hourMax > tempMaxTime.getHours()) {
  8866. this._defaults.hourMax = tempMaxTime.getHours();
  8867. this._defaults.minuteMax = tempMaxTime.getMinutes()
  8868. } else {
  8869. if (this._defaults.hourMax === tempMaxTime.getHours() === this.hour && this._defaults.minuteMax > tempMaxTime.getMinutes()) {
  8870. this._defaults.minuteMax = tempMaxTime.getMinutes()
  8871. } else {
  8872. this._defaults.minuteMax = 59
  8873. }
  8874. }
  8875. }
  8876. }
  8877. }
  8878. if (adjustSliders !== undefined && adjustSliders === true) {
  8879. var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10)
  8880. , minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10)
  8881. , secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10)
  8882. , millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10)
  8883. , microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);
  8884. if (this.hour_slider) {
  8885. this.control.options(this, this.hour_slider, "hour", {
  8886. min: this._defaults.hourMin,
  8887. max: hourMax,
  8888. step: this._defaults.stepHour
  8889. });
  8890. this.control.value(this, this.hour_slider, "hour", this.hour - (this.hour % this._defaults.stepHour))
  8891. }
  8892. if (this.minute_slider) {
  8893. this.control.options(this, this.minute_slider, "minute", {
  8894. min: this._defaults.minuteMin,
  8895. max: minMax,
  8896. step: this._defaults.stepMinute
  8897. });
  8898. this.control.value(this, this.minute_slider, "minute", this.minute - (this.minute % this._defaults.stepMinute))
  8899. }
  8900. if (this.second_slider) {
  8901. this.control.options(this, this.second_slider, "second", {
  8902. min: this._defaults.secondMin,
  8903. max: secMax,
  8904. step: this._defaults.stepSecond
  8905. });
  8906. this.control.value(this, this.second_slider, "second", this.second - (this.second % this._defaults.stepSecond))
  8907. }
  8908. if (this.millisec_slider) {
  8909. this.control.options(this, this.millisec_slider, "millisec", {
  8910. min: this._defaults.millisecMin,
  8911. max: millisecMax,
  8912. step: this._defaults.stepMillisec
  8913. });
  8914. this.control.value(this, this.millisec_slider, "millisec", this.millisec - (this.millisec % this._defaults.stepMillisec))
  8915. }
  8916. if (this.microsec_slider) {
  8917. this.control.options(this, this.microsec_slider, "microsec", {
  8918. min: this._defaults.microsecMin,
  8919. max: microsecMax,
  8920. step: this._defaults.stepMicrosec
  8921. });
  8922. this.control.value(this, this.microsec_slider, "microsec", this.microsec - (this.microsec % this._defaults.stepMicrosec))
  8923. }
  8924. }
  8925. },
  8926. _onTimeChange: function() {
  8927. if (!this._defaults.showTimepicker) {
  8928. return
  8929. }
  8930. var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, "hour") : false
  8931. , minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, "minute") : false
  8932. , second = (this.second_slider) ? this.control.value(this, this.second_slider, "second") : false
  8933. , millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, "millisec") : false
  8934. , microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, "microsec") : false
  8935. , timezone = (this.timezone_select) ? this.timezone_select.val() : false
  8936. , o = this._defaults
  8937. , pickerTimeFormat = o.pickerTimeFormat || o.timeFormat
  8938. , pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
  8939. if (typeof (hour) === "object") {
  8940. hour = false
  8941. }
  8942. if (typeof (minute) === "object") {
  8943. minute = false
  8944. }
  8945. if (typeof (second) === "object") {
  8946. second = false
  8947. }
  8948. if (typeof (millisec) === "object") {
  8949. millisec = false
  8950. }
  8951. if (typeof (microsec) === "object") {
  8952. microsec = false
  8953. }
  8954. if (typeof (timezone) === "object") {
  8955. timezone = false
  8956. }
  8957. if (hour !== false) {
  8958. hour = parseInt(hour, 10)
  8959. }
  8960. if (minute !== false) {
  8961. minute = parseInt(minute, 10)
  8962. }
  8963. if (second !== false) {
  8964. second = parseInt(second, 10)
  8965. }
  8966. if (millisec !== false) {
  8967. millisec = parseInt(millisec, 10)
  8968. }
  8969. if (microsec !== false) {
  8970. microsec = parseInt(microsec, 10)
  8971. }
  8972. if (timezone !== false) {
  8973. timezone = timezone.toString()
  8974. }
  8975. var ampm = o[hour < 12 ? "amNames" : "pmNames"][0];
  8976. var hasChanged = (hour !== parseInt(this.hour, 10) || minute !== parseInt(this.minute, 10) || second !== parseInt(this.second, 10) || millisec !== parseInt(this.millisec, 10) || microsec !== parseInt(this.microsec, 10) || (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || (this.timezone !== null && timezone !== this.timezone.toString()));
  8977. if (hasChanged) {
  8978. if (hour !== false) {
  8979. this.hour = hour
  8980. }
  8981. if (minute !== false) {
  8982. this.minute = minute
  8983. }
  8984. if (second !== false) {
  8985. this.second = second
  8986. }
  8987. if (millisec !== false) {
  8988. this.millisec = millisec
  8989. }
  8990. if (microsec !== false) {
  8991. this.microsec = microsec
  8992. }
  8993. if (timezone !== false) {
  8994. this.timezone = timezone
  8995. }
  8996. if (!this.inst) {
  8997. this.inst = $.datepicker._getInst(this.$input[0])
  8998. }
  8999. this._limitMinMaxDateTime(this.inst, true)
  9000. }
  9001. if (this.support.ampm) {
  9002. this.ampm = ampm
  9003. }
  9004. this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
  9005. if (this.$timeObj) {
  9006. if (pickerTimeFormat === o.timeFormat) {
  9007. this.$timeObj.val(this.formattedTime + pickerTimeSuffix)
  9008. } else {
  9009. this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix)
  9010. }
  9011. if (this.$timeObj[0].setSelectionRange) {
  9012. var sPos = this.$timeObj[0].selectionStart;
  9013. var ePos = this.$timeObj[0].selectionEnd
  9014. }
  9015. }
  9016. this.timeDefined = true;
  9017. if (hasChanged) {
  9018. this._updateDateTime()
  9019. }
  9020. },
  9021. _onSelectHandler: function() {
  9022. var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
  9023. var inputEl = this.$input ? this.$input[0] : null;
  9024. if (onSelect && inputEl) {
  9025. onSelect.apply(inputEl, [this.formattedDateTime, this])
  9026. }
  9027. },
  9028. _updateDateTime: function(dp_inst) {
  9029. dp_inst = this.inst || dp_inst;
  9030. var dtTmp = (dp_inst.currentYear > 0 ? new Date(dp_inst.currentYear,dp_inst.currentMonth,dp_inst.currentDay) : new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay))
  9031. , dt = $.datepicker._daylightSavingAdjust(dtTmp)
  9032. , dateFmt = $.datepicker._get(dp_inst, "dateFormat")
  9033. , formatCfg = $.datepicker._getFormatConfig(dp_inst)
  9034. , timeAvailable = dt !== null && this.timeDefined;
  9035. this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
  9036. var formattedDateTime = this.formattedDate;
  9037. if (dp_inst.lastVal === "") {
  9038. dp_inst.currentYear = dp_inst.selectedYear;
  9039. dp_inst.currentMonth = dp_inst.selectedMonth;
  9040. dp_inst.currentDay = dp_inst.selectedDay
  9041. }
  9042. if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
  9043. formattedDateTime = this.formattedTime
  9044. } else {
  9045. if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {
  9046. formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix
  9047. }
  9048. }
  9049. this.formattedDateTime = formattedDateTime;
  9050. if (!this._defaults.showTimepicker) {
  9051. this.$input.val(this.formattedDate)
  9052. } else {
  9053. if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
  9054. this.$altInput.val(this.formattedTime);
  9055. this.$input.val(this.formattedDate)
  9056. } else {
  9057. if (this.$altInput) {
  9058. this.$input.val(formattedDateTime);
  9059. var altFormattedDateTime = ""
  9060. , altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator
  9061. , altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
  9062. if (!this._defaults.timeOnly) {
  9063. if (this._defaults.altFormat) {
  9064. altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg)
  9065. } else {
  9066. altFormattedDateTime = this.formattedDate
  9067. }
  9068. if (altFormattedDateTime) {
  9069. altFormattedDateTime += altSeparator
  9070. }
  9071. }
  9072. if (this._defaults.altTimeFormat !== null) {
  9073. altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix
  9074. } else {
  9075. altFormattedDateTime += this.formattedTime + altTimeSuffix
  9076. }
  9077. this.$altInput.val(altFormattedDateTime)
  9078. } else {
  9079. this.$input.val(formattedDateTime)
  9080. }
  9081. }
  9082. }
  9083. this.$input.trigger("change")
  9084. },
  9085. _onFocus: function() {
  9086. if (!this.$input.val() && this._defaults.defaultValue) {
  9087. this.$input.val(this._defaults.defaultValue);
  9088. var inst = $.datepicker._getInst(this.$input.get(0))
  9089. , tp_inst = $.datepicker._get(inst, "timepicker");
  9090. if (tp_inst) {
  9091. if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
  9092. try {
  9093. $.datepicker._updateDatepicker(inst)
  9094. } catch (err) {
  9095. $.timepicker.log(err)
  9096. }
  9097. }
  9098. }
  9099. }
  9100. },
  9101. _controls: {
  9102. slider: {
  9103. create: function(tp_inst, obj, unit, val, min, max, step) {
  9104. var rtl = tp_inst._defaults.isRTL;
  9105. return obj.prop("slide", null).slider({
  9106. orientation: "horizontal",
  9107. value: rtl ? val * -1 : val,
  9108. min: rtl ? max * -1 : min,
  9109. max: rtl ? min * -1 : max,
  9110. step: step,
  9111. slide: function(event, ui) {
  9112. tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
  9113. tp_inst._onTimeChange()
  9114. },
  9115. stop: function(event, ui) {
  9116. tp_inst._onSelectHandler()
  9117. }
  9118. })
  9119. },
  9120. options: function(tp_inst, obj, unit, opts, val) {
  9121. if (tp_inst._defaults.isRTL) {
  9122. if (typeof (opts) === "string") {
  9123. if (opts === "min" || opts === "max") {
  9124. if (val !== undefined) {
  9125. return obj.slider(opts, val * -1)
  9126. }
  9127. return Math.abs(obj.slider(opts))
  9128. }
  9129. return obj.slider(opts)
  9130. }
  9131. var min = opts.min
  9132. , max = opts.max;
  9133. opts.min = opts.max = null;
  9134. if (min !== undefined) {
  9135. opts.max = min * -1
  9136. }
  9137. if (max !== undefined) {
  9138. opts.min = max * -1
  9139. }
  9140. return obj.slider(opts)
  9141. }
  9142. if (typeof (opts) === "string" && val !== undefined) {
  9143. return obj.slider(opts, val)
  9144. }
  9145. return obj.slider(opts)
  9146. },
  9147. value: function(tp_inst, obj, unit, val) {
  9148. if (tp_inst._defaults.isRTL) {
  9149. if (val !== undefined) {
  9150. return obj.slider("value", val * -1)
  9151. }
  9152. return Math.abs(obj.slider("value"))
  9153. }
  9154. if (val !== undefined) {
  9155. return obj.slider("value", val)
  9156. }
  9157. return obj.slider("value")
  9158. }
  9159. },
  9160. select: {
  9161. create: function(tp_inst, obj, unit, val, min, max, step) {
  9162. var sel = '<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">'
  9163. , format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
  9164. for (var i = min; i <= max; i += step) {
  9165. sel += '<option value="' + i + '"' + (i === val ? " selected" : "") + ">";
  9166. if (unit === "hour") {
  9167. sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, "")), {
  9168. hour: i
  9169. }, tp_inst._defaults)
  9170. } else {
  9171. if (unit === "millisec" || unit === "microsec" || i >= 10) {
  9172. sel += i
  9173. } else {
  9174. sel += "0" + i.toString()
  9175. }
  9176. }
  9177. sel += "</option>"
  9178. }
  9179. sel += "</select>";
  9180. obj.children("select").remove();
  9181. $(sel).appendTo(obj).change(function(e) {
  9182. tp_inst._onTimeChange();
  9183. tp_inst._onSelectHandler();
  9184. tp_inst._afterInject()
  9185. });
  9186. return obj
  9187. },
  9188. options: function(tp_inst, obj, unit, opts, val) {
  9189. var o = {}
  9190. , $t = obj.children("select");
  9191. if (typeof (opts) === "string") {
  9192. if (val === undefined) {
  9193. return $t.data(opts)
  9194. }
  9195. o[opts] = val
  9196. } else {
  9197. o = opts
  9198. }
  9199. return tp_inst.control.create(tp_inst, obj, $t.data("unit"), $t.val(), o.min >= 0 ? o.min : $t.data("min"), o.max || $t.data("max"), o.step || $t.data("step"))
  9200. },
  9201. value: function(tp_inst, obj, unit, val) {
  9202. var $t = obj.children("select");
  9203. if (val !== undefined) {
  9204. return $t.val(val)
  9205. }
  9206. return $t.val()
  9207. }
  9208. }
  9209. }
  9210. });
  9211. $.fn.extend({
  9212. timepicker: function(o) {
  9213. o = o || {};
  9214. var tmp_args = Array.prototype.slice.call(arguments);
  9215. if (typeof o === "object") {
  9216. tmp_args[0] = $.extend(o, {
  9217. timeOnly: true
  9218. })
  9219. }
  9220. return $(this).each(function() {
  9221. $.fn.datetimepicker.apply($(this), tmp_args)
  9222. })
  9223. },
  9224. datetimepicker: function(o) {
  9225. o = o || {};
  9226. var tmp_args = arguments;
  9227. if (typeof (o) === "string") {
  9228. if (o === "getDate" || (o === "option" && tmp_args.length === 2 && typeof (tmp_args[1]) === "string")) {
  9229. return $.fn.datepicker.apply($(this[0]), tmp_args)
  9230. } else {
  9231. return this.each(function() {
  9232. var $t = $(this);
  9233. $t.datepicker.apply($t, tmp_args)
  9234. })
  9235. }
  9236. } else {
  9237. return this.each(function() {
  9238. var $t = $(this);
  9239. $t.datepicker($.timepicker._newInst($t, o)._defaults)
  9240. })
  9241. }
  9242. }
  9243. });
  9244. $.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
  9245. var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
  9246. if (parseRes.timeObj) {
  9247. var t = parseRes.timeObj;
  9248. parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
  9249. parseRes.date.setMicroseconds(t.microsec)
  9250. }
  9251. return parseRes.date
  9252. }
  9253. ;
  9254. $.datepicker.parseTime = function(timeFormat, timeString, options) {
  9255. var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {})
  9256. , iso8601 = (timeFormat.replace(/\'.*?\'/g, "").indexOf("Z") !== -1);
  9257. var strictParse = function(f, s, o) {
  9258. var getPatternAmpm = function(amNames, pmNames) {
  9259. var markers = [];
  9260. if (amNames) {
  9261. $.merge(markers, amNames)
  9262. }
  9263. if (pmNames) {
  9264. $.merge(markers, pmNames)
  9265. }
  9266. markers = $.map(markers, function(val) {
  9267. return val.replace(/[.*+?|()\[\]{}\\]/g, "\\$&")
  9268. });
  9269. return "(" + markers.join("|") + ")?"
  9270. };
  9271. var getFormatPositions = function(timeFormat) {
  9272. var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g)
  9273. , orders = {
  9274. h: -1,
  9275. m: -1,
  9276. s: -1,
  9277. l: -1,
  9278. c: -1,
  9279. t: -1,
  9280. z: -1
  9281. };
  9282. if (finds) {
  9283. for (var i = 0; i < finds.length; i++) {
  9284. if (orders[finds[i].toString().charAt(0)] === -1) {
  9285. orders[finds[i].toString().charAt(0)] = i + 1
  9286. }
  9287. }
  9288. }
  9289. return orders
  9290. };
  9291. var regstr = "^" + f.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function(match) {
  9292. var ml = match.length;
  9293. switch (match.charAt(0).toLowerCase()) {
  9294. case "h":
  9295. return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
  9296. case "m":
  9297. return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
  9298. case "s":
  9299. return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
  9300. case "l":
  9301. return "(\\d?\\d?\\d)";
  9302. case "c":
  9303. return "(\\d?\\d?\\d)";
  9304. case "z":
  9305. return "(z|[-+]\\d\\d:?\\d\\d|\\S+)?";
  9306. case "t":
  9307. return getPatternAmpm(o.amNames, o.pmNames);
  9308. default:
  9309. return "(" + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function(m) {
  9310. return "\\" + m
  9311. }) + ")?"
  9312. }
  9313. }).replace(/\s/g, "\\s?") + o.timeSuffix + "$", order = getFormatPositions(f), ampm = "", treg;
  9314. treg = s.match(new RegExp(regstr,"i"));
  9315. var resTime = {
  9316. hour: 0,
  9317. minute: 0,
  9318. second: 0,
  9319. millisec: 0,
  9320. microsec: 0
  9321. };
  9322. if (treg) {
  9323. if (order.t !== -1) {
  9324. if (treg[order.t] === undefined || treg[order.t].length === 0) {
  9325. ampm = "";
  9326. resTime.ampm = ""
  9327. } else {
  9328. ampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function(x, i) {
  9329. return x.toUpperCase()
  9330. })) !== -1 ? "AM" : "PM";
  9331. resTime.ampm = o[ampm === "AM" ? "amNames" : "pmNames"][0]
  9332. }
  9333. }
  9334. if (order.h !== -1) {
  9335. if (ampm === "AM" && treg[order.h] === "12") {
  9336. resTime.hour = 0
  9337. } else {
  9338. if (ampm === "PM" && treg[order.h] !== "12") {
  9339. resTime.hour = parseInt(treg[order.h], 10) + 12
  9340. } else {
  9341. resTime.hour = Number(treg[order.h])
  9342. }
  9343. }
  9344. }
  9345. if (order.m !== -1) {
  9346. resTime.minute = Number(treg[order.m])
  9347. }
  9348. if (order.s !== -1) {
  9349. resTime.second = Number(treg[order.s])
  9350. }
  9351. if (order.l !== -1) {
  9352. resTime.millisec = Number(treg[order.l])
  9353. }
  9354. if (order.c !== -1) {
  9355. resTime.microsec = Number(treg[order.c])
  9356. }
  9357. if (order.z !== -1 && treg[order.z] !== undefined) {
  9358. resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z])
  9359. }
  9360. return resTime
  9361. }
  9362. return false
  9363. };
  9364. var looseParse = function(f, s, o) {
  9365. try {
  9366. var d = new Date("2012-01-01 " + s);
  9367. if (isNaN(d.getTime())) {
  9368. d = new Date("2012-01-01T" + s);
  9369. if (isNaN(d.getTime())) {
  9370. d = new Date("01/01/2012 " + s);
  9371. if (isNaN(d.getTime())) {
  9372. throw "Unable to parse time with native Date: " + s
  9373. }
  9374. }
  9375. }
  9376. return {
  9377. hour: d.getHours(),
  9378. minute: d.getMinutes(),
  9379. second: d.getSeconds(),
  9380. millisec: d.getMilliseconds(),
  9381. microsec: d.getMicroseconds(),
  9382. timezone: d.getTimezoneOffset() * -1
  9383. }
  9384. } catch (err) {
  9385. try {
  9386. return strictParse(f, s, o)
  9387. } catch (err2) {
  9388. $.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f)
  9389. }
  9390. }
  9391. return false
  9392. };
  9393. if (typeof o.parse === "function") {
  9394. return o.parse(timeFormat, timeString, o)
  9395. }
  9396. if (o.parse === "loose") {
  9397. return looseParse(timeFormat, timeString, o)
  9398. }
  9399. return strictParse(timeFormat, timeString, o)
  9400. }
  9401. ;
  9402. $.datepicker.formatTime = function(format, time, options) {
  9403. options = options || {};
  9404. options = $.extend({}, $.timepicker._defaults, options);
  9405. time = $.extend({
  9406. hour: 0,
  9407. minute: 0,
  9408. second: 0,
  9409. millisec: 0,
  9410. microsec: 0,
  9411. timezone: null
  9412. }, time);
  9413. var tmptime = format
  9414. , ampmName = options.amNames[0]
  9415. , hour = parseInt(time.hour, 10);
  9416. if (hour > 11) {
  9417. ampmName = options.pmNames[0]
  9418. }
  9419. tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function(match) {
  9420. switch (match) {
  9421. case "HH":
  9422. return ("0" + hour).slice(-2);
  9423. case "H":
  9424. return hour;
  9425. case "hh":
  9426. return ("0" + convert24to12(hour)).slice(-2);
  9427. case "h":
  9428. return convert24to12(hour);
  9429. case "mm":
  9430. return ("0" + time.minute).slice(-2);
  9431. case "m":
  9432. return time.minute;
  9433. case "ss":
  9434. return ("0" + time.second).slice(-2);
  9435. case "s":
  9436. return time.second;
  9437. case "l":
  9438. return ("00" + time.millisec).slice(-3);
  9439. case "c":
  9440. return ("00" + time.microsec).slice(-3);
  9441. case "z":
  9442. return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
  9443. case "Z":
  9444. return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
  9445. case "T":
  9446. return ampmName.charAt(0).toUpperCase();
  9447. case "TT":
  9448. return ampmName.toUpperCase();
  9449. case "t":
  9450. return ampmName.charAt(0).toLowerCase();
  9451. case "tt":
  9452. return ampmName.toLowerCase();
  9453. default:
  9454. return match.replace(/'/g, "")
  9455. }
  9456. });
  9457. return tmptime
  9458. }
  9459. ;
  9460. $.datepicker._base_selectDate = $.datepicker._selectDate;
  9461. $.datepicker._selectDate = function(id, dateStr) {
  9462. var inst = this._getInst($(id)[0]), tp_inst = this._get(inst, "timepicker"), was_inline;
  9463. if (tp_inst && inst.settings.showTimepicker) {
  9464. tp_inst._limitMinMaxDateTime(inst, true);
  9465. was_inline = inst.inline;
  9466. inst.inline = inst.stay_open = true;
  9467. this._base_selectDate(id, dateStr);
  9468. inst.inline = was_inline;
  9469. inst.stay_open = false;
  9470. this._notifyChange(inst);
  9471. this._updateDatepicker(inst)
  9472. } else {
  9473. this._base_selectDate(id, dateStr)
  9474. }
  9475. }
  9476. ;
  9477. $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
  9478. $.datepicker._updateDatepicker = function(inst) {
  9479. var input = inst.input[0];
  9480. if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
  9481. return
  9482. }
  9483. if (typeof (inst.stay_open) !== "boolean" || inst.stay_open === false) {
  9484. this._base_updateDatepicker(inst);
  9485. var tp_inst = this._get(inst, "timepicker");
  9486. if (tp_inst) {
  9487. tp_inst._addTimePicker(inst)
  9488. }
  9489. }
  9490. }
  9491. ;
  9492. $.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
  9493. $.datepicker._doKeyPress = function(event) {
  9494. var inst = $.datepicker._getInst(event.target)
  9495. , tp_inst = $.datepicker._get(inst, "timepicker");
  9496. if (tp_inst) {
  9497. if ($.datepicker._get(inst, "constrainInput")) {
  9498. var ampm = tp_inst.support.ampm
  9499. , tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone
  9500. , dateChars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"))
  9501. , datetimeChars = tp_inst._defaults.timeFormat.toString().replace(/[hms]/g, "").replace(/TT/g, ampm ? "APM" : "").replace(/Tt/g, ampm ? "AaPpMm" : "").replace(/tT/g, ampm ? "AaPpMm" : "").replace(/T/g, ampm ? "AP" : "").replace(/tt/g, ampm ? "apm" : "").replace(/t/g, ampm ? "ap" : "") + " " + tp_inst._defaults.separator + tp_inst._defaults.timeSuffix + (tz ? tp_inst._defaults.timezoneList.join("") : "") + (tp_inst._defaults.amNames.join("")) + (tp_inst._defaults.pmNames.join("")) + dateChars
  9502. , chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
  9503. return event.ctrlKey || (chr < " " || !dateChars || datetimeChars.indexOf(chr) > -1)
  9504. }
  9505. }
  9506. return $.datepicker._base_doKeyPress(event)
  9507. }
  9508. ;
  9509. $.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
  9510. $.datepicker._updateAlternate = function(inst) {
  9511. var tp_inst = this._get(inst, "timepicker");
  9512. if (tp_inst) {
  9513. var altField = tp_inst._defaults.altField;
  9514. if (altField) {
  9515. var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat
  9516. , date = this._getDate(inst)
  9517. , formatCfg = $.datepicker._getFormatConfig(inst)
  9518. , altFormattedDateTime = ""
  9519. , altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator
  9520. , altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix
  9521. , altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
  9522. altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
  9523. if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
  9524. if (tp_inst._defaults.altFormat) {
  9525. altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime
  9526. } else {
  9527. altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime
  9528. }
  9529. }
  9530. $(altField).val(inst.input.val() ? altFormattedDateTime : "")
  9531. }
  9532. } else {
  9533. $.datepicker._base_updateAlternate(inst)
  9534. }
  9535. }
  9536. ;
  9537. $.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
  9538. $.datepicker._doKeyUp = function(event) {
  9539. var inst = $.datepicker._getInst(event.target)
  9540. , tp_inst = $.datepicker._get(inst, "timepicker");
  9541. if (tp_inst) {
  9542. if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
  9543. try {
  9544. $.datepicker._updateDatepicker(inst)
  9545. } catch (err) {
  9546. $.timepicker.log(err)
  9547. }
  9548. }
  9549. }
  9550. return $.datepicker._base_doKeyUp(event)
  9551. }
  9552. ;
  9553. $.datepicker._base_gotoToday = $.datepicker._gotoToday;
  9554. $.datepicker._gotoToday = function(id) {
  9555. var inst = this._getInst($(id)[0]);
  9556. this._base_gotoToday(id);
  9557. var tp_inst = this._get(inst, "timepicker");
  9558. if (!tp_inst) {
  9559. return
  9560. }
  9561. var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone);
  9562. var now = new Date();
  9563. now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10));
  9564. this._setTime(inst, now);
  9565. this._setDate(inst, now);
  9566. tp_inst._onSelectHandler()
  9567. }
  9568. ;
  9569. $.datepicker._disableTimepickerDatepicker = function(target) {
  9570. var inst = this._getInst(target);
  9571. if (!inst) {
  9572. return
  9573. }
  9574. var tp_inst = this._get(inst, "timepicker");
  9575. $(target).datepicker("getDate");
  9576. if (tp_inst) {
  9577. inst.settings.showTimepicker = false;
  9578. tp_inst._defaults.showTimepicker = false;
  9579. tp_inst._updateDateTime(inst)
  9580. }
  9581. }
  9582. ;
  9583. $.datepicker._enableTimepickerDatepicker = function(target) {
  9584. var inst = this._getInst(target);
  9585. if (!inst) {
  9586. return
  9587. }
  9588. var tp_inst = this._get(inst, "timepicker");
  9589. $(target).datepicker("getDate");
  9590. if (tp_inst) {
  9591. inst.settings.showTimepicker = true;
  9592. tp_inst._defaults.showTimepicker = true;
  9593. tp_inst._addTimePicker(inst);
  9594. tp_inst._updateDateTime(inst)
  9595. }
  9596. }
  9597. ;
  9598. $.datepicker._setTime = function(inst, date) {
  9599. var tp_inst = this._get(inst, "timepicker");
  9600. if (tp_inst) {
  9601. var defaults = tp_inst._defaults;
  9602. tp_inst.hour = date ? date.getHours() : defaults.hour;
  9603. tp_inst.minute = date ? date.getMinutes() : defaults.minute;
  9604. tp_inst.second = date ? date.getSeconds() : defaults.second;
  9605. tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
  9606. tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
  9607. tp_inst._limitMinMaxDateTime(inst, true);
  9608. tp_inst._onTimeChange();
  9609. tp_inst._updateDateTime(inst)
  9610. }
  9611. }
  9612. ;
  9613. $.datepicker._setTimeDatepicker = function(target, date, withDate) {
  9614. var inst = this._getInst(target);
  9615. if (!inst) {
  9616. return
  9617. }
  9618. var tp_inst = this._get(inst, "timepicker");
  9619. if (tp_inst) {
  9620. this._setDateFromField(inst);
  9621. var tp_date;
  9622. if (date) {
  9623. if (typeof date === "string") {
  9624. tp_inst._parseTime(date, withDate);
  9625. tp_date = new Date();
  9626. tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
  9627. tp_date.setMicroseconds(tp_inst.microsec)
  9628. } else {
  9629. tp_date = new Date(date.getTime());
  9630. tp_date.setMicroseconds(date.getMicroseconds())
  9631. }
  9632. if (tp_date.toString() === "Invalid Date") {
  9633. tp_date = undefined
  9634. }
  9635. this._setTime(inst, tp_date)
  9636. }
  9637. }
  9638. }
  9639. ;
  9640. $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
  9641. $.datepicker._setDateDatepicker = function(target, _date) {
  9642. var inst = this._getInst(target);
  9643. var date = _date;
  9644. if (!inst) {
  9645. return
  9646. }
  9647. if (typeof (_date) === "string") {
  9648. date = new Date(_date);
  9649. if (!date.getTime()) {
  9650. this._base_setDateDatepicker.apply(this, arguments);
  9651. date = $(target).datepicker("getDate")
  9652. }
  9653. }
  9654. var tp_inst = this._get(inst, "timepicker");
  9655. var tp_date;
  9656. if (date instanceof Date) {
  9657. tp_date = new Date(date.getTime());
  9658. tp_date.setMicroseconds(date.getMicroseconds())
  9659. } else {
  9660. tp_date = date
  9661. }
  9662. if (tp_inst && tp_date) {
  9663. if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
  9664. tp_inst.timezone = tp_date.getTimezoneOffset() * -1
  9665. }
  9666. date = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone);
  9667. tp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone)
  9668. }
  9669. this._updateDatepicker(inst);
  9670. this._base_setDateDatepicker.apply(this, arguments);
  9671. this._setTimeDatepicker(target, tp_date, true)
  9672. }
  9673. ;
  9674. $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
  9675. $.datepicker._getDateDatepicker = function(target, noDefault) {
  9676. var inst = this._getInst(target);
  9677. if (!inst) {
  9678. return
  9679. }
  9680. var tp_inst = this._get(inst, "timepicker");
  9681. if (tp_inst) {
  9682. if (inst.lastVal === undefined) {
  9683. this._setDateFromField(inst, noDefault)
  9684. }
  9685. var date = this._getDate(inst);
  9686. var currDT = null;
  9687. if (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) {
  9688. currDT = tp_inst.$input.val() + " " + tp_inst.$altInput.val()
  9689. } else {
  9690. if (tp_inst.$input.get(0).tagName !== "INPUT" && tp_inst.$altInput) {
  9691. currDT = tp_inst.$altInput.val()
  9692. } else {
  9693. currDT = tp_inst.$input.val()
  9694. }
  9695. }
  9696. if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) {
  9697. date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
  9698. date.setMicroseconds(tp_inst.microsec);
  9699. if (tp_inst.timezone != null) {
  9700. if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
  9701. tp_inst.timezone = date.getTimezoneOffset() * -1
  9702. }
  9703. date = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()))
  9704. }
  9705. }
  9706. return date
  9707. }
  9708. return this._base_getDateDatepicker(target, noDefault)
  9709. }
  9710. ;
  9711. $.datepicker._base_parseDate = $.datepicker.parseDate;
  9712. $.datepicker.parseDate = function(format, value, settings) {
  9713. var date;
  9714. try {
  9715. date = this._base_parseDate(format, value, settings)
  9716. } catch (err) {
  9717. if (err.indexOf(":") >= 0) {
  9718. date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(":") - 2)), settings);
  9719. $.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format)
  9720. } else {
  9721. throw err
  9722. }
  9723. }
  9724. return date
  9725. }
  9726. ;
  9727. $.datepicker._base_formatDate = $.datepicker._formatDate;
  9728. $.datepicker._formatDate = function(inst, day, month, year) {
  9729. var tp_inst = this._get(inst, "timepicker");
  9730. if (tp_inst) {
  9731. tp_inst._updateDateTime(inst);
  9732. return tp_inst.$input.val()
  9733. }
  9734. return this._base_formatDate(inst)
  9735. }
  9736. ;
  9737. $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
  9738. $.datepicker._optionDatepicker = function(target, name, value) {
  9739. var inst = this._getInst(target), name_clone;
  9740. if (!inst) {
  9741. return null
  9742. }
  9743. var tp_inst = this._get(inst, "timepicker");
  9744. if (tp_inst) {
  9745. var min = null, max = null, onselect = null, overrides = tp_inst._defaults.evnts, fns = {}, prop, ret, oldVal, $target;
  9746. if (typeof name === "string") {
  9747. if (name === "minDate" || name === "minDateTime") {
  9748. min = value
  9749. } else {
  9750. if (name === "maxDate" || name === "maxDateTime") {
  9751. max = value
  9752. } else {
  9753. if (name === "onSelect") {
  9754. onselect = value
  9755. } else {
  9756. if (overrides.hasOwnProperty(name)) {
  9757. if (typeof (value) === "undefined") {
  9758. return overrides[name]
  9759. }
  9760. fns[name] = value;
  9761. name_clone = {}
  9762. }
  9763. }
  9764. }
  9765. }
  9766. } else {
  9767. if (typeof name === "object") {
  9768. if (name.minDate) {
  9769. min = name.minDate
  9770. } else {
  9771. if (name.minDateTime) {
  9772. min = name.minDateTime
  9773. } else {
  9774. if (name.maxDate) {
  9775. max = name.maxDate
  9776. } else {
  9777. if (name.maxDateTime) {
  9778. max = name.maxDateTime
  9779. }
  9780. }
  9781. }
  9782. }
  9783. for (prop in overrides) {
  9784. if (overrides.hasOwnProperty(prop) && name[prop]) {
  9785. fns[prop] = name[prop]
  9786. }
  9787. }
  9788. }
  9789. }
  9790. for (prop in fns) {
  9791. if (fns.hasOwnProperty(prop)) {
  9792. overrides[prop] = fns[prop];
  9793. if (!name_clone) {
  9794. name_clone = $.extend({}, name)
  9795. }
  9796. delete name_clone[prop]
  9797. }
  9798. }
  9799. if (name_clone && isEmptyObject(name_clone)) {
  9800. return
  9801. }
  9802. if (min) {
  9803. if (min === 0) {
  9804. min = new Date()
  9805. } else {
  9806. min = new Date(min)
  9807. }
  9808. tp_inst._defaults.minDate = min;
  9809. tp_inst._defaults.minDateTime = min
  9810. } else {
  9811. if (max) {
  9812. if (max === 0) {
  9813. max = new Date()
  9814. } else {
  9815. max = new Date(max)
  9816. }
  9817. tp_inst._defaults.maxDate = max;
  9818. tp_inst._defaults.maxDateTime = max
  9819. } else {
  9820. if (onselect) {
  9821. tp_inst._defaults.onSelect = onselect
  9822. }
  9823. }
  9824. }
  9825. if (min || max) {
  9826. $target = $(target);
  9827. oldVal = $target.datetimepicker("getDate");
  9828. ret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
  9829. $target.datetimepicker("setDate", oldVal);
  9830. return ret
  9831. }
  9832. }
  9833. if (value === undefined) {
  9834. return this._base_optionDatepicker.call($.datepicker, target, name)
  9835. }
  9836. return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value)
  9837. }
  9838. ;
  9839. var isEmptyObject = function(obj) {
  9840. var prop;
  9841. for (prop in obj) {
  9842. if (obj.hasOwnProperty(prop)) {
  9843. return false
  9844. }
  9845. }
  9846. return true
  9847. };
  9848. var extendRemove = function(target, props) {
  9849. $.extend(target, props);
  9850. for (var name in props) {
  9851. if (props[name] === null || props[name] === undefined) {
  9852. target[name] = props[name]
  9853. }
  9854. }
  9855. return target
  9856. };
  9857. var detectSupport = function(timeFormat) {
  9858. var tf = timeFormat.replace(/'.*?'/g, "").toLowerCase()
  9859. , isIn = function(f, t) {
  9860. return f.indexOf(t) !== -1 ? true : false
  9861. };
  9862. return {
  9863. hour: isIn(tf, "h"),
  9864. minute: isIn(tf, "m"),
  9865. second: isIn(tf, "s"),
  9866. millisec: isIn(tf, "l"),
  9867. microsec: isIn(tf, "c"),
  9868. timezone: isIn(tf, "z"),
  9869. ampm: isIn(tf, "t") && isIn(timeFormat, "h"),
  9870. iso8601: isIn(timeFormat, "Z")
  9871. }
  9872. };
  9873. var convert24to12 = function(hour) {
  9874. hour %= 12;
  9875. if (hour === 0) {
  9876. hour = 12
  9877. }
  9878. return String(hour)
  9879. };
  9880. var computeEffectiveSetting = function(settings, property) {
  9881. return settings && settings[property] ? settings[property] : $.timepicker._defaults[property]
  9882. };
  9883. var splitDateTime = function(dateTimeString, timeSettings) {
  9884. var separator = computeEffectiveSetting(timeSettings, "separator")
  9885. , format = computeEffectiveSetting(timeSettings, "timeFormat")
  9886. , timeParts = format.split(separator)
  9887. , timePartsLen = timeParts.length
  9888. , allParts = dateTimeString.split(separator)
  9889. , allPartsLen = allParts.length;
  9890. if (allPartsLen > 1) {
  9891. return {
  9892. dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),
  9893. timeString: allParts.splice(0, timePartsLen).join(separator)
  9894. }
  9895. }
  9896. return {
  9897. dateString: dateTimeString,
  9898. timeString: ""
  9899. }
  9900. };
  9901. var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
  9902. var date, parts, parsedTime;
  9903. parts = splitDateTime(dateTimeString, timeSettings);
  9904. date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);
  9905. if (parts.timeString === "") {
  9906. return {
  9907. date: date
  9908. }
  9909. }
  9910. parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);
  9911. if (!parsedTime) {
  9912. throw "Wrong time format"
  9913. }
  9914. return {
  9915. date: date,
  9916. timeObj: parsedTime
  9917. }
  9918. };
  9919. var selectLocalTimezone = function(tp_inst, date) {
  9920. if (tp_inst && tp_inst.timezone_select) {
  9921. var now = date || new Date();
  9922. tp_inst.timezone_select.val(-now.getTimezoneOffset())
  9923. }
  9924. };
  9925. $.timepicker = new Timepicker();
  9926. $.timepicker.timezoneOffsetString = function(tzMinutes, iso8601) {
  9927. if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {
  9928. return tzMinutes
  9929. }
  9930. var off = tzMinutes
  9931. , minutes = off % 60
  9932. , hours = (off - minutes) / 60
  9933. , iso = iso8601 ? ":" : ""
  9934. , tz = (off >= 0 ? "+" : "-") + ("0" + Math.abs(hours)).slice(-2) + iso + ("0" + Math.abs(minutes)).slice(-2);
  9935. if (tz === "+00:00") {
  9936. return "Z"
  9937. }
  9938. return tz
  9939. }
  9940. ;
  9941. $.timepicker.timezoneOffsetNumber = function(tzString) {
  9942. var normalized = tzString.toString().replace(":", "");
  9943. if (normalized.toUpperCase() === "Z") {
  9944. return 0
  9945. }
  9946. if (!/^(\-|\+)\d{4}$/.test(normalized)) {
  9947. return parseInt(tzString, 10)
  9948. }
  9949. return ((normalized.substr(0, 1) === "-" ? -1 : 1) * ((parseInt(normalized.substr(1, 2), 10) * 60) + parseInt(normalized.substr(3, 2), 10)))
  9950. }
  9951. ;
  9952. $.timepicker.timezoneAdjust = function(date, fromTimezone, toTimezone) {
  9953. var fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone);
  9954. var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
  9955. if (!isNaN(toTz)) {
  9956. date.setMinutes(date.getMinutes() + (-fromTz) - (-toTz))
  9957. }
  9958. return date
  9959. }
  9960. ;
  9961. $.timepicker.timeRange = function(startTime, endTime, options) {
  9962. return $.timepicker.handleRange("timepicker", startTime, endTime, options)
  9963. }
  9964. ;
  9965. $.timepicker.datetimeRange = function(startTime, endTime, options) {
  9966. $.timepicker.handleRange("datetimepicker", startTime, endTime, options)
  9967. }
  9968. ;
  9969. $.timepicker.dateRange = function(startTime, endTime, options) {
  9970. $.timepicker.handleRange("datepicker", startTime, endTime, options)
  9971. }
  9972. ;
  9973. $.timepicker.handleRange = function(method, startTime, endTime, options) {
  9974. options = $.extend({}, {
  9975. minInterval: 0,
  9976. maxInterval: 0,
  9977. start: {},
  9978. end: {}
  9979. }, options);
  9980. var timeOnly = false;
  9981. if (method === "timepicker") {
  9982. timeOnly = true;
  9983. method = "datetimepicker"
  9984. }
  9985. function checkDates(changed, other) {
  9986. var startdt = startTime[method]("getDate")
  9987. , enddt = endTime[method]("getDate")
  9988. , changeddt = changed[method]("getDate");
  9989. if (startdt !== null) {
  9990. var minDate = new Date(startdt.getTime())
  9991. , maxDate = new Date(startdt.getTime());
  9992. minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);
  9993. maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);
  9994. if (options.minInterval > 0 && minDate > enddt) {
  9995. endTime[method]("setDate", minDate)
  9996. } else {
  9997. if (options.maxInterval > 0 && maxDate < enddt) {
  9998. endTime[method]("setDate", maxDate)
  9999. } else {
  10000. if (startdt > enddt) {
  10001. other[method]("setDate", changeddt)
  10002. }
  10003. }
  10004. }
  10005. }
  10006. }
  10007. function selected(changed, other, option) {
  10008. if (!changed.val()) {
  10009. return
  10010. }
  10011. var date = changed[method].call(changed, "getDate");
  10012. if (date !== null && options.minInterval > 0) {
  10013. if (option === "minDate") {
  10014. date.setMilliseconds(date.getMilliseconds() + options.minInterval)
  10015. }
  10016. if (option === "maxDate") {
  10017. date.setMilliseconds(date.getMilliseconds() - options.minInterval)
  10018. }
  10019. }
  10020. if (date.getTime) {
  10021. other[method].call(other, "option", option, date)
  10022. }
  10023. }
  10024. $.fn[method].call(startTime, $.extend({
  10025. timeOnly: timeOnly,
  10026. onClose: function(dateText, inst) {
  10027. checkDates($(this), endTime)
  10028. },
  10029. onSelect: function(selectedDateTime) {
  10030. selected($(this), endTime, "minDate")
  10031. }
  10032. }, options, options.start));
  10033. $.fn[method].call(endTime, $.extend({
  10034. timeOnly: timeOnly,
  10035. onClose: function(dateText, inst) {
  10036. checkDates($(this), startTime)
  10037. },
  10038. onSelect: function(selectedDateTime) {
  10039. selected($(this), startTime, "maxDate")
  10040. }
  10041. }, options, options.end));
  10042. checkDates(startTime, endTime);
  10043. selected(startTime, endTime, "minDate");
  10044. selected(endTime, startTime, "maxDate");
  10045. return $([startTime.get(0), endTime.get(0)])
  10046. }
  10047. ;
  10048. $.timepicker.log = function() {
  10049. if (window.console && window.console.log && window.console.log.apply) {
  10050. window.console.log.apply(window.console, Array.prototype.slice.call(arguments))
  10051. }
  10052. }
  10053. ;
  10054. $.timepicker._util = {
  10055. _extendRemove: extendRemove,
  10056. _isEmptyObject: isEmptyObject,
  10057. _convert24to12: convert24to12,
  10058. _detectSupport: detectSupport,
  10059. _selectLocalTimezone: selectLocalTimezone,
  10060. _computeEffectiveSetting: computeEffectiveSetting,
  10061. _splitDateTime: splitDateTime,
  10062. _parseDateTimeInternal: parseDateTimeInternal
  10063. };
  10064. if (!Date.prototype.getMicroseconds) {
  10065. Date.prototype.microseconds = 0;
  10066. Date.prototype.getMicroseconds = function() {
  10067. return this.microseconds
  10068. }
  10069. ;
  10070. Date.prototype.setMicroseconds = function(m) {
  10071. this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000));
  10072. this.microseconds = m % 1000;
  10073. return this
  10074. }
  10075. }
  10076. $.timepicker.version = "1.6.3"
  10077. }));
  10078. !function(a) {
  10079. "function" == typeof define && define.amd ? define(["jquery"], a) : a("object" == typeof exports ? require("jquery") : jQuery)
  10080. }(function(e) {
  10081. var f, d = navigator.userAgent, c = /iphone/i.test(d), a = /chrome/i.test(d), b = /android/i.test(d);
  10082. e.mask = {
  10083. definitions: {
  10084. "9": "[0-9]",
  10085. a: "[A-Za-z]",
  10086. "*": "[A-Za-z0-9]"
  10087. },
  10088. autoclear: !0,
  10089. dataName: "rawMaskFn",
  10090. placeholder: "_"
  10091. },
  10092. e.fn.extend({
  10093. caret: function(i, g) {
  10094. var h;
  10095. if (0 !== this.length && !this.is(":hidden")) {
  10096. return "number" == typeof i ? (g = "number" == typeof g ? g : i,
  10097. this.each(function() {
  10098. this.setSelectionRange ? this.setSelectionRange(i, g) : this.createTextRange && (h = this.createTextRange(),
  10099. h.collapse(!0),
  10100. h.moveEnd("character", g),
  10101. h.moveStart("character", i),
  10102. h.select())
  10103. })) : (this[0].setSelectionRange ? (i = this[0].selectionStart,
  10104. g = this[0].selectionEnd) : document.selection && document.selection.createRange && (h = document.selection.createRange(),
  10105. i = 0 - h.duplicate().moveStart("character", -100000),
  10106. g = i + h.text.length),
  10107. {
  10108. begin: i,
  10109. end: g
  10110. })
  10111. }
  10112. },
  10113. unmask: function() {
  10114. return this.trigger("unmask")
  10115. },
  10116. mask: function(q, j) {
  10117. var n, k, h, i, p, g, l, o;
  10118. if (!q && this.length > 0) {
  10119. n = e(this[0]);
  10120. var m = n.data(e.mask.dataName);
  10121. return m ? m() : void 0
  10122. }
  10123. return j = e.extend({
  10124. autoclear: e.mask.autoclear,
  10125. placeholder: e.mask.placeholder,
  10126. completed: null
  10127. }, j),
  10128. k = e.mask.definitions,
  10129. h = [],
  10130. i = l = q.length,
  10131. p = null,
  10132. e.each(q.split(""), function(r, s) {
  10133. "?" == s ? (l--,
  10134. i = r) : k[s] ? (h.push(new RegExp(k[s])),
  10135. null === p && (p = h.length - 1),
  10136. i > r && (g = h.length - 1)) : h.push(null)
  10137. }),
  10138. this.trigger("unmask").each(function() {
  10139. function D() {
  10140. if (j.completed) {
  10141. for (var J = p; g >= J; J++) {
  10142. if (h[J] && E[J] === I(J)) {
  10143. return
  10144. }
  10145. }
  10146. j.completed.call(B)
  10147. }
  10148. }
  10149. function I(J) {
  10150. return j.placeholder.charAt(J < j.placeholder.length ? J : 0)
  10151. }
  10152. function u(J) {
  10153. for (; ++J < l && !h[J]; ) {}
  10154. return J
  10155. }
  10156. function t(J) {
  10157. for (; --J >= 0 && !h[J]; ) {}
  10158. return J
  10159. }
  10160. function x(M, J) {
  10161. var L, K;
  10162. if (!(0 > M)) {
  10163. for (L = M,
  10164. K = u(J); l > L; L++) {
  10165. if (h[L]) {
  10166. if (!(l > K && h[L].test(E[K]))) {
  10167. break
  10168. }
  10169. E[L] = E[K],
  10170. E[K] = I(K),
  10171. K = u(K)
  10172. }
  10173. }
  10174. A(),
  10175. B.caret(Math.max(p, M))
  10176. }
  10177. }
  10178. function s(N) {
  10179. var L, M, J, K;
  10180. for (L = N,
  10181. M = I(N); l > L; L++) {
  10182. if (h[L]) {
  10183. if (J = u(L),
  10184. K = E[L],
  10185. E[L] = M,
  10186. !(l > J && h[J].test(K))) {
  10187. break
  10188. }
  10189. M = K
  10190. }
  10191. }
  10192. }
  10193. function G() {
  10194. var K = B.val()
  10195. , L = B.caret();
  10196. var J = function() {
  10197. e.proxy(e.fn.caret, B, L.begin, L.begin)()
  10198. };
  10199. if (o && o.length && o.length > K.length) {
  10200. for (z(!0); L.begin > 0 && !h[L.begin - 1]; ) {
  10201. L.begin--
  10202. }
  10203. if (0 === L.begin) {
  10204. for (; L.begin < p && !h[L.begin]; ) {
  10205. L.begin++
  10206. }
  10207. }
  10208. setTimeout(function() {
  10209. J();
  10210. D()
  10211. }, 0)
  10212. } else {
  10213. for (z(!0); L.begin < l && !h[L.begin]; ) {
  10214. L.begin++
  10215. }
  10216. setTimeout(function() {
  10217. J();
  10218. D()
  10219. }, 0)
  10220. }
  10221. }
  10222. function C(J) {
  10223. z(),
  10224. B.val() != w && H(J)
  10225. }
  10226. function H(J) {
  10227. B.change();
  10228. if (j.onChange) {
  10229. j.onChange.call(B, J)
  10230. }
  10231. }
  10232. function v(M) {
  10233. if (!B.prop("readonly")) {
  10234. var N, L, J, K = M.which || M.keyCode;
  10235. o = B.val(),
  10236. 8 === K || 46 === K || c && 127 === K ? (N = B.caret(),
  10237. L = N.begin,
  10238. J = N.end,
  10239. J - L === 0 && (L = 46 !== K ? t(L) : J = u(L - 1),
  10240. J = 46 === K ? u(J) : J),
  10241. r(L, J),
  10242. x(L, J - 1),
  10243. M.preventDefault()) : 13 === K ? C.call(this, M) : 27 === K && (B.val(w),
  10244. B.caret(0, z()),
  10245. M.preventDefault())
  10246. }
  10247. }
  10248. function F(N) {
  10249. if (!B.prop("readonly")) {
  10250. var M, P, L, J = N.which || N.keyCode, O = B.caret();
  10251. if (!(N.ctrlKey || N.altKey || N.metaKey || 32 > J || (J > 34 && J < 41)) && J && 13 !== J) {
  10252. if (O.end - O.begin !== 0 && (r(O.begin, O.end),
  10253. x(O.begin, O.end - 1)),
  10254. M = u(O.begin - 1),
  10255. l > M && (P = String.fromCharCode(J),
  10256. h[M].test(P))) {
  10257. if (s(M),
  10258. E[M] = P,
  10259. A(),
  10260. L = u(M),
  10261. b) {
  10262. var K = function() {
  10263. e.proxy(e.fn.caret, B, L)()
  10264. };
  10265. setTimeout(K, 0)
  10266. } else {
  10267. B.caret(L)
  10268. }
  10269. O.begin <= g && D()
  10270. }
  10271. N.preventDefault()
  10272. }
  10273. }
  10274. }
  10275. function r(L, J) {
  10276. var K;
  10277. for (K = L; J > K && l > K; K++) {
  10278. h[K] && (E[K] = I(K))
  10279. }
  10280. }
  10281. function A() {
  10282. B.val(E.join(""))
  10283. }
  10284. function z(K) {
  10285. var J, O, N, M = B.val(), L = -1;
  10286. for (J = 0,
  10287. N = 0; l > J; J++) {
  10288. if (h[J]) {
  10289. for (E[J] = I(J); N++ < M.length; ) {
  10290. if (O = M.charAt(N - 1),
  10291. h[J].test(O)) {
  10292. E[J] = O,
  10293. L = J;
  10294. break
  10295. }
  10296. }
  10297. if (N > M.length) {
  10298. r(J + 1, l);
  10299. break
  10300. }
  10301. } else {
  10302. E[J] === M.charAt(N) && N++,
  10303. i > J && (L = J)
  10304. }
  10305. }
  10306. return K ? A() : i > L + 1 ? j.autoclear || E.join("") === y ? (B.val() && B.val(""),
  10307. r(0, l)) : A() : (A(),
  10308. B.val(B.val().substring(0, L + 1))),
  10309. i ? J : p
  10310. }
  10311. var B = e(this)
  10312. , E = e.map(q.split(""), function(K, J) {
  10313. return "?" != K ? k[K] ? I(J) : K : void 0
  10314. })
  10315. , y = E.join("")
  10316. , w = B.val();
  10317. B.data(e.mask.dataName, function() {
  10318. return e.map(E, function(K, J) {
  10319. return h[J] && K != I(J) ? K : null
  10320. }).join("")
  10321. }),
  10322. B.one("unmask", function() {
  10323. B.off(".mask").removeData(e.mask.dataName)
  10324. }).on("focus.mask", function() {
  10325. if (!B.prop("readonly")) {
  10326. clearTimeout(f);
  10327. var J;
  10328. w = B.val(),
  10329. J = z(),
  10330. f = setTimeout(function() {
  10331. B.get(0) === document.activeElement && (A(),
  10332. J == q.replace("?", "").length ? B.caret(0, J) : B.caret(J))
  10333. }, 10)
  10334. }
  10335. }).on("blur.mask", C).on("keydown.mask", v).on("keypress.mask", F).on("input.mask paste.mask", function() {
  10336. B.prop("readonly") || setTimeout(function() {
  10337. var J = z(!0);
  10338. B.caret(J),
  10339. D()
  10340. }, 0)
  10341. }),
  10342. a && b && B.off("input.mask").on("input.mask", G),
  10343. z()
  10344. })
  10345. }
  10346. })
  10347. });
  10348. $(function() {
  10349. var a = {
  10350. primaryStyles: ["fontFamily", "fontSize", "fontWeight", "fontVariant", "fontStyle", "paddingLeft", "paddingTop", "paddingBottom", "paddingRight", "marginLeft", "marginTop", "marginBottom", "marginRight", "borderLeftColor", "borderTopColor", "borderBottomColor", "borderRightColor", "borderLeftStyle", "borderTopStyle", "borderBottomStyle", "borderRightStyle", "borderLeftWidth", "borderTopWidth", "borderBottomWidth", "borderRightWidth", "line-height", "outline"],
  10351. specificStyle: {
  10352. "word-wrap": "break-word",
  10353. "overflow-x": "hidden",
  10354. "overflow-y": "auto"
  10355. },
  10356. simulator: $('<div id="textarea_simulator"/>').css({
  10357. position: "absolute",
  10358. top: 0,
  10359. left: 0,
  10360. visibility: "hidden"
  10361. }).appendTo(document.body),
  10362. toHtml: function(b) {
  10363. return PrimeFaces.escapeHTML(b).replace(/\n/g, "<br>").split(" ").join('<span style="white-space:prev-wrap">&nbsp;</span>')
  10364. },
  10365. getCaretPosition: function() {
  10366. var c = a
  10367. , n = this
  10368. , g = n[0]
  10369. , d = n.offset();
  10370. if ($.browser.msie && document.selection && document.selection.createRange) {
  10371. g.focus();
  10372. var h = document.selection.createRange();
  10373. $("#hskeywords").val(g.scrollTop);
  10374. return {
  10375. left: h.boundingLeft - d.left,
  10376. top: parseInt(h.boundingTop) - d.top + g.scrollTop + document.documentElement.scrollTop + parseInt(n.getComputedStyle("fontSize"))
  10377. }
  10378. }
  10379. c.simulator.empty();
  10380. $.each(c.primaryStyles, function(p, q) {
  10381. n.cloneStyle(c.simulator, q)
  10382. });
  10383. c.simulator.css($.extend({
  10384. width: n.width(),
  10385. height: n.height()
  10386. }, c.specificStyle));
  10387. var l = n.val()
  10388. , e = n.getCursorPosition();
  10389. var f = l.substring(0, e)
  10390. , m = l.substring(e);
  10391. var j = $('<span class="before"/>').html(c.toHtml(f))
  10392. , o = $('<span class="focus"/>')
  10393. , b = $('<span class="after"/>').html(c.toHtml(m));
  10394. c.simulator.append(j).append(o).append(b);
  10395. var i = o.offset()
  10396. , k = c.simulator.offset();
  10397. return {
  10398. top: i.top - k.top - g.scrollTop + ($.browser.mozilla ? 0 : parseInt(n.getComputedStyle("fontSize"))),
  10399. left: o[0].offsetLeft - c.simulator[0].offsetLeft - g.scrollLeft
  10400. }
  10401. }
  10402. };
  10403. $.fn.extend({
  10404. getComputedStyle: function(c) {
  10405. if (this.length == 0) {
  10406. return
  10407. }
  10408. var d = this[0];
  10409. var b = this.css(c);
  10410. b = b || ($.browser.msie ? d.currentStyle[c] : document.defaultView.getComputedStyle(d, null)[c]);
  10411. return b
  10412. },
  10413. cloneStyle: function(c, b) {
  10414. var d = this.getComputedStyle(b);
  10415. if (!!d) {
  10416. $(c).css(b, d)
  10417. }
  10418. },
  10419. cloneAllStyle: function(e, d) {
  10420. var c = this[0];
  10421. for (var b in c.style) {
  10422. var f = c.style[b];
  10423. typeof f == "string" || typeof f == "number" ? this.cloneStyle(e, b) : NaN
  10424. }
  10425. },
  10426. getCursorPosition: function() {
  10427. var e = this[0]
  10428. , b = 0;
  10429. if ("selectionStart"in e) {
  10430. b = e.selectionStart
  10431. } else {
  10432. if ("selection"in document) {
  10433. var c = document.selection.createRange();
  10434. if (parseInt($.browser.version) > 6) {
  10435. e.focus();
  10436. var g = document.selection.createRange().text.length;
  10437. c.moveStart("character", -e.value.length);
  10438. b = c.text.length - g
  10439. } else {
  10440. var h = document.body.createTextRange();
  10441. h.moveToElementText(e);
  10442. for (; h.compareEndPoints("StartToStart", c) < 0; b++) {
  10443. h.moveStart("character", 1)
  10444. }
  10445. for (var d = 0; d <= b; d++) {
  10446. if (e.value.charAt(d) == "\n") {
  10447. b++
  10448. }
  10449. }
  10450. var f = e.value.split("\n").length - 1;
  10451. b -= f;
  10452. return b
  10453. }
  10454. }
  10455. }
  10456. return b
  10457. },
  10458. getCaretPosition: a.getCaretPosition
  10459. })
  10460. });
  10461. /*!
  10462. autosize 4.0.2
  10463. license: MIT
  10464. http://www.jacklmoore.com/autosize
  10465. */
  10466. (function(c, a) {
  10467. if (typeof define === "function" && define.amd) {
  10468. define(["module", "exports"], a)
  10469. } else {
  10470. if (typeof exports !== "undefined") {
  10471. a(module, exports)
  10472. } else {
  10473. var b = {
  10474. exports: {}
  10475. };
  10476. a(b, b.exports);
  10477. c.autosize = b.exports
  10478. }
  10479. }
  10480. }
  10481. )(this, function(b, d) {
  10482. var a = typeof Map === "function" ? new Map() : function() {
  10483. var n = [];
  10484. var k = [];
  10485. return {
  10486. has: function m(p) {
  10487. return n.indexOf(p) > -1
  10488. },
  10489. get: function l(p) {
  10490. return k[n.indexOf(p)]
  10491. },
  10492. set: function o(p, q) {
  10493. if (n.indexOf(p) === -1) {
  10494. n.push(p);
  10495. k.push(q)
  10496. }
  10497. },
  10498. _delete: function e(q) {
  10499. var p = n.indexOf(q);
  10500. if (p > -1) {
  10501. n.splice(p, 1);
  10502. k.splice(p, 1)
  10503. }
  10504. }
  10505. }
  10506. }();
  10507. var h = function h(e) {
  10508. return new Event(e,{
  10509. bubbles: true
  10510. })
  10511. };
  10512. try {
  10513. new Event("test")
  10514. } catch (f) {
  10515. h = function h(k) {
  10516. var e = document.createEvent("Event");
  10517. e.initEvent(k, true, false);
  10518. return e
  10519. }
  10520. }
  10521. function j(n) {
  10522. if (!n || !n.nodeName || n.nodeName !== "TEXTAREA" || a.has(n)) {
  10523. return
  10524. }
  10525. var e = null;
  10526. var r = null;
  10527. var k = null;
  10528. function t() {
  10529. var u = window.getComputedStyle(n, null);
  10530. if (u.resize === "vertical") {
  10531. n.style.resize = "none"
  10532. } else {
  10533. if (u.resize === "both") {
  10534. n.style.resize = "horizontal"
  10535. }
  10536. }
  10537. if (u.boxSizing === "content-box") {
  10538. e = -(parseFloat(u.paddingTop) + parseFloat(u.paddingBottom))
  10539. } else {
  10540. e = parseFloat(u.borderTopWidth) + parseFloat(u.borderBottomWidth)
  10541. }
  10542. if (isNaN(e)) {
  10543. e = 0
  10544. }
  10545. m()
  10546. }
  10547. function p(v) {
  10548. var u = n.style.width;
  10549. n.style.width = "0px";
  10550. n.offsetWidth;
  10551. n.style.width = u;
  10552. n.style.overflowY = v
  10553. }
  10554. function s(v) {
  10555. var u = [];
  10556. while (v && v.parentNode && v.parentNode instanceof Element) {
  10557. if (v.parentNode.scrollTop) {
  10558. u.push({
  10559. node: v.parentNode,
  10560. scrollTop: v.parentNode.scrollTop
  10561. })
  10562. }
  10563. v = v.parentNode
  10564. }
  10565. return u
  10566. }
  10567. function l() {
  10568. if (n.scrollHeight === 0) {
  10569. return
  10570. }
  10571. var v = s(n);
  10572. var u = document.documentElement && document.documentElement.scrollTop;
  10573. n.style.height = "";
  10574. n.style.height = n.scrollHeight + e + "px";
  10575. r = n.clientWidth;
  10576. v.forEach(function(w) {
  10577. w.node.scrollTop = w.scrollTop
  10578. });
  10579. if (u) {
  10580. document.documentElement.scrollTop = u
  10581. }
  10582. }
  10583. function m() {
  10584. l();
  10585. var y = Math.round(parseFloat(n.style.height));
  10586. var w = window.getComputedStyle(n, null);
  10587. var x = w.boxSizing === "content-box" ? Math.round(parseFloat(w.height)) : n.offsetHeight;
  10588. if (x < y) {
  10589. if (w.overflowY === "hidden") {
  10590. p("scroll");
  10591. l();
  10592. x = w.boxSizing === "content-box" ? Math.round(parseFloat(window.getComputedStyle(n, null).height)) : n.offsetHeight
  10593. }
  10594. } else {
  10595. if (w.overflowY !== "hidden") {
  10596. p("hidden");
  10597. l();
  10598. x = w.boxSizing === "content-box" ? Math.round(parseFloat(window.getComputedStyle(n, null).height)) : n.offsetHeight
  10599. }
  10600. }
  10601. if (k !== x) {
  10602. k = x;
  10603. var u = h("autosize:resized");
  10604. try {
  10605. n.dispatchEvent(u)
  10606. } catch (v) {}
  10607. }
  10608. }
  10609. var o = function o() {
  10610. if (n.clientWidth !== r) {
  10611. m()
  10612. }
  10613. };
  10614. var q = function(u) {
  10615. window.removeEventListener("resize", o, false);
  10616. n.removeEventListener("input", m, false);
  10617. n.removeEventListener("keyup", m, false);
  10618. n.removeEventListener("autosize:destroy", q, false);
  10619. n.removeEventListener("autosize:update", m, false);
  10620. Object.keys(u).forEach(function(v) {
  10621. n.style[v] = u[v]
  10622. });
  10623. a._delete(n)
  10624. }
  10625. .bind(n, {
  10626. height: n.style.height,
  10627. resize: n.style.resize,
  10628. overflowY: n.style.overflowY,
  10629. overflowX: n.style.overflowX,
  10630. wordWrap: n.style.wordWrap
  10631. });
  10632. n.addEventListener("autosize:destroy", q, false);
  10633. if ("onpropertychange"in n && "oninput"in n) {
  10634. n.addEventListener("keyup", m, false)
  10635. }
  10636. window.addEventListener("resize", o, false);
  10637. n.addEventListener("input", m, false);
  10638. n.addEventListener("autosize:update", m, false);
  10639. n.style.overflowX = "hidden";
  10640. n.style.wordWrap = "break-word";
  10641. a.set(n, {
  10642. destroy: q,
  10643. update: m
  10644. });
  10645. t()
  10646. }
  10647. function g(k) {
  10648. var e = a.get(k);
  10649. if (e) {
  10650. e.destroy()
  10651. }
  10652. }
  10653. function c(k) {
  10654. var e = a.get(k);
  10655. if (e) {
  10656. e.update()
  10657. }
  10658. }
  10659. var i = null;
  10660. if (typeof window === "undefined" || typeof window.getComputedStyle !== "function") {
  10661. i = function i(e) {
  10662. return e
  10663. }
  10664. ;
  10665. i.destroy = function(e) {
  10666. return e
  10667. }
  10668. ;
  10669. i.update = function(e) {
  10670. return e
  10671. }
  10672. } else {
  10673. i = function i(k, e) {
  10674. if (k) {
  10675. Array.prototype.forEach.call(k.length ? k : [k], function(l) {
  10676. return j(l, e)
  10677. })
  10678. }
  10679. return k
  10680. }
  10681. ;
  10682. i.destroy = function(e) {
  10683. if (e) {
  10684. Array.prototype.forEach.call(e.length ? e : [e], g)
  10685. }
  10686. return e
  10687. }
  10688. ;
  10689. i.update = function(e) {
  10690. if (e) {
  10691. Array.prototype.forEach.call(e.length ? e : [e], c)
  10692. }
  10693. return e
  10694. }
  10695. }
  10696. b.exports = i
  10697. });
  10698. /*!
  10699. * jQuery Cookie Plugin v1.4.1
  10700. * https://github.com/carhartl/jquery-cookie
  10701. *
  10702. * Copyright 2006, 2014 Klaus Hartl
  10703. * Released under the MIT license
  10704. */
  10705. (function(a) {
  10706. if (typeof define === "function" && define.amd) {
  10707. define(["jquery"], a)
  10708. } else {
  10709. if (typeof exports === "object") {
  10710. module.exports = a(require("jquery"))
  10711. } else {
  10712. a(jQuery)
  10713. }
  10714. }
  10715. }(function(f) {
  10716. var a = /\+/g;
  10717. function d(i) {
  10718. return b.raw ? i : encodeURIComponent(i)
  10719. }
  10720. function g(i) {
  10721. return b.raw ? i : decodeURIComponent(i)
  10722. }
  10723. function h(i) {
  10724. return d(b.json ? JSON.stringify(i) : String(i))
  10725. }
  10726. function c(i) {
  10727. if (i.indexOf('"') === 0) {
  10728. i = i.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\")
  10729. }
  10730. try {
  10731. i = decodeURIComponent(i.replace(a, " "));
  10732. return b.json ? JSON.parse(i) : i
  10733. } catch (j) {}
  10734. }
  10735. function e(j, i) {
  10736. var k = b.raw ? j : c(j);
  10737. return f.isFunction(i) ? i(k) : k
  10738. }
  10739. var b = f.cookie = function(q, p, v) {
  10740. if (arguments.length > 1 && !f.isFunction(p)) {
  10741. v = f.extend({}, b.defaults, v);
  10742. if (typeof v.expires === "number") {
  10743. var r = v.expires
  10744. , u = v.expires = new Date();
  10745. u.setMilliseconds(u.getMilliseconds() + r * 86400000)
  10746. }
  10747. return (document.cookie = [d(q), "=", h(p), v.expires ? "; expires=" + v.expires.toUTCString() : "", v.path ? "; path=" + v.path : "", v.domain ? "; domain=" + v.domain : "", v.secure ? "; secure" : ""].join(""))
  10748. }
  10749. var w = q ? undefined : {}
  10750. , s = document.cookie ? document.cookie.split("; ") : []
  10751. , o = 0
  10752. , m = s.length;
  10753. for (; o < m; o++) {
  10754. var n = s[o].split("=")
  10755. , j = g(n.shift())
  10756. , k = n.join("=");
  10757. if (q === j) {
  10758. w = e(k, p);
  10759. break
  10760. }
  10761. if (!q && (k = e(k)) !== undefined) {
  10762. w[j] = k
  10763. }
  10764. }
  10765. return w
  10766. }
  10767. ;
  10768. b.defaults = {};
  10769. f.removeCookie = function(j, i) {
  10770. f.cookie(j, "", f.extend({}, i, {
  10771. expires: -1
  10772. }));
  10773. return !f.cookie(j)
  10774. }
  10775. }));
  10776. /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
  10777. * Licensed under the MIT License (LICENSE.txt).
  10778. *
  10779. * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
  10780. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
  10781. * Thanks to: Seamus Leahy for adding deltaX and deltaY
  10782. *
  10783. * Version: 3.0.6
  10784. *
  10785. * Requires: 1.2.2+
  10786. */
  10787. (function(d) {
  10788. var b = ["DOMMouseScroll", "mousewheel"];
  10789. if (d.event.fixHooks) {
  10790. for (var a = b.length; a; ) {
  10791. d.event.fixHooks[b[--a]] = d.event.mouseHooks
  10792. }
  10793. }
  10794. d.event.special.mousewheel = {
  10795. setup: function() {
  10796. if (this.addEventListener) {
  10797. for (var e = b.length; e; ) {
  10798. this.addEventListener(b[--e], c, false)
  10799. }
  10800. } else {
  10801. this.onmousewheel = c
  10802. }
  10803. },
  10804. teardown: function() {
  10805. if (this.removeEventListener) {
  10806. for (var e = b.length; e; ) {
  10807. this.removeEventListener(b[--e], c, false)
  10808. }
  10809. } else {
  10810. this.onmousewheel = null
  10811. }
  10812. }
  10813. };
  10814. d.fn.extend({
  10815. mousewheel: function(e) {
  10816. return e ? this.bind("mousewheel", e) : this.trigger("mousewheel")
  10817. },
  10818. unmousewheel: function(e) {
  10819. return this.unbind("mousewheel", e)
  10820. }
  10821. });
  10822. function c(j) {
  10823. var h = j || window.event
  10824. , g = [].slice.call(arguments, 1)
  10825. , k = 0
  10826. , i = true
  10827. , f = 0
  10828. , e = 0;
  10829. j = d.event.fix(h);
  10830. j.type = "mousewheel";
  10831. if (h.wheelDelta) {
  10832. k = h.wheelDelta / 120
  10833. }
  10834. if (h.detail) {
  10835. k = -h.detail / 3
  10836. }
  10837. e = k;
  10838. if (h.axis !== undefined && h.axis === h.HORIZONTAL_AXIS) {
  10839. e = 0;
  10840. f = -1 * k
  10841. }
  10842. if (h.wheelDeltaY !== undefined) {
  10843. e = h.wheelDeltaY / 120
  10844. }
  10845. if (h.wheelDeltaX !== undefined) {
  10846. f = -1 * h.wheelDeltaX / 120
  10847. }
  10848. g.unshift(j, k, f, e);
  10849. return (d.event.dispatch || d.event.handle).apply(this, g)
  10850. }
  10851. }
  10852. )(jQuery);
  10853. (function(c) {
  10854. var l = "undefined";
  10855. var d, g, q, f, b;
  10856. var n, i, m, p;
  10857. function j(s, v) {
  10858. var u = typeof s[v];
  10859. return u === "function" || (!!(u == "object" && s[v])) || u == "unknown"
  10860. }
  10861. function k(s, t) {
  10862. return typeof (s[t]) != l
  10863. }
  10864. function e(s, t) {
  10865. return !!(typeof (s[t]) == "object" && s[t])
  10866. }
  10867. function h(s) {
  10868. if (window.console && window.console.log) {
  10869. window.console.log("TextInputs module for Rangy not supported in your browser. Reason: " + s)
  10870. }
  10871. }
  10872. function o(t, u, s) {
  10873. if (u < 0) {
  10874. u += t.value.length
  10875. }
  10876. if (typeof s == l) {
  10877. s = u
  10878. }
  10879. if (s < 0) {
  10880. s += t.value.length
  10881. }
  10882. return {
  10883. start: u,
  10884. end: s
  10885. }
  10886. }
  10887. function a(t, u, s) {
  10888. return {
  10889. start: u,
  10890. end: s,
  10891. length: s - u,
  10892. text: t.value.slice(u, s)
  10893. }
  10894. }
  10895. function r() {
  10896. return e(document, "body") ? document.body : document.getElementsByTagName("body")[0]
  10897. }
  10898. c(document).ready(function() {
  10899. var t = document.createElement("textarea");
  10900. r().appendChild(t);
  10901. if (k(t, "selectionStart") && k(t, "selectionEnd")) {
  10902. d = function(w) {
  10903. var x = w.selectionStart
  10904. , v = w.selectionEnd;
  10905. return a(w, x, v)
  10906. }
  10907. ;
  10908. g = function(x, v, w) {
  10909. var y = o(x, v, w);
  10910. x.selectionStart = y.start;
  10911. x.selectionEnd = y.end
  10912. }
  10913. ;
  10914. p = function(w, v) {
  10915. if (v) {
  10916. w.selectionEnd = w.selectionStart
  10917. } else {
  10918. w.selectionStart = w.selectionEnd
  10919. }
  10920. }
  10921. } else {
  10922. if (j(t, "createTextRange") && e(document, "selection") && j(document.selection, "createRange")) {
  10923. d = function(z) {
  10924. var C = 0, x = 0, B, w, v, A;
  10925. var y = document.selection.createRange();
  10926. if (y && y.parentElement() == z) {
  10927. v = z.value.length;
  10928. B = z.value.replace(/\r\n/g, "\n");
  10929. w = z.createTextRange();
  10930. w.moveToBookmark(y.getBookmark());
  10931. A = z.createTextRange();
  10932. A.collapse(false);
  10933. if (w.compareEndPoints("StartToEnd", A) > -1) {
  10934. C = x = v
  10935. } else {
  10936. C = -w.moveStart("character", -v);
  10937. C += B.slice(0, C).split("\n").length - 1;
  10938. if (w.compareEndPoints("EndToEnd", A) > -1) {
  10939. x = v
  10940. } else {
  10941. x = -w.moveEnd("character", -v);
  10942. x += B.slice(0, x).split("\n").length - 1
  10943. }
  10944. }
  10945. }
  10946. return a(z, C, x)
  10947. }
  10948. ;
  10949. var u = function(v, w) {
  10950. return w - (v.value.slice(0, w).split("\r\n").length - 1)
  10951. };
  10952. g = function(z, v, y) {
  10953. var A = o(z, v, y);
  10954. var x = z.createTextRange();
  10955. var w = u(z, A.start);
  10956. x.collapse(true);
  10957. if (A.start == A.end) {
  10958. x.move("character", w)
  10959. } else {
  10960. x.moveEnd("character", u(z, A.end));
  10961. x.moveStart("character", w)
  10962. }
  10963. x.select()
  10964. }
  10965. ;
  10966. p = function(x, w) {
  10967. var v = document.selection.createRange();
  10968. v.collapse(w);
  10969. v.select()
  10970. }
  10971. } else {
  10972. r().removeChild(t);
  10973. h("No means of finding text input caret position");
  10974. return
  10975. }
  10976. }
  10977. r().removeChild(t);
  10978. f = function(w, z, v, x) {
  10979. var y;
  10980. if (z != v) {
  10981. y = w.value;
  10982. w.value = y.slice(0, z) + y.slice(v)
  10983. }
  10984. if (x) {
  10985. g(w, z, z)
  10986. }
  10987. }
  10988. ;
  10989. q = function(v) {
  10990. var w = d(v);
  10991. f(v, w.start, w.end, true)
  10992. }
  10993. ;
  10994. m = function(v) {
  10995. var w = d(v), x;
  10996. if (w.start != w.end) {
  10997. x = v.value;
  10998. v.value = x.slice(0, w.start) + x.slice(w.end)
  10999. }
  11000. g(v, w.start, w.start);
  11001. return w.text
  11002. }
  11003. ;
  11004. b = function(w, z, v, x) {
  11005. var y = w.value, A;
  11006. w.value = y.slice(0, v) + z + y.slice(v);
  11007. if (x) {
  11008. A = v + z.length;
  11009. g(w, A, A)
  11010. }
  11011. }
  11012. ;
  11013. n = function(v, y) {
  11014. var w = d(v)
  11015. , x = v.value;
  11016. v.value = x.slice(0, w.start) + y + x.slice(w.end);
  11017. var z = w.start + y.length;
  11018. g(v, z, z)
  11019. }
  11020. ;
  11021. i = function(v, y, B) {
  11022. var x = d(v)
  11023. , A = v.value;
  11024. v.value = A.slice(0, x.start) + y + x.text + B + A.slice(x.end);
  11025. var z = x.start + y.length;
  11026. var w = z + x.length;
  11027. g(v, z, w)
  11028. }
  11029. ;
  11030. function s(v, w) {
  11031. return function() {
  11032. var z = this.jquery ? this[0] : this;
  11033. var A = z.nodeName.toLowerCase();
  11034. if (z.nodeType == 1 && (A == "textarea" || (A == "input" && z.type == "text"))) {
  11035. var y = [z].concat(Array.prototype.slice.call(arguments));
  11036. var x = v.apply(this, y);
  11037. if (!w) {
  11038. return x
  11039. }
  11040. }
  11041. if (w) {
  11042. return this
  11043. }
  11044. }
  11045. }
  11046. c.fn.extend({
  11047. getSelection: s(d, false),
  11048. setSelection: s(g, true),
  11049. collapseSelection: s(p, true),
  11050. deleteSelectedText: s(q, true),
  11051. deleteText: s(f, true),
  11052. extractSelectedText: s(m, false),
  11053. insertText: s(b, true),
  11054. replaceSelectedText: s(n, true),
  11055. surroundSelectedText: s(i, true)
  11056. })
  11057. })
  11058. }
  11059. )(jQuery);
  11060. /*!
  11061. * jQuery Browser Plugin v0.0.6
  11062. * https://github.com/gabceb/jquery-browser-plugin
  11063. *
  11064. * Original jquery-browser code Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
  11065. * http://jquery.org/license
  11066. *
  11067. * Modifications Copyright 2013 Gabriel Cebrian
  11068. * https://github.com/gabceb
  11069. *
  11070. * Released under the MIT license
  11071. *
  11072. * Date: 2013-07-29T17:23:27-07:00
  11073. */
  11074. (function(f, e, h) {
  11075. var a, d;
  11076. f.uaMatch = function(k) {
  11077. k = k.toLowerCase();
  11078. var j = /(opr)[\/]([\w.]+)/.exec(k) || /(chrome)[ \/]([\w.]+)/.exec(k) || /(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(k) || /(webkit)[ \/]([\w.]+)/.exec(k) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(k) || /(msie) ([\w.]+)/.exec(k) || k.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec(k) || k.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(k) || [];
  11079. var i = /(ipad)/.exec(k) || /(iphone)/.exec(k) || /(android)/.exec(k) || /(windows phone)/.exec(k) || /(win)/.exec(k) || /(mac)/.exec(k) || /(linux)/.exec(k) || /(cros)/i.exec(k) || [];
  11080. return {
  11081. browser: j[3] || j[1] || "",
  11082. version: j[2] || "0",
  11083. platform: i[0] || ""
  11084. }
  11085. }
  11086. ;
  11087. a = f.uaMatch(e.navigator.userAgent);
  11088. d = {};
  11089. if (a.browser) {
  11090. d[a.browser] = true;
  11091. d.version = a.version;
  11092. d.versionNumber = parseInt(a.version)
  11093. }
  11094. if (a.platform) {
  11095. d[a.platform] = true
  11096. }
  11097. if (d.android || d.ipad || d.iphone || d["windows phone"]) {
  11098. d.mobile = true
  11099. }
  11100. if (d.cros || d.mac || d.linux || d.win) {
  11101. d.desktop = true
  11102. }
  11103. if (d.chrome || d.opr || d.safari) {
  11104. d.webkit = true
  11105. }
  11106. if (d.rv) {
  11107. var g = "msie";
  11108. a.browser = g;
  11109. d[g] = true
  11110. }
  11111. if (d.opr) {
  11112. var c = "opera";
  11113. a.browser = c;
  11114. d[c] = true
  11115. }
  11116. if (d.safari && d.android) {
  11117. var b = "android";
  11118. a.browser = b;
  11119. d[b] = true
  11120. }
  11121. d.name = a.browser;
  11122. d.platform = a.platform;
  11123. f.browser = d
  11124. }
  11125. )(jQuery, window);
  11126. /*!
  11127. * jQuery UI Touch Punch 0.2.3
  11128. *
  11129. * Copyright 2011–2014, Dave Furfero
  11130. * Dual licensed under the MIT or GPL Version 2 licenses.
  11131. *
  11132. * Depends:
  11133. * jquery.ui.widget.js
  11134. * jquery.ui.mouse.js
  11135. */
  11136. (function(b) {
  11137. b.support.touch = "ontouchend"in document;
  11138. if (!b.support.touch) {
  11139. return
  11140. }
  11141. var d = b.ui.mouse.prototype, f = d._mouseInit, c = d._mouseDestroy, a;
  11142. function e(h, i) {
  11143. if (h.originalEvent.touches.length > 1) {
  11144. return
  11145. }
  11146. h.preventDefault();
  11147. var j = h.originalEvent.changedTouches[0]
  11148. , g = document.createEvent("MouseEvents");
  11149. g.initMouseEvent(i, true, true, window, 1, j.screenX, j.screenY, j.clientX, j.clientY, false, false, false, false, 0, null);
  11150. h.target.dispatchEvent(g)
  11151. }
  11152. d._touchStart = function(h) {
  11153. var g = this;
  11154. if (a || !g._mouseCapture(h.originalEvent.changedTouches[0])) {
  11155. return
  11156. }
  11157. a = true;
  11158. g._touchMoved = 0;
  11159. e(h, "mouseover");
  11160. e(h, "mousemove");
  11161. e(h, "mousedown")
  11162. }
  11163. ;
  11164. d._touchMove = function(g) {
  11165. if (!a) {
  11166. return
  11167. }
  11168. this._touchMoved += 1;
  11169. e(g, "mousemove")
  11170. }
  11171. ;
  11172. d._touchEnd = function(g) {
  11173. if (!a) {
  11174. return
  11175. }
  11176. e(g, "mouseup");
  11177. e(g, "mouseout");
  11178. if (this._touchMoved <= 5) {
  11179. e(g, "click")
  11180. }
  11181. a = false
  11182. }
  11183. ;
  11184. d._mouseInit = function() {
  11185. var g = this;
  11186. g.element.bind({
  11187. touchstart: b.proxy(g, "_touchStart"),
  11188. touchmove: b.proxy(g, "_touchMove"),
  11189. touchend: b.proxy(g, "_touchEnd")
  11190. });
  11191. f.call(g)
  11192. }
  11193. ;
  11194. d._mouseDestroy = function() {
  11195. var g = this;
  11196. g.element.unbind({
  11197. touchstart: b.proxy(g, "_touchStart"),
  11198. touchmove: b.proxy(g, "_touchMove"),
  11199. touchend: b.proxy(g, "_touchEnd")
  11200. });
  11201. c.call(g)
  11202. }
  11203. }
  11204. )(jQuery);
  11205. (function() {
  11206. var a = $.datepicker._gotoToday;
  11207. $.datepicker._gotoToday = function(d) {
  11208. var c = $(d)
  11209. , b = this._getInst(c[0]);
  11210. a.call(this, d);
  11211. this._selectDate(d, this._formatDate(b, b.selectedDay, b.drawMonth, b.drawYear))
  11212. }
  11213. ;
  11214. $.datepicker._attachHandlers = function(c) {
  11215. var b = this._get(c, "stepMonths")
  11216. , d = "#" + c.id.replace(/\\\\/g, "\\");
  11217. c.dpDiv.find("[data-handler]").map(function() {
  11218. var e = {
  11219. prev: function() {
  11220. $.datepicker._adjustDate(d, -b, "M");
  11221. this.updateDatePickerPosition(c)
  11222. },
  11223. next: function() {
  11224. $.datepicker._adjustDate(d, +b, "M");
  11225. this.updateDatePickerPosition(c)
  11226. },
  11227. hide: function() {
  11228. $.datepicker._hideDatepicker()
  11229. },
  11230. today: function() {
  11231. $.datepicker._gotoToday(d)
  11232. },
  11233. selectDay: function() {
  11234. $.datepicker._selectDay(d, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
  11235. return false
  11236. },
  11237. selectMonth: function() {
  11238. $.datepicker._selectMonthYear(d, this, "M");
  11239. return false
  11240. },
  11241. selectYear: function() {
  11242. $.datepicker._selectMonthYear(d, this, "Y");
  11243. return false
  11244. }
  11245. };
  11246. $(this).bind(this.getAttribute("data-event"), e[this.getAttribute("data-handler")]);
  11247. this.updateDatePickerPosition = function(g) {
  11248. if (!$.datepicker._pos) {
  11249. $.datepicker._pos = $.datepicker._findPos(g.input[0]);
  11250. $.datepicker._pos[1] += g.input[0].offsetHeight
  11251. }
  11252. var i = {
  11253. left: $.datepicker._pos[0],
  11254. top: $.datepicker._pos[1]
  11255. };
  11256. $.datepicker._pos = null;
  11257. var h = false;
  11258. $(g.input[0]).parents().each(function() {
  11259. h |= $(this).css("position") === "fixed";
  11260. return !h
  11261. });
  11262. var f = $.datepicker._checkOffset(g, i, h);
  11263. g.dpDiv.css({
  11264. top: f.top + "px"
  11265. })
  11266. }
  11267. ;
  11268. this.updateDatePickerPosition(c)
  11269. })
  11270. }
  11271. ;
  11272. $.datepicker._generateMonthYearHeader = function(f, d, n, h, l, o, j, b) {
  11273. var s, c, t, q, g, p, m, i, e = this._get(f, "changeMonth"), u = this._get(f, "changeYear"), v = this._get(f, "showMonthAfterYear"), k = "<div class='ui-datepicker-title'>", r = "";
  11274. if (o || !e) {
  11275. r += "<span class='ui-datepicker-month' aria-label='select month'>" + j[d] + "</span>"
  11276. } else {
  11277. s = (h && h.getFullYear() === n);
  11278. c = (l && l.getFullYear() === n);
  11279. r += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change' aria-label='select month'>";
  11280. for (t = 0; t < 12; t++) {
  11281. if ((!s || t >= h.getMonth()) && (!c || t <= l.getMonth())) {
  11282. r += "<option value='" + t + "'" + (t === d ? " selected='selected'" : "") + ">" + b[t] + "</option>"
  11283. }
  11284. }
  11285. r += "</select>"
  11286. }
  11287. if (!v) {
  11288. k += r + (o || !(e && u) ? "&#xa0;" : "")
  11289. }
  11290. if (!f.yearshtml) {
  11291. f.yearshtml = "";
  11292. if (o || !u) {
  11293. k += "<span class='ui-datepicker-year' aria-label='select year'>" + n + "</span>"
  11294. } else {
  11295. q = this._get(f, "yearRange").split(":");
  11296. g = new Date().getFullYear();
  11297. p = function(x) {
  11298. var w = (x.match(/c[+\-].*/) ? n + parseInt(x.substring(1), 10) : (x.match(/[+\-].*/) ? g + parseInt(x, 10) : parseInt(x, 10)));
  11299. return (isNaN(w) ? g : w)
  11300. }
  11301. ;
  11302. m = p(q[0]);
  11303. i = Math.max(m, p(q[1] || ""));
  11304. m = (h ? Math.max(m, h.getFullYear()) : m);
  11305. i = (l ? Math.min(i, l.getFullYear()) : i);
  11306. f.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change' aria-label='select year'>";
  11307. for (; m <= i; m++) {
  11308. f.yearshtml += "<option value='" + m + "'" + (m === n ? " selected='selected'" : "") + ">" + m + "</option>"
  11309. }
  11310. f.yearshtml += "</select>";
  11311. k += f.yearshtml;
  11312. f.yearshtml = null
  11313. }
  11314. }
  11315. k += this._get(f, "yearSuffix");
  11316. if (v) {
  11317. k += (o || !(e && u) ? "&#xa0;" : "") + r
  11318. }
  11319. k += "</div>";
  11320. return k
  11321. }
  11322. ;
  11323. $.datepicker._updateDatepicker = function(c) {
  11324. var b = c.input[0];
  11325. if ($.datepicker._curInst && $.datepicker._curInst !== c && $.datepicker._datepickerShowing && $.datepicker._lastInput !== b) {
  11326. return
  11327. }
  11328. if (typeof (c.stay_open) !== "boolean" || c.stay_open === false) {
  11329. var d = this;
  11330. setTimeout(function() {
  11331. d._base_updateDatepicker(c);
  11332. var e = d._get(c, "timepicker");
  11333. if (e) {
  11334. e._addTimePicker(c)
  11335. }
  11336. }, 0)
  11337. }
  11338. }
  11339. }
  11340. )();
  11341. (function() {
  11342. $.extend($.ui.keyCode, {
  11343. NUMPAD_ENTER: 108
  11344. });
  11345. $.fn.extend({
  11346. focus: (function(a) {
  11347. return function(b, c) {
  11348. return typeof b === "number" ? this.each(function() {
  11349. var d = this;
  11350. setTimeout(function() {
  11351. $(d).focus();
  11352. if (c) {
  11353. c.call(d)
  11354. }
  11355. }, b)
  11356. }) : a.apply(this, arguments)
  11357. }
  11358. }
  11359. )($.fn.focus),
  11360. disableSelection: (function() {
  11361. var a = "onselectstart"in document.createElement("div") ? "selectstart" : "mousedown";
  11362. return function() {
  11363. return this.bind(a + ".ui-disableSelection", function(b) {
  11364. b.preventDefault()
  11365. })
  11366. }
  11367. }
  11368. )(),
  11369. enableSelection: function() {
  11370. return this.unbind(".ui-disableSelection")
  11371. },
  11372. zIndex: function(d) {
  11373. if (d !== undefined) {
  11374. return this.css("zIndex", d)
  11375. }
  11376. if (this.length) {
  11377. var b = $(this[0]), a, c;
  11378. while (b.length && b[0] !== document) {
  11379. a = b.css("position");
  11380. if (a === "absolute" || a === "relative" || a === "fixed") {
  11381. c = parseInt(b.css("zIndex"), 10);
  11382. if (!isNaN(c) && c !== 0) {
  11383. return c
  11384. }
  11385. }
  11386. b = b.parent()
  11387. }
  11388. }
  11389. return 0
  11390. }
  11391. })
  11392. }
  11393. )();
  11394. $.widget("ui.sortable", $.ui.sortable, {
  11395. _setHandleClassName: function() {
  11396. this._removeClass(this.element.find(".ui-sortable-handle"), "ui-sortable-handle");
  11397. $.each(this.items, function() {
  11398. (this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item).addClass("ui-sortable-handle")
  11399. })
  11400. }
  11401. });
  11402. (function() {
  11403. $.extend(Object.getPrototypeOf($.timepicker), {
  11404. _updateDateTime: function(h) {
  11405. h = this.inst || h;
  11406. var e = (h.currentYear > 0 ? new Date(h.currentYear,h.currentMonth,h.currentDay) : new Date(h.selectedYear,h.selectedMonth,h.selectedDay))
  11407. , b = $.datepicker._daylightSavingAdjust(e)
  11408. , i = $.datepicker._get(h, "dateFormat")
  11409. , c = $.datepicker._getFormatConfig(h)
  11410. , g = b !== null && this.timeDefined;
  11411. this.formattedDate = $.datepicker.formatDate(i, (b === null ? new Date() : b), c);
  11412. var a = this.formattedDate;
  11413. var j = h.lastVal;
  11414. if (j === "") {
  11415. h.currentYear = h.selectedYear;
  11416. h.currentMonth = h.selectedMonth;
  11417. h.currentDay = h.selectedDay
  11418. }
  11419. if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
  11420. a = this.formattedTime
  11421. } else {
  11422. if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || g)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {
  11423. a += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix
  11424. }
  11425. }
  11426. this.formattedDateTime = a;
  11427. if (!this._defaults.showTimepicker) {
  11428. this.$input.val(this.formattedDate)
  11429. } else {
  11430. if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
  11431. this.$altInput.val(this.formattedTime);
  11432. this.$input.val(this.formattedDate)
  11433. } else {
  11434. if (this.$altInput) {
  11435. this.$input.val(a);
  11436. var f = ""
  11437. , k = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator
  11438. , d = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
  11439. if (!this._defaults.timeOnly) {
  11440. if (this._defaults.altFormat) {
  11441. f = $.datepicker.formatDate(this._defaults.altFormat, (b === null ? new Date() : b), c)
  11442. } else {
  11443. f = this.formattedDate
  11444. }
  11445. if (f) {
  11446. f += k
  11447. }
  11448. }
  11449. if (this._defaults.altTimeFormat !== null) {
  11450. f += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + d
  11451. } else {
  11452. f += this.formattedTime + d
  11453. }
  11454. this.$altInput.val(f)
  11455. } else {
  11456. this.$input.val(a)
  11457. }
  11458. }
  11459. }
  11460. if (j != a) {
  11461. this.$input.trigger("change")
  11462. }
  11463. },
  11464. _addTimePicker: function(b) {
  11465. var a = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + " " + this.$altInput.val() : (b.inline ? this.$input.next().val() : this.$input.val()));
  11466. this.timeDefined = this._parseTime(a);
  11467. this._limitMinMaxDateTime(b, false);
  11468. this._injectTimePicker();
  11469. this._afterInject()
  11470. },
  11471. _controls: {
  11472. slider: {
  11473. create: function(b, g, e, h, c, a, d) {
  11474. var f = b._defaults.isRTL;
  11475. return g.prop("slide", null).slider({
  11476. orientation: "horizontal",
  11477. value: f ? h * -1 : h,
  11478. min: f ? a * -1 : c,
  11479. max: f ? c * -1 : a,
  11480. step: d,
  11481. slide: function(i, j) {
  11482. b.control.value(b, $(this), e, f ? j.value * -1 : j.value);
  11483. b._onTimeChange()
  11484. },
  11485. stop: function(i, j) {
  11486. b._onSelectHandler()
  11487. }
  11488. })
  11489. },
  11490. options: function(b, f, e, d, g) {
  11491. if (b._defaults.isRTL) {
  11492. if (typeof (d) === "string") {
  11493. if (d === "min" || d === "max") {
  11494. if (g !== undefined) {
  11495. return f.slider(d, g * -1)
  11496. }
  11497. return Math.abs(f.slider(d))
  11498. }
  11499. return f.slider(d)
  11500. }
  11501. var c = d.min
  11502. , a = d.max;
  11503. d.min = d.max = null;
  11504. if (c !== undefined) {
  11505. d.max = c * -1
  11506. }
  11507. if (a !== undefined) {
  11508. d.min = a * -1
  11509. }
  11510. return f.slider(d)
  11511. }
  11512. if (typeof (d) === "string" && g !== undefined) {
  11513. return f.slider(d, g)
  11514. }
  11515. return f.slider(d)
  11516. },
  11517. value: function(a, c, b, d) {
  11518. if (a._defaults.isRTL) {
  11519. if (d !== undefined) {
  11520. return c.slider("value", d * -1)
  11521. }
  11522. return Math.abs(c.slider("value"))
  11523. }
  11524. if (d !== undefined) {
  11525. return c.slider("value", d)
  11526. }
  11527. return c.slider("value")
  11528. }
  11529. },
  11530. select: {
  11531. create: function(g, f, k, b, d, h, c) {
  11532. var a = '<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="' + k + '" data-min="' + d + '" data-max="' + h + '" data-step="' + c + '" aria-label="select ' + k + '">'
  11533. , j = g._defaults.pickerTimeFormat || g._defaults.timeFormat;
  11534. for (var e = d; e <= h; e += c) {
  11535. a += '<option value="' + e + '"' + (e === b ? " selected" : "") + ">";
  11536. if (k === "hour") {
  11537. a += $.datepicker.formatTime($.trim(j.replace(/[^ht ]/ig, "")), {
  11538. hour: e
  11539. }, g._defaults)
  11540. } else {
  11541. if (k === "millisec" || k === "microsec" || e >= 10) {
  11542. a += e
  11543. } else {
  11544. a += "0" + e.toString()
  11545. }
  11546. }
  11547. a += "</option>"
  11548. }
  11549. a += "</select>";
  11550. f.children("select").remove();
  11551. $(a).appendTo(f).change(function(i) {
  11552. g._onTimeChange();
  11553. g._onSelectHandler();
  11554. g._afterInject()
  11555. });
  11556. return f
  11557. },
  11558. options: function(a, d, c, b, f) {
  11559. var e = {}
  11560. , g = d.children("select");
  11561. if (typeof (b) === "string") {
  11562. if (f === undefined) {
  11563. return g.data(b)
  11564. }
  11565. e[b] = f
  11566. } else {
  11567. e = b
  11568. }
  11569. return a.control.create(a, d, g.data("unit"), g.val(), e.min >= 0 ? e.min : g.data("min"), e.max || g.data("max"), e.step || g.data("step"))
  11570. },
  11571. value: function(a, c, b, d) {
  11572. var e = c.children("select");
  11573. if (d !== undefined) {
  11574. return e.val(d)
  11575. }
  11576. return e.val()
  11577. }
  11578. }
  11579. }
  11580. })
  11581. }
  11582. )();
  11583.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement